Section 02 — runtime-rails
Goal
Build the on-rails state machine: a lint+static step then 5 fixed category batches, single-subagent per step, resumable.
Implementation Sketch
Model the workflow as plan_orchestrator does: step1 = lint + static checking; steps 2-6 = the 5 fixed batches (B1 SSOT/PHASE/FLOW, B2 TEST/COVER, B3 SCOPE/NAME/WASTE, B4 STRUCT/ORG, B5 COMMENT/INTEL/SPEC). The script owns the loop, emits next_action per step, advances state; the skill only consumes next_action. Resumable run-state.
Spec References
script-first.md §1/§4/§5 (runtime layout + next_action surface); workflow-ownership.md §1/§2; state-discipline.md §1.
Work Items
- Define the workflow step sequence (lint + 5 batches) + the batch->category fixed mapping
- Implement the state machine + next_action emission + resumable run-state
- pytest coverage for step routing, batch mapping, and resume
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “impl-hygiene-rewrite-v3/s-7480c4cb” }, “generated_at”: “2026-06-23T03:07:07.226837+00:00”, “graph_state”: { “head_sha”: “ddf60faa”, “last_code_import_at”: “2026-06-23T03:06:45.2Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:impl-hygiene-rewrite-v3/s-7480c4cb] 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/impl-hygiene-rewrite-v3” } } }
(full dossier: runtime-rails—s-7480c4cb.intel.json)