Repository navigation
feat: automatically register remote second mates in local Herdr - #13
Merged
Merged
Conversation
…matically (#4) Remote agents now always show up in the local Herdr on this machine. After a remote second mate is launched, and again whenever a liveness probe finds its route alive, the primary saves its host alias as a machine pointing at the fm-remote remote session (bin/fm-herdr-machine-lib.sh). The save is idempotent, bounded, serialized per host, skips silently without a local herdr, reports a refusal instead of failing the launch or probe, and never removes or rewrites a saved machine it did not add. The remote doctor gains a herdr-version readiness check with a 0.9.3 floor, the first release verified to serve saved machines, covering both the host's client and, while running, its fm-remote server. Below the floor the gap is human: the action names `herdr update --handoff`, and --fix never runs the update. Every test now drives the parent-side save through fake herdr CLIs so no suite reads or changes the runner's real saved machines; the shared fixture helper lives in tests/lib.sh, and a colocated suite pins absent-herdr, present, never-rewrite, added, refused, unreadable-list, and lock-skip behavior. Fork only, never upstream.
…isibility mismatches
…erve all existing entries
…eplaced the racy Herdr test responses with state-based behavior. Focused bootstrap checks, repeated startup checks, delayed-start regression, and targeted lint pass. Full suites encountered unrelated local environment failures
…by replacing order-dependent mock responses with server-state responses. Reproduced the exact failure with delayed startup; normal and delayed startup now pass. Full backend suite and targeted lint passed, using installed GNU sleep to bypass an unrelated local multicall-sleep issue
…eplaced the racy Herdr test responses with state-based behavior. Focused bootstrap checks, repeated startup checks, delayed-start regression, and targeted lint pass. Full suites encountered unrelated local environment failures
…d timeout guarantees
dscott98
force-pushed
the
fm/fm-herdr-machine-auto
branch
from
October 2, 2026 02:01
d8f9645 to
f4fccdf
Compare
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
Remote agents should always show up in the local Herdr on this machine, so their activity is visible; if it can be done, it should always be done.
This lives in the dscott98/firstmate fork only, never upstream.
On 2026-10-01 this was done by hand for agent01-03: each host was upgraded to herdr 0.9.3 with
herdr update --handoff(which upgraded thefm-remoteserver live without killing second-mate panes), then saved locally withherdr machine add --label <alias> --remote-session fm-remote <alias>.Saved machines need a remote server that advertises the surface_interest/health_check capabilities; herdr 0.9.1 refuses with "remote server is not ready for saved machines", while a 0.9.1 local client could still add 0.9.3 machines.
Make remote second-mate provisioning and liveness do this idempotently, including a herdr version floor check in the remote doctor.
What Changed
Risk Assessment
✅ Low: The changes are bounded, preserve existing saved machines, and satisfy the revised intent without a substantiated source defect.
Testing
Three focused fixture suites passed. The lifecycle fixture verified launch refusal tolerance and idempotent saving before repeating the previously declined inheritance-wait failure. No live Herdr calls or visual artifacts were produced under the recorded fake-only restriction; no source changes were made.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
tests/fm-backend-herdr.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/fm-herdr-machine-auto✅ **Review** - passed
✅ No issues found.
FM_TEST_SKIP_ORPHAN_REAP=1 bash tests/fm-herdr-machine.test.sh— passedFM_TEST_SKIP_ORPHAN_REAP=1 bash tests/fm-remote-doctor.test.sh— passedFM_TEST_SKIP_ORPHAN_REAP=1 bash tests/fm-secondmate-liveness.test.sh— passedFM_TEST_SKIP_ORPHAN_REAP=1 bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh— saved-machine integration checks passed; later inheritance wait failed and temporary-hook cleanup reported permission errorsgit status --short— clean after testing✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.