execution-loop-and-flow-doc
Goal
Wire the per-section execute loop to ledger cycles + the baseline-compare regression gate, confirm the TPR->hygiene->baseline-compare->commit close-out ordering, document the first-exec vs resume flows, and update the rule SSOTs.
Dependency
Needs S5 (orchestrator wiring).
Implementation Sketch
- Execution attempts append learning-ledger cycles (
ledger_appendper disposition; consult dead-ends on retry). verify_and_complete_v7consumes the baseline-compare criterion so a regression blocks completion and loops back to execute.- Document the first-execution vs resume per-section flows.
- Add
/review-sectionto routing.md §7 consumption matrix (+1 consumer) and the skill-control-contract tool role list.
Per-Section Execute Flow — First-Execution vs Resume
Canonical reference: .claude/skills/continue-roadmap/references/per-section-execute-flow.md (the continue-roadmap reference pointer this section delivers). Summary of the two flows the wired loop drives:
First-execution (a not-started section):
- Serve emits the
test_baseline_recorddirective — capture the pre-work test baseline (state.sh baseline capture --key <section-id>, create-if-absent; first capture wins). - PRE-WORK review-as-phase:
/review-section(v7) writesreviewed:true. - Re-scan flips
not-started → in-progress(write-on-serve) and routes to the completion review-as-phase. - Author the section’s deliverables.
verify_and_complete_v7(the SOLE done-writer) runs the strict-completion + owned-criteria gates including the baseline-compare criterion (CONSUME half) — a recorded test-baseline regression QUARANTINES; a clean/missing baseline passes.- On COMPLETED: write attestation, flip every work_item to
completed, append a KEPT learning-ledger cycle (engine-side WRITE half, sibling-linked to the section).
Resume (an in-progress section, fresh session):
- The resume pointer is reconstructed from disk alone (
resume_manifest.build_manifest) — no memory. - Serve re-routes the already-
in-progresssection straight to the completion review-as-phase (no re-execution — deliverables built on the prior cycle). verify_and_complete_v7as in first-execution steps 5–6. A QUARANTINE re-serves for DEVIATE-and-fix, consulting dead-ends on retry (latest_dead_end_attempt_for_node→intel_reground).
Close-out ordering (compiler scope): TPR → impl-hygiene → baseline-compare → commit. The “Needs S5” dependency is body-prose only; the v7 route models order in the lexorank key, never a depends_on edge (INV-6/INV-19).
Spec References
scripts/plan_corpus/write.py ledger_append; scripts/plan_orchestrator/review_phase.py verify_and_complete_v7; .claude/rules/routing.md §7; .claude/rules/skill-control-contract.md; .claude/skills/continue-roadmap/references/per-section-execute-flow.md; scripts/run-plan-corpus-tests.sh.
Work Items
- Wire per-section execute attempts as ledger cycles (ledger_append per disposition) + consult dead-ends on retry.
- Wire the baseline-compare criterion into verify_and_complete_v7 so a regression blocks completion and loops back to execute.
- Update routing.md §7 consumption matrix (+1 consumer: /review-section) and the skill-control-contract tool role list.
- Document the first-execution vs resume per-section flows (plan body + continue-roadmap reference).
- Run the full plan_corpus + skill_audit suites clean.