Repository navigation
docs(skills): add remote-secondmate recovery hint for false-negative verdicts - #2456
Merged
Merged
Conversation
…tive fm-crew-state and fm-send routinely misreport a live remote secondmate as dead; confirm against the pane before relaunching, and relaunch only through fm-spawn.sh, never raw herdr pane surgery.
adibirzu
added a commit
to adibirzu/firstmate
that referenced
this pull request
Aug 16, 2026
…ndoff fixes (#9) * fix: keep the public promise reachable when work is routed to a second mate (kunchenguid#2457) The lightweight Relay follow-up link lives in the answering home's own state/<task-id>.meta, so it can only bind work that home owns. When a Relay-linked request is routed to a second mate, the task record lives in the second mate's home, fm-x-link.sh failed with a bare "no such task ...meta", and nothing else picked the promise up: only the soft acknowledgement was ever posted. The typed promised-final path already supports --work-home secondmate:<id>; the playbook simply never chose it. - fmx-respond now states the routing rule crisply: a task in this home takes the lightweight link, and second-mate-routed work takes a promised-final commitment bound to that home, registered up front with the brief command carried into the routed worker's instructions. - fm-x-link.sh refuses a task with no local record by naming the registered second mate whose home actually holds it and printing the promised-final registration command, with the exact --work-home when the match is unambiguous. A home with no registered second mates keeps the plain error. - fm-backlog-handoff.sh reports, after a successful move, any moved key that still owes a public reply bound to main/<key>, since that binding no longer names the home owning the work. The move itself is never blocked. Docs and the secondmate handoff prose follow the same rule. Tests cover the refusal, its scoping, the unchanged local-link path, and both handoff outcomes at the script boundary. * docs(skills): add remote-secondmate recovery hint for false-negative verdicts (kunchenguid#2456) * fix(skills): hint that remote secondmate liveness verdicts false-negative fm-crew-state and fm-send routinely misreport a live remote secondmate as dead; confirm against the pane before relaunching, and relaunch only through fm-spawn.sh, never raw herdr pane surgery. * no-mistakes: apply CI fixes * fix(calm): keep Pi's export confirmation visible (kunchenguid#2461) Pi 0.83.0 added a status line to every tool-expansion change, and Pi updates the previous status line in place when two status messages arrive back to back. Calm's post-export redraw cycled tool expansion on the macrotask right after Pi printed "Session exported to: <path>", so both expansion status lines coalesced over that confirmation and the captain was left with no record of where their export landed. Calm now repaints only the tool rows it presents, by invalidating each row through the render context Pi hands its render slots, and requests the surrounding redraw through setStatus. Neither appends to the transcript. The repaint is still needed because Pi can re-render a row asynchronously - the built-in edit row invalidates itself once its diff is ready - and that re-render can land inside the window where /export forces stock rendering. The real-terminal /export case now asserts the confirmation is still on screen after the redraw has settled, and that the redraw restored every Calm-hidden row, instead of only racing the moment the confirmation first appeared. --------- Co-authored-by: Kun Chen <[email protected]>
joliverMI
added a commit
to joliverMI/firstmate
that referenced
this pull request
Aug 16, 2026
…ng state (#2) * fix(ci): fail hung Herdr behavior runs in 20 minutes (kunchenguid#2413) A wedged family-run step was occupying the runner until the 75-minute job cap; bound that step so cleanup and timing artifacts still upload. * fix: keep the public promise reachable when work is routed to a second mate (kunchenguid#2457) The lightweight Relay follow-up link lives in the answering home's own state/<task-id>.meta, so it can only bind work that home owns. When a Relay-linked request is routed to a second mate, the task record lives in the second mate's home, fm-x-link.sh failed with a bare "no such task ...meta", and nothing else picked the promise up: only the soft acknowledgement was ever posted. The typed promised-final path already supports --work-home secondmate:<id>; the playbook simply never chose it. - fmx-respond now states the routing rule crisply: a task in this home takes the lightweight link, and second-mate-routed work takes a promised-final commitment bound to that home, registered up front with the brief command carried into the routed worker's instructions. - fm-x-link.sh refuses a task with no local record by naming the registered second mate whose home actually holds it and printing the promised-final registration command, with the exact --work-home when the match is unambiguous. A home with no registered second mates keeps the plain error. - fm-backlog-handoff.sh reports, after a successful move, any moved key that still owes a public reply bound to main/<key>, since that binding no longer names the home owning the work. The move itself is never blocked. Docs and the secondmate handoff prose follow the same rule. Tests cover the refusal, its scoping, the unchanged local-link path, and both handoff outcomes at the script boundary. * docs(skills): add remote-secondmate recovery hint for false-negative verdicts (kunchenguid#2456) * fix(skills): hint that remote secondmate liveness verdicts false-negative fm-crew-state and fm-send routinely misreport a live remote secondmate as dead; confirm against the pane before relaunching, and relaunch only through fm-spawn.sh, never raw herdr pane surgery. * no-mistakes: apply CI fixes * fix(calm): keep Pi's export confirmation visible (kunchenguid#2461) Pi 0.83.0 added a status line to every tool-expansion change, and Pi updates the previous status line in place when two status messages arrive back to back. Calm's post-export redraw cycled tool expansion on the macrotask right after Pi printed "Session exported to: <path>", so both expansion status lines coalesced over that confirmation and the captain was left with no record of where their export landed. Calm now repaints only the tool rows it presents, by invalidating each row through the render context Pi hands its render slots, and requests the surrounding redraw through setStatus. Neither appends to the transcript. The repaint is still needed because Pi can re-render a row asynchronously - the built-in edit row invalidates itself once its diff is ready - and that re-render can land inside the window where /export forces stock rendering. The real-terminal /export case now asserts the confirmation is still on screen after the redraw has settled, and that the redraw restored every Calm-hidden row, instead of only racing the moment the confirmation first appeared. * feat(bin): render the captain's four-section status board from existing state fm-status-board.sh prints one HTML page (Needs you to continue, In progress, Waiting, Recently completed) rendered entirely from fm-bearings-snapshot.sh's already-correct cross-home classification and fm-fleet-snapshot.sh's untruncated per-item detail, with no second store for agents to keep in sync. --------- Co-authored-by: Kun Chen <[email protected]> Co-authored-by: joliverMI <[email protected]>
joliverMI
added a commit
to joliverMI/firstmate
that referenced
this pull request
Aug 16, 2026
* fix(ci): fail hung Herdr behavior runs in 20 minutes (kunchenguid#2413) A wedged family-run step was occupying the runner until the 75-minute job cap; bound that step so cleanup and timing artifacts still upload. * fix: keep the public promise reachable when work is routed to a second mate (kunchenguid#2457) The lightweight Relay follow-up link lives in the answering home's own state/<task-id>.meta, so it can only bind work that home owns. When a Relay-linked request is routed to a second mate, the task record lives in the second mate's home, fm-x-link.sh failed with a bare "no such task ...meta", and nothing else picked the promise up: only the soft acknowledgement was ever posted. The typed promised-final path already supports --work-home secondmate:<id>; the playbook simply never chose it. - fmx-respond now states the routing rule crisply: a task in this home takes the lightweight link, and second-mate-routed work takes a promised-final commitment bound to that home, registered up front with the brief command carried into the routed worker's instructions. - fm-x-link.sh refuses a task with no local record by naming the registered second mate whose home actually holds it and printing the promised-final registration command, with the exact --work-home when the match is unambiguous. A home with no registered second mates keeps the plain error. - fm-backlog-handoff.sh reports, after a successful move, any moved key that still owes a public reply bound to main/<key>, since that binding no longer names the home owning the work. The move itself is never blocked. Docs and the secondmate handoff prose follow the same rule. Tests cover the refusal, its scoping, the unchanged local-link path, and both handoff outcomes at the script boundary. * docs(skills): add remote-secondmate recovery hint for false-negative verdicts (kunchenguid#2456) * fix(skills): hint that remote secondmate liveness verdicts false-negative fm-crew-state and fm-send routinely misreport a live remote secondmate as dead; confirm against the pane before relaunching, and relaunch only through fm-spawn.sh, never raw herdr pane surgery. * no-mistakes: apply CI fixes * fix(calm): keep Pi's export confirmation visible (kunchenguid#2461) Pi 0.83.0 added a status line to every tool-expansion change, and Pi updates the previous status line in place when two status messages arrive back to back. Calm's post-export redraw cycled tool expansion on the macrotask right after Pi printed "Session exported to: <path>", so both expansion status lines coalesced over that confirmation and the captain was left with no record of where their export landed. Calm now repaints only the tool rows it presents, by invalidating each row through the render context Pi hands its render slots, and requests the surrounding redraw through setStatus. Neither appends to the transcript. The repaint is still needed because Pi can re-render a row asynchronously - the built-in edit row invalidates itself once its diff is ready - and that re-render can land inside the window where /export forces stock rendering. The real-terminal /export case now asserts the confirmation is still on screen after the redraw has settled, and that the redraw restored every Calm-hidden row, instead of only racing the moment the confirmation first appeared. * fix(procevent): deliver captured results at most once A Lavish-captured answer reached a secondmate five times because forwarding it ran fm-send.sh and only afterward, manually, remembered to call `handled` - so every re-announcement of the still-unacknowledged capture (a restart, a compaction, a re-read wake) repeated the forward. The retry loop was ours, not lavish-axi's: fm-procevent.sh already proves capture is exactly-once, but nothing paired a downstream effect with its acknowledgement atomically. Add `fm-procevent.sh deliver <source-id> <sequence> -- <command>...`, which checks handled status, runs the command, and marks the generation handled as one call under the source lock, so a repeated delivery attempt against an already-delivered generation runs the command zero times and a failed command stays eligible for retry instead of being dropped. Point the process-event-sources skill and the runner's operating contract at it for exactly this class of forward. Five delivery attempts against one captured generation now run the downstream command once instead of five times - the read-and-discard cost of the other four is eliminated structurally. The historical incident's own token cost was not measured at the time and is not reconstructable after the fact. --------- Co-authored-by: Kun Chen <[email protected]> Co-authored-by: joliverMI <[email protected]>
zeeshaanahmad
added a commit
to zeeshaanahmad/firstmate
that referenced
this pull request
Aug 17, 2026
Intent
Add a minimal recovery hint for a seemingly-dead REMOTE second mate, encoding a lesson from a real 2026-08-15 incident: firstmate trusted false-negative liveness/send verdicts (fm-crew-state 'unknown/worktree gone', fm-send 'remote send failed'/'delivery unconfirmed') for a remote secondmate that was actually alive the whole time, and a genuine stuck-agent case was made worse by raw herdr pane close surgery that stranded the endpoint binding. In .agents/skills/stuck-crewmate-recovery/SKILL.md (the recovery playbook), add a short note for the remote-secondmate case capturing exactly two points: (1) pane inspection is the source of truth for a remote second mate - fm-crew-state and fm-send verdicts are unreliable and routinely false-negative for remote mates, do not conclude dead/failed from those alone, confirm against the actual remote pane first; (2) restart only via the official mechanics - bin/fm-spawn.sh --secondmate - never raw herdr pane close/kill surgery, which strands the endpoint binding. Keep it to the minimum needed to convey those two points: no new sections, no verbose prose, matching the existing terse skill style. Also added one cheap one-line pointer in secondmate-provisioning's Recovery section pointing back to this note, without expanding it. This is a firstmate-repo shared/tracked-material change; firstmate-coding-guidelines was already loaded and followed (one-owner rule, inline pointers not duplicated content, size discipline).
What Changed
stuck-crewmate-recovery's playbook for the REMOTE secondmate case:fm-crew-state'sunknown/worktree goneandfm-send'sremote send failed/delivery unconfirmedverdicts are unreliable and routinely false-negative, so confirm against the actual remote pane before concluding the mate is dead; and recover a genuinely stuck remote mate only viabin/fm-spawn.sh <id> --secondmate, never raw herdr pane close/kill surgery that strands the endpoint binding.secondmate-provisioning's recovery guidance referring back to that note as the owner of why the endpoint-dead and send-failed verdicts are themselves unreliable.Risk Assessment
✅ Low: Documentation-only change adding a terse, accurate recovery note and a one-line cross-reference pointer that fully match the authoritative intent and reference real, verified mechanics.
Testing
This is a natural-language documentation change to two agent-consumed SKILL.md playbooks, so there is no runtime behavior to unit-test and (per the test-quality rule) an instruction is not proven by its source text; I therefore validated via the repo's real doc/link consumer
bin/fm-doc-audience-check.sh(passed, all 253 local links resolve and both surfaces remain classified), by confirming every recovery mechanic and verdict the note references actually exists in the codebase (fm-spawn --secondmate, and thefm-crew-state/fm-sendfalse-negative verdicts), and by rendering both changed sections to an HTML page plus a full-page screenshot showing the two required points, terse placement with no new section, and the one-owner back-pointer. All checks passed with no actionable findings.Evidence: Rendered recovery-hint change in context (HTML)
Source: Rendered recovery-hint change in context (HTML)
Evidence: Doc consumer check output
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash bin/fm-doc-audience-check.sh— repo's real markdown/doc consumer; passed (surfaces=68, local_links=253 resolved, both changed SKILL surfaces still classified)Verified prescribed recovery mechanics are real:bin/fm-spawn.sh <id> --secondmateis a documented flag (records kind=secondmate)Verified the false-negative verdicts the note cites exist:fm-crew-stateemitsunknown/worktree gone (torn down?);fm-sendemits<backend> send failed/delivery unconfirmedConfirmed placement: note under thekind=secondmatepointer in stuck-crewmate-recovery (lines 26-27), back-pointer under## Recoveryin secondmate-provisioning (line 216)Rendered both changed SKILL sections to an HTML artifact and captured a full-page screenshot as reviewer-visible evidence✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.