Skip to content

feat(bin): pace Claude reset-edge releases and pin Firstmate homes to one account - #12

Merged
doitdigital0495 merged 14 commits into
mainfrom
fm/geris-reset-admission-control
Sep 4, 2026
Merged

doitdigital0495 merged 14 commits into
mainfrom
fm/geris-reset-admission-control

Conversation

@doitdigital0495

Copy link
Copy Markdown
Owner

Intent

Implement recommendations 1 and 2 from the Geris Claude 5-hour usage-spike scout report, scoped exclusively to Claude Code sessions billed through the Herdr geris session / Geris credential, plus the captain's two later clarifications that supersede the original non-goals.

ROOT CAUSE BEING ADDRESSED: a subscription window's reset instant is a synchronization edge. Claude Code's own per-session 'continuing automatically' timer and firstmate's own dispatch/relaunch paths both fire on it, and at that instant every quota surface reads full while the account is maximally committed. 30M tokens discharged in under 9 minutes.

REC 1 - reset-edge release shaping, Geris only. When Geris Claude quota becomes available after a limit reset, release at most one Firstmate-managed waiting Geris worker per 5-10 minute interval, highest-priority eligible work first. Preserve all authorized work in a durable queue and continue it eventually. Never cancel, discard, narrow, or silently reroute work. Do not alter personal/default Claude behavior or any non-Geris Herdr session.

REC 2 - committed-demand accounting, Geris only. Before quota-aware dispatch or relaunch treats Geris headroom as available, count live Geris Claude Code sessions parked for automatic continuation with no later real turn and discount Geris effective headroom/ranking by their measured committed demand. Keep point-in-time quota data and committed demand distinct and inspectable. Do not apply this to personal/default Claude or other providers.

CAPTAIN CLARIFICATION 1 (supersedes the original non-goal only to close the proven cross-session relaunch defect): the account remains bound to the Herdr session, NOT the repository. Anything originally started in Herdr geris must always run with Geris Claude; anything started in Herdr personal must always run with personal Claude. Preserve and use each task's original Herdr session binding on every reset/relaunch instead of inheriting the caller's current session. Do NOT implement repo-based account binding. Regression coverage must prove personal tasks cannot relaunch into geris and geris tasks cannot relaunch into personal.

CAPTAIN CLARIFICATION 2 (strengthened invariant): Geris Firstmate and Personal Firstmate must NEVER mix. Each Firstmate home is durably pinned to its originating Herdr session/account identity; a primary launched from another Herdr session must REFUSE rather than silently reuse or migrate that home. Every ordinary worker and second mate started by a Firstmate inherits that parent session/account identity, records it durably, and every relaunch/recovery/send path uses the recorded identity rather than the caller/current environment. A second mate's own workers stay with that second mate's identity. NO fallback across geris/personal on missing or unreadable identity - refuse instead. Preserve separate homes and all existing work; no migration or destructive cleanup.

CAPTAIN CLARIFICATION 3 (test infrastructure): do not ship on portable coverage alone, and do not start or use the generic default Herdr session, because Personal and Geris must remain strictly separate. Keep geris and personal untouched. Make the smallest in-scope test-infrastructure correction that safely permits a named isolated lab anchored to an already-running named session while proving the other named session remains unchanged, with regression coverage for that safety rule.

DELIBERATE DESIGN DECISIONS a reviewer would not infer from the diff:

  • Scope is opt-in per credential store via config/claude-shaped-store (LOCAL, gitignored). An unlisted store - including the default personal one - takes no state, no lock, and no decision, which is what keeps default/personal Claude byte-for-byte unchanged. This was chosen over hard-coding 'geris' or over shaping every non-default store.
  • Shaping is armed only while a shaped store carries committed parked demand, plus a horizon after, rather than pacing unconditionally. This deliberately keeps ordinary unlimited windows unshaped, so the change is not a permanent rate limit on that account.
  • The committed-demand census is data-only and never folded into quota-axi's published numbers; quota-array-dispatch applies the discount in the open. floorInputTokens is deliberately labelled a measured FLOOR (one resumed turn per parked session), not a forecast, to avoid over-claiming.
  • Store identity is CLAUDE_CONFIG_DIR (the value fm-spawn already forwards onto a claude pane), never a name match and never a credential value. No credential is ever read, printed, or copied.
  • A default-store binding is enforced by actively unsetting an inherited CLAUDE_CONFIG_DIR rather than by omitting a prefix, because a pane can inherit one from the terminal server. This intentionally changes the claude launch string for the unset case, and tests/fm-spawn-dispatch-profile.test.sh was updated accordingly.
  • A bounded head-of-queue valve (FM_CLAUDE_HEAD_MAX_WAIT, default 3 release intervals) exists so an abandoned queue entry cannot livelock lower-priority work. It never discards the head.
  • Malformed or unreadable evidence refuses (exit 3) AFTER recording the request in the durable queue, so work is preserved and named rather than lost. This is an evidence failure to repair, deliberately NOT a usage stop line: the standing no-usage-stop-line contract is preserved and nothing pauses on a usage percentage.
  • fm-control consults a NON-CONSUMING preview before stopping a running agent, because fm-spawn's consuming decision only runs after the old agent is gone; a withheld relaunch there would otherwise leave the task with no worker.
  • The home pin is (herdr_session, claude_config_dir) together: a session can be repointed at another store and two sessions can share one, so either moving is a refusal. An unpinned home takes the identity of the first session that uses it; a pinned home is only ever compared, never rewritten.
  • The Herdr lab tripwire previously recorded ONLY the row flagged default and required it to be named 'default' and running. On an operator fleet whose live work runs in named sessions with 'default' present but stopped, the lab refused to provision while the sessions actually worth protecting were never in the snapshot. It now snapshots every session except the lab's own - strictly stronger - and still refuses a fleet with nothing running (vacuous) or more than one default-flagged session (ambiguous).

VERIFICATION ALREADY PERFORMED (evidence recorded in docs/verification/claude-account-binding.md): live isolated Herdr lab provisioned against the real operator fleet and torn down with the tripwire confirming both named sessions byte-identical; live two-direction refusal proven on the real spawn path; pane-level account binding proven on a private tmux server by reading each launched process's own /proc environ - work-bound task ran with the work store, personal-bound task had no CLAUDE_CONFIG_DIR at all despite the server environment carrying one. Firstmate's own Herdr backend correctly refuses cross-session worker placement, which is why the pane-level half runs on tmux, the verified reference backend; that guard was not worked around.

DELIVERY: open a PR. Do NOT merge - captain approval is required after green CI. Do not use --yes; every gate is decided deliberately, and any ask-user finding is escalated rather than self-answered.

What Changed

  • Added bin/fm-claude-admission.sh: an opt-in (per credential store, via a local config/claude-shaped-store list) admission controller that, at a quota reset edge, releases at most one waiting worker per interval from a durable priority queue, and censuses live sessions parked for automatic continuation so quota-aware dispatch and relaunch discount that committed demand from effective headroom. Unlisted stores (including the default personal one) take no state, no lock, and no decision. Malformed evidence refuses (exit 3) only after the request is recorded in the queue, and fm-control consults a non-consuming preview before stopping a running agent.
  • Added bin/fm-home-identity.sh and wired it through fm-spawn, fm-control, fm-send, fm-bootstrap, and fm-remote-secondmate-control: each Firstmate home is durably pinned to the (herdr_session, claude_config_dir) pair that first used it, workers and second mates inherit and record the parent identity, and every relaunch/recovery/send path uses the recorded identity instead of the caller's environment. Mismatches refuse rather than migrate or fall back; a default-store binding is enforced by actively unsetting an inherited CLAUDE_CONFIG_DIR on the launched pane, which changes the claude launch string for that case.
  • Broadened the fm-herdr-lab safety tripwire to snapshot every session except the lab's own instead of only the row flagged default, still refusing a fleet with nothing running or with more than one default-flagged session. Added tests/fm-claude-admission.test.sh, tests/fm-home-identity.test.sh, and tests/fm-remote-secondmate-identity.test.sh, extended the control-relaunch, herdr-lab, secondmate-safety, and spawn-dispatch-profile suites, and documented the behaviour plus the recorded live verification evidence under docs/.

Risk Assessment

⚠️ Medium: Large change adding fail-closed identity and admission gates to every spawn, send, and relaunch path, but ten review rounds have closed each concrete failure sequence and the remaining findings are informational (a millisecond-wide re-read window and a misleading test name), so it is safe to merge with these as follow-ups.

Testing

Targeted suites for admission control, home identity, control relaunch, remote secondmate identity, Herdr lab and spawn dispatch all pass, and a manual CLI walkthrough demonstrates the shaped Geris store releasing one worker per interval with the rest held in a durable queue, the committed-demand census published separately, the personal/default store untouched and always admitted, and both geris/personal identity refusals leaving each home's pin intact; the only failure encountered was the secondmate suite tripping on this machine's global git commit-hook template, which passes once a neutral GIT_TEMPLATE_DIR is used.

Evidence: Geris reset-edge admission control CLI walkthrough

Source: Geris reset-edge admission control CLI walkthrough

$ fm-claude-admission.sh demand (shaped Geris store) store=/tmp/geris-demo/geris-store shaped=yes parkedSessions=3 floorInputTokens=730000 sessions{sessionId,parkedAtEpoch,parkedAgeSeconds,turnsObserved,avgInputTokensPerTurn}: geris-session-c,...,120,1,300000 geris-session-b,...,90,1,180000 geris-session-a,...,60,1,250000 $ gate task-urgent-fix --priority 10 admitted: task-urgent-fix (release slot open on .../geris-store with 3 parked session(s) of committed demand) $ gate task-feature --priority 20 withheld: task-feature (a Claude worker was released onto .../geris-store 0s ago; the next release slot opens in 8s) the request is held in .../state/claude-admission/geris-store-.../queue and released when the slot opens; nothing was cancelled $ queue waiting{enqueuedEpoch,priority,taskId,reason}: ...,20,task-feature,feature work ...,30,task-docs,docs pass ...,40,task-chore,cleanup [after one release interval] admitted: task-feature ; task-chore still withheld $ gate personal-task-1 (personal store) admitted: personal-task-1 (store .../personal-store is not shaped by this home) $ queue -> shaped=no (no state, no lock, no decision) $ FM_HOME=<geris-home> HERDR_SESSION=personal fm-home-identity.sh check fm-home-identity: refused: this firstmate home belongs to session geris on Claude store .../geris-store, but the current session is personal on /home/daan/.claude. [exit 3] $ FM_HOME=<personal-home> HERDR_SESSION=geris CLAUDE_CONFIG_DIR=.../geris-store fm-home-identity.sh check fm-home-identity: refused: this firstmate home belongs to session personal on ... [exit 3] Both pins intact afterwards.


=== Fleet state: three Geris Claude Code sessions parked on 'continuing automatically', one personal session parked too ===

$ cat '/tmp/geris-demo.XPl3BS/fm-home/config/claude-shaped-store'
/tmp/geris-demo.XPl3BS/geris-store
[exit 0]

=== REC 2 - committed-demand census for the Geris store (evidence, not a quota reading) ===

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' demand
store=/tmp/geris-demo.XPl3BS/geris-store
shaped=yes
scannedFiles=3
skippedStaleFiles=0
parkedSessions=3
floorInputTokens=730000
maxAgeSeconds=21600
turnsAveraged=10
sessions{sessionId,parkedAtEpoch,parkedAgeSeconds,turnsObserved,avgInputTokensPerTurn}:
  geris-session-c,1788405074,120,1,300000
  geris-session-b,1788405104,90,1,180000
  geris-session-a,1788405134,60,1,250000
[exit 0]

=== REC 2 - the personal/default store is a separate, unshaped census ===

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/personal-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' demand
store=/tmp/geris-demo.XPl3BS/personal-store
shaped=no
scannedFiles=1
skippedStaleFiles=0
parkedSessions=1
floorInputTokens=500000
maxAgeSeconds=21600
turnsAveraged=10
sessions{sessionId,parkedAtEpoch,parkedAgeSeconds,turnsObserved,avgInputTokensPerTurn}:
  personal-session-x,1788405134,60,1,500000
[exit 0]

=== REC 1 - the reset edge: four Geris workers ask to launch at once, priority 10/20/30/40 ===

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate task-urgent-fix --priority 10 --reason 'p1 incident'
admitted: task-urgent-fix (release slot open on /tmp/geris-demo.XPl3BS/geris-store with 3 parked session(s) of committed demand)
[exit 0]

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate task-feature --priority 20 --reason 'feature work'
withheld: task-feature (a Claude worker was released onto /tmp/geris-demo.XPl3BS/geris-store 0s ago; the next release slot opens in 8s)
          the request is held in /tmp/geris-demo.XPl3BS/fm-home/state/claude-admission/geris-store-6caaba7cccc1/queue and released when the slot opens; nothing was cancelled
[exit 1]

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate task-docs --priority 30 --reason 'docs pass'
withheld: task-docs (a Claude worker was released onto /tmp/geris-demo.XPl3BS/geris-store 0s ago; the next release slot opens in 8s)
          the request is held in /tmp/geris-demo.XPl3BS/fm-home/state/claude-admission/geris-store-6caaba7cccc1/queue and released when the slot opens; nothing was cancelled
[exit 1]

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate task-chore --priority 40 --reason 'cleanup'
withheld: task-chore (a Claude worker was released onto /tmp/geris-demo.XPl3BS/geris-store 0s ago; the next release slot opens in 8s)
          the request is held in /tmp/geris-demo.XPl3BS/fm-home/state/claude-admission/geris-store-6caaba7cccc1/queue and released when the slot opens; nothing was cancelled
[exit 1]

=== Nothing was cancelled: the withheld work sits in a durable queue, highest priority first ===

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' queue
store=/tmp/geris-demo.XPl3BS/geris-store
shaped=yes
parkedSessions=3
floorInputTokens=730000
releaseIntervalSeconds=8
lastReleaseEpoch=1788405194
waiting{enqueuedEpoch,priority,taskId,reason}:
  1788405194,20,task-feature,feature work
  1788405194,30,task-docs,docs pass
  1788405194,40,task-chore,cleanup
[exit 0]

=== Waiting out one release interval (8s here; 420s = 7 min in production) ===

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate task-feature --priority 20
admitted: task-feature (release slot open on /tmp/geris-demo.XPl3BS/geris-store with 3 parked session(s) of committed demand)
[exit 0]

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' queue
store=/tmp/geris-demo.XPl3BS/geris-store
shaped=yes
parkedSessions=3
floorInputTokens=730000
releaseIntervalSeconds=8
lastReleaseEpoch=1788405204
waiting{enqueuedEpoch,priority,taskId,reason}:
  1788405194,30,task-docs,docs pass
  1788405194,40,task-chore,cleanup
[exit 0]

=== Lower-priority work still waits behind the queue head - one release per interval, not a stampede ===

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate task-chore --priority 40
withheld: task-chore (a Claude worker was released onto /tmp/geris-demo.XPl3BS/geris-store 0s ago; the next release slot opens in 8s)
          the request is held in /tmp/geris-demo.XPl3BS/fm-home/state/claude-admission/geris-store-6caaba7cccc1/queue and released when the slot opens; nothing was cancelled
[exit 1]

=== The durable queue survives a firstmate restart (state on disk, not in memory) ===

$ ls '/tmp/geris-demo.XPl3BS/fm-home/state/claude-admission'
geris-store-6caaba7cccc1
[exit 0]

=== Personal/default Claude is untouched: every launch is admitted, and no state, lock or decision is taken ===

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/personal-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate personal-task-1 --priority 40
admitted: personal-task-1 (store /tmp/geris-demo.XPl3BS/personal-store is not shaped by this home)
[exit 0]

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/personal-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate personal-task-2 --priority 40
admitted: personal-task-2 (store /tmp/geris-demo.XPl3BS/personal-store is not shaped by this home)
[exit 0]

$ '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' gate default-store-task --priority 40
admitted: default-store-task (store /home/daan/.claude is not shaped by this home)
[exit 0]

$ CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/personal-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-claude-admission.sh' queue
store=/tmp/geris-demo.XPl3BS/personal-store
shaped=no
[exit 0]

=== CAPTAIN CLARIFICATION 2 - a home is pinned to its originating Herdr session AND account ===

$ FM_HOME='/tmp/geris-demo.XPl3BS/geris-home' HERDR_SESSION=geris CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-home-identity.sh' ensure
identity: session=geris store=/tmp/geris-demo.XPl3BS/geris-store (pinned now)
[exit 0]

$ FM_HOME='/tmp/geris-demo.XPl3BS/geris-home' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-home-identity.sh' show
fm-home-identity-v1
herdr_session=geris
claude_config_dir=/tmp/geris-demo.XPl3BS/geris-store
[exit 0]

$ FM_HOME='/tmp/geris-demo.XPl3BS/personal-home' HERDR_SESSION=personal '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-home-identity.sh' ensure
identity: session=personal store=/home/daan/.claude (pinned now)
[exit 0]

$ FM_HOME='/tmp/geris-demo.XPl3BS/personal-home' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-home-identity.sh' show
fm-home-identity-v1
herdr_session=personal
claude_config_dir=/home/daan/.claude
[exit 0]

=== Refusal direction 1: the personal session tries to use the Geris home ===

$ FM_HOME='/tmp/geris-demo.XPl3BS/geris-home' HERDR_SESSION=personal '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-home-identity.sh' check
fm-home-identity: refused: this firstmate home belongs to session geris on Claude store /tmp/geris-demo.XPl3BS/geris-store, but the current session is personal on /home/daan/.claude.
                  Homes are never migrated or merged across sessions. Open this home from its own session, or use the home that belongs to this one.
[exit 3]

=== Refusal direction 2: the Geris session tries to use the personal home ===

$ FM_HOME='/tmp/geris-demo.XPl3BS/personal-home' HERDR_SESSION=geris CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/geris-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-home-identity.sh' check
fm-home-identity: refused: this firstmate home belongs to session personal on Claude store /home/daan/.claude, but the current session is geris on /tmp/geris-demo.XPl3BS/geris-store.
                  Homes are never migrated or merged across sessions. Open this home from its own session, or use the home that belongs to this one.
[exit 3]

=== Same session, store repointed at the other account - still a refusal, never a silent migration ===

$ FM_HOME='/tmp/geris-demo.XPl3BS/geris-home' HERDR_SESSION=geris CLAUDE_CONFIG_DIR='/tmp/geris-demo.XPl3BS/personal-store' '/home/daan/.no-mistakes/worktrees/cf62ac6bfd91/01M1JBYWD6RQGPRQTV2B39NWD3/bin/fm-home-identity.sh' check
fm-home-identity: refused: this firstmate home belongs to session geris on Claude store /tmp/geris-demo.XPl3BS/geris-store, but the current session is geris on /tmp/geris-demo.XPl3BS/personal-store.
                  Homes are never migrated or merged across sessions. Open this home from its own session, or use the home that belongs to this one.
[exit 3]

=== Both homes survive the refusals byte-for-byte - no migration, no cleanup ===

$ find '/tmp/geris-demo.XPl3BS/geris-home' '/tmp/geris-demo.XPl3BS/personal-home' -name home-identity -exec sh -c 'echo "-- $1"; cat "$1"' _ {} \;
-- /tmp/geris-demo.XPl3BS/geris-home/data/home-identity
fm-home-identity-v1
herdr_session=geris
claude_config_dir=/tmp/geris-demo.XPl3BS/geris-store
-- /tmp/geris-demo.XPl3BS/personal-home/data/home-identity
fm-home-identity-v1
herdr_session=personal
claude_config_dir=/home/daan/.claude
[exit 0]

(lab: /tmp/geris-demo.XPl3BS)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 infos
  • 🚨 bin/fm-remote-secondmate-control.sh:198 - The new home-identity pin breaks remote secondmate steering. cmd_launch (line 172) runs fm-spawn.sh with an explicit HERDR_SESSION="$REMOTE_HERDR_SESSION" (fm-remote), and fm-spawn's new fm-home-identity.sh seed &#34;$PROJ_ABS&#34; &#34;$HOME_PIN_SESSION&#34; ... therefore pins $TARGET_HOME/data/home-identity with herdr_session=fm-remote. cmd_send (line 198) and cmd_key (line 207) invoke fm-send.sh with FM_HOME="$TARGET_HOME" but WITHOUT HERDR_SESSION; nothing in bin/fm-remote-entrypoint.sh or bin/fm-remote-job-worker.sh exports it either, so read_environment_identity resolves ENV_SESSION=default, refuse_mismatch fires, and fm-send's new fm-home-identity.sh ensure guard (bin/fm-send.sh:129) exits 1 before any delivery. Failure sequence: launch a remote secondmate, then send it any message or --key -> "this firstmate home belongs to session fm-remote ... but the current session is default" and the steer never reaches the agent. Fix: set HERDR_SESSION="$REMOTE_HERDR_SESSION" on the cmd_send/cmd_key invocations exactly as cmd_launch already does.
  • ⚠️ bin/fm-claude-admission.sh:559 - The fail-closed contract for a malformed durable queue is silently bypassed. head_row=$(sorted_queue | head -n 1) || exit $? takes the exit status of head, not of sorted_queue, so sorted_queue's die_evidence (exit 3 on an unreadable row, priority, or task id) is swallowed: head_row comes back empty and evaluate falls through to DECISION=admit. Verified: f(){ printf &#39;row\n&#39;; exit 3; }; x=$(f | head -n 1); echo $? prints status=0. Failure sequence: state/claude-admission/<slug>/queue acquires a corrupted row (external edit, truncated filesystem write); the next gate on a shaped store enqueues, evaluates with an empty head, and admits every launch immediately - the exact reset-edge burst the script exists to prevent - instead of exiting 3 as the header and tests document. The same swallow affects action_queue's &lt;&lt;&lt; &#34;$(sorted_queue)&#34;. Fix: capture sorted_queue into a variable (checking its status) before taking the head.
  • ⚠️ bin/fm-claude-admission.sh:671 - Shaping can never disarm under sustained traffic, contradicting the stated design decision. Intent: "Shaping is armed only while a shaped store carries committed parked demand, plus a horizon after ... This deliberately keeps ordinary unlimited windows unshaped, so the change is not a permanent rate limit on that account", and docs/configuration.md repeats "stays armed for FM_CLAUDE_DEMAND_HORIZON after the last time it did [carry committed demand]". But action_gate writes ARMED_SINCE whenever DECISION_ARMED=yes, including when armed came from the horizon branch (line 538) rather than from parked>0. Failure sequence: one park event arms the store; parked demand then clears; with defaults (interval 420s, horizon 1800s) any gate call within 30 min refreshes armed-since, so a fleet that spawns or relaunches at least once per horizon stays paced at 1 Claude launch / 7 min indefinitely on an unlimited window. test_shaping_disarms_when_no_demand_remains runs with FM_TEST_HORIZON=0 and cannot catch it. If the sticky arming is intentional, the header and docs need to say so; otherwise the write should be conditioned on parked>0.
  • ⚠️ bin/fm-claude-admission.sh:510 - queue_remove interpolates the task id into a grep basic regex: grep -v $&#39;\t&#39;&#34;$id&#34;$&#39;\t&#39;. fm_pr_task_id_valid (bin/fm-pr-lib.sh:97) permits '.', which is a regex wildcard. Failure sequence: tasks "a.c" and "abc" are both queued on a shaped store; releasing or withdrawing "a.c" rewrites the queue without the "abc" row too, so authorized work is dropped from the durable queue with no release and no withdraw - violating the header's "Nothing is ever dropped from the queue except by an explicit withdraw or by being released." Fix: match the id as a literal field (e.g. awk -F'\t' with $3 != id).
  • ℹ️ bin/fm-claude-admission.sh:638 - action_demand calls store_is_shaped inside $(store_is_shaped &#34;$store&#34; &amp;&amp; echo yes || echo no), so its die_evidence (exit 3 on a config line that is not an absolute path, or an unreadable config file) is confined to the command substitution and the verb prints shaped=no instead of refusing. demand is data-only, but the misreport is the opposite of the documented fail-closed boundary and would tell a reader that a shaped store is unshaped. Call store_is_shaped outside the substitution and branch on its status.
  • ℹ️ bin/fm-claude-admission.sh:745 - action_poll runs the full census (evaluate -> demand_census) on every watcher cycle while anything is queued, and demand_census reads up to FM_CLAUDE_DEMAND_TAIL_BYTES (1 MiB default) from every transcript in the store modified within FM_CLAUDE_DEMAND_MAX_AGE (6 h default). On a busy store that is tens of MiB of reads plus a python3 start per poll interval, for as long as the queue is non-empty - which is precisely the reset-edge window. The header's "silent-and-cheap when nothing waits" is accurate; the loaded case is the expensive one. Noting the bound rather than asking for a change.

🔧 Fix: fix admission fail-open, id matching, arming decay, remote identity
3 issues (2 warnings, 1 info) still open:

  • ⚠️ bin/fm-claude-admission.sh:470 - The fix round audited callers of sorted_queue but left the same status-swallow inside the queue helpers: queue=$(read_queue) at lines 470 (sorted_queue), 497 (queue_enqueue) and 509 (queue_remove) discards read_queue's die_evidence exit 3, because the exit only kills the command-substitution subshell and the script runs under set -u without -e. Line 484 (queue_has) got the || exit $? treatment; these three did not. Failure sequence: state/claude-admission/<slug>/queue becomes a symlink or otherwise unreadable (external tamper, permissions, fs error); the next gate on a shaped store calls queue_enqueue, which sees an empty queue and write_record mv's a single-row file over it - every previously queued authorized request is silently gone - and evaluate's sorted_queue then reads only that one row and returns DECISION=admit. That breaks both named invariants at once: 'Nothing is ever dropped from the queue except by an explicit withdraw or by being released' and the documented fail-closed boundary for unreadable evidence. Fix: queue=$(read_queue) || exit $? at all three sites.
  • ⚠️ bin/fm-control.sh:129 - The new fm-home-identity.sh ensure guard is placed before FM_HOME is validated as a directory (fm-control.sh:129 sits above the [ -d &#34;$FM_HOME&#34; ] check at line 133; fm-send.sh:128 sits above its own [ ! -d &#34;$FM_HOME&#34; ] check at line 134). action_ensure creates the record directory (mkdir -p &#34;$FM_HOME/data&#34;) and writes the pin, so a stale, mistyped, or relative FM_HOME that previously produced a clean "FM_HOME is not a directory" error now silently materializes <FM_HOME>/data/home-identity - in the current working directory when the value is relative - and pins that phantom home to the calling session. Fix: move the ensure block below the existing FM_HOME directory check in both scripts.
  • ℹ️ tests/fm-remote-secondmate-identity.test.sh:70 - write_pin always records claude_config_dir=default, so the new coverage exercises only the -u CLAUDE_CONFIG_DIR branch of remote_identity_env (bin/fm-remote-secondmate-control.sh:120-123). The other half of the propagated identity - a pin naming an absolute store, which must arrive as CLAUDE_CONFIG_DIR=&lt;path&gt; and satisfy fm-send's ensure comparison after canonicalization - has no executable case, and the test's own control() unsets CLAUDE_CONFIG_DIR so the 'actively removed rather than inherited' claim is not exercised either. A second write_pin case with an absolute store, run with a foreign CLAUDE_CONFIG_DIR in the caller environment, would cover both.

🔧 Fix: fail closed on unreadable queue and phantom home pins
3 issues (2 warnings, 1 info) still open:

  • ⚠️ bin/fm-claude-admission.sh:760 - action_poll discards the fail-closed refusal the rest of the file now enforces. sorted=$(sorted_queue) || return 0 (line 760) catches sorted_queue's die_evidence exit 3 and returns 0, and stamp=&#34;$head:$(read_epoch_record &#34;$LAST_RELEASE&#34;)&#34; (line 767) swallows the same status. Failure sequence: state/claude-admission/<slug>/queue becomes a symlink or gains a torn row; every gate correctly refuses with exit 3 so nothing is ever released, but the watcher poll - the only automated surface that turns waiting work into a check: wake - stays silent forever, so firstmate is never told the queue needs repair. The boundary is inconsistent inside the same function: store_is_shaped on line 757 is not in a subshell, so a malformed config/claude-shaped-store DOES exit 3 out of poll. Fix: sorted=$(sorted_queue) || exit $?, and capture read_epoch_record with its status, matching every other verb.
  • ⚠️ tests/fm-control-relaunch.test.sh:897 - test_relaunch_keeps_a_personal_task_off_a_work_account asserts a premise it never establishes. Its comment (lines 890-891) says "a work account is sitting in the environment" and $store is created on line 889 then never used, but line 897 runs with FM_TEST_CLAUDE_CONFIG_DIR='' so the caller carries no account at all. assert_not_contains &#34;$launch&#34; &#34;CLAUDE_CONFIG_DIR=&#34; therefore passes even if fm-spawn ignored the recorded binding and forwarded the ambient value - there is nothing to forward. The test cannot fail for the defect it names. A conflicting ambient store cannot just be added, because fm-control's identity gate requires caller store == home pin; the reachable setup is to pin the home to $store (herdr_session=default, claude_config_dir=$store), keep the task meta at claude_config_dir=default, and run with FM_TEST_CLAUDE_CONFIG_DIR="$store" - the recorded default binding must still yield -u CLAUDE_CONFIG_DIR and no CLAUDE_CONFIG_DIR= prefix.
  • ℹ️ bin/fm-spawn.sh:1882 - The secondmate home-identity seed (lines 1882-1890) runs before the release-shaping gate (lines 1900-1907), so a withheld --secondmate claude spawn prints "nothing was created and the request is preserved above" after having already written $PROJ_ABS/data/home-identity. The pin is idempotent and identical to what a later successful launch writes, so no state is corrupted, but the message is inaccurate. Both blocks depend only on HOME_PIN_SESSION/HOME_PIN_STORE resolved above, so moving the admission gate ahead of the seed is a straight reorder.

🔧 Fix: wake firstmate on poll refusals, fix vacuous relaunch premises
3 issues (1 warning, 2 infos) still open:

  • ⚠️ bin/fm-claude-admission.sh:784 - action_poll routes only sorted_queue (line 776) and the two epoch records (lines 779-780) through poll_refuse. evaluate at line 784 still calls demand_census as census=$(demand_census &#34;$STORE&#34;) || exit $?, so an unreadable transcript, a torn non-final JSON record, a missing python3, or an unreadable parked count exits 3 with the message on stderr only. bin/fm-watch.sh:711 discards the check's stderr and ignores its status, so FM_CHECK_RESULT is empty and no check: wake is appended. Failure sequence: a shaped store holds queued work, one transcript under <store>/projects/*/ becomes unreadable; every gate correctly refuses (exit 3) so nothing is released, and the watcher poll - the only automated surface that turns waiting work into a wake - stays silent forever, so firstmate is never told the store needs repair. Same shape at line 774: store_is_shaped &#34;$store&#34; 2&gt;/dev/null || return 0 is not a command substitution, so a malformed config/claude-shaped-store line exits 3 out of poll with stderr sent to /dev/null. This contradicts the block comment added at lines 755-759 ('Every refusal a poll can hit is therefore reported as the one wake line'). Fix: pre-capture the census status the way armed/last are pre-captured (census=$(demand_census &#34;$STORE&#34; 2&gt;&amp;1) || poll_refuse &#34;$?&#34; &#34;$census&#34;) and hand it to evaluate, and give store_is_shaped a refusal path naming the config problem by store path (SLUG is not resolved yet at that point).
  • ℹ️ AGENTS.md:113 - The check-shim entry still reads 'silent unless a shaped store has waiting work whose release slot is open', but poll_refuse now also emits a wake line for unreadable durable evidence with no open slot. docs/configuration.md:346 describes the same one-line-names-the-task-to-release behavior. Add the evidence-refusal wake to both so a reader can interpret the line.
  • ℹ️ bin/fm-claude-admission.sh:764 - poll_refuse composes ~80 characters of preamble ('claude admission: ' + slug + ' holds waiting work that cannot be released; ') before the concrete reason, and fm_cap_line cuts at FM_LINE_CAP_DEFAULT=220. With the new test's own path (/tmp/fm-claude-admission.XXXXXX/unreadablequeue/home/state/claude-admission/<slug>/queue) the line lands ~213 characters, 7 under the cap; any longer TMPDIR (common in CI) truncates the tail, so tests/fm-claude-admission.test.sh:353 assert_contains &#34;$out&#34; &#34;is a symlink&#34; fails and the operator gets '... [truncated]' instead of the named problem. Put the reason ahead of the preamble, or pass an explicit larger max for this line.

🔧 Fix: route every poll evidence refusal to a wake line
2 issues (1 warning, 1 info) still open:

  • ⚠️ tests/fm-claude-admission.test.sh:354 - The new poll wake-line coverage cannot fail for the defect it was added for. The whole point of the round-4 fix is that bin/fm-watch.sh:713 sends the check's stderr to /dev/null and only keeps its STDOUT (FM_CHECK_RESULT), so a refusal that reaches stderr alone leaves a stuck queue invisible. But the shared admission() helper (line 98) ends with &#34;$ADMISSION&#34; &#34;$@&#34; 2&gt;&amp;1, merging both streams into $out. So assert_contains &#34;$out&#34; &#34;claude admission:&#34; (line 354), assert_contains &#34;$out&#34; &#34;unreadable record&#34; (line 380), assert_contains &#34;$out&#34; &#34;until that is repaired&#34;, the head -n 1 leading-line check (line 583), and assert_contains &#34;$out&#34; &#34;not an absolute path&#34; (line 608) would all still pass if poll_refuse's fm_cap_line were changed to write to stderr - which is exactly the silent-forever regression. The tests prove the text is emitted somewhere, not that it is emitted where the watcher reads. Fix: capture stdout only for the poll assertions (e.g. an admission_stdout() variant that runs with 2&gt;/dev/null), and keep the merged helper for the paths that assert die_evidence messages.
  • ℹ️ bin/fm-claude-admission.sh:782 - The block comment added at lines 754-762 claims "EVERY refusal reachable from a poll is therefore pre-captured and reported as the one wake line", but two refusals before the store is resolved still exit with stderr only, which the watcher discards. store=$(launch_store 2&gt;/dev/null) || return 0 (line 782) swallows launch_store's exit 3 (a non-absolute CLAUDE_CONFIG_DIR, or neither CLAUDE_CONFIG_DIR nor HOME set) and returns silently; resolve_store_state &#34;$store&#34; (line 789) can die_evidence out of store_slug when no shasum/sha256sum is on PATH, exiting 3 with nothing on stdout. In both cases a shaped store holding queued work stays stuck with firstmate never told. Both are pre-STORE_DIR, so poll_refuse already handles that case correctly (it skips the report record and still prints, as the malformed-config path proves) - routing these two through it would make the boundary match the comment. Lower severity than the prior rounds because both causes are environmental rather than data corruption.

🔧 Fix: assert poll wakes on stdout, announce pre-store refusals
2 issues (1 warning, 1 info) still open:

  • ⚠️ bin/fm-spawn.sh:1855 - The home-identity guard runs too late on the secondmate path, so a spawn from a foreign Herdr session mutates the child home before refusing. For KIND=secondmate, bin/fm-spawn.sh:1637 fast-forwards the secondmate worktree via ff_target, line 1650 creates $PROJ_ABS/state, and line 1667 runs propagate_secondmate_inheritance (which now also copies the new config/claude-shaped-store, per bin/fm-config-inherit-lib.sh:63) - all before fm-home-identity.sh ensure at line 1855. Failure sequence: from a session the home does not belong to, run fm-spawn.sh <id> <home> --secondmate; the child home's git HEAD is moved and the wrong parent's local config is written into it, and only then does the identity check refuse with 'this firstmate home does not belong to the current session, and nothing was created' - a claim that is false on that path. The sibling entry points were fixed for exactly this shape in an earlier round (bin/fm-control.sh:129 and bin/fm-send.sh:129 now check immediately after the FM_HOME directory validation). Fix: move the ensure call and the HOME_PIN_SESSION/HOME_PIN_STORE resolution up to just after FM_HOME is resolved (bin/fm-spawn.sh:246), leaving the seed block where PROJ_ABS exists. Existing coverage (tests/fm-home-identity.test.sh test_spawn_refuses_a_foreign_session_and_creates_nothing) drives an ordinary spawn only, so the secondmate path is unproven.
  • ℹ️ bin/fm-claude-admission.sh:786 - The two pre-store poll refusals added this round have no dedupe, so they wake firstmate on every watcher cycle indefinitely. poll_refuse only writes its 'evidence-refusal' report record when STORE_DIR is resolved (bin/fm-claude-admission.sh:770-773), and the launch_store refusal at line 786 and the store_slug refusal at line 793 both fire before resolve_store_state, so each poll re-emits the same wake line. bin/fm-watch.sh:1044-1058 appends a wake and calls wake() for every non-empty check output with no dedupe of its own. Failure sequence: a home that lists a shaped store runs with a relative CLAUDE_CONFIG_DIR (or with neither CLAUDE_CONFIG_DIR nor HOME set, or on a host with no shasum/sha256sum); every FM_CHECK_INTERVAL firstmate is woken with the identical line until a human repairs the environment - burning exactly the agent turns this feature exists to conserve. It also contradicts docs/configuration.md:349 ('the refusal is also reported once per store rather than on every cycle'). Fix: dedupe these two under a home-level marker (the config file exists, so this home is shaping something and a marker under $ADMISSION_ROOT is legitimate), or state the exception in the docs.

🔧 Fix: guard identity before any spawn mutation, dedupe poll wakes
2 warnings still open:

  • ⚠️ bin/fm-spawn.sh:1895 - The release-shaping gate runs after the secondmate path has already mutated the child home, so a withheld launch's "nothing was created" is false. For KIND=secondmate, bin/fm-spawn.sh:1661 fast-forwards the child worktree (ff_target), 1673 creates $PROJ_ABS/state, and 1690 runs propagate_secondmate_inheritance - which now also copies config/claude-shaped-store (bin/fm-config-inherit-lib.sh:66) - all before the gate at 1895. Failure sequence: a shaped store is armed and its release slot is spent; a --secondmate claude spawn moves the child home's git HEAD and writes the parent's local config into it, then exits 1 with "error: <id> was not released onto its Claude credential store; nothing was created and the request is preserved above". The block comment added at 1885 ("this point creates no worktree, no endpoint, and no task metadata") is false on this path. Round 3 fixed the identity seed for exactly this shape but only relative to the gate, not relative to the secondmate block above it. Fix: resolve SPAWN_CLAUDE_STORE and run the gate before the secondmate block at 1633 (it needs only HARNESS, the relaunch meta, and HOME_PIN_STORE, all available by then).
  • ⚠️ bin/fm-claude-admission.sh:807 - The new pre-store dedupe marker can silence a recurring refusal forever. rm -f -- &#34;$HOME_REFUSAL&#34; (line 807) is only reached once the store is resolved AND shaped; the unshaped branch at line 802 (1) return 0) and the unconfigured-home return leave the marker in place. Failure sequence: a home shaping /work/store with queued work runs with a relative CLAUDE_CONFIG_DIR -> poll_refuse wakes firstmate once and writes .home-evidence-refusal with that reason; the operator repoints CLAUDE_CONFIG_DIR at an unshaped personal store, so the poll returns silently at 802 and the marker is never retired; the same relative value later returns -> poll_refuse matches the stale stamp and exits 3 with empty stdout on every cycle, so the stuck queue on /work/store is never announced. That is the same silent-forever class rounds 4-6 closed elsewhere. Fix: clear HOME_REFUSAL as soon as the pre-store steps succeed (immediately after store_is_shaped returns 0 or 1), not only on the shaped path.

🔧 Fix: gate before secondmate mutations, retire stale refusal marker
2 warnings still open:

  • ⚠️ bin/fm-spawn.sh:1665 - The release gate is consuming (action_gate does queue_remove + writes LAST_RELEASE) and round 7 moved it above refusals that still exit 1, with no compensating withdraw anywhere. Below the new boundary and still refusing: secondmate FIRSTMATE_HOME resolution and validate_firstmate_home_for_spawn / secondmate_registry_validate_bindings (bin/fm-spawn.sh:1683-1697), the mkdir/lock failures at 1719-1729, the missing-brief check at 1747, the ship delivery-contract and contradictory-brief refusals at 1858-1890, and the child identity seed at 1924. Failure sequence: a shaped store is armed; fm-spawn.sh fm-x proj --mode direct-PR runs against a brief recording Delivery contract: mode=no-mistakes. The gate admits, removes fm-x from the durable queue and stamps last-release, then the delivery mismatch exits 1 - so the one release per FM_CLAUDE_RELEASE_INTERVAL is burned by a spawn that created nothing, every legitimately queued worker is delayed a full interval, and fm-x is no longer in the queue that is supposed to preserve it. The same holds for a secondmate whose firstmate home is unregistered and for any missing brief. The boundary comment added at 1633 ('everything above this line is resolution and validation') is not true of the code below it. Fix: hoist the remaining pure-validation refusals above the boundary (or place the gate immediately before the first mutation on each path) rather than placing the gate above validation.
  • ⚠️ bin/fm-claude-admission.sh:806 - The relocated rm -f -- &#34;$HOME_REFUSAL&#34; retires the pre-store dedupe marker before the last refusal that uses it. In action_poll the marker is now removed on shaped_status 0|1 (line 806), but slug=$(store_slug &#34;$store&#34; 2&gt;&amp;1) || poll_refuse &#34;$?&#34; &#34;$slug&#34; (line 809) runs after that and is still pre-store (resolve_store_state has not run, so STORE_DIR is empty and poll_refuse dedupes on HOME_REFUSAL). Failure sequence: a home that shapes a store runs on a host with neither shasum nor sha256sum on PATH; every watcher cycle deletes the marker, store_slug refuses, poll_refuse finds no stamp and emits the wake line again - firstmate is woken with the identical line every FM_CHECK_INTERVAL until a human repairs PATH. That is the repeat the round-7 change was meant to close, and it contradicts docs/configuration.md:349 ('the refusal is also reported once per store rather than on every cycle'). Fix: retire the marker only once every pre-store step has succeeded (after store_slug on the shaped path, and on the unshaped return), not before the last refusal that reads it.

🔧 Fix: order spawn refusals before the consuming release gate
2 issues (1 warning, 1 info) still open:

  • ⚠️ bin/fm-claude-admission.sh:765 - The resolved-store half of the poll dedupe is keyed by a CONSTANT stamp, so the "clear-then-recur / a different problem wakes again" invariant that rounds 7-8 closed for the pre-store marker is still broken on the store path. poll_refuse sets stamp=evidence-refusal for every store-level refusal (line 765) and writes it to $REPORTED (line 784), while the pre-store branch deliberately uses stamp=$reason. $REPORTED is only retired on the admit paths (rm -f -- &#34;$REPORTED&#34; at 686 in action_gate and 722 in action_withdraw, or overwritten with "$head:$last" at 839); action_poll's withhold path returns at 833 without clearing it. Failure sequence A (different problem silenced): a shaped store holds queued work and a transcript under <store>/projects/*/ becomes unreadable -> poll wakes firstmate once and writes $REPORTED=evidence-refusal; the operator repairs the transcript but the release slot is not open yet, so the next poll returns at 833 with the stale marker in place; state/claude-admission/<slug>/queue then gains a torn row -> poll_refuse matches the identical stamp and exits 3 with EMPTY stdout on every cycle. bin/fm-watch.sh:713 discards the check's stderr and ignores its status, so firstmate is never told the queue is stuck and the queued work waits indefinitely - the exact silent-forever class rounds 4-6 were fixed for. Failure sequence B is the same shape without any repair: two distinct evidence problems in a row, only the first announced. Fix: key the store-level stamp by the reason as the pre-store branch does (e.g. stamp=&#34;evidence-refusal:$reason&#34;), and retire $REPORTED once a poll gets through every evidence read cleanly, not only when it admits. Coverage: tests/fm-claude-admission.test.sh:337 and :378 each drive a single refusal per fixture, and the census case repairs with FM_TEST_INTERVAL=1 so it lands on the admit path - neither can catch this.
  • ℹ️ bin/fm-spawn.sh:1837 - The new phase-boundary comment asserts "a spent release slot always produced a launch", which is stronger than the code can deliver. The gate at 1863-1877 is consuming (queue_remove + LAST_RELEASE), and several non-validation failures still exit 1 below it with no compensating withdraw: the secondmate state mkdir (1903) and inheritance lock (1908-1912), the child identity seed (1946), freshen_spawn_worktree_base (2558), the backend create calls (2165, 2313, 2324, 2336-2349, 2380) and the meta lock (2950). Concretely: tmux's server is gone, fm_backend_tmux_create_task fails, and the store's one release per FM_CLAUDE_RELEASE_INTERVAL is spent by a spawn that launched nothing while the task is no longer in the durable queue. That residual is inherent - a mutation cannot be validated without mutating - and it is not a regression (the gate previously sat even earlier), so this is a note on the comment's absolute wording rather than a request to move the gate again. Naming the bound ("every REFUSAL precedes the gate; an infrastructure failure after it can still spend a slot") would keep the next change from trusting a guarantee that does not hold.

🔧 Fix: key store poll refusals by reason, bound slot guarantee
2 issues (1 warning, 1 info) still open:

  • ⚠️ tests/fm-claude-admission.test.sh:459 - The round-9 code addition - the case &#34;$(cat -- &#34;$REPORTED&#34;)&#34; in evidence-refusal:*) rm -f retire block at bin/fm-claude-admission.sh:833-839 - has no coverage that fails without it. In test_a_different_store_problem_wakes_firstmate_again the clear-then-recur step re-introduces the CENSUS fault (torn.jsonl), but the last stamp written was the SYMLINK reason, so the reasons differ and poll_refuse emits the wake line regardless of whether the retire block exists. Delete the retire block and the test still passes; the assertion "a fault that cleared and recurred must wake firstmate again" therefore cannot fail for the defect it names. Steps 1-3 of the same test are sound (dedupe on repeat, re-wake on a different reason). Fix: make the recurrence the SAME fault that was last reported - repair only the census fault while the queue symlink is the last-reported one, poll cleanly (which must retire the stamp), then re-introduce the symlink and assert the wake line returns. That path fails without the retire block and passes with it.
  • ℹ️ docs/configuration.md:348 - docs/configuration.md still says "the refusal is also reported once per store rather than on every cycle, and a refusal that fires before any store could be named is reported once per home the same way". Since round 9 both records dedupe on the concrete PROBLEM, not on the fact of a refusal, so a second, different fault on the same store wakes firstmate again and a cleared fault that recurs is announced. The current wording reads as though one refusal silences the store outright, which is the behavior the change deliberately removed. Add the per-problem qualifier (one sentence per line, plain '-').

🔧 Fix: cover the refusal-stamp retirement, document per-problem dedupe
2 infos still open:

  • ℹ️ bin/fm-claude-admission.sh:848 - action_poll pre-captures sorted_queue, armed-since and last-release specifically so their refusals reach stdout through poll_refuse, then calls evaluate, which re-reads all three (bin/fm-claude-admission.sh:530 armed_since, :546 last, :557 sorted_queue) with plain || exit $?. Only the census is passed in. Consequence is twofold: the durable queue and both epoch records are read twice per poll cycle, and a fault that appears between the pre-capture and the re-read exits 3 with the reason on stderr only, which bin/fm-watch.sh discards - the silent-forever shape rounds 4-6 closed. The window is a few milliseconds so this is a residual, not a reachable defect, but it is removable: pass the already-captured armed/last/sorted values into evaluate the way census already is, and the duplicate I/O and the residual window both go away.
  • ℹ️ tests/fm-claude-admission.test.sh:870 - test_a_refusal_after_the_gate_never_spends_the_slot and its comment ("a refusal that lives below the release gate's own position in the file") describe a post-gate refusal, but the delivery mismatch it triggers is emitted at bin/fm-spawn.sh:1784, above the phase boundary at :1820 and above the gate at :1870. The test really proves the phase-1 ordering (a validation refusal never reaches the gate), which is valuable and does fail if the gate is hoisted back above the mismatch. As written the name asserts coverage of the case the phase comment at bin/fm-spawn.sh:1837 explicitly says is NOT guaranteed (an infrastructure failure below the gate can still spend a slot), so a later reader may trust a guarantee no test holds. Rename to reflect that the refusal precedes the gate and drop the "below the gate" comment.
✅ **Test** - passed

✅ No issues found.

  • bin/fm-test-run.sh tests/fm-claude-admission.test.sh tests/fm-home-identity.test.sh tests/fm-control-relaunch.test.sh tests/fm-remote-secondmate-identity.test.sh tests/fm-secondmate-safety.test.sh tests/fm-spawn-dispatch-profile.test.sh tests/fm-herdr-lab.test.sh
  • GIT_TEMPLATE_DIR=/tmp/empty-git-template bin/fm-test-run.sh tests/fm-secondmate-safety.test.sh (re-run after isolating the machine's global pre-commit hook template)
  • Manual walkthrough script driving bin/fm-claude-admission.sh demand|gate|queue against a shaped Geris store with three parked sessions and an unshaped personal store
  • Manual walkthrough driving bin/fm-home-identity.sh ensure|show|check for geris and personal homes, including both cross-session refusal directions and a store-repoint refusal
  • git status --porcelain to confirm the worktree was left clean
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

daeverhuur and others added 14 commits September 2, 2026 23:21
…account

Two independent mechanisms fired on the same clock edge with no account-level
admission control anywhere in the stack: Claude Code's per-session
auto-continue timer, and firstmate's own dispatch and relaunch paths reading a
reset as free headroom. At the reset instant every quota surface reads full
while the account is maximally committed, so a whole backlog discharged into a
fresh window at once.

Release shaping. bin/fm-claude-admission.sh releases at most one
firstmate-launched Claude worker per interval onto a credential store the home
lists in config/claude-shaped-store, highest priority first. Shaping is armed
only while that store carries committed demand and for a horizon after, so an
ordinary window is not paced. A withheld launch creates nothing, is held in a
durable queue that survives restarts, and is released on its own schedule; the
watcher poll wakes firstmate when a slot opens. Nothing is ever cancelled,
narrowed, or rerouted, and the pacing is never keyed to how full a window is.

Committed demand. The same script publishes a census of live sessions parked
for automatic continuation with no later real turn, with each one's measured
billable input tokens per turn. quota-array-dispatch reads it beside quota-axi's
point-in-time headroom and discounts a shaped candidate in the open; the two
readings stay distinct and are never folded into one number.

Account binding. The account a worker bills followed whichever session firstmate
happened to be in, so a relaunch could move a task between subscriptions.
bin/fm-home-identity.sh pins each home to the session and account it was started
from; fm-spawn, fm-send, and fm-control refuse every other session, homes are
never migrated or merged, and an unreadable pin is repaired deliberately rather
than re-derived. A worker records its home's account in its own task metadata
and every later relaunch reuses that record, with a default-store binding
enforced by unsetting an inherited value rather than by omitting one. A second
mate is seeded with its parent's identity, so its own workers stay there too.

An unlisted store takes no state, no lock, and no decision, so default and
personal Claude launches are byte-for-byte what they were.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hf7z9pt5cBPehNNLr7ptCb
The lab tripwire recorded only the session flagged default, and required that
row to be named "default" and to be running. On an operator fleet whose live
work runs in named sessions kept strictly separate, "default" is present but
stopped, so the lab refused to provision at all - while the sessions actually
worth protecting were never in the snapshot, and a passing tripwire proved
nothing about them.

The snapshot now covers every session except the lab's own, so teardown proves
the lab disturbed none of them by name, socket, and running state. That is
strictly stronger than watching one row, and it no longer cares which session
carries the default flag. The lab session is excluded because it legitimately
changes: absent when the tripwire is recorded, present-but-stopped when an
owned lab is re-provisioned.

Two conditions still refuse rather than record, because a snapshot taken under
either proves nothing: no session running, so "unchanged" is vacuous; or more
than one session claiming the default flag, so the fleet is ambiguous.

The fake Herdr client grows a configurable fleet so these shapes are covered:
a stopped default beside running named sessions provisions and tears down, a
change to any watched session fails teardown loudly, a vanished session fails,
and the two refusal conditions leave no tripwire behind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hf7z9pt5cBPehNNLr7ptCb
@doitdigital0495
doitdigital0495 merged commit 02b1d53 into main Sep 4, 2026
13 checks passed
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.

2 participants