Skip to content

fix: remove obsolete one-task recovery handoff - #14

Merged
ryannmicua merged 3 commits into
mainfrom
fm/fm-legacy-handoff-removal
Oct 10, 2026
Merged

ryannmicua merged 3 commits into
mainfrom
fm/fm-legacy-handoff-removal

Conversation

@ryannmicua

@ryannmicua ryannmicua commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Intent

Remove old one-off recovery code once confirmed.

Context: the fork-strategy research found about 800 lines of a one-task legacy handoff in bin/fm-control.sh (the handoff verb hard-coded to task paseo-backend-adapter, its former tmux endpoint and old branch), apparently obsolete. The captain approved removing it once it is confirmed that nothing still depends on it.

What Changed

  • Remove the legacy handoff command pinned to paseo-backend-adapter, including its identity flags, attestation journal, launcher bypass, and dedicated tmux session creation.
  • Remove the handoff procedure and recovery-skill exception; missing tmux endpoints now uniformly refuse recovery without absence proof.
  • Delete handoff-specific test fixtures and cases, and use the shared cleanup helper for the relaunch test suite.

Risk Assessment

✅ Low: The removal is narrowly scoped, leaves no executable callers of the deleted helpers, and preserves ordinary relaunch safeguards.

Testing

All five live CLI scenarios and the targeted relaunch regression checks passed. The initial fixture-location issue was resolved; cleanup warnings were fixed and verified separately. CLI evidence was captured and disposable resources removed.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Legacy handoff is rejected without altering task records, instructions, work, or endpoints ✅ pass live Live CLI and private tmux transcript
Removed attestation flags cannot enable handoff through ordinary relaunch ✅ pass live Live CLI and private tmux transcript
A missing historical tmux endpoint refuses exit and replacement while preserving work ✅ pass live Live CLI and private tmux transcript
Legacy transaction environment variables cannot bypass direct-spawn safety ✅ pass live Live CLI and private tmux transcript
Ordinary exit recognizes an already-stopped agent and preserves its endpoint ✅ pass live Live CLI and private tmux transcript
Evidence: Live CLI and private tmux transcript

Source: Live CLI and private tmux transcript

$ bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
exit=0
$ git init -q ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l/copy
exit=0
$ git -C ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l/copy -c user.name=Lab -c [email protected] commit --allow-empty -qm lab
exit=0
$ tmux -L fm-lab new-session -d -s firstmate -n sentinel -x 120 -y 35 -c ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l/copy bash --noprofile --norc
exit=0
$ tmux -L fm-lab display-message -p -t firstmate:sentinel #{socket_path},#{pid},0
~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l/tmux/tmux-1000/fm-lab,931498,0
exit=0

SCENARIO: Legacy task handoff is rejected without altering work or creating an endpoint
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
$ bin/fm-control.sh paseo-backend-adapter handoff --expect-endpoint firstmate:fm-paseo-backend-adapter --expect-worktree ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l/copy --expect-head 8bbad9bccd7d8282266d55c03ac30eb5fb826ffb --note legacy retry
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
error: 'handoff' is not a control verb
allowed verbs:
  interrupt
  exit
  relaunch
exit=2
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
Task records, brief, unfinished work, and real tmux inventory unchanged.

SCENARIO: Old attestation flags cannot enable handoff through relaunch
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
$ bin/fm-control.sh paseo-backend-adapter relaunch --expect-endpoint legacy --note legacy retry
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
error: unexpected argument '--expect-endpoint'
exit=1
$ bin/fm-control.sh paseo-backend-adapter relaunch --expect-worktree legacy --note legacy retry
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
error: unexpected argument '--expect-worktree'
exit=1
$ bin/fm-control.sh paseo-backend-adapter relaunch --expect-head legacy --note legacy retry
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
error: unexpected argument '--expect-head'
exit=1
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
Removed handoff flags cannot enter an ordinary relaunch.

SCENARIO: Missing historical tmux endpoint refuses exit and replacement without changing work
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
$ bin/fm-control.sh paseo-backend-adapter exit
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
error: task paseo-backend-adapter's endpoint firstmate:fm-paseo-backend-adapter reads 'missing', but tmux absence cannot be proven from a task record: the record does not carry the endpoint's socket identity, and a server-wide window inventory only describes the tmux server this process addresses, so a window absent from it may still be alive on another; exit will not claim an agent stopped at an address it cannot trust, nor send lifecycle input to one
exit=1
$ bin/fm-control.sh paseo-backend-adapter relaunch --note do not duplicate
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
error: task paseo-backend-adapter's endpoint firstmate:fm-paseo-backend-adapter reads 'missing', but tmux absence cannot be proven from a task record: the record does not carry the endpoint's socket identity, and a server-wide window inventory only describes the tmux server this process addresses, so a window absent from it may still be alive on another; exit will not claim an agent stopped at an address it cannot trust, nor send lifecycle input to one
error: relaunch of paseo-backend-adapter failed while stopping the old agent and its state is 'missing', so it was not proven stopped; its original instructions were restored and the durable record was retained for recovery
exit=1
$ bin/fm-spawn.sh paseo-backend-adapter --relaunch --harness codex
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
error: task paseo-backend-adapter's recorded endpoint firstmate:fm-paseo-backend-adapter reads 'missing', but tmux absence cannot be proven from a task record: the record does not carry the endpoint's socket identity, and a server-wide window inventory only describes the tmux server this process addresses, so a window absent from it may still be alive on another. An endpoint that cannot be proven absent may still hold a live agent on this task's worktree; refusing rather than launching a second agent into it
exit=1
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
Both control verbs and direct spawn preserve task state and refuse the absent window.

SCENARIO: Legacy transaction environment cannot bypass direct-spawn safety
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
$ bin/fm-spawn.sh paseo-backend-adapter --relaunch --harness codex
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
error: task paseo-backend-adapter's recorded endpoint firstmate:fm-paseo-backend-adapter reads 'missing', but tmux absence cannot be proven from a task record: the record does not carry the endpoint's socket identity, and a server-wide window inventory only describes the tmux server this process addresses, so a window absent from it may still be alive on another. An endpoint that cannot be proven absent may still hold a live agent on this task's worktree; refusing rather than launching a second agent into it
exit=1
$ bin/fm-spawn.sh paseo-backend-adapter --relaunch --harness codex
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
error: task paseo-backend-adapter's recorded endpoint firstmate:fm-paseo-backend-adapter reads 'missing', but tmux absence cannot be proven from a task record: the record does not carry the endpoint's socket identity, and a server-wide window inventory only describes the tmux server this process addresses, so a window absent from it may still be alive on another. An endpoint that cannot be proven absent may still hold a live agent on this task's worktree; refusing rather than launching a second agent into it
exit=1
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:sentinel:bash
exit=0
Nonempty and empty legacy transaction variables cannot bypass normal absence proof.

SCENARIO: Ordinary exit still recognizes an already-stopped agent and preserves its endpoint
$ tmux -L fm-lab rename-window -t firstmate:sentinel fm-sentinel
exit=0
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:fm-sentinel:bash
exit=0
$ bin/fm-control.sh sentinel exit
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l
already-stopped sentinel harness=codex backend=tmux endpoint=firstmate:fm-sentinel worktree=~/.no-mistakes/worktrees/ff5e17b6f5de/01M4HGNAD303NZ473VHVBMGE8S/.l/copy
exit=0
$ tmux -L fm-lab list-windows -a -F #{session_name}:#{window_name}:#{pane_current_command}
firstmate:fm-sentinel:bash
exit=0
Ordinary exit recognizes a real stopped shell and preserves its endpoint and unfinished work.
Teardown: private fm-lab tmux server stopped; disposable lab home removed.

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.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Legacy handoff is rejected without altering task records, instructions, work, or endpoints ✅ pass live Live CLI and private tmux transcript
Removed attestation flags cannot enable handoff through ordinary relaunch ✅ pass live Live CLI and private tmux transcript
A missing historical tmux endpoint refuses exit and replacement while preserving work ✅ pass live Live CLI and private tmux transcript
Legacy transaction environment variables cannot bypass direct-spawn safety ✅ pass live Live CLI and private tmux transcript
Ordinary exit recognizes an already-stopped agent and preserves its endpoint ✅ pass live Live CLI and private tmux transcript
  • Inspected the target diff and searched repository callers of the deleted handoff helpers.
  • python3 .test-tmp/legacy-live.py: exercised five scenarios against the real CLI and private tmux server; retained the driver as evidence/legacy-live-driver.py.
  • TMPDIR="$PWD/.test-tmp" bash tests/fm-control-relaunch.test.sh: encountered a fixture-location restriction.
  • env -u TMPDIR bash tests/fm-control-relaunch.test.sh: completed successfully with no behavioral failures.
  • bash tests/.relaunch-cleanup-probe.sh: verified the corrected cleanup removes read-only fixture directories.
  • Removed disposable lab state, private tmux server, temporary probes, and test fixtures.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

The handoff verb was hard-coded to the stranded paseo-backend-adapter task, its former tmux endpoint and old branch, and nothing in either home or upstream depends on it. Remove the verb, its journal validator and spawn-side authorization, the tmux handoff session helper, its tests, and the doc mentions, keeping interrupt, exit, relaunch and the Paseo backend intact.
… left after deleting legacy handoff. Reproduced SC2034 before the fix; source-aware `bash bin/fm-lint.sh bin/fm-control.sh` now passes with pinned ShellCheck 0.11.0. Bash syntax and diff checks also pass
@ryannmicua
ryannmicua merged commit 0e7395b into main Oct 10, 2026
19 checks passed
@ryannmicua
ryannmicua deleted the fm/fm-legacy-handoff-removal branch October 10, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant