0%

Section 05: Strip Completion Writers

Status: Not Started Goal: Cut every existing path that can write the two privileged transitions, leaving /independent-review as the sole writer.

Success Criteria:

  • flip_from_in_review_clean* + /review-plan Step 7+8 + autopilot_auto_cure no longer complete sections directly.
  • plan-complete.py --complete-all / --subsection no longer derives status: complete.
  • record_review_reversal gated to /independent-review.
  • Audit: no completion/reversal writer outside /independent-review.

Context: These are the API paths that, alongside raw edits, can set completion. Stripping them is the write-API-refusal enforcement layer. MUST land AFTER §04 (read-time rejection exists) and §06 (the new completer exists) so no window opens where nothing completes.

Depends on: Section 04 (read-time rejection backstop) + Section 06 (the replacement completer).


Intelligence Reconnaissance

Queries run 2026-05-26:

  • scripts/intel-query.sh search "flip_from_in_review_clean record_review_reversal" — N/A on the Rust-only code-symbol graph; this section edits Python. Recorded per plan-schema non-Rust allowance.
  • Direct grounding (this session): writers found — scripts/review_plan_runtime/status_flip.py:flip_from_in_review_clean / flip_from_in_review_clean_with_marker / record_review_reversal; scripts/plan-complete.py:sync_subsection_statuses (DERIVABLE_STATUSES includes complete); scripts/plan_orchestrator/autopilot_auto_cure.py (line ~545 calls flip_from_in_review_clean); scripts/plan_orchestrator/review_plan.py Step 7+8 calls flip_from_in_review_clean_with_marker.

Results summary [ori]: four writer surfaces — status_flip.py (completion + reversal fns), plan-complete.py (status→complete derivation), autopilot_auto_cure.py (auto-complete call), review_plan.py (Step 7+8 close-out). Gating mechanism: completion/reversal fns require an /independent-review-supplied attestation token / caller identity; absent it, raise/refuse. UNVERIFIED: cleanest identity-pass mechanism — confirm at execution (likely attestation-write precondition vs caller flag).


05.1 Gate flip_from_in_review_clean + plan-complete.py + autopilot_auto_cure

File(s): scripts/review_plan_runtime/status_flip.py; scripts/plan-complete.py; scripts/plan_orchestrator/autopilot_auto_cure.py; scripts/plan_orchestrator/review_plan.py

  • flip_from_in_review_clean*: refuse to write status:complete/reviewed:true unless the call carries a valid /independent-review attestation (the §04 block written by §06). /review-plan Step 7+8 stops completing directly.
  • plan-complete.py: remove complete from the auto-derived statuses (or gate the complete derivation behind /independent-review); --complete-all errors with a pointer to /independent-review.
  • autopilot_auto_cure.py: remove the State-B auto-complete flip_from_in_review_clean call (full removal handled with §08 autopilot wiring; here, sever the completion write).
  • Subsection close-out (05.1) — MANDATORY before 05.2:
    • Tasks [x]; tests confirm these paths no longer complete; update subsection statuscomplete.
    • Repo hygiene checkcompiler_repo/diagnostics/repo-hygiene.sh --check.

05.2 Gate record_review_reversal to /independent-review

File(s): scripts/review_plan_runtime/status_flip.py

  • record_review_reversal (reviewed:true→false): refuse unless invoked by /independent-review. Other callers get a refusal pointing at /independent-review.
  • Update any in-tree caller of record_review_reversal to route through /independent-review (or remove the call).
  • Subsection close-out (05.2) — MANDATORY before 05.N:
    • Tasks [x]; tests confirm reversal gated; update subsection statuscomplete.
    • Repo hygiene checkcompiler_repo/diagnostics/repo-hygiene.sh --check.

05.N Completion Checklist

  • 05.1–05.2 [x] and status complete.
  • Audit: grep for status.*complete / reviewed.*True writes across scripts/ shows the only writer is /independent-review’s path.
  • python3 -m pytest scripts/plan_corpus/tests/ scripts/plan_orchestrator/tests/ -q green (writer-gating cases).
  • python -m scripts.plan_corpus check clean on a fixture plan completed via /independent-review; ERROR on one completed via the (now-stripped) old path.
  • Plan sync — close via §06 /independent-review (bootstrap caveat); update 00-overview.md + index.md.
  • Repo hygiene checkcompiler_repo/diagnostics/repo-hygiene.sh --check.

Exit Criteria: No code path outside /independent-review writes status: complete or reviewed: true→false; the old writers refuse with a pointer to /independent-review; tests green.