Skip to content

feat: record agent sessions and operator halts in supervised rounds (P2) - #8

Merged
TKontu merged 2 commits into
autonomous-reconcile-loopfrom
auto/p2-sessions-halts
Oct 10, 2026
Merged

TKontu merged 2 commits into
autonomous-reconcile-loopfrom
auto/p2-sessions-halts

Conversation

@TKontu

@TKontu TKontu commented Oct 10, 2026

Copy link
Copy Markdown
Owner

This is phase P2 of the autonomous Reconcile-loop plan. It is stacked on #7: after #7 merges, retarget this PR to autonomous-reconcile-loop.

New version 2 ledger commands in scripts/round.py:

  • session start ROUND --role planner|executor|reviewer|merger …
    • It is a write-ahead record of each agent launch: runner, session UUID, worktree, head, deadline. It prints {"session": "S<n>"}.
    • It refuses:
      • a duplicate UUID
      • a second live session on an assignment
      • a second live planner
      • any start while a halt is uncleared
    • Role rules:
      • an executor needs assigned, or a needs-fix review (a repair)
      • a reviewer needs the latest head with no review yet
      • a merger needs a ready review of that head
  • session ack --pid moves a session from launching to running. session end --state exited|timed-out|killed|lost records the exit code, cost and the imported record (the record path must exist).
  • review --session S is an alternative to --reviewer. It accepts only a finished reviewer session for the same assignment and head.
  • halt and clear-halt keep a durable record with code, detail, action needed and an optional inventory JSON. Clearing needs evidence.
  • Guards:
    • Cancellation refuses while the assignment has a live session.
    • A merged resolution tolerates only its live merger session.
    • Supervised closure refuses live sessions and uncleared halts.
  • Version 1 rounds refuse all of these commands.

SUPERVISION.md documents sessions and halts.

Validation:

  • RED: 6 of the 7 new tests failed before implementation. The version 1 refusal guard passed already.
  • GREEN: python3 -m unittest discover -s tests passes (41 tests), also with ResourceWarnings promoted to errors. git diff --check is clean.

🤖 Generated with Claude Code

`session start|ack|end` records each launched agent before launch, with
role rules that refuse double dispatch and out-of-order work; `review`
accepts a finished reviewer session. `halt` and `clear-halt` record
conditions that need an operator; uncleared halts block new sessions
and closure. Live sessions block cancellation and closure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TKontu
TKontu changed the base branch from auto/p1-ledger-v2 to autonomous-reconcile-loop October 10, 2026 20:38
@TKontu
TKontu merged commit 8e140c1 into autonomous-reconcile-loop Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant