Skip to content

feat(bin): let a local home opt out of inherited Claude seats - #8

Merged
max-metaplanet merged 3 commits into
mainfrom
fm/seat-local-optout-v2
Sep 24, 2026
Merged

max-metaplanet merged 3 commits into
mainfrom
fm/seat-local-optout-v2

Conversation

@max-metaplanet

@max-metaplanet max-metaplanet commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

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

  • Adds a per-home config/claude-seat-local presence flag, checked in bin/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_config skips claude-seat, claude-seats-root and claude-seat-threshold for that home and records each one as skipped with the reason. This applies at every local convergence point: a switch's --local-only push, 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 status has 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_active in bin/fm-seat-lib.sh now takes an optional config-dir argument; it still defaults to the current home.
  • Updates docs/configuration.md, docs/claude-seats.md (new "One home on a separate account" section), AGENTS.md and the secondmate-provisioning skill. Adds tests in tests/fm-seat.test.sh, tests/fm-bootstrap.test.sh and tests/fm-secondmate-harness.test.sh covering: 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 the quota-axi login 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.sh passed, 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.

  • Live validation: ✅ go - 8 of 10 scenarios driven live against the product
Scenario Result Live Evidence
No opt-out anywhere: switch work, then switch default, reaches every local home, same as the base commit ✅ pass live live-transcript.txt S1/S1c; default-diff.txt shows only the new status section differs from b59c9fd
One home touches config/claude-seat-local and keeps its own seat, seats root and threshold through a primary switch while the other homes take it ✅ pass live live-transcript.txt S2, S4, S5
Switch output names each seat item skipped for the declining home and why ✅ pass live live-transcript.txt S2
Primary status lists each declining home with the seat it is really on, and says '(none ...)' when there is none ✅ pass live live-transcript.txt S1b, S3, S8, S9; declining-home-own-switch.txt
Declining home runs its own switch and threshold without touching the primary or other homes ✅ pass live declining-home-own-switch.txt
Adversarial: a flag on the primary is not inherited by the other homes ✅ pass live live-transcript.txt S7
Adversarial: flag content 'off', a directory flag and a dangling-symlink flag all decline and show in status ✅ pass live live-transcript.txt S8
Removing the flag puts the home back with the rest on the next switch ✅ pass live live-transcript.txt S9
Secondmate launch leaves a declining home's seat settings alone while other homes still inherit ⏸️ untested no The prior payload did not establish a live result. This path was checked only by the automated B5a spawn test in tests/fm-secondmate-harness.test.sh, not by a live secondmate launch. A live launch nee…
Session-start secondmate sweep leaves a declining home's seat settings alone ⏸️ untested no The prior payload did not establish a live result: tests/fm-bootstrap.test.sh was still queued when this step had to report. Run bash tests/fm-bootstrap.test.sh (test_routine_bootstrap_honours_a_hom…
Evidence: Live scenario driver script

Source: Live scenario driver script

#!/usr/bin/env bash
# drive.sh <firstmate-root> <sandbox-dir>
# Drives the real bin/fm-seat.sh (switch/status) against a sandboxed primary with
# three local secondmate homes. Only fakes: tmux (exit 0, so no live fleet pane
# is touched) and quota-axi (seat login probe for named seat "work").
set -u
ROOT=$1; SB=$2
rm -rf "$SB"; mkdir -p "$SB/fake" "$SB/seats/work" "$SB/client-seats/client"
P="$SB/primary"; mkdir -p "$P/config" "$P/state" "$P/data"
printf '%s\n' "$SB/seats" > "$P/config/claude-seats-root"
printf '#!/bin/sh\nexit 0\n' > "$SB/fake/tmux"
cat > "$SB/fake/quota-axi" <<'Q'
#!/bin/sh
printf '%s\n' '{"generatedAt":"2026-01-01T00:00:00Z","schemaVersion":5,"providers":[{"provider":"claude","label":"Claude","source":"oauth","account":{"email":"[email protected]"},"quotaSemantics":{"status":"known","effectiveAvailability":[]}}]}'
Q
chmod +x "$SB/fake/"*
mk_sm() { local id=$1 sm="$SB/sm-$1"; mkdir -p "$sm/config" "$sm/data" "$sm/state" "$sm/bin"
  printf '%s\n' "$id" > "$sm/.fm-secondmate-home"; printf 'x\n' > "$sm/AGENTS.md"
  printf 'window=firstmate:fm-%s\nkind=secondmate\nhome=%s\n' "$id" "$sm" > "$P/state/$id.meta"; }
seat() { local h=$1; shift; TMUX='' FM_HOME="$h" FM_CONFIG_OVERRIDE="$h/config" FM_STATE_OVERRIDE="$h/state" \
  FM_DATA_OVERRIDE="$h/data" CLAUDE_CONFIG_DIR='' PATH="$SB/fake:$PATH" "$ROOT/bin/fm-seat.sh" "$@" 2>&1; echo "[exit $?]"; }
show() { for h in "$SB"/sm-*; do printf '  %-14s claude-seat=%-9s seats-root=%-40s threshold=%s optout=%s\n' "$(basename "$h")" \
  "$(cat "$h/config/claude-seat" 2>/dev/null || echo '<absent>')" "$(cat "$h/config/claude-seats-root" 2>/dev/null || echo '<absent>')" \
  "$(cat "$h/config/claude-seat-threshold" 2>/dev/null || echo '<absent>')" "$([ -e "$h/config/claude-seat-local" ] || [ -L "$h/config/claude-seat-local" ] && echo yes || echo no)"; done; }
mk_sm fleet-a; mk_sm fleet-b; mk_sm client
echo "== S1 default: no opt-out anywhere; switch work"; seat "$P" switch work; show
echo "== S1b status with no opt-out"; seat "$P" status
echo "== S1c switch default"; seat "$P" switch default; show
if [ "${NO_OPTOUT_ONLY:-0}" = 1 ]; then exit 0; fi
echo "== S2 client home opts out (touch), holds its own seat/root/threshold"
touch "$SB/sm-client/config/claude-seat-local"
printf 'client\n' > "$SB/sm-client/config/claude-seat"; printf '%s\n' "$SB/client-seats" > "$SB/sm-client/config/claude-seats-root"
printf '40\n' > "$SB/sm-client/config/claude-seat-threshold"
seat "$P" switch work; show
echo "== S3 status shows the declining home"; seat "$P" status
echo "== S4 switch default from primary"; seat "$P" switch default; show
echo "== S5 fm-config-push --local-only (the convergence a switch uses) run directly"
TMUX='' FM_HOME="$P" FM_CONFIG_OVERRIDE="$P/config" FM_STATE_OVERRIDE="$P/state" FM_DATA_OVERRIDE="$P/data" PATH="$SB/fake:$PATH" \
  "$ROOT/bin/fm-config-push.sh" --local-only 2>&1 | grep -E 'secondmate|claude-seat' ; show
echo "== S6 declining home runs its own switch"; seat "$SB/sm-client" switch --force client; show
echo "  primary claude-seat: $(cat "$P/config/claude-seat" 2>/dev/null || echo '<absent>')"
echo "== S7 flag not inherited: primary also carries a flag, switch work"
touch "$P/config/claude-seat-local"; seat "$P" switch work; show; rm -f "$P/config/claude-seat-local"
echo "== S8 adversarial: flag content 'off', dangling symlink, directory"
printf 'off\n' > "$SB/sm-client/config/claude-seat-local"
rm -f "$SB/sm-fleet-b/config/claude-seat"; ln -s "$SB/nowhere" "$SB/sm-fleet-b/config/claude-seat-local"
printf 'mine\n' > "$SB/sm-fleet-b/config/claude-seat"
mkdir "$SB/sm-fleet-a/config/claude-seat-local"
seat "$P" switch default; seat "$P" switch work; show; seat "$P" status | sed -n '/declining/,$p'
echo "== S9 remove the flags: home rejoins fleet on next switch"
rm -rf "$SB"/sm-*/config/claude-seat-local; seat "$P" switch default; seat "$P" switch work; show; seat "$P" status | sed -n '/declining/,$p'
Evidence: Full live transcript S1-S9

Source: Full live transcript S1-S9

== S1 default: no opt-out anywhere; switch work
switched: default -> work
applies to NEW claude workers only; running workers keep their own seat
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  3 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
config-push: /var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/primary -> live secondmate homes
secondmate client (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-client):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed
  claude-seats-root: pushed
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate client: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-a (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-a):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed
  claude-seats-root: pushed
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-a: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-b (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-b):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed
  claude-seats-root: pushed
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-b: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
warning: seat switched here, but not every secondmate home was updated (see above); those homes keep spawning on their previous seat until bin/fm-config-push.sh --local-only succeeds
[exit 0]
  sm-client      claude-seat=work      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
  sm-fleet-a     claude-seat=work      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
  sm-fleet-b     claude-seat=work      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
== S1b status with no opt-out
active seat for NEW workers: work
active profile: /var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats/work
login state: logged-in
auto-switch threshold: (unset - no automatic switching)
auto-switch watch: not armed

live workers keep the seat they launched with:
  client	(ambient default login)
  fleet-a	(ambient default login)
  fleet-b	(ambient default login)

local secondmate homes declining inherited seats:
  (none - every local home takes this seat)
[exit 0]
== S1c switch default
switched: work -> default
applies to NEW claude workers only; running workers keep their own seat
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
config-push: /var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/primary -> live secondmate homes
secondmate client (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-client):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed - mirrored primary absence
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate client: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-a (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-a):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed - mirrored primary absence
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-a: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-b (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-b):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed - mirrored primary absence
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-b: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
warning: seat switched here, but not every secondmate home was updated (see above); those homes keep spawning on their previous seat until bin/fm-config-push.sh --local-only succeeds
[exit 0]
  sm-client      claude-seat=<absent>  seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
  sm-fleet-a     claude-seat=<absent>  seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
  sm-fleet-b     claude-seat=<absent>  seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
== S2 client home opts out (touch), holds its own seat/root/threshold
switched: default -> work
applies to NEW claude workers only; running workers keep their own seat
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
config-push: /var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/primary -> live secondmate homes
secondmate client (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-client):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged

... [17047 bytes truncated] ...

 skipped - home declines inherited seat settings (config/claude-seat-local)
  claude-seats-root: skipped - home declines inherited seat settings (config/claude-seat-local)
  claude-seat-threshold: skipped - home declines inherited seat settings (config/claude-seat-local)
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-a: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-b (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-b):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: skipped - home declines inherited seat settings (config/claude-seat-local)
  claude-seats-root: skipped - home declines inherited seat settings (config/claude-seat-local)
  claude-seat-threshold: skipped - home declines inherited seat settings (config/claude-seat-local)
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-b: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
warning: seat switched here, but not every secondmate home was updated (see above); those homes keep spawning on their previous seat until bin/fm-config-push.sh --local-only succeeds
[exit 0]
  sm-client      claude-seat=client    seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/client-seats threshold=40 optout=yes
  sm-fleet-a     claude-seat=work      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=yes
  sm-fleet-b     claude-seat=mine      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=yes
local secondmate homes declining inherited seats:
  client	client	/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-client
  fleet-a	work	/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-a
  fleet-b	mine	/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-b
[exit 0]
== S9 remove the flags: home rejoins fleet on next switch
switched: work -> default
applies to NEW claude workers only; running workers keep their own seat
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
config-push: /var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/primary -> live secondmate homes
secondmate client (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-client):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed - mirrored primary absence
  claude-seats-root: pushed
  claude-seat-threshold: pushed - mirrored primary absence
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate client: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-a (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-a):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed - mirrored primary absence
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-a: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-b (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-b):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed - mirrored primary absence
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-b: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
warning: seat switched here, but not every secondmate home was updated (see above); those homes keep spawning on their previous seat until bin/fm-config-push.sh --local-only succeeds
[exit 0]
switched: default -> work
applies to NEW claude workers only; running workers keep their own seat
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
config-push: /var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/primary -> live secondmate homes
secondmate client (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-client):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate client: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-a (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-a):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-a: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
secondmate fleet-b (/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/sm-fleet-b):
  crew-dispatch.json: unchanged
  crew-harness: unchanged
  backlog-backend: unchanged
  backend: unchanged
  herdr-presentation-spaces: unchanged
  startup-memory-budget: unchanged
  trace-context: unchanged - session-scoped
  launch-env-allowlist: unchanged
  claude-permission-mode: unchanged
  lavish-axi-host: unchanged
  claude-seat: pushed
  claude-seats-root: unchanged
  claude-seat-threshold: unchanged
  data/captain-shared.md: unchanged
CONFIG_REREAD: secondmate fleet-b: send failed: error: no-mistakes gate agent must not drive the fleet (NO_MISTAKES_GATE set)
warning: seat switched here, but not every secondmate home was updated (see above); those homes keep spawning on their previous seat until bin/fm-config-push.sh --local-only succeeds
[exit 0]
  sm-client      claude-seat=work      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
  sm-fleet-a     claude-seat=work      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
  sm-fleet-b     claude-seat=work      seats-root=/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/tmp.GtchqU4yQt/sb/seats threshold=<absent> optout=no
local secondmate homes declining inherited seats:
  (none - every local home takes this seat)
[exit 0]
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)

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-client

$ (in declining home sm-client) fm-seat.sh switch personal
switched: client -> personal
applies to NEW claude workers only; running workers keep their own seat
config-push: no live secondmate homes found
$ (in sm-client) fm-seat.sh threshold 30
auto-switch threshold: 30% remaining
sm-client claude-seat=personal threshold=30
primary claude-seat=team threshold=<absent>
sm-fleet claude-seat=team
$ (primary) fm-seat.sh status
local secondmate homes declining inherited seats:
  client	personal	/private/var/folders/1l/gg6b5zsx0qn753wwhcmmq8cr0000gn/T/ownsw/sb/sm-client
Evidence: Switch output for an opted-out home
secondmate client (.../sm-client):
claude-seat: skipped - home declines inherited seat settings (config/claude-seat-local)
claude-seats-root: skipped - home declines inherited seat settings (config/claude-seat-local)
claude-seat-threshold: skipped - home declines inherited seat settings (config/claude-seat-local)
secondmate fleet-a (.../sm-fleet-a):
claude-seat: pushed
Evidence: fm-seat.test.sh log

Source: fm-seat.test.sh log

ok - an unset seat setting is the ambient default and configures no automatic switching
ok - a switch to a logged-in seat records the seat and nothing else
ok - a switch to a profile that is not logged in is refused and changes nothing
ok - --force does not override a seat proven to be logged out
ok - a rate-limited signed-in seat is undecided, and --force switches onto it
ok - an unreadable credential store reads as undecided and --force may cross it
ok - a forced switch refuses a seat whose profile directory does not exist
ok - switching to the default seat clears the setting and restores ambient behaviour
ok - a seat switch reaches running local secondmate homes and reports each one
ok - a failed secondmate push is reported and never undoes the primary switch
ok - a local home that declines keeps its own three seat settings through a switch
ok - one home's decline leaves every other local home taking the switch
ok - status names every local home that declined and the seat it is really on
ok - a decline flag of any type declines and shows in status
ok - seat settings reach local secondmate homes only and never cross to a remote route
ok - a seat switch pushes only local secondmate homes and never waits on a remote route
ok - fm-config-push reaches remote routes by default and skips them only with --local-only
ok - the auto-switch threshold is configurable, validated, clearable, and unset by default
ok - the threshold condition turns true exactly at the configured percent
ok - an unreadable quota never trips an automatic switch
ok - only account-level quota windows count toward the auto-switch threshold
ok - the default seat's probe and threshold read the ambient profile new workers launch with
ok - rotation chooses the next logged-in seat under the root and skips ones with no credentials
ok - rotation never targets the default profile, even when it is the only other logged-in store
ok - rotation never assumes which seats exist and picks up seats added later
ok - rotation refuses rather than pretending to switch when no other seat is usable
ok - adding a seat creates an empty profile directory and prints the owner's login steps
ok - a directory named 'default' is never offered, added, or rotated to
ok - seat names that are not a single safe path component are refused
ok - an unset seat setting leaves the launch and the task record exactly as before
ok - a spawn launches on the active seat and records it in the task's own record
ok - switching seats leaves a running worker's recorded profile unchanged
ok - after a switch new workers get the new seat while existing ones keep theirs
ok - an ambient CLAUDE_CONFIG_DIR still reaches workers and is recorded per task
ok - a configured seat takes precedence over firstmate's own ambient config dir
ok - a non-claude spawn records no Claude seat while a named seat is active
ok - a home configuring both an account pin and an active seat is refused before anything exists
ok - an account pin refuses relaunching a task recorded on a seat before anything is touched
ok - a pin-only home with no seat file still relaunches a claude task under its pin
ok - a pin pointing at a seat directory still relaunches a task recorded on that directory
# all fm-seat tests passed
Evidence: fm-secondmate-harness.test.sh log (includes B5a seat-decline pass)

Source: fm-secondmate-harness.test.sh log (includes B5a seat-decline pass)

ok - A1 fm-harness.sh secondmate resolves the fallback chain; crew mode unchanged
ok - fm-harness detects only Cursor Agent CLI's exact invocation marker
ok - C1 fm-harness.sh secondmate-model/secondmate-effort resolve the optional tokens; bare harness stays empty (backward-compat)
ok - pi-signed identity: authoritative launch selection distinguishes shared wrapper ancestry
ok - harness identity: dash-leading ps command names are basename operands, not options
ok - B1 propagate_inheritable_config: copy, idempotence, convergence, absence-mirror, exclusion, no-op, skip diagnostics
ok - B2 spawn: secondmate runs the secondmate harness; its home inherits declared config
ok - B3 spawn: an absent secondmate-harness falls back to the crew harness (backward-compat)
ok - B4 spawn: no config at all -> own harness and no propagation side effects
ok - B5a spawn: a home's seat decline holds at secondmate launch; every other home still inherits
ok - B5 spawn: an explicit per-spawn harness arg overrides config/secondmate-harness
ok - B6 spawn: an unverified resolved secondmate harness is refused (guard intact)
skip: cursor executable not resolvable in this environment, so the launch could not be built
ok - B5b spawn: FM_BACKEND wins over inherited config/backend
ok - B5c spawn: explicit --backend wins over FM_BACKEND and inherited config/backend
ok - C2 spawn: a bare harness-only secondmate-harness file launches with no model/effort flag (backward-compat)
ok - C3 spawn: config/secondmate-harness's model token threads --model into the launch and meta
ok - C4 spawn: config/secondmate-harness's model+effort tokens thread into the launch and meta
ok - C5 spawn: an explicit --model overrides config/secondmate-harness's model token; the file's effort token still applies
ok - C6 spawn: an explicit --effort overrides config/secondmate-harness's effort token; the file's model token still applies
ok - C7 spawn: an explicit --harness starts with clean model/effort defaults
ok - C8 spawn: an explicit --harness still honors explicit model/effort flags
ok - C9 spawn: secondmate launch pins supervision to its own harness
ok - C9 spawn: the harness fallback chain still resolves with no tokens; crew/scout launches are unaffected by this feature
ok - B7 bootstrap sweep pushes, re-converges, and mirrors absence; never inherits secondmate-harness
ok - B8 bootstrap sweep propagates config even when the home's tracked files are already current
ok - B9 bootstrap sweep defers new inherited config until the home ignores it
ok - B10 bootstrap sweep materializes and inherits the startup-memory default while fast-forwarding
ok - B12b backend inheritance: present values and primary absence converge exactly
ok - C2b spawn: config/claude-permission-mode=auto reaches a Claude secondmate launch
ok - B12c claude-permission-mode inheritance: present values and primary absence converge exactly
ok - B12c presentation inheritance: the primary default converges on, and only an explicit opt-out propagates off
ok - B11 bootstrap sweep surfaces config propagation failures
ok - B11 bootstrap rereads completed config writes after partial propagation
ok - B12 config-push propagates via shared live discovery, reports items, rereads on change only, and does not fast-forward
ok - B13 config-push reports dirty, non-allowing, and invalid homes without failing warnings-only runs
ok - B14 config-push exits nonzero on real propagation errors
ok - B14 config-push rereads completed config writes after partial propagation
ok - B15 config reread is per-home, exact-byte, ordered, and pointer-only
ok - B16 config reread isolation, ABSENT, generation safety, send failure, and retry
ok - B20 config reread publication failures retain exact generations for retry
ok - B21 config reread instruction-write failures retain exact retry generations
ok - B21 config reread preserves exact bytes when temporary adoption also fails
ok - B21 config reread serializes concurrent propagation and delivery
ok - B22 full config reread retry queues drain before new publication
ok - B23 mixed config reread delivery failures still bound sent history
ok - B26 config reread delivery stops after the oldest failed generation
- Outcome: ⚠️ 2 infos across 1 run (26m28s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 infos
  • ℹ️ 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 status lists 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.
⚠️ **Test** - 2 infos
  • ℹ️ Sandboxing finding the intent asked for. Firstmate has no built-in way to run a local secondmate as a different OS user or in a container: local routes share the primary's filesystem and user, and docs/configuration.md says the launch-env filter 'is not a sandbox'. A different-user or container home can only be reached two ways. (1) As a remote route: an SSH alias to otheruser@localhost or a container running sshd. Seat settings are never sent to remote routes, so that home already stays separate with no flag. (2) As a local route whose raw launch command wraps sudo -u/docker around a bind-mounted home. Then the config push either fails because the home is not writable by the primary's user, which is reported and does not undo the switch, or writes seat paths that do not exist inside the sandbox, so the worker fails loudly with 'Not logged in' rather than silently spending the team account. Either way the design still holds, and config/claude-seat-local covers a same-user home that wants a separate account.
  • ℹ️ Every switch in the sandbox printed 'not every secondmate home was updated' because the gate environment (NO_MISTAKES_GATE) blocks the re-read nudge to secondmate agents. It happens on the base commit too, and all seat files were written correctly, so this change does not cause it.
  • Live validation: ✅ go - 8 of 10 scenarios driven live against the product
Scenario Result Live Evidence
No opt-out anywhere: switch work, then switch default, reaches every local home, same as the base commit ✅ pass live live-transcript.txt S1/S1c; default-diff.txt shows only the new status section differs from b59c9fd
One home touches config/claude-seat-local and keeps its own seat, seats root and threshold through a primary switch while the other homes take it ✅ pass live live-transcript.txt S2, S4, S5
Switch output names each seat item skipped for the declining home and why ✅ pass live live-transcript.txt S2
Primary status lists each declining home with the seat it is really on, and says '(none ...)' when there is none ✅ pass live live-transcript.txt S1b, S3, S8, S9; declining-home-own-switch.txt
Declining home runs its own switch and threshold without touching the primary or other homes ✅ pass live declining-home-own-switch.txt
Adversarial: a flag on the primary is not inherited by the other homes ✅ pass live live-transcript.txt S7
Adversarial: flag content 'off', a directory flag and a dangling-symlink flag all decline and show in status ✅ pass live live-transcript.txt S8
Removing the flag puts the home back with the rest on the next switch ✅ pass live live-transcript.txt S9
Secondmate launch leaves a declining home's seat settings alone while other homes still inherit ⏸️ untested no The prior payload did not establish a live result. This path was checked only by the automated B5a spawn test in tests/fm-secondmate-harness.test.sh, not by a live secondmate launch. A live launch nee…
Session-start secondmate sweep leaves a declining home's seat settings alone ⏸️ untested no The prior payload did not establish a live result: tests/fm-bootstrap.test.sh was still queued when this step had to report. Run bash tests/fm-bootstrap.test.sh (test_routine_bootstrap_honours_a_hom…
  • drive.sh &lt;worktree&gt; &lt;sandbox&gt;: 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.sh on a git archive b59c9fd extract and on the change, then diff of the two outputs (default behaviour unchanged)
  • Declining home runs its own fm-seat.sh switch personal and threshold 30; checked the primary and the other home, then ran primary status
  • bash 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.

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.
@max-metaplanet
max-metaplanet merged commit 73ae45e into main Sep 24, 2026
20 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant