Repository navigation
Conversation
…ction Phase P3 of the autonomous Reconcile-loop plan. scripts/supervise.py observes the ledger, Git, PR/check state and session processes, and a pure decide() picks exactly one next action. It performs no effects: `next` prints the decision, `status` explains it, and `run --dry-run` logs decisions under a single-instance lock. - config: committed policy is read from the remote default branch; an ignored local file may override runner/budget keys only; autonomy needs committed grants. - policy: path globs, required checks on an exact SHA, and the L2 merge gate. - gh: read-only wrapper where any failure is Unknown, never success. - Table-driven decide tests, plus CLI tests against real Git and a fake gh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o/p3-supervisor-skeleton
TKontu
changed the base branch from
auto/p2-sessions-halts
to
autonomous-reconcile-loop
October 10, 2026 20:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is phase P3 of the autonomous Reconcile-loop plan. It is stacked on #8. After #7 and #8 merge, retarget this PR to
autonomous-reconcile-loop.scripts/supervise.pyis the deterministic loop manager, in a read-only form. Each tick it observes the ledger, Git, PR and check state, and session processes. A puredecide()then returns exactly one action. This version performs no effects: it never launches agents, writes the ledger, pushes, comments or merges.runwithout--dry-runexits 2. Exit codes:New modules in
scripts/supervisor/:config.pyreads.agent/supervisor.tomlfromREMOTE/BRANCHwithgit show, never from the working tree.supervisor.local.tomlmay override only[runner]and[budgets].auto_mergeand a non-emptyrequired_checks. L3 also requiresauto_reconcileandallow_reconcile_merge. A missing grant exits 2 and names it.--autonomycan only lower the level.decide.pyis pure and implements the plan's state machine. Live sessions are contained even while a halt is uncleared (kill past deadline, mark lost, ack).max_paralleland the round budget.policy.pyprovides path globs, the required-checks state on an exact SHA, and the L2 merge gate. The newest run wins. Missing, skipped, neutral and cancelled checks fail. Pending checks hold afterci_timeout_minutes.--numstatgives them no line count to check againstmax_changed_lines. The plan doesn't list this.gh.pyis a read-only wrapper. Any failure isUnknown, never an empty success.observe.pybuilds the snapshot:round.py status, so the read takes the ledger lock.ls-remoteand does not fetch. If the remote head object is missing locally, the decision isFetch..agent-runs/supervisor/sessions/; P4's shim will write them..agent/supervisor.example.tomlis conservative: L1, no merge grants. The Claude output field names in it are still unconfirmed until P4 records a real envelope.SUPERVISION.mdgains the preview, configuration, decision table and merge gate sections.Validation:
supervise.py, so they did not have a separate failing run. They then caught one real bug: a trailing newline ingit diff --name-onlybecame an empty path, which the gate held as "outside-owned".python3 -m unittest discover -s testspassed 91 tests: the existing ledger tests plus 50 new ones. These include table-drivendecidecases and CLI tests against a real bare origin and clone, withtests/fakes/ghonPATH. The CLI tests assert that only read-onlyghcalls are made and that the ledger and checkout are unchanged.git diff --checkpassed, and the staged diff was reviewed for secrets.nextexits 2 because there is no committedsupervisor.toml.Not covered: the shadow run on a real project (rollout step 1) has not been done, and nothing is verified against live GitHub. All
ghbehavior in the tests comes from the fake.🤖 Generated with Claude Code