Skip to content

feat: add supervised version 2 rounds to the ledger (P1) - #7

Merged
TKontu merged 2 commits into
autonomous-reconcile-loopfrom
auto/p1-ledger-v2
Oct 10, 2026
Merged

TKontu merged 2 commits into
autonomous-reconcile-loopfrom
auto/p1-ledger-v2

Conversation

@TKontu

@TKontu TKontu commented Oct 10, 2026

Copy link
Copy Markdown
Owner

This is phase P1 of the autonomous Reconcile-loop plan. It targets the long-lived autonomous-reconcile-loop branch, not main.

scripts/round.py gains opt-in supervised (version 2) rounds:

  • init --supervised writes version: 2 with empty sessions and halts records. Without the flag, the manifest and packet stay byte-identical to version 1.
  • On a supervised round, assign requires --owns GLOB and accepts --resource NAME and --kind work|reconcile (--start REF for reconcile). These are written into the packet, so the digest binds them.
    • Live work assignments may not share a resource or have overlapping owned-path prefixes. The check is deliberately conservative.
    • A reconcile assignment requires all work assignments to be terminal, and ends the round's work.
  • review ROUND A --head --verdict ready|needs-fix|blocked --evidence --reviewer is bound to the latest result's exact head. A newer result supersedes it.
  • On a supervised round, resolve merged needs a ready review of the latest result at --head.
  • Supervised close requires --delta changed|none.
  • Ledger writers take an exclusive flock on .agent-runs/ROUND/round.lock.
  • Version 1 refuses all of the new options. Lean main refuses version 2 rounds through its existing "unknown version" rule.

Existing functions are touched only at hook points; all new code is in one tail block, to keep main → branch syncs small. New documents: SUPERVISION.md (draft), plus an appended pointer line in SPEC.md and a paragraph in AGENTS.md.

Validation:

  • RED: 8 of the 10 new tests in tests/test_round_v2.py failed before implementation. The other 2 are version 1 regression guards.
  • GREEN: python3 -m unittest discover -s tests passes (34 tests). git diff --check is clean.
  • The lock test also passes with ResourceWarnings promoted to errors.

Not included yet: sessions and halts (P2) and the supervisor itself (P3+). This branch was cut from main before #4–#6 merged; they will arrive by a main → branch merge.

🤖 Generated with Claude Code

`init --supervised` writes a version 2 round. Supervised assignments
bind owned paths, resources and kind into the packet and refuse overlap
with live assignments; a reconcile assignment follows terminal work.
`review` records head-bound verdicts, and supervised merges require a
ready review of the latest result. Supervised closure records the
behavior delta. Ledger writers serialize on a per-round lock. Version 1
rounds are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ypassed

The overlap check compares literal prefixes as strings, but only a leading "/" was
rejected. With src/a already owned, ./src/a, src//a and src/x/../a were accepted as
non-overlapping, and ../outside could point out of the repository. Owned patterns
now need non-empty segments other than "." and "..", so one path has one spelling.

SUPERVISION.md also states that version 1 rounds take the round lock, and that the
lock covers every command except init.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TKontu
TKontu merged commit 02ecee6 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