Repository navigation
feat(bin): let a local home opt out of inherited Claude seats - #8
Merged
Merged
Conversation
A seat switch pushed the active Claude seat into every local secondmate home on this machine, and a home had no way to decline. An operator who wants one home spending a separate account - one home on a personal or client account while the rest run on the team account - could not have it, and a switch took that choice away silently. The fleet-wide default is unchanged. With no flag anywhere, a switch still reaches every local home and the whole machine moves together; a regression assertion in each of the three convergence paths proves it. A home declines for itself by placing the presence flag config/claude-seat-local in its OWN config/. bin/fm-config-inherit-lib.sh reads it in the destination home once, before any item is considered, so all three machine-local seat items - claude-seat, claude-seats-root, claude-seat-threshold - are skipped for that home at every local convergence point: the post-switch fm-config-push --local-only, the session-start secondmate sweep in fm-bootstrap.sh, and every secondmate launch in fm-spawn.sh. The declining home keeps its own three files exactly as they are, including absent, and keeps full use of its own switch, threshold, and arm against itself. The flag is deliberately not inheritable. The decline is visible, because a setting that silently does nothing is the failure worth avoiding here: fm-seat.sh status lists every local home that declined with the seat it is actually on, and a switch names each seat item it skipped for that home and why. A flag that is not a plain regular file states no readable intent, so the seat items are refused for that home with an error rather than resolved by guessing in either direction. Alternatives considered and ruled out: - A scoped list on the primary: it puts a home's own billing choice on another home, and it drifts as homes are added, renamed, or retired. - Per-file partial opt-out: no concrete need, and a home on a separate account holding the fleet's threshold or seats root is incoherent. - Inferring the opt-out from a home already holding a different seat: that is the silent-behaviour failure again. Investigated separately, no code change: local propagation assumes two local homes on one machine share a filesystem and a credential store. That assumption holds. Firstmate has no supported way to place a local secondmate under a different OS user or in a container - a local home is a git worktree the primary reads and writes directly, and its endpoint is created in the primary's own session, with nothing in bin/ able to change user or enter a container. The supported way to cross a trust boundary is the remote route, which already refuses seat settings. No defect found.
…figuration and seats guide
max-metaplanet
added a commit
that referenced
this pull request
Oct 6, 2026
Carried from fork commit 73ae45e (#8). AGENTS.md conflict resolved the same way as the seat-switching commit: upstream's restructure moved the operational-home layout tree into the `operational-home-layout` skill, so the seat entry this commit edited is edited in the skill instead and the always-loaded file keeps only upstream's pointer.
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
we should fix our gap
The gap: seat switching pushes the active Claude seat into every local secondmate home on this machine with no way for a home to decline.
An operator who wants one local home spending a separate account - billing separation is the concrete case, one home on a personal or a client account while the rest run on the team account - cannot have that today; a switch takes the choice away from them silently.
The fix, with one non-negotiable constraint: the default stays exactly what it is now - a switch reaches every local home and the whole machine moves together.
What is missing is a per-home way to decline, so the fleet-wide default is preserved and only a home that deliberately opts out is left alone.
A home that opts out must be visible in the switch status, because a setting that silently does nothing is the failure mode to avoid.
Also settle, as findings rather than by expanding the change: the local-propagation design assumes two local homes on one machine share a filesystem and a credential store; establish whether a local secondmate can be deliberately sandboxed under a different OS user or container, and if it can, what that means for the design.
Supersedes #6, rebuilt on the synced main.
What Changed
config/claude-seat-localpresence flag, checked inbin/fm-config-inherit-lib.sh. When a destination home has any path by that name (a file, a directory, or a symlink, even a dangling one),propagate_inheritable_configskipsclaude-seat,claude-seats-rootandclaude-seat-thresholdfor that home and records each one asskippedwith the reason. This applies at every local convergence point: a switch's--local-onlypush, the session-start sweep, and secondmate spawn. The flag is never inherited itself. Homes without it still take every switch, exactly as before.bin/fm-seat.sh statushas a new section listing each local secondmate home that has opted out, with its id, the seat it is actually on and its path. If none have, it prints(none - every local home takes this seat). To read another home's seat,fm_seat_activeinbin/fm-seat-lib.shnow takes an optional config-dir argument; it still defaults to the current home.docs/configuration.md,docs/claude-seats.md(new "One home on a separate account" section),AGENTS.mdand the secondmate-provisioning skill. Adds tests intests/fm-seat.test.sh,tests/fm-bootstrap.test.shandtests/fm-secondmate-harness.test.shcovering: an opted-out home keeping its own seat through a switch, homes without the flag still being updated, the status listing, a flag that isn't a plain file, the bootstrap sweep, and spawn.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The opt-out is a narrow presence check at the single loop every local convergence path goes through, the default is byte-identical when the flag is absent, the declining home appears in both switch output and status, and the only other issue found is a cosmetic duplicate row in status.
Testing
I drove the real seat-switch and status commands against a sandboxed fleet: a primary home plus three local secondmate homes. Only two things were faked:
tmux, so no live fleet pane was touched, and thequota-axilogin check for the named seat. Every live opt-out scenario passed, including the adversarial ones: flag content "off", a directory flag, a dangling-symlink flag, a flag on the primary, and removing the flag. Compared with the base commit, the default path's switch output and each home's seat files are byte-for-byte the same; the one difference is the new status section.tests/fm-seat.test.shpassed, and the automated spawn test for a home that opts out (B5a) passed, but the secondmate launch path was not driven live, so it is marked untested. The session-start sweep test in fm-bootstrap.test.sh had not run before this step had to report, so that path is also untested. The "not every secondmate home was updated" warning in the transcripts appears on the base commit too: the gate environment blocks the re-read nudge to secondmate agents, and the change does not cause it. This is a CLI, so evidence is transcripts rather than screenshots.bash tests/fm-bootstrap.test.sh(test_routine_bootstrap_honours_a_hom…Evidence: Live scenario driver script
Source: Live scenario driver script
Evidence: Full live transcript S1-S9
Source: Full live transcript S1-S9
Evidence: Default path: base commit vs change diff (only the new status section differs)
Source: Default path: base commit vs change diff (only the new status section differs)
68a69,71 > > local secondmate homes declining inherited seats: > (none - every local home takes this seat)Evidence: Declining home's own switch and threshold, then primary status
Source: Declining home's own switch and threshold, then primary status
switched: client -> personal sm-client claude-seat=personal threshold=30 primary claude-seat=team threshold=<absent> sm-fleet claude-seat=team local secondmate homes declining inherited seats: client personal .../sm-clientEvidence: Switch output for an opted-out home
Evidence: fm-seat.test.sh log
Source: fm-seat.test.sh log
Evidence: fm-secondmate-harness.test.sh log (includes B5a seat-decline pass)
Source: fm-secondmate-harness.test.sh log (includes B5a seat-decline pass)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-config-inherit-lib.sh:90- Intent-requested finding (not a code change): nothing in this repo runs a local secondmate under a different OS user or inside a container. fm-spawn.sh launches local secondmates in the same user's tmux/Herdr session, and every local convergence point (fm-config-push.sh:239, fm-bootstrap.sh:565, fm-spawn.sh:2808/3618) writes straight into <home>/config on the shared filesystem through propagate_inheritable_config. The only isolated placement is a remote route over SSH (remote_host= in meta). fm_config_inherit_items already leaves the machine-local seat items out of that route, so no seat settings are ever sent there. So the assumption of a shared filesystem and credential store holds for every local home. An operator who wants isolation by OS user or container would set it up as a remote route (for example SSH to localhost as another user). That home would then get no seats and would log in with its own account, which matches the design and needs no change.bin/fm-seat.sh:163- declining_secondmate_homes does not dedupe by VALIDATED_HOME, unlike fm-config-push.sh (the seen_homes check). If two live secondmate metas resolve to the same declining home (for example a stale meta left by a relaunch),fm-seat.sh statuslists that home twice while the switch pushes to it only once. Keeping a seen-homes set here, as config-push does, would make status report exactly the homes the push handles, which the comment on the new source line promises.bash tests/fm-bootstrap.test.sh(test_routine_bootstrap_honours_a_hom…drive.sh <worktree> <sandbox>: real fm-seat.sh switch/status and fm-config-push.sh --local-only on 3 local secondmate homes, walking scenarios S1-S9 (default, opt-out, status, switch back to default, direct push, own switch, flag not inherited, odd flag types, flag removed)NO_OPTOUT_ONLY=1 drive.shon agit archive b59c9fdextract and on the change, thendiffof the two outputs (default behaviour unchanged)Declining home runs its ownfm-seat.sh switch personalandthreshold 30; checked the primary and the other home, then ran primarystatusbash tests/fm-seat.test.sh(all passed, including the 4 new decline tests)bash tests/fm-secondmate-harness.test.sh(B5a spawn seat-decline test passed; rest of the file still running)bash tests/fm-bootstrap.test.sh(queued behind the harness file; had not run when this step had to report)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.