100%

01 — completion-gate

Goal

The premature-consolidation lock: /consolidate operates ONLY on a plan whose EVERY section is complete (and reviewed). A plan with any non-complete section is REFUSED — you cannot collapse a surface while sections are still landing on it. Read the whole plan (plan-read-discipline §3.3), never skim.

Implementation Sketch

gates.py:completion_gate(plan_dir) uses scripts/plan_corpus/read.py to load the plan and assert every section status == complete; bug-tracker plans allowed too. Refuse with a structured exit naming the first non-complete section. The gate is the FIRST thing main runs; nothing downstream runs on a refused plan.

Spec References

scripts/plan_corpus/read.py (load_plan, section status); scripts/intel-query.sh plan-status (local-read completion counts); .claude/rules/plan-read-discipline.md §3.3 (read entirely)

Work Items

  • gates.py:completion_gate — every section complete+reviewed or REFUSE
  • Refusal names the first non-complete section (structured exit)
  • Gate runs first; downstream stages never execute on a refused plan
  • Test: complete plan passes; one in-progress/not-started section -> refusal