orchestrator-wiring
Goal
Wire the per-section gate: repoint the existing pre_work review_as_phase block to dispatch /review-section, re-key it on intel_reviewed_hash mismatch, add the test-baseline-record directive at serve, and the baseline-compare criterion at completion.
Dependency
Needs S2 (hash field) + S3 (review-section skill).
Implementation Sketch
In _enrich_route_envelope_for_execution between the intel-heal directive (step 3) and the review_as_phase block (roadmap.py:580-621): repoint review_as_phase.next_skill -> review-section (intel_heal_dispatch-style DIRECTIVE block, NOT an action=exit->dispatch transform per INV-20); fire the gate when section.intel_reviewed_hash != compute_intel_package_hash(current pkg). Add a payload.test_baseline_record directive (state.sh baseline capture --key <section-id>) beside the intel-heal. Extend next_action.schema.json (payload.review_section + payload.test_baseline_record). Add baseline-compare as a SuccessCriterion at completion (probe_ref state.sh baseline compare --key <K> --json, comparator exact-match, expected gate_pass=true).
Spec References
scripts/plan_orchestrator/roadmap.py:497-621; scripts/plan_orchestrator/intel_heal_dispatch.py; scripts/plan_orchestrator/next_action.schema.json; compiler_repo/diagnostics/state.sh baseline.
Work Items
- Repoint the pre_work review_as_phase gate to dispatch /review-section and re-key its trigger on intel_reviewed_hash mismatch.
- Add the test-baseline-record directive at serve (state.sh baseline capture —key
). - Add the baseline-compare SuccessCriterion at completion (state.sh baseline compare; exact-match; gate_pass=true).
- Extend next_action.schema.json with payload.review_section + payload.test_baseline_record blocks.
- Author gate tests: fires on hash-mismatch, no-fires on match; directive shape.