100%

Walking skeleton: zeroed -> forensic entry detection

Goal

Make /review-plan DETECT a zeroed plan and route into a forensic-review mode instead of the current empty v7 clean structural pass. This is the minimal end-to-end vertical slice: zeroed-flag accessor -> forensic branch -> a forensic entry exit that proves the branch fires (no real forensic work yet; that lands 01-04). Establishes the seam every later section extends.

Implementation Sketch

Today (verified): on a v7 plan /review-plan runs Step 1 precheck (v7 no-op, review_plan.py:381) -> Step 1.7 v7 short-circuit (review_plan.py:1331 -> _clean_structural_pass_exit, review_plan.py:1332-1340) -> exit. The reviewer skills carry ZERO zeroed references. The LLM must NOT read plan.json (plan-read-discipline.md §2.1); zeroed reaches the skill ONLY via a backend accessor or a CLI carrier. V7Backend already reads plan.json internally (backend.py:250) so a zeroed property there is the sanctioned accessor.

Spec References

scripts/review_plan_runtime/backend.py (V7Backend.zeroed accessor; MarkdownBackend.zeroed=False); scripts/plan_orchestrator/review_plan.py:1331 (v7 short-circuit branch); scripts/plan_orchestrator/main.py + compose_review_plan_api.py (CLI carrier, threaded like —autopilot-run-id); route_v7.load_v7_plan_json (the sanctioned zeroed reader the backend wraps).

Work Items

  • Add a zeroed property to V7Backend (scripts/review_plan_runtime/backend.py) that reads plan.json:zeroed via the sanctioned route_v7 reader (NOT a raw tool read); MarkdownBackend.zeroed returns False. SRP: the backend is the sole zeroed accessor for the reviewer surface.
  • Thread a forensic-mode signal through the review-plan CLI: derive it from backend.zeroed inside review_plan.orchestrate (no new user-facing flag required) AND preserve it across —step resume hops the way —autopilot-run-id is threaded (compose_review_plan_api.py / post_dispatch.compose_review_plan_resume).
  • In review_plan.py:_step_1_7_integrity_audit v7 short-circuit (review_plan.py:1331), branch on backend.zeroed: when zeroed, emit a forensic-entry next_action (new exit_kind zeroed_forensic_review) instead of _clean_structural_pass_exit; when not zeroed, keep today’s clean structural pass UNCHANGED.
  • pytest scripts/plan_orchestrator/tests/test_review_plan_zeroed_forensic_entry.py: (pos pin) a zeroed v7 fixture routes to the forensic-entry exit_kind; (neg pin) a non-zeroed v7 fixture still emits cross_section_structural_pass. Semantic pin: deleting the zeroed branch flips the pos test red.

Fresh intel (regenerated)

{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “zeroed-plan-forensic-review/s-2e7e915e” }, “generated_at”: “2026-06-20T01:07:41.589399+00:00”, “graph_state”: { “head_sha”: “e4b7c39a”, “last_code_import_at”: “2026-06-20T01:04:39.944Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:zeroed-plan-forensic-review/s-2e7e915e] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/zeroed-plan-forensic-review” } } }

(full dossier: walking-skeleton-forensic-entry-detection—s-2e7e915e.intel.json)