Stop the handoff carrying the write Orchestra asked for

Handoff.Command is the last command observed in the pane. The handoff prompt
tells the agent to write .orchestra-handoff-report.md and stop, so that write
is almost always the last command there. Validate then rejects it as circular:
"must not point to a handoff or report".

Every phase rotation therefore failed on Orchestra's own instruction. Live on
run 5, one stage past F36.

lastObservedCommand now skips commands the validator would call circular, so
the successor gets the last command that was real work. The rule stays in
continuity and is asked, not restated, which is how F36 happened.

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 01:45:11 +04:00
parent 294cbcb078
commit cb7782db01
3 changed files with 49 additions and 2 deletions
+6
View File
@@ -151,6 +151,12 @@ const maxAuthoredAction = 2*maxAuthoredLine + len(" — ")
var circularAction = regexp.MustCompile(`(?i)handoff|report\.md|^continue the task`)
var circularCommand = regexp.MustCompile(`(?i)\.orchestra-handoff|handoff-report|report\.md`)
// IsCircularCommand reports whether Validate would reject this as a command
// that points at a handoff. Producers need the same answer before they build a
// handoff, so the rule lives in one place rather than being restated as a
// second regexp that can drift.
func IsCircularCommand(s string) bool { return circularCommand.MatchString(s) }
func (h Handoff) Validate() error {
if strings.TrimSpace(h.Meta.ID) == "" || !reasons[h.Meta.Reason] || h.Meta.RotationIndex < 0 {
return errors.New("invalid handoff meta")