Repository navigation
fix: pin remote secondmate relaunches to Herdr - #210
Merged
Merged
Conversation
cmd_relaunch omitted the --backend herdr that cmd_launch passes, so a remote relaunch resolved the remote home's configured backend (tmux), failed OMP session-lock binding, and stranded the route. fm-control relaunch now accepts --backend, forwards it to the launch owner, and refuses before touching anything when the recorded endpoint lives on a different backend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Fix Boat F2:
bin/fm-remote-secondmate-control.sh relaunchdid not pin--backend herdr.cmd_relaunchomitted the--backend herdrthatcmd_launchpasses. In the live Boat proof, a remote relaunch therefore resolved the remote home's default backend (tmux), failed OMP session-lock binding, and left the endpoint metawindow=firstmate:with the routeunverifiedand no migrate verb. Requirements: pin--backend herdrincmd_relaunchexactly ascmd_launchdoes. Also make remote relaunch refuse, with a clear message, when the recorded endpoint backend is not herdr, rather than silently relaunching on another backend.Accepted design decisions (deliberate, not mistakes): to let the remote control pass the pin through the ordinary host-local control plane,
bin/fm-control.sh relaunchgains a--backend <name>option that is forwarded to the launch owner (fm-spawn --relaunch); when the pinned backend differs from the task's recorded endpoint backend, fm-control refuses before any journal write, agent touch, or spawn, so a mismatched pin can never migrate a task onto another backend.--backendis relaunch-only (other verbs refuse it like --harness/--model). The remote-side refusal for a recorded non-herdr endpoint is enforced by the existingremote_endpoint_requirecheck (message names the recorded backend and 'expected herdr') before fm-control runs, with fm-control's pin check as defense in depth.Acceptance criteria:
relaunchpasses--backend herdr(fails on the parent commit, passes after the fix). Implemented as an e2e case in tests/fm-remote-secondmate-lifecycle-e2e.test.sh where the remote home config names tmux and the remote OMP mate is relaunched from a dead endpoint; plus fm-control pin-forwarding tests in tests/fm-spawn-relaunch-dead-endpoint.test.sh.bin/fm-test-run.sh --changed) green andbin/fm-lint.shclean; the PR's full GitHub CI suite is the broad-regression gate.PR description requirement: local
bin/fm-test-run.sh --changed(72 scripts) had 3 failures that must be listed in the PR description with this triage, not presented as green: tests/fm-spawn-pool-base-freshen.test.sh and tests/fm-secondmate-sync.test.sh fail identically on the parent commit 44f9fe3 (pre-existing); tests/fm-secondmate-harness.test.sh fails only because the worktree-tangle detector fires when running inside a feature-branch worktree and passes on a detached HEAD of the parent. tests/fm-remote-reply.test.sh was observed flaky (fails on both parent and branch intermittently, passed in the clean full run). GitHub CI is the deciding gate for these.Firstmate-Validation-Generation: c9458f578878030dbfa38610bbb75c0a
What Changed
--backend herdr, preserving Herdr even when the remote home defaults to tmux. Document the pin and refusal of recorded non-Herdr endpoints.--backendforwarding infm-control.sh; reject mismatched pins before journal writes, agent interaction, or spawning. Add regression coverage for forwarding, refusal without metadata or route changes, and remote OMP relaunch from a dead endpoint.bin/fm-test-run.sh --changedrun (72 scripts) had three failures:tests/fm-spawn-pool-base-freshen.test.shandtests/fm-secondmate-sync.test.shfail identically on parent44f9fe3b;tests/fm-secondmate-harness.test.shhits the feature-worktree tangle detector and passes on a detached parent HEAD.tests/fm-remote-reply.test.shintermittently fails on both parent and branch but passed in the clean full run. GitHub CI is the deciding gate.Risk Assessment
✅ Low: Captain, this bounded fix pins remote relaunch to Herdr, rejects mismatched recorded backends before relaunch mutations, and adds behavioral regression coverage.
Testing
Both targeted scripts and all four live CLI scenarios passed; base checks reproduced the regression. Setup issues were resolved, evidence retained, and disposable resources removed. Lint, broad-suite validation, PR, and CI remain with the outer executor.
Evidence: Live OMP relaunch preserves Herdr and verifies session-lock binding
Evidence: Remote refusal and relaunch-only option guards
Evidence: Conflicting pin leaves the running OMP process and journal untouched
Evidence: Base-commit replay reproduces tmux endpoint drift
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.
TMPDIR="$PWD/.test-phase/tmp" bash tests/fm-spawn-relaunch-dead-endpoint.test.sh— passed.TMPDIR="$PWD/.no-mistakes/test-phase/tmp" bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh— passed after correcting the initial scratch-directory copy recursion.Started real Herdr 0.9.0 in isolated XDG directories; used a relative XDG path to resolve Linux's Unix-socket path limit.Ran real remote OMP relaunch using a disposable saved session; acquired the lock through OMP's interactive bash command!bin/fm-lock.sh, then checked public state, route, metadata, and process binding.Executed remote and host-local backend mismatch refusals, interrupt/exit option guards, and empty/missing pin guards through the real CLI.Executed the pin-forwarding regression against base commit7bfe32ac35c64923ed521625b562467183566a24; it failed because --backend was unsupported.Replayed base-commit remote relaunch against isolated real Herdr and tmux; it publishedwindow=firstmate:fm-boat-test.Stopped and deleted disposable servers, ran product teardown, removed scratch files, and confirmed no source changes remained.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.