Skip to content

fix(bin): inherit config/firstmate-role into secondmate homes - #7515

Closed
Authentis wants to merge 247 commits into
kunchenguid:mainfrom
Authentis:fm/fm-inherit-firstmate-role-1019
Closed

Authentis wants to merge 247 commits into
kunchenguid:mainfrom
Authentis:fm/fm-inherit-firstmate-role-1019

Conversation

@Authentis

@Authentis Authentis commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Add the one remaining inherited-config item the remote host needs: the primary sender emits 16 inherited items but the fork receiver (after PR #21) allows only 15, so pushing config to a remote host fails closed with path is not inherited material: config/firstmate-role and the host cannot respawn. The full sender-vs-receiver diff is exactly one item: config/firstmate-role (the receiver already carries the other 15, including herdr-project-groups from PR #21). Put that diff list in the PR body.

What Changed

  • Added firstmate-role to the default FM_INHERITABLE_CONFIG list in bin/fm-config-inherit-lib.sh. Secondmate homes now inherit it, and the remote receiver (bin/fm-remote-inherit.sh) accepts config/firstmate-role. Before this, the receiver rejected it with path is not inherited material: config/firstmate-role. The header comment now also describes config/herdr-project-groups, which PR feat: manage project agent memory through ship briefs #21 added to the list.
  • Added test B12e (test_remote_receiver_accepts_firstmate_role) to tests/fm-secondmate-harness.test.sh. It checks that the receiver handles both a put and an absent for config/firstmate-role, writing the file and then removing it.

Sender vs. receiver inherited items: the primary sends 16 items. Before this change the receiver allowed 15 of them. The only missing item was config/firstmate-role:

Item Sender Receiver before Receiver after
config/crew-dispatch.json ✓ ✓ ✓
config/dispatch-never-send ✓ ✓ ✓
config/crew-harness ✓ ✓ ✓
config/backlog-backend ✓ ✓ ✓
config/backend ✓ ✓ ✓
config/herdr-presentation-spaces ✓ ✓ ✓
config/herdr-project-groups ✓ ✓ (PR #21) ✓
config/startup-memory-budget ✓ ✓ ✓
config/trace-context ✓ ✓ ✓
config/launch-env-allowlist ✓ ✓ ✓
config/claude-permission-mode ✓ ✓ ✓
config/lavish-axi-host ✓ ✓ ✓
config/keep-ai-trailers ✓ ✓ ✓
config/supervision-host-off ✓ ✓ ✓
data/captain-shared.md ✓ ✓ ✓
config/firstmate-role ✓ ✗ ✓

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The branch's only own change adds one token to the inheritable-config allowlist, plus a receiver test. The other listed files come from history that has already merged; they arrive through a stale pipeline base, and this change doesn't alter them.

Testing

I drove the real sender (fm-remote-inherit-push.sh via fm-on.sh) into a disposable remote secondmate home twice. The SSH hop and remote worker queue were swapped for a local stand-in that execs the receiver under an empty environment. Against the pre-fix receiver the push reproduced the reported fail-closed error on config/firstmate-role. Against the fixed receiver all 16 items went through and the file landed in the remote home. I also computed the sender-vs-receiver item lists from origin/main and both fork revisions using the real lib: the only difference is config/firstmate-role. Adversarial receiver calls (non-inherited path, traversal, wrong directory, digest mismatch) were all refused, and removing firstmate-role propagates. The targeted harness test file, including the new B12e test, passed. The real remote host was not reachable, so the remote side was a local lab home. Everything ran against temporary lab dirs that have been deleted; only the evidence files remain.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Reproduce: primary pushes inherited config to the pre-fix fork receiver and it fails closed with 'path is not inherited material: config/firstmate-role' ✅ pass live before-fix-receiver.txt: 14 items unchanged/pushed, then error: path is not inherited material: config/firstmate-role, exit 1, firstmate-role absent in remote home
Fix: primary pushes all 16 inherited items to the fixed receiver, which accepts config/firstmate-role and writes it into the remote home ✅ pass live after-fix-receiver.txt: pushed: config/firstmate-role, unchanged: data/captain-shared.md, exit 0, 16 transport calls, remote config/firstmate-role = maintainer
Diff: the sender-vs-receiver inherited-item set differs by exactly config/firstmate-role, and the fixed receiver matches the sender ✅ pass live sender-receiver-diff.txt: origin/main 16, 6ec6910 15, dce97ac 16; only diff config/firstmate-role; fixed list identical to sender
Removal: when the primary has no firstmate-role, an absent push removes it from the remote home ✅ pass live adversarial-receiver.txt: removed: config/firstmate-role, exit 0, file-exists=no
Guard: the receiver still refuses non-inherited, wrong-directory and traversal paths and digest-mismatched payloads ✅ pass live adversarial-receiver.txt: config/not-inherited, config/../config/firstmate-role and data/firstmate-role each refused with 'path is not inherited material' (exit 1); digest mismatch refused, nothing wr…
Committed regression test B12e: receiver accepts put and absent for config/firstmate-role ⏸️ untested no The prior payload only recorded an automated test run for this scenario (bash tests/fm-secondmate-harness.test.sh, B12e ok), not a live run against the product, so it did not establish a live result…
Evidence: Pre-fix receiver: push fails closed on config/firstmate-role

Source: Pre-fix receiver: push fails closed on config/firstmate-role

== receiver rev: 6ec6910c; sender: dce97aca
unchanged: config/crew-dispatch.json
unchanged: config/dispatch-never-send
unchanged: config/crew-harness
unchanged: config/backlog-backend
pushed: config/backend
unchanged: config/herdr-presentation-spaces
unchanged: config/herdr-project-groups
unchanged: config/startup-memory-budget
unchanged: config/trace-context
unchanged: config/launch-env-allowlist
unchanged: config/claude-permission-mode
unchanged: config/lavish-axi-host
unchanged: config/keep-ai-trailers
unchanged: config/supervision-host-off
error: path is not inherited material: config/firstmate-role
== push exit status: 1
== shim calls: 15
== remote home config/firstmate-role: cat: /tmp/fm-lab.TOSWRy/remote-home/config/firstmate-role: No such file or directory
== remote home config/backend: herdr
Evidence: Fixed receiver: all 16 items pushed, firstmate-role lands in remote home

Source: Fixed receiver: all 16 items pushed, firstmate-role lands in remote home

== receiver rev: dce97aca; sender: dce97aca
unchanged: config/crew-dispatch.json
unchanged: config/dispatch-never-send
unchanged: config/crew-harness
unchanged: config/backlog-backend
pushed: config/backend
unchanged: config/herdr-presentation-spaces
unchanged: config/herdr-project-groups
unchanged: config/startup-memory-budget
unchanged: config/trace-context
unchanged: config/launch-env-allowlist
unchanged: config/claude-permission-mode
unchanged: config/lavish-axi-host
unchanged: config/keep-ai-trailers
unchanged: config/supervision-host-off
pushed: config/firstmate-role
unchanged: data/captain-shared.md
== push exit status: 0
== shim calls: 16
== remote home config/firstmate-role: maintainer
== remote home config/backend: herdr
Evidence: Sender vs receiver inherited-item diff

Source: Sender vs receiver inherited-item diff

primary sender (origin/main 45dd50a5) items: 16 pre-fix fork receiver (6ec6910c, after PR #21) items: 15 fixed fork receiver (dce97aca) items: 16 -- in sender, missing from pre-fix receiver: config/firstmate-role -- in pre-fix receiver, missing from sender: -- sender vs fixed receiver: (identical)

primary sender (origin/main 45dd50a5) items: 16
pre-fix fork receiver (6ec6910c, after PR #21) items: 15
fixed fork receiver (dce97aca) items: 16
-- in sender, missing from pre-fix receiver:
config/firstmate-role
-- in pre-fix receiver, missing from sender:
-- sender vs fixed receiver:
(identical)
Evidence: Receiver adversarial checks

Source: Receiver adversarial checks

== absent config/firstmate-role (primary removed it; removal propagates)
removed: config/firstmate-role
exit=0 file-exists=no
== put config/not-inherited (must refuse)
error: path is not inherited material: config/not-inherited
exit=1
== put config/../config/firstmate-role (traversal spelling must refuse)
error: path is not inherited material: config/../config/firstmate-role
exit=1
== put data/firstmate-role (wrong directory must refuse)
error: path is not inherited material: data/firstmate-role
exit=1
== put config/firstmate-role with bytes not matching digest commitment (must refuse)
error: inherited material digest does not match its commitment
exit=1 file-exists=no
Evidence: Live push driver script

Source: Live push driver script

#!/usr/bin/env bash
# Live driver: the real sender (bin/fm-remote-inherit-push.sh -> bin/fm-on.sh
# from the run worktree) pushes the full inherited set to a disposable "remote"
# secondmate home whose receiver code root is extracted at RECV_REV. Only the
# SSH hop and remote worker queue are replaced by a local transport shim that
# decodes fm-on.sh's protocol argv and execs <root>/bin/<cmd> under an empty
# environment with FM_HOME=<home>, as the remote entrypoint's worker does.
# Usage: drive-remote-inherit.sh <worktree> <receiver-rev> <lab-dir>
set -u
WT=$1; RECV_REV=$2; LAB=$3
mkdir -p "$LAB/primary/config" "$LAB/primary/data" "$LAB/remote-home/config" "$LAB/remote-home/data" "$LAB/bin" "$LAB/recv-root"
git -C "$WT" archive "$RECV_REV" bin | tar -x -C "$LAB/recv-root" -f -
cat > "$LAB/bin/ssh" <<'SH'
#!/usr/bin/env bash
while [ "$1" != -- ]; do shift; done; shift
host=$1
root=$(printf '%s' "$4" | base64 -D)
home=$(printf '%s' "$5" | base64 -D)
args=(); while IFS= read -r -d '' a; do args+=("$a"); done < <(printf '%s' "$6" | base64 -D)
printf 'ssh-shim host=%s root=%s cmd=%s\n' "$host" "$root" "${args[*]}" >> "$LAB_LOG"
exec env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin FM_HOME="$home" bash "$root/bin/${args[0]}" "${args[@]:1}"
SH
chmod +x "$LAB/bin/ssh"
printf -- '- remote - lab remote (host: remote-lab; root: %s; home: %s; scope: lab; projects: none; added 2026-10-19)\n' \
  "$LAB/recv-root" "$LAB/remote-home" > "$LAB/primary/data/secondmates.md"
printf 'maintainer\n' > "$LAB/primary/config/firstmate-role"
printf 'herdr\n' > "$LAB/primary/config/backend"
echo "== receiver rev: $(git -C "$WT" rev-parse --short "$RECV_REV"); sender: $(git -C "$WT" rev-parse --short HEAD)"
LAB_LOG="$LAB/ssh.log" FM_HOME="$LAB/primary" FM_ROOT_OVERRIDE="$WT" \
  FM_CONFIG_OVERRIDE="$LAB/primary/config" FM_DATA_OVERRIDE="$LAB/primary/data" \
  FM_SSH_BIN="$LAB/bin/ssh" bash "$WT/bin/fm-remote-inherit-push.sh" remote 7
status=$?
echo "== push exit status: $status"
echo "== shim calls: $(wc -l < "$LAB/ssh.log" | tr -d ' ')"
echo "== remote home config/firstmate-role: $(cat "$LAB/remote-home/config/firstmate-role" 2>&1)"
echo "== remote home config/backend: $(cat "$LAB/remote-home/config/backend" 2>&1)"
exit $status
Evidence: Diff + adversarial driver script

Source: Diff + adversarial driver script

#!/usr/bin/env bash
# Usage: diff-and-adversarial.sh <worktree> <lab-with-fixed-receiver> <evidence-dir>
set -u
WT=$1; L=$2; EV=$3
T=$(mktemp -d /tmp/fm-lab.XXXXXX)
items() { # <rev> <name>: the inherited item list as the real lib emits it at <rev>
  mkdir -p "$T/$2"
  git -C "$WT" archive "$1" bin | tar -x -C "$T/$2"
  env -u FM_INHERITABLE_CONFIG bash -c ". '$T/$2/bin/fm-config-inherit-lib.sh'; fm_config_inherit_items" | sort
}
items origin/main sender > "$T/s"
items 'dce97aca^' recvbefore > "$T/rb"
items HEAD recvafter > "$T/ra"
{
  echo "primary sender (origin/main $(git -C "$WT" rev-parse --short origin/main)) items: $(wc -l < "$T/s" | tr -d ' ')"
  echo "pre-fix fork receiver (6ec6910c, after PR #21) items: $(wc -l < "$T/rb" | tr -d ' ')"
  echo "fixed fork receiver (dce97aca) items: $(wc -l < "$T/ra" | tr -d ' ')"
  echo "-- in sender, missing from pre-fix receiver:"; comm -23 "$T/s" "$T/rb"
  echo "-- in pre-fix receiver, missing from sender:"; comm -13 "$T/s" "$T/rb"
  echo "-- sender vs fixed receiver:"; diff "$T/s" "$T/ra" && echo "(identical)"
} > "$EV/sender-receiver-diff.txt" 2>&1
cat "$EV/sender-receiver-diff.txt"
echo

R=$L/recv-root/bin/fm-remote-inherit.sh; H=$L/remote-home
E=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X=$(printf 'x\n' | shasum -a 256 | cut -c1-64)
rx() { env -i PATH=/usr/bin:/bin FM_HOME="$H" bash "$R" "$@"; }
exists() { [ -e "$H/config/firstmate-role" ] && echo yes || echo no; }
{
  echo "== absent config/firstmate-role (primary removed it; removal propagates)"
  rx absent config/firstmate-role 0 "$E" 8; echo "exit=$? file-exists=$(exists)"
  echo "== put config/not-inherited (must refuse)"
  printf 'x\n' | rx put config/not-inherited 2 "$X" 9; echo "exit=$?"
  echo "== put config/../config/firstmate-role (traversal spelling must refuse)"
  printf 'x\n' | rx put config/../config/firstmate-role 2 "$X" 9; echo "exit=$?"
  echo "== put data/firstmate-role (wrong directory must refuse)"
  printf 'x\n' | rx put data/firstmate-role 2 "$X" 9; echo "exit=$?"
  echo "== put config/firstmate-role with bytes not matching digest commitment (must refuse)"
  printf 'evil\n' | rx put config/firstmate-role 5 "$X" 10; echo "exit=$? file-exists=$(exists)"
} > "$EV/adversarial-receiver.txt" 2>&1
cat "$EV/adversarial-receiver.txt"
rm -rf "$T"

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ tests/fm-crew-state.test.sh - merge conflict rebasing onto origin/main
⚠️ **Review** - 2 infos
  • ℹ️ bin/fm-config-inherit-lib.sh:87 - Adding firstmate-role to FM_INHERITABLE_CONFIG also makes this fork's local propagation copy the primary's raw config/firstmate-role into local secondmate homes, and makes a fork-run sender push raw bytes. Upstream (7df545b) instead publishes the resolved role (fm_role_inherit_payload) and commits a local receipt (.fm-inherit-firstmate-role.generation). This fork has no fm-role-lib.sh and nothing reads firstmate-role, so the copy has no effect today. Upstream's resolver also rejects a grant that has no matching receipt, so it fails closed. On the remote route, the receiver already writes the generation receipt. The order and set of the new list now match origin/main exactly (16 items), and the intent's one-item sender-vs-receiver diff holds. No action is needed. This is only a note for a later merge of upstream's role-lib.
  • ℹ️ bin/fm-config-inherit-lib.sh:87 - Pipeline base 6407052 is stale. The diff to it includes 209 files from already-merged history (PRs docs: tighten captain-facing communication #16, feat: add authoritative review diff helper #17, the upstream merge and PR feat: manage project agent memory through ship briefs #21, ending at merge 6ec6910). This branch's own change, 6ec6910..dce97ac, touches only bin/fm-config-inherit-lib.sh (adds firstmate-role to FM_INHERITABLE_CONFIG) and tests/fm-secondmate-harness.test.sh. None of the other listed files are changed by this branch's commit, and the diff has no conflict markers. No action needed.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Reproduce: primary pushes inherited config to the pre-fix fork receiver and it fails closed with 'path is not inherited material: config/firstmate-role' ✅ pass live before-fix-receiver.txt: 14 items unchanged/pushed, then error: path is not inherited material: config/firstmate-role, exit 1, firstmate-role absent in remote home
Fix: primary pushes all 16 inherited items to the fixed receiver, which accepts config/firstmate-role and writes it into the remote home ✅ pass live after-fix-receiver.txt: pushed: config/firstmate-role, unchanged: data/captain-shared.md, exit 0, 16 transport calls, remote config/firstmate-role = maintainer
Diff: the sender-vs-receiver inherited-item set differs by exactly config/firstmate-role, and the fixed receiver matches the sender ✅ pass live sender-receiver-diff.txt: origin/main 16, 6ec6910 15, dce97ac 16; only diff config/firstmate-role; fixed list identical to sender
Removal: when the primary has no firstmate-role, an absent push removes it from the remote home ✅ pass live adversarial-receiver.txt: removed: config/firstmate-role, exit 0, file-exists=no
Guard: the receiver still refuses non-inherited, wrong-directory and traversal paths and digest-mismatched payloads ✅ pass live adversarial-receiver.txt: config/not-inherited, config/../config/firstmate-role and data/firstmate-role each refused with 'path is not inherited material' (exit 1); digest mismatch refused, nothing wr…
Committed regression test B12e: receiver accepts put and absent for config/firstmate-role ⏸️ untested no The prior payload only recorded an automated test run for this scenario (bash tests/fm-secondmate-harness.test.sh, B12e ok), not a live run against the product, so it did not establish a live result…
  • drive-remote-inherit.sh &lt;wt&gt; dce97aca^ &lt;lab&gt;: real bin/fm-remote-inherit-push.sh → bin/fm-on.sh → receiver code root at 6ec6910c (pre-fix) in a disposable remote home, with a local stand-in for the SSH hop
  • drive-remote-inherit.sh &lt;wt&gt; HEAD &lt;lab&gt;: the same push against the fixed receiver (dce97aca)
  • diff-and-adversarial.sh: fm_config_inherit_items taken from origin/main (primary sender), 6ec6910c and dce97aca, compared with comm/diff
  • Receiver adversarial calls: fm-remote-inherit.sh absent config/firstmate-role, put config/not-inherited, put config/../config/firstmate-role, put data/firstmate-role, put config/firstmate-role with mismatched digest
  • bash tests/fm-secondmate-harness.test.sh (includes the new B12e firstmate-role receiver test): exit 0, 58 ok, no failures
⚠️ **Document** - 1 info
  • ℹ️ .agents/skills/operational-home-layout/SKILL.md:24 - config/firstmate-role is now in FM_INHERITABLE_CONFIG (bin/fm-config-inherit-lib.sh:87), but this fork has no reader and no documentation for it: bin/fm-role-lib.sh is absent and the upstream commit 7df545b is not an ancestor. That commit documents the item in docs/configuration.md "Firstmate role" and in the operational-home-layout config inventory. The secondmate-provisioning contract points to fm_config_inherit_items as the owner of the inherited set, so no existing doc became stale. I did not add a layout entry, because it would describe a feature this fork doesn't implement. Upstream also says firstmate-role is inherited under a resolved-role/receipt policy, 'not as a raw copy of the primary file', while this fork copies it raw. When the role feature is ported, its docs (configuration.md section plus the layout inventory line) should come with it.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

holu and others added 30 commits September 18, 2026 10:49
…ests

The imported steward-exemption tests used bare GNU-only `sed -i`,
which fails under BSD/macOS sed with no backup suffix argument.
Match the repo's existing sed -i.bak convention.
…osures

reconcile close requires a board-created reconcile request, so an OPEN
DECISIONS reconciliation that finds a moot call with no pending request
has no truthful completion path, and closing it under answer would
fabricate captain provenance for words the captain never gave.

Add fm-captain-hold.sh rule: it records the same evidentiary standard as
reconcile close (a non-empty evidence file, never an assertion) under a
distinct Firstmate ruling label, closes an actively held call without the
board-request precondition, and retroactively attaches the same record to
a task already closed with no resolution record so a truthful ordinary
closure can satisfy verify without impersonating a captain answer. An
exact retry is idempotent; drifted evidence or an incompatible existing
resolution mode is refused rather than relabeled.
(cherry picked from commit 9d00a76d8b22ae39c72d20256c600737b9820129)
The registered `axi respond --action fix --findings <ids>` interface only
advances the findings a round selects; an unselected finding is not
re-surfaced by the tool's own output on a later round and had no durable
firstmate-side record, so a worker could report everything addressed while
silently dropping open findings (observed run 01M1TB9ZZQGN0JQ1RYV3WERD4S,
review round3).

Add bin/fm-nm-findings-lib.sh as the single owner of a durable, append-only
JSONL finding-retention ledger and its fold/report/completion logic: every
finding a gate presents is retained under its original identity, verbatim
text, and provenance until an explicit fixed/skipped-closed/deferred
disposition names it, with deferred requiring both an external owner and id.
A disposition for a finding never seen is not fabricated into a closure, and
an absent or malformed ledger degrades safely rather than erroring.

Wire the worker-side contract into bin/fm-dod-lib.sh's no-mistakes
Definition-of-done block and its ask-user escalation block (both single
policy owners), so a driving worker hand-appends to the ledger at every gate
and folds it before reporting done, and extend the two fm_dod_block call
sites (bin/fm-brief.sh, bin/fm-promote.sh) with the data-dir argument the new
ledger path needs.

(cherry picked from commit a5ac620d184655e256e53989569a9ffa2f2f927e)
A spawn whose treehouse-get never reaches an isolated worktree refused
at the deadline but left the window it had just created behind: no task
record named it, nothing else could ever close it, and the clean retry
refused on "window <session>:fm-<id> already exists".

The abort trap now runs a transactional rollback that closes exactly the
endpoint this spawn created, and only after proving it still answers as
this spawn's own endpoint, holds no agent and no composer work, has no
task record (partial ones included), and acquired no isolated copy - so
a pre-existing or replaced endpoint is never closed and no project path
or other task's worktree is touched. Armed on tmux and herdr, the
backends whose liveness classifier is recovery-grade; disarmed the
moment the task record publishes and teardown takes ownership.

Adds executable race/negative tests: the incident's refused-isolation
shape rolls its window back and retries cleanly, and pre-existing
window, partial metadata, and live agent each block the rollback.

(cherry picked from commit ea4715d91c8c45dd2867e9eaa313020d25dec83a)
Absorbs:
- daaffdb fix(bin): create captain-hold rows when Beads requires due (kunchenguid#4854)
- 1bb72cc fix: disable compact adviser for spawned agents (kunchenguid#4877)
Absorbs:
- 4812db8 fix(bin): preserve Claude lock ownership after helper recycling (kunchenguid#4894)
- 65a3bac feat: park main under the away posture on Pi (kunchenguid#4889)
- 2bcb88c ci: standardize workflow timeouts into three tiers (kunchenguid#4910)
A separated Pi composer was rejected while the agent was working, leaving lifecycle restart unable to queue a control command. Admit working only after the existing identity and blank-pair proof; blocked Pi panes still defer because their prompts intercept input.
…fresh-20260920

# Conflicts:
#	docs/architecture.md
Defect: when `no-mistakes axi status`'s overview is truncated (a task's
own branch has zero rows among the shown ones), fm_nm_select_run's
Python fallback derived the repo identity for its direct SQLite query
from a `repo: <path>` line it expected in the overview text. The real
CLI never emits that line, truncated or not (see the genuine capture at
tests/captures/no-mistakes-v1.70.1/overview.toon, which has only
`count:`/`runs[...]:`), so the lookup always failed and reported
"unreadable runs table" for a task that simply has no run on its
branch. On a fleet with many concurrent runs, every idle-branch task
hits the truncated-overview path routinely, so this fired every few
minutes and drowned genuine unreadable/blocked verdicts in noise.

Fix: derive the repo identity from the task worktree path instead,
which is exactly the value `no-mistakes` records as a repo's
`working_path` (confirmed against the existing capped-overview test
fixtures, which already register repos by worktree path). A worktree
path that is not absolute cannot be matched and still reads as
unreadable rather than being guessed at. Also raise the reader's
SQLite busy timeout from 1s to 30s so ordinary lock contention on a
busy fleet cannot masquerade as an unreadable database.

Safety: every other verdict byte-for-byte unchanged - the repo lookup
still requires exactly one matching row (a genuinely corrupt or
mismatched repos table still reports unreadable, per the existing
`repo` failure-mode test), the branch query and row validation are
untouched, and a zero-row result for the branch still flows through
the same recursive re-parse that already turns an empty `runs[0]{...}`
table into `absent`. Added a regression test
(test_capped_overview_without_repo_line_and_no_runs_reports_absent)
that reproduces the real overview shape - capped, zero rows for the
task's branch, no `repo: ` line - and asserts the crew state falls
through to the pane/busy verdict instead of reporting unknown or
"unreadable". Full fm-crew-state.test.sh suite passes unchanged
otherwise.
Two independent defects in the published --secondmate-home-summary path
made a healthy home read as invalid, burying real alarms under false ones.

1. bin/fm-nm-run-lib.sh: a pooled lane is a git worktree whose
   `git rev-parse --git-common-dir` resolves to the primary checkout, and
   the no-mistakes daemon files every lane's runs under ONE repo row keyed
   by that primary path. fm_nm_select_run's capped-overview reader looked
   up repository identity by the lane's own exact worktree path, which
   never matches that row, so a live run on the lane's branch was reported
   as "complete same-branch run inventory unreadable" - unknown run-step,
   which then surfaced as child_current_unavailable. The reader now also
   tries the lane's resolved primary-checkout path (derived from its
   common dir) as a second identity candidate, and, when neither path
   matches a repo row, falls back to a runs-by-branch lookup that is
   trusted only when the branch resolves to exactly one repo_id (two repos
   coincidentally sharing a branch name stays unresolved, preserving the
   cross-repo safety the exact-path lookup exists for). A genuinely
   unreadable database still reports unreadable.

2. bin/fm-fleet-snapshot.sh: unknown_children can only exempt a child via
   a steward exemption when a matching "hold" identity row exists in
   durable_steward_rows, and that row was synthesized from live
   current-state only for the parked/paused/blocked states - never for
   unknown or stopped, the two states unknown_children actually gates on.
   A plain in-flight child with no backlog hold at all (current_role ==
   "worker") could therefore never be exempted once its endpoint read
   unknown or stopped: even a fully valid, date-current,
   state-and-detail-matching steward exemption stayed permanently
   inactive, and the home stayed invalid. The child-state row generator
   now also fires for unknown and stopped, matching the doc comment at the
   top of the file, which already promised this coverage. A record with no
   matching exemption at all is unaffected and still reads unknown.
Authentis and others added 27 commits October 12, 2026 11:58
The main-only pass-through cases leave their successor watcher running by
design, and none ended its fake session, so four watcher cycles at the suite's
one-second poll and five session loops ran through every later case. On a
loaded host that starved timing-bound cases further down the file. Each case
now ends its session and stops its watcher before it passes.
The gate review receives rulings only through --intent, so a new or restarted
run re-raised findings the supervisors had already closed, deferred, or bounded.
The no-mistakes contract now tells the worker to re-read its steering inbox
before every run and restart and end --intent with one verbatim, narrowing-only
rulings block, omitted when the inbox holds no ruling.
…sh spawn (#12)

* fix(bin): wait a bounded time for the shared Treehouse project lock on a fresh spawn

A fresh Treehouse-backed spawn took the shared project lock with a single try, so a brief teardown or return made the lane refill error out. Poll for up to FM_SPAWN_TREEHOUSE_LOCK_WAIT_SECS (default 120) then make one final try, keeping the exact refusal; dead holders are still reclaimed at once.

* no-mistakes(review): Wait for Treehouse project lock before taking task-set lock
…niture, not the composer

With a slash command typed, Claude Code 2.1.296 draws the menu's selected row as an indented glyph row under the composer's closing rule.
That row won as the bare composer, so the content became the typed command plus the whole menu, the post-send payload proof refused a payload that had landed, and the send returned send-failed.
A glyph row directly under the envelope, indented deeper than the composer's own glyph row, now starts a menu run whose indented rows are footer furniture.
…menu furniture, not the composer"

This reverts commit 0022b0e.
…ented same-glyph row

With a slash command typed, Claude Code 2.1.296 draws a menu of matching commands under the composer's closing rule and selects one entry with the proving glyph.
That selected row won as the bare composer, so the content became the typed command plus the whole menu and the post-send payload proof refused a payload that had landed.
The footer-zone walk now counts the menu as furniture only when it is positively one: a claude-proven envelope, rows that are a /name token plus a description column or the wrapped rest of a description, and at most one selected entry at any position.
An indented glyph row that is not such an entry stays a live composer, so a draft there still reads non-empty and refuses the next send.
…indented entry

A lone '/name  text' row under a composer's closing rule matched the menu-entry shape, so an indented live draft and its wrapped continuation were swallowed as furniture and the composer read empty.
A menu block now stands only when its entries share one description column, its continuation rows sit exactly at that column, the composer row holds slash text, and a single entry prefix-matches that text.
Anything else stays composer content and keeps refusing the next send.
Non-consecutive entries split by a furniture row met the two-entry threshold together, so two live draft rows around the permission-mode hint read as one menu and hid both payload lines.
A furniture row after a menu entry now ends the block, and any menu-shaped row after that refuses the zone.
… claude pane with a rule-bounded composer

The slash-menu exemption moved verdicts toward empty for every harness, so each review found another menu-shaped draft it could swallow.
The extractor now takes the caller's pane identity and the classifier asks for it through the existing lazy identity pass, and the exemption applies only when that identity is claude and the composer's closing row is a solid rule.
Codex, pi, and unidentified panes, and boxed or left-bar composers, keep every menu-looking row as content by construction.
The herdr send proof passes the identity it already probed.
…tody

A finished lane's no-mistakes run can end with its fix commits only in the
pipeline's own gate repository and the branch still pipeline-held
(branch_sync.next_action.code recover_custody). Cleaning the lane up then
deletes a branch whose unpublished fixes are not in the copy, and each such
lane needed a manual ruling to get its custody back.

axi sync has no run selector, so a teardown that ran it could act on a run
other than the one it checked. Teardown therefore never runs it: when the
structured status names this branch and this copy's HEAD as the local head and
offers recover_custody, it refuses with the exact manual command, the worktree
path shell-quoted so it can be pasted as typed, and deletes nothing. --force
does not lift the refusal, since it authorizes discarding the lane's own
earlier work and not the pipeline's unpublished fix commits.
Fork keeps: review-receipt gate docs, trim-guard hardening, no-mistakes
mirror tests, squash-preserve behavior and its tests. Upstream brings:
Forgejo tea merge path, wake-fold/Codex-checkpoint docs, FORGE_RULE_LINE
scaffold refactor, Forgejo teardown tests.
…test shard (#16)

* fix(tests): repair the eight baseline CI failures on the fleet fork

Reconcile fixtures and one type error with behavior that already landed:
Pi extension handlers narrow the before_agent_start event union before
reading prompt; Pi secondmate fixtures name an explicit model and run the
first-call fake; the wake-fold suite follows the scan exclusion of a remote
mate's own parent channel; the kimi launch expectation carries the spawner
PATH export; and three lint findings are cleared.

* no-mistakes(test): Make busy-adapter and session-start test fixtures hermetic

* fix(tests): give the supervision-host test its own portable serial shard

The hosted rerun of Behavior portable serial 2 was cancelled at the 30-minute
limit: tests/fm-supervision-host.test.sh took 1030s and then 1620s against a
789s planning hint, and the planner had packed about 150s of other scripts
behind it. Raise its hint to the lane budget so the planner leaves it alone in
its shard, require that isolation in the runner test, and record the reason in
the shard doc. No test is skipped and no timeout changes.

* no-mistakes(document): Fix stale wake-fold echo reference in supervision-host docs

---------

Co-authored-by: Authentis <authentis@users.noreply.github.com>
… each launch took a turn (#17)

* feat(bin): check worker models against the harness catalog and verify each launch took a turn

Adds the launch-check verb, the shared Pi/OpenCode catalog rule, launch-registered provider handling, and the custody-first completed/held/failed verdicts, with regression and live-guard tests.

* no-mistakes(document): Align control-plane docs with the launch-check verb

* no-mistakes(review): Remove host-load rule from worker briefs and its test
fix(bin): inherit herdr project-groups config into secondmate homes
@Authentis

Copy link
Copy Markdown
Contributor Author

Closed without merging: opened against the wrong base by mistake. The correct carrier is Authentis#22 (fork main).

@Authentis Authentis closed this Oct 19, 2026
@Authentis
Authentis deleted the fm/fm-inherit-firstmate-role-1019 branch October 19, 2026 01:47
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