Repository navigation
fix(bin): point seeded remote secondmate charter at its host-local steering inbox - #2
Merged
Freudator86 merged 13 commits intoSep 21, 2026
Conversation
… drop parent-channel guess
… in remote-secondmates
…emote-secondmates
…failing test was tests/fm-remote-transport-lanes.test.sh (family=secondmate, the 1 failure of 2 in that family); it died with ".../remote-root/bin/fm-git-code-root-lib.sh: No such file or directory" at the control-state case. Root cause: the fixture builds a synthetic remote code root by copying an explicit list of bin/ scripts (tests/fm-remote-transport-lanes.test.sh:50). This branch added `. "$SCRIPT_DIR/fm-git-code-root-lib.sh"` to bin/fm-remote-secondmate-control.sh:72, but the new library was not added to that list, so the control script aborted at source time inside the fixture root. Fix (one line): stage bin/fm-git-code-root-lib.sh with the other libraries the fixture copies (tests/fm-remote-transport-lanes.test.sh:59). No production code changed. Verification run locally: fm-remote-transport-lanes reproduced the exact CI failure before the edit and reports ALL TESTS PASSED after; fm-remote-job (the other secondmate test in that shard), fm-remote-home-provision, fm-secondmate-sync, fm-remote-secondmate-parent-binding and fm-remote-code-root-ownership all pass; bin/fm-lint.sh on the changed file is clean. bin/fm-remote-home-provision.sh is the only other consumer of the new library and no test stages it into a synthetic bin tree, so no other fixture needed the same entry
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 vanilla remote secondmate steering so the throwaway remote secondmate can actually receive and act on routed requests.
Coditan reported that the remote secondmate launched but refused its first message because its seeded charter kept the parent's steering inbox path while the doorbell named the guest inbox.
This is critical path before real secondmate conversions.
Do not hand-patch the remote home to make a false pass; install/test the vanilla behavior and fix the upstream-suitable path.
What Changed
bin/fm-remote-home-seed.shnow rewrites the parent's$STATE/<id>.inboxpath in the remote charter copy to$REMOTE_HOME/state/parent-route/<id>.inbox, in addition to the existing status-path rewrite. That is the same inbox thatfm-remote-secondmate-control.shwrites routed records into and rings the doorbell for, so the remote mate now reads the inbox that actually receives its requests.tests/fm-remote-secondmate-lifecycle-e2e.test.shnow asserts that the seeded charter names the host-local steering inbox and not the parent's. It also restores an old-style charter that still names the parent inbox, re-runsfm-remote-home-seed.shon the same route, and asserts that this republishes the corrected inbox path.docs/remote-secondmates.mdnames thestate/parent-route/<id>.inboxsteering inbox and says the seeded charter points at that same inbox. It also notes that re-runningfm-remote-home-seed.shrepublishes the charter into an existing home.🤖 Generated with Claude Code
Risk Assessment
✅ Low: Small, well-bounded fix that makes the seeded remote charter name the exact steering inbox that the control script writes to and rings the doorbell for; an end-to-end test runs the real seed script and checks the charter it writes.
Testing
An earlier attempt of this phase, driven against the authorized probe install on ak-secondmate, covered all five scenarios through the real seed, spawn, send and teardown scripts. Base commit dee119b published an inbox under the parent's /tmp home, which does not exist on the host. Reseeding at ad500bf fixed that same home without hand edits. A fresh seed named the inbox under state/parent-route/. The routed
fm-sendrecord landed in exactly that inbox, and the real Claude mate moved it to handled/ and appended a reply with the matching corr token (LIVEPROOF-01M31), which reached the parent status stream. This run re-checked over SSH that the entrypoint symlink is restored to firstmate-routing-vanilla, the probe dirs are gone, the vanilla root is unchanged and has no uncommitted changes, and the worker and ordinary pane are unaffected. The earlier attempt's readiness doctor returned ok. The focused lifecycle e2e test passes at HEAD and fails at the base seed on the new inbox assertion. No UI surface is involved, so the evidence is CLI transcripts, not screenshots.Evidence: Live probe evidence index
Source: Live probe evidence index
Evidence: Base-commit seed publishes the parent inbox (adversarial)
Source: Base-commit seed publishes the parent inbox (adversarial)
Evidence: Reseed corrects the old charter
Source: Reseed corrects the old charter
Evidence: Fresh seed charter on host
Source: Fresh seed charter on host
Evidence: fm-send record landed, handled, and replied to
Source: fm-send record landed, handled, and replied to
Evidence: Remote Claude pane capture acting on the request
Source: Remote Claude pane capture acting on the request
Evidence: Reply mirrored to parent; pending-reply resolved
Source: Reply mirrored to parent; pending-reply resolved
Evidence: Entrypoint restored and ordinary readiness ok
Source: Entrypoint restored and ordinary readiness ok
Evidence: Lifecycle e2e at HEAD (rerun)
Source: Lifecycle e2e at HEAD (rerun)
Evidence: Lifecycle e2e with base seed (fails on inbox assertion)
Source: Lifecycle e2e with base seed (fails on inbox assertion)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
🔧 **Test** - 1 issue found → no changes applied ✅
ssh localhostwas refused (no sshd), and the configured SSH aliases are production fleet hosts. To drive it, provide a disposable SSH alia…bash tests/fm-remote-secondmate-lifecycle-e2e.test.shat head (full remote lifecycle over the deterministic SSH boundary: seed, reseed of an existing home, launch, fm-send into the remote inbox, retire)Same lifecycle test in a /tmp copy withbin/fm-remote-home-seed.shreverted to base dee119b, to reproduce the reported bugInstrumented /tmp copy of the lifecycle test that dumped the seeded remote charter's inbox/status lines and the remotestate/parent-route/ios.inbox/*.msgrecords right after fm-send deliveredssh -o BatchMode=yes localhost trueto check for a safe real SSH target (connection refused)🔧 No changes applied.
✅ Re-checked - no issues remain.
Live probe on ak-secondmate (option B, fresh probe root ~/firstmate-probe-ad500bf, throwaway FM_HOME=/tmp/fm-live-probe-01M31/parent):bin/fm-remote-home-seed.shfrom base dee119b, then reseed of the same home at ad500bf, then fresh seed at ad500bfFM_HOME=... bin/fm-spawn.sh probe-ak-fresh --secondmate(real Claude pane w3:p2),bin/fm-procevent-remote-reply.sh arm,bin/fm-send.sh fm-probe-ak-fresh 'Routing proof LIVEPROOF-01M31 ...',bin/fm-procevent.sh start remote-reply-probe-ak-fresh,bin/fm-teardown.sh probe-ak-freshRestored ~/.local/bin/fm-remote-entrypoint.sh to point at firstmate-routing-vanilla and ran the read-onlybin/fm-on.sh throwaway-ak-vanilla fm-remote-doctor.shRe-checked over SSH: the symlink target, that the probe dirs are gone, that the vanilla root is at 4612388 with no changes, the job worker process, and the herdr pane listbash tests/fm-remote-secondmate-lifecycle-e2e.test.shat HEAD (pass), plus the earlier run against the base-commit seed (fails on the new inbox assertion)✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.