Simplify PR checklist enforcement and reduce brittle PR body sync
Problem
The enforce-checklist GitHub Actions check fails too often, including for normal non-cbox PRs. Root causes:
- Redundant gates: "Preflight passed" duplicates CI checks GitHub already surfaces natively. "Review artifact path is recorded" is implied by review execution/approval.
- Duplicated label definitions:
validate_pr_checklist.pyandpr_body_lib.pyboth define gate labels independently — they can drift. - No template marker = full gates: PRs without a
<!-- pr-template: ... -->marker default to full gates, causing all manual/external PRs to fail. - Brittle body sync:
pr-sync-bodycallsgh pr view→pr-body→gh pr edit. Thegh pr editcall 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.
- Remove "Preflight passed" from full gates (CI covers this natively)
- Remove "Review artifact path is recorded" from full gates (implied by review execution)
- Import gate labels in
validate_pr_checklist.pyfrompr_body_lib.py(single source of truth) - Pass the check when no
<!-- pr-template: -->marker is found (eliminates false failures for manual PRs) - Update PR templates, scripts, and tests to match
- Remove
--preflight-passedfrompr-bodyandpr-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:
scripts/pr_body_lib.py— remove redundant gate labels, removepreflight_passed/review_artifact_recordedparams fromrender_pr_body().github/scripts/validate_pr_checklist.py— import labels frompr_body_lib, pass when no template marker.github/pull_request_template.md— remove redundant checkboxes.github/pull_request_template_lite.md— no changes (lite gates are fine)scripts/pr-body— remove--preflight-passedflagscripts/pr-sync-body— remove--preflight-passedflagtests/core/test_validate_pr_checklist.py— update for new behaviortests/core/test_pr_body.py— update for simplified gates.claude/commands/pr.mdand.codex/commands/pr.md— remove preflight-passed sync step
Implementation Progress
All changes implemented and tests passing (14/14).
Changes made:
scripts/pr_body_lib.py— Removed "Preflight passed" and "Review artifact path is recorded" from review gate labels (nowREVIEW_REQUIRED_GATE_LABELS+ lite-specific gates). Removedpreflight_passedandreview_artifact_recordedparams fromrender_pr_body()..github/scripts/validate_pr_checklist.py— Imports labels frompr_body_lib(single source of truth). ReturnsNone(pass) when no<!-- pr-template: -->marker is found, eliminating false failures for manual PRs..github/pull_request_template.md— Removed redundant checkboxes (now 2 gates: CBox review executed + verdict).scripts/pr-body— Removed--preflight-passedflag.scripts/pr-sync-body— Removed--preflight-passedflag.tests/core/test_validate_pr_checklist.py— Updated: tests for full marker, lite marker, and no-marker (skip) behavior.tests/core/test_pr_body.py— Updated template intest_render_pr_body_includes_task_problem_summary_and_linkto use new gates..claude/commands/pr.md,.codex/commands/pr.md,libs/cbox/.claude/commands/pr.md— Removed--preflight-passedfrom sync step.
Review Feedback
- [ ] Review cleared