Tell the terminal phase how to finish

The worker finalises a task when .orchestra/done appears. No brief ever named
that file: grepping a rendered launch.md for it returned nothing, in any phase.

review is terminal. Its only legal move is backwards to implement, so a review
that passes has nothing to ask for and, until now, nothing to write either. Run
5 halted exactly there after four clean rotations, with no error anywhere,
because stopping was the correct reading of its instructions.

The brief now names the marker in the terminal phase, says when to write it,
and says it is exclusive with asking to go back. The test asserts the negative
too, so a phase that can still ask is never told to finish instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011xsXyr5J1RACo71YeKG3Pu
This commit is contained in:
2026-08-28 02:16:36 +04:00
parent 6eef1096bf
commit bcaf0cc285
3 changed files with 58 additions and 0 deletions
+21
View File
@@ -1695,3 +1695,24 @@ below all of them. That is the target chain, live.
Run 5 is implementing, not finished. The chain this run set out to prove is
proven. Completion, the review phase, and the final report are still ahead.
### F40: the terminal phase never learned how to finish
Run 5's review agent finished at 02:12 and stopped. No `phase-request.json`, no
handoff, no `.orchestra/done`, and nothing in the worker journal after 02:06:21.
`legalPhaseTransitions` makes review terminal: its only move is backwards to
`implement`, for rework. A review that passes has nothing to ask for.
The worker has always finalised on `.orchestra/done`
(`cmd/orchestra-worker/main.go:546`). No brief ever named that file. Grepping a
rendered `launch.md` for it returned zero matches, in every phase.
So the completion signal existed on one side of the contract only. An agent
whose review passed had no instruction at all, and stopping was the correct
reading of what it had been told.
Fixed in the phase brief: the terminal phase now states the marker, when to
write it, and that it is exclusive with asking to go back.
`TestTerminalPhaseNamesTheCompletionSignal` also asserts the negative, so a
phase that can still ask is never told to finish instead.