Repository navigation
feat(bin): add worker stand-down and repair to fm-control - #3281
AgardnerAU wants to merge 61 commits into
Conversation
[High impact] The PR appears safe to merge. Reviews (13) · Last reviewed commit: "no-mistakes(document): Clarify live chec..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: Reviewed HEAD Contract-class: new-default. Unconfigured fleet now has first-class VISION (per rule):
Attestation HTML binds |
…pair and rollback
…e before wiring retire
… refuse an absent CLI
…ed run projections
d402739 to
562d760
Compare
|
Merged current upstream main into this branch (head 9dc61a0), resolving the conflicts in bin/fm-control.sh and tests/fm-contributions.test.sh; the budget-hang fixture fix is kept. The branch is up to date with main and ready for CI; the workflow runs are waiting for maintainer approval. |
|
Speaking as Kun's firstmate (OSS triage, not the captain). Thanks @AgardnerAU. My 09-19 stamp was waiting-author, because CI was red on the contributions budget-hang test at I re-reviewed the tip diff. There are no workflow or secret changes, so I approved the fork runs: CI Contract-class: new-default (unchanged). An unconfigured fleet gains first-class VISION (unchanged):
Outcome: waiting-ci. The author-side blocker is cleared. Once CI and no-mistakes are green, this goes to the captain to merge or leave. It won't auto-merge. Nothing is needed from you right now. |
…r-false-wedge-alarms # Conflicts: # tests/fm-crew-state.test.sh
|
Merged current upstream main into this branch (head 876c626); the one test-file conflict is resolved and the branch has no conflicts with main. The affected tests pass locally. Ready for CI - the fork workflow runs are waiting for maintainer approval. |
|
Speaking as Kun's firstmate: thanks @AgardnerAU — tip Contract-class: new-default (unchanged). Unconfigured fleet still gains first-class stand-down verbs, durable VISION: one-interface / scripts / restart / spine / vendor / scope align; authority in tension (no opt-in gate) — hence new-default. Outcome: waiting-ci. Main is red; no merge. When CI + no-mistakes are green on a green main, this goes to the captain to merge or leave (not auto-merge). Live 8/10 noted (relaunch + in-flight NM covered by suites). Nothing needed from you right now. |
…r-false-wedge-alarms # Conflicts: # bin/fm-spawn.sh # tests/fm-contributions.test.sh # tests/fm-control-relaunch.test.sh # tests/fm-crew-state.test.sh # tests/fm-send-inbox.test.sh
… fm-spawn directly
|
Merged current upstream main (1aa2a21) into this branch and resolved the conflicts; head is now 45a6e5d. The relaunch rollback now arms only after upstream's polytoken hook-layer refusal, while a refused relaunch still restores the stood-down record (covered by a new test in tests/fm-control-relaunch.test.sh). Up to date with main and ready for CI - the workflow runs are waiting for maintainer approval. |
|
Speaking as Kun's firstmate: thanks @AgardnerAU for keeping this current. What changed since my 14 Oct stamp ( I approved the held fork runs on this head: CI Contract-class: new-default (unchanged). An unconfigured fleet gains first-class Status: waiting-ci. Once CI and no-mistakes are green, this goes to Kun to merge or leave. It won't auto-merge, and nothing is waiting on you right now. Main's last completed run had Behavior portable serial 2 cancelled at the 30-minute ceiling (#7255). If that shard is the only red here, it mirrors main and isn't on you. |
|
The one red check, Behavior portable serial 5 (https://github.com/kunchenguid/firstmate/actions/runs/39132134436/job/117699354793), is a known intermittent failure that this PR does not cause: tests/fm-remote-secondmate-lifecycle-e2e.test.sh times out with "the watcher did not exit on its auto-relaunch wake within the bound". The same failure appears on unrelated branches: https://github.com/kunchenguid/firstmate/actions/runs/39152095982, https://github.com/kunchenguid/firstmate/actions/runs/39106745352, https://github.com/kunchenguid/firstmate/actions/runs/39094096437. The test file passes locally on this head. Could you please rerun the failed job? |
…r-false-wedge-alarms # Conflicts: # bin/fm-crew-state.sh
|
Speaking as Kun's firstmate: thanks @AgardnerAU for working through all three Greptile findings. Head
All three threads are resolved, and Greptile is 5/5 on this head. The attestation binds I've added |
|
Speaking as Kun's firstmate: @kunchenguid this one is ready for your merge-or-leave call. The Full suite passed on Contract-class: new-default. An unconfigured fleet gains @AgardnerAU nothing more is needed from you; this is waiting on Kun, and any merge conflict is ours to fix. |
|
Speaking as Kun's firstmate: thanks @AgardnerAU. I checked the refresh. Head Nothing changes in where this stands: it is still waiting on Kun's merge-or-leave decision, not on you. Contract class: new-default (unchanged). Any merge conflict is ours to fix. |
Intent
Refresh the contribution in #3281 locally from the approved d33bd39c baseline.
"A1" - start the 15 Nov firstmate code work after the 12 Nov upstream catch-up lands; local work and checks only; no upstream PR, push or post before 15 Nov.
publish the five local fixes to kunchenguid/firstmate as PRs - update PR 5805 (upstream-refresh-5805-herdr-lab), update PR 3281 (fm-refresh-3281-1018), a new PR for fm-herdr-presentation-e2e-concurrent-lock, a new PR for fm-lock-typed-outcomes, and the Herdr passive capture fix alone as its own PR (fm-herdr-passive-capture-contribution).
The referenced contribution adds worker stand-down and repair so held ship or scout workers can stop without false wedge alarms, while active validation and pending instructions remain protected, and addresses the three findings on retry exit failure, incomplete run listings, and live checks-green reporting.
What Changed
stand-downandrepair-worker-stateverbs tobin/fm-control.sh, backed by the newbin/fm-worker-state-lib.sh. On the tmux backend,stand-downstops a held ship or scout worker and writes an exactstate/<id>.worker-staterecord only after it proves the agent is gone. It refuses when the branch has an in-flight no-mistakes run, when a steering instruction is still unacknowledged, when the run state can't be read, or when the agent was already gone and the task has nopaused:/captain-held:hold declared.repair-worker-statekeeps a valid record only while its endpoint is proven dead. Otherwise it clears the record and returns the task to ordinary supervision.bin/fm-nm-run-lib.shnow owns a single branch-run verdict (active,quiet, or refused when unreadable). It readsaxi statusfirst and uses only the newestno-mistakes runsrow for this branch as corroboration. It refuses on a failed listing or a full window only when another branch has the active run.fm-watchskips stale-pane and wedge alarms for a proven worker-free endpoint.fm-sendrefuses new input to such a task.fm-spawn --relaunchclears the record before relaunching and restores it if the relaunch aborts.fm-teardownremoves the record.fm-crew-statereportsparked · source: worker-stateunless a still-live attributed run (including one whose checks are green) keeps step authority. It reportsunknownwhen the endpoint has vanished.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The remaining four test files exercise the real fm-control, fm-send and fm-watch entry points against fake tmux and no-mistakes boundary stubs, each with a counterfactual case; the only issue is one stale explanatory comment.
Testing
All seven live scenarios passed against a real Claude worker in an isolated lab: stand-down, both refusals, repair, held-task reporting and send refusal, and relaunch with rollback; the transcripts are in the evidence directory. The fm-control, fm-control-relaunch and fm-crew-state suites passed. The fm-send-inbox, fm-task-inbox and fm-watch-triage suites were stopped unfinished because of the time budget. The fm-watch wedge exemption was not driven live, because its stale timers run for minutes. One early setup attempt ran Claude as the pane's own command, which is not how real spawns run it. The pane closed when Claude exited, and stand-down correctly refused and left the task supervised; that run is kept as s0 evidence. The tmux server was stopped and the lab socket dir torn down, but the sandbox denied
rm -rfof the lab home, so /tmp/fm-lab.YPDRxi and the unpacked tmux in /tmp/tmuxpkg.KpKy are still there, outside the worktree.bash tests/fm-control.test.shexit 0 (stand-down active-run, terminal-run and unanswerable-check cases); suite-fm-control.logEvidence: Pending inbox instruction refuses stand-down
Source: Pending inbox instruction refuses stand-down
Evidence: Stand-down of live claude worker plus idempotent repeat
Source: Stand-down of live claude worker plus idempotent repeat
Evidence: Repair clears a record contradicted by a live agent
Source: Repair clears a record contradicted by a live agent
Evidence: crew-state parked and fm-send refused while held
Source: crew-state parked and fm-send refused while held
Evidence: Dead agent without declared hold refused, then accepted after paused:
Source: Dead agent without declared hold refused, then accepted after paused:
Evidence: Aborted relaunch restores the stood-down record
Source: Aborted relaunch restores the stood-down record
Evidence: Relaunch from stood-down clears record and restarts claude
Source: Relaunch from stood-down clears record and restarts claude
~/.no-mistakes/evidence/01M7EHPTFV99DYVY0C73JYK3ZN/s0-setup-pane-without-shell-refuses.txt)Evidence: Targeted suite results
Source: Targeted suite results
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/fm-control.test.sh:1407- The comment above test_stand_down_refuses_while_an_instruction_is_unacknowledged says "the watcher's re-ring ladder stops for a stood-down window". That contradicts the shipped behaviour, which tests/fm-task-inbox.test.sh (test_watcher_ladder_still_runs_for_a_stood_down_task) pins: the ladder keeps running and only pane-stale and wedge detection are exempt. The reason for the refusal is still correct, because fm-send refuses new steers to a worker-free task and an unread steer would wait for a relaunch. Reword the comment so it matches the actual exemption.rm -rfon the disposable lab home /tmp/fm-lab.YPDRxi and the unpacked tmux in /tmp/tmuxpkg.KpKy. The lab tmux server was stopped and fm-lab-home.sh teardown succeeded, but both directories, outside the worktree, still need manual removal.bash tests/fm-control.test.shexit 0 (stand-down active-run, terminal-run and unanswerable-check cases); suite-fm-control.logbin/fm-lab-home.sh createplustmux-dirlab home, with a tmux 3.6 binary unpacked inside the workspace (apt-get download + dpkg-deb -x, no system install)Live:fm-control.sh t1 stand-downwith an unacknowledgedstate/t1.inbox/0001.msgand a live claude workerLive:fm-control.sh t1 repair-worker-statetwice against a stale standing-down record with a live claude in the endpointLive:fm-control.sh t1 stand-downtwice against a live claude worker in a shell pane, thencat state/t1.worker-stateLive:fm-crew-state.sh t1andfm-send.sh t1 'new instruction'while t1 was stood downLive:fm-control.sh t2 stand-downon a ship with a dead agent and no declared hold, then again after appendingpaused:to t2.statusLive:fm-control.sh t1 relaunch --note ...from stood-down, once refused by a fixture brief error (rollback) and once successfulbash tests/fm-control.test.sh(exit 0)bash tests/fm-control-relaunch.test.sh(exit 0)bash tests/fm-crew-state.test.sh(exit 0)Stopped before finishing because of the time budget: tests/fm-send-inbox, fm-task-inbox, fm-watch-triage✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.