The outer loop
workflow.py · run_until_blocked()
Each tick of the loop: load the state file, derive the next
task, dispatch it to Codex, gate the result against the
current task's success criteria, advance the state machine,
and auto-commit the scoped diff. A file lock
(state/orchestrator.lock) prevents
concurrent runs. The loop exits on an open BLOCKER, an open
approval, or when the planner returns nothing
(run_state: IDLE). On
DEV_IMPLEMENT
gate failure, the loop tries a bounded 2-attempt repair
before surfacing the failure to the user.