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/--subsectionno longer derivesstatus: complete. -
record_review_reversalgated 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 includescomplete);scripts/plan_orchestrator/autopilot_auto_cure.py(line ~545 calls flip_from_in_review_clean);scripts/plan_orchestrator/review_plan.pyStep 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 writestatus:complete/reviewed:trueunless 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: removecompletefrom the auto-derived statuses (or gate thecompletederivation behind /independent-review);--complete-allerrors with a pointer to /independent-review. -
autopilot_auto_cure.py: remove the State-B auto-completeflip_from_in_review_cleancall (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 subsectionstatus→complete. - Repo hygiene check —
compiler_repo/diagnostics/repo-hygiene.sh --check.
- Tasks
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_reversalto route through /independent-review (or remove the call). - Subsection close-out (05.2) — MANDATORY before 05.N:
- Tasks
[x]; tests confirm reversal gated; update subsectionstatus→complete. - Repo hygiene check —
compiler_repo/diagnostics/repo-hygiene.sh --check.
- Tasks
05.N Completion Checklist
- 05.1–05.2
[x]and statuscomplete. - Audit:
grepforstatus.*complete/reviewed.*Truewrites acrossscripts/shows the only writer is /independent-review’s path. -
python3 -m pytest scripts/plan_corpus/tests/ scripts/plan_orchestrator/tests/ -qgreen (writer-gating cases). -
python -m scripts.plan_corpus checkclean 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); update00-overview.md+index.md. - Repo hygiene check —
compiler_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.