Repository navigation
fix(backends): scope herdr workspace by firstmate home - #325
Closed
zachlandes wants to merge 5 commits into
Closed
zachlandes wants to merge 5 commits into
zachlandes wants to merge 5 commits into
Conversation
zachlandes
force-pushed
the
fm/herdr-hometag-f2
branch
from
July 8, 2026 00:17
f0b2280 to
15235d7
Compare
Every primary firstmate home resolved its herdr workspace to the bare constant "firstmate", so two independent primaries on one machine both minted-or-adopted one shared "firstmate" workspace and their two fleets' tabs commingled in a single herdr space. Ports the home-tag fix already shipped for cmux (kunchenguid#246) and zellij (kunchenguid#252): fm_backend_herdr_workspace_label now delegates to the shared bin/fm-backend-hometag-lib.sh, returning a readable prefix plus a short hash of the resolved home path, so distinct installations - multiple primaries included - get distinct workspaces. Herdr is the narrowest of the three ports: only the ONE workspace-container label carries the tag, since the per-home workspace is itself the namespace; per-task tab labels stay the bare fm-<id>. The home-tag hashes FM_ROOT, so fm-spawn.sh's herdr arm now shadows BOTH FM_HOME and FM_ROOT to the secondmate home for a --secondmate spawn, not just FM_HOME. Shadowing only FM_HOME would give the secondmate's workspace the primary's hash while its own later crewmate spawns compute the secondmate's hash, splitting one home across two workspaces. This matches fm-teardown.sh's zellij child-cleanup, which shadows both for the same cross-home reason. The path hash also shrinks the adopt-a-strangers-workspace surface: a workspace merely named "firstmate" (including herdr's cwd-basename derived label, the 2026-07-02 self-kill trigger) no longer matches. The structural created-vs-adopted prune gate stays the real protection. Docs synced across docs/herdr-backend.md, docs/configuration.md, docs/architecture.md, docs/cmux-backend.md, and docs/scripts.md.
zachlandes
force-pushed
the
fm/herdr-hometag-f2
branch
from
July 14, 2026 09:22
c803d19 to
bac2f5f
Compare
Owner
|
Speaking as Kun's firstmate: closing this as stale. It has been waiting on a contributor update for 14+ days with no author push or comment. Reopen if you want to pick it back up. |
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Oct 29, 2026
…last good worker counts under load (kunchenguid#325) * fix(bin): count waiting for you only when the captain acts, and keep last good counts under load A worker's done before validation, and a scout report, are firstmate's turn, so they count as working; waiting for you is kept for a PR or ready branch the delivery contract reads as the ready report, or a decision a human owes. When a fresh fleet reading is not ready in time, the bar shows the last good counts with a dim age and keeps refreshing, so it reads workers unknown only when no good reading has ever been taken. * no-mistakes(review): Count firstmate's-turn done work in no status figure * no-mistakes(review): Make last-good-reading fleet test deterministic * no-mistakes(document): Fix stale max-age seam comment in fleet status lib
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 2, 2026
…last good worker counts under load (kunchenguid#325) * fix(bin): count waiting for you only when the captain acts, and keep last good counts under load A worker's done before validation, and a scout report, are firstmate's turn, so they count as working; waiting for you is kept for a PR or ready branch the delivery contract reads as the ready report, or a decision a human owes. When a fresh fleet reading is not ready in time, the bar shows the last good counts with a dim age and keeps refreshing, so it reads workers unknown only when no good reading has ever been taken. * no-mistakes(review): Count firstmate's-turn done work in no status figure * no-mistakes(review): Make last-good-reading fleet test deterministic * no-mistakes(document): Fix stale max-age seam comment in fleet status lib
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
Stop two independent firstmate installations on one machine from commingling their agent tabs in a single herdr workspace.
Every PRIMARY firstmate home resolved its herdr workspace to the bare constant 'firstmate'. The workspace lookup adopts the first workspace in the shared herdr session carrying that label, so two independent primaries on the same machine mint-or-adopt one shared space and both fleets' tabs land in it together. Neither installation can tell its own work from the other's in herdr's spaces sidebar, and each one's recovery claims the other's tasks as its own.
This is not hypothetical. It is the live configuration on the machine this was written for: two primary homes side by side, neither a secondmate home, with herdr selected as the backend.
The fix ports a solution this repository has already adopted twice. bin/fm-backend-hometag-lib.sh is the shared home-tag derivation that cmux (#246) and zellij (#252) both already use: a readable prefix plus a short hash of the resolved home path, so distinct installations never collide even though they share one backend-global namespace. fm_backend_herdr_workspace_label now delegates to it instead of returning a constant. herdr was the last backend still on the bare constant, so this closes the gap and leaves the three adapters unable to drift apart again.
It also repairs a latent inconsistency in that shared library, which this port exposed: the library read FM_HOME for the readable prefix but FM_ROOT for the hash. A cross-home invocation therefore produced a tag whose prefix named one home and whose hash named another, silently minting an orphan workspace that neither home's lookup would ever match. Both now derive from the same home. The two paths are identical in any well-formed home, so this is a no-op for every existing installation and no cmux or zellij tab title changes.
Deliberate decisions a reviewer should know about:
What Changed
fm_backend_herdr_workspace_labelnow delegates to the shared home-tag derivation inbin/fm-backend-hometag-lib.shinstead of returning the bare constantfirstmate, so the primary home's workspace becomesfirstmate-<hash>(and a secondmate home's2ndmate-<id>-<hash>). Two independent primary installations on one machine no longer mint-or-adopt a single shared herdr space where both fleets' tabs commingle and each home's recovery claims the other's tasks. Only the workspace-container label carries the tag; per-task tab labels stay the barefm-<id>, since the per-home workspace is already the namespace.FM_HOMEfor the readable prefix butFM_ROOTfor the hash, so a cross-home invocation produced a tag naming one home in its prefix and another in its hash, silently orphaning the tab. Both halves now derive fromFM_HOME. The two paths are identical in any well-formed home, so no existing cmux or zellij title changes.bin/fm-spawn.shshadowsFM_ROOTalongsideFM_HOMEon the--secondmateherdr path so the temporary environment names one home consistently.tests/fm-backend-hometag-lib.test.shcovering the shared derivation, extended the herdr unit and workspace-per-home e2e suites with two-independent-primaries cases, and hoisted the expected-tag helper intotests/lib.shas the single reimplementation shared by the cmux, zellij, herdr, and hometag suites. Docs acrossarchitecture,configuration, and the herdr/cmux/zellij backend guides now describe the tag asFM_HOME-derived, with the one-time herdr workspace migration written out as a runnable command.Testing
Pipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
Step was skipped.
⏭️ **Rebase** - skipped
Step was skipped.
⏭️ **Review** - skipped
Step was skipped.
⏭️ **Test** - skipped
Step was skipped.
⏭️ **Document** - skipped
Step was skipped.
⏭️ **Lint** - skipped
Step was skipped.
✅ **Push** - passed
✅ No issues found.