Dataface Tasks

Simplify PR checklist enforcement and reduce brittle PR body sync

IDINFRA_TOOLING-SIMPLIFY_PR_CHECKLIST_ENFORCEMENT_AND_REDUCE_BRITTLE_PR_BODY_SYNC
Statuscompleted
Priorityp1
Milestonem1-ft-analytics-analyst-pilot
Ownersr-engineer-architect
Completed byCBox Agent
Completed2026-03-14

Problem

The enforce-checklist GitHub Actions check fails too often, including for normal non-cbox PRs. Root causes:

  1. Redundant gates: "Preflight passed" duplicates CI checks GitHub already surfaces natively. "Review artifact path is recorded" is implied by review execution/approval.
  2. Duplicated label definitions: validate_pr_checklist.py and pr_body_lib.py both define gate labels independently — they can drift.
  3. No template marker = full gates: PRs without a <!-- pr-template: ... --> marker default to full gates, causing all manual/external PRs to fail.
  4. Brittle body sync: pr-sync-body calls gh pr viewpr-bodygh pr edit. The gh pr edit call can fail due to GitHub API changes (Projects GraphQL deprecation). More gates = more body syncing needed.

GitHub issue: #592.

Context

Key files: - .github/workflows/pr-checklist.yml — workflow triggers on PR events - .github/scripts/validate_pr_checklist.py — reads PR body, checks gates - scripts/pr_body_lib.py — canonical gate labels, render/parse helpers - scripts/pr-body — renders PR body from template + args - scripts/pr-sync-body — fetches live PR body, re-renders, pushes via gh pr edit - .github/pull_request_template.md — full PR template (4 gates) - .github/pull_request_template_lite.md — lite PR template (2 gates) - .claude/commands/pr.md / .codex/commands/pr.md — /pr command docs - tests/core/test_validate_pr_checklist.py — enforcement tests - tests/core/test_pr_body.py — body rendering tests

Constraints: keep changes scoped to PR checklist enforcement and PR body tooling. Prefer simplification over new process.

Possible Solutions

Option A: Remove redundant gates + consolidate labels + skip non-templated PRs

Recommended.

  1. Remove "Preflight passed" from full gates (CI covers this natively)
  2. Remove "Review artifact path is recorded" from full gates (implied by review execution)
  3. Import gate labels in validate_pr_checklist.py from pr_body_lib.py (single source of truth)
  4. Pass the check when no <!-- pr-template: --> marker is found (eliminates false failures for manual PRs)
  5. Update PR templates, scripts, and tests to match
  6. Remove --preflight-passed from pr-body and pr-sync-body

Trade-offs: Reduces full gates from 4→2. Manual PRs now pass (acceptable — CI still enforces code quality). Fewer body syncs needed → less exposure to gh pr edit brittleness.

Option B: Replace checklist enforcement with CI-status-based checks

Replace the PR body checklist with a GitHub status check that queries other CI checks. Much larger scope; not needed if Option A solves the noise.

Option C: Keep all gates, only fix the import consolidation

Minimal change but doesn't address the redundancy or manual PR problem.

Plan

Implement Option A. Files to modify:

  1. scripts/pr_body_lib.py — remove redundant gate labels, remove preflight_passed/review_artifact_recorded params from render_pr_body()
  2. .github/scripts/validate_pr_checklist.py — import labels from pr_body_lib, pass when no template marker
  3. .github/pull_request_template.md — remove redundant checkboxes
  4. .github/pull_request_template_lite.md — no changes (lite gates are fine)
  5. scripts/pr-body — remove --preflight-passed flag
  6. scripts/pr-sync-body — remove --preflight-passed flag
  7. tests/core/test_validate_pr_checklist.py — update for new behavior
  8. tests/core/test_pr_body.py — update for simplified gates
  9. .claude/commands/pr.md and .codex/commands/pr.md — remove preflight-passed sync step

Implementation Progress

All changes implemented and tests passing (14/14).

Changes made:

  1. scripts/pr_body_lib.py — Removed "Preflight passed" and "Review artifact path is recorded" from review gate labels (now REVIEW_REQUIRED_GATE_LABELS + lite-specific gates). Removed preflight_passed and review_artifact_recorded params from render_pr_body().
  2. .github/scripts/validate_pr_checklist.py — Imports labels from pr_body_lib (single source of truth). Returns None (pass) when no <!-- pr-template: --> marker is found, eliminating false failures for manual PRs.
  3. .github/pull_request_template.md — Removed redundant checkboxes (now 2 gates: CBox review executed + verdict).
  4. scripts/pr-body — Removed --preflight-passed flag.
  5. scripts/pr-sync-body — Removed --preflight-passed flag.
  6. tests/core/test_validate_pr_checklist.py — Updated: tests for full marker, lite marker, and no-marker (skip) behavior.
  7. tests/core/test_pr_body.py — Updated template in test_render_pr_body_includes_task_problem_summary_and_link to use new gates.
  8. .claude/commands/pr.md, .codex/commands/pr.md, libs/cbox/.claude/commands/pr.md — Removed --preflight-passed from sync step.

Review Feedback

  • [ ] Review cleared