feat(orchestrator): agent-initiated ROTATE via handoff reason=manual (S11)
rotate() and TurnDecision now check the agent's own handoff for
meta.reason=="manual" before evaluating occupancy/turn-boundary — per
spec §5.3, that reason is itself the boundary signal ("a coherent unit
finished and the next is independent"), so it bypasses both checks and
releases immediately. Extracted the shared release-and-anchor-certify
tail into Coordinator.finishRelease so the manual path gets the same
anchor safety guarantee as the threshold path.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W1rkJ2hBMybnJctPbcy4tT
This commit is contained in:
+14
-1
@@ -282,8 +282,21 @@ Fixed so far:
|
||||
rotation, thrash detection, agent-initiated `ROTATE` — see AUDIT.md's S11
|
||||
section for why those are bigger than a threshold check.
|
||||
|
||||
- **S11 (agent-initiated ROTATE)** — the schema already accepted
|
||||
`meta.reason: "manual"` (since B5) but nothing checked for it. New
|
||||
`handoffReason(worktree)` reads a written `.orchestra-handoff.json` and, if
|
||||
its reason is `"manual"`, both `rotate()` and `TurnDecision` skip occupancy
|
||||
and the turn-boundary probe entirely and release immediately — the agent's
|
||||
own handoff *is* the boundary signal per §5.3 ("a coherent unit finished and
|
||||
the next is independent"). Extracted the shared release-and-certify tail
|
||||
into `Coordinator.finishRelease` so the manual path reaches the same
|
||||
anchor-safety guarantee as the threshold path. Covered by a new
|
||||
`TestTurnDecision` subtest (occupancy=0, boundary=false — every other path
|
||||
would refuse or continue — asserting rotation happens anyway once a
|
||||
`reason=manual` handoff exists).
|
||||
|
||||
Not yet started: Codex/opencode Stop-hook-equivalent scripts, S8, S11's
|
||||
milestone/thrash/agent-`ROTATE` pieces. See `AUDIT.md` for the full plan.
|
||||
milestone/thrash pieces. See `AUDIT.md` for the full plan.
|
||||
|
||||
**Phase 0 done (2026-07-27):** this box has live TCP reachability to the real
|
||||
herdr instance at `192.168.1.105:9245` — verified by hand (raw JSON-RPC
|
||||
|
||||
Reference in New Issue
Block a user