Skip to content

feat(bin): sync upstream firstmate main into the fork - #17

Merged
JacyAnderson merged 138 commits into
mainfrom
upstream-sync-2
Sep 29, 2026
Merged

JacyAnderson merged 138 commits into
mainfrom
upstream-sync-2

Conversation

@JacyAnderson

@JacyAnderson JacyAnderson commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Brings the fork up to date with upstream firstmate through eb219c8 (132 upstream commits since the f5735dc sync) with a real merge, so the fork's published history stays intact.

Since the last sync, upstream moved most of AGENTS.md into on-demand skills (operational-home-layout, ship-landing, scout-completion, agent-skill-trigger-index, and others). It added a per-project ship-branch prefix (branch=<prefix> in the registry, resolved by fm-project-mode.sh --branch-prefix, recorded as branch= in task meta). It added Gerrit forge support to the delivery contract and PR poll, a shared-infrastructure brief rule, and AI co-author trailer stripping on worker commits. Each fork change was carried onto that structure, or dropped where upstream now covers it.

Upstream fixes that matter to this fleet

  • Resumed workers now enter their recorded worktree (fa48367), so a relaunched worker starts in the directory its work lives in.
  • fm-pr-merge.sh accepts a task's next PR after its bound PR merges (eb219c8), and refuses merges while required checks are unreported (8d2ee29).
  • The live harness gate is guarded against Claude Code's auto-updater (29213a0), and manual Claude Stop hook calls do not arm supervision (b3dbc67).
  • Worker commits have AI co-author trailers stripped (83a4bbd), with a config/keep-ai-trailers opt-out (bff6454). This backs the fork's repo-text rule that commits carry no agent co-author.
  • Workers are cleaned up after their PRs land (ada21f5), green no-mistakes PRs awaiting merge are surfaced (d92cea0), and cancelled validation runs do not report false failures (9d56cf6).
  • Crewmate briefs forbid administering the shared worktree pool (0d983d2).
  • tasks-axi add/create --start is refused (977a81e), and the lavish-axi floor rose to 0.1.77.

Fork changes and how each landed

  • Mission Control board (skill, doc, server, poll, seed, and tests): carried unchanged. Its section 13 trigger line moved into upstream's agent-skill-trigger-index skill, and its data/mission-control/ and state/mission-control/ layout entries moved into operational-home-layout.
  • PR review-comment wakes (pr-comments +N): carried. The pr-comments +N wake-handling line in AGENTS.md section 8 merged without conflicts. The <id>.pr-comments layout entry and the "merge and review-comment poll" wording moved into operational-home-layout and ship-landing. The fm-pr-check.sh and fm-pr-poll.sh headers were combined with upstream's Gerrit text, and comment detection is documented as GitHub and GitLab only, because a Gerrit change is polled for its merge alone.
  • Repo-text rule (docs/repo-text-rule.md, fm-text-check.sh, rule 8 in briefs, PR description rewrite): carried. Rule 8 renders after upstream's new shared-infrastructure rule 7 in both ship and scout scaffolds. The rule 8 PR-description steps sit in upstream's restructured fm_dod_block (direct-PR and no-mistakes on the pull-request forge). The PR view placeholder now reads <number> to match upstream's non-draft check.
  • Bare task branch names without fm/: adapted. Upstream now has a per-project prefix that defaults to fm/. The fork keeps its bare <id> default on that mechanism: one constant, FM_DEFAULT_BRANCH_PREFIX in the new bin/fm-branch-prefix-lib.sh, is empty and is read by fm-project-mode.sh, fm-brief.sh, fm-spawn.sh, fm-promote.sh, and fm-dod-lib.sh. The registry parser and the script flag defaults therefore agree, and a missed --branch-prefix flag still yields the bare branch. A project can opt into a prefix with branch=fix/ or branch=fm/ in the registry. The spawn's registry mismatch notice now says the branch will not follow the project's registered naming. The upstream tests that asserted the fm/<id> default now assert the bare default, and explicit fm/ cases remain where a test passes or registers that prefix. The fork's legacy handling was adapted to upstream's recorded branch= meta field: a task record from before that field existed names no branch, and fm-merge-local.sh, fm-review-diff.sh, and fm-spawn.sh --relaunch now use the bare <id> branch when it exists and fm/<id> otherwise. That covers tasks started under the fork's naming, including ones in flight during this upgrade. One narrow gap remains: a relaunch of such a record whose worktree= is missing or gone cannot probe for the bare branch and records fm/<id>. Bearings maps a PR head to a task without a recorded branch by either form.
  • Configurable worktree wait (FM_SPAWN_WORKTREE_TIMEOUT): carried. Upstream still hard-codes 60 seconds. The test's secondmate home fixture is now a git repository, because upstream's spawn installs trailer-strip hooks into the home and refuses a non-repository.
  • Done-archive lookup for answered captain calls in fm-captain-hold.sh: carried unchanged. Upstream restructured docs/captain-hold-lifecycle.md into sections and bullets, so the archive paragraph now sits under "Checking before scout teardown" and the archive regression is a bullet under "Completion and verification".
  • no-mistakes-required.yml exempting JacyAnderson, the .tasks.toml archive-key note, and the FM_CHECK_INTERVAL wording in docs/configuration.md: carried; they merged without conflicts.
  • CI's Bearings test count: bumped to 61, which is upstream's 60 plus the fork's bare-and-legacy branch mapping test.
  • The fork's promoted-worker relaunch assertions in tests/fm-control-relaunch.test.sh: carried onto upstream's version of the file, now reading the shared bare default. A new case in the same file covers the branchless-record relaunch.

Conflict notes

Each entry lists the conflicting file, what each side changed, and how it was resolved.

Recurring hotspot: the ship-branch default. Upstream hard-codes fm/ as the default prefix in fm-project-mode.sh, fm-brief.sh, fm-spawn.sh, fm-promote.sh, and fm-dod-lib.sh, in their header comments, in AGENTS.md section 7, README.md, and docs/architecture.md, and in the tests that assert fm/<id>. The fork's default is the bare <id>, held in one constant in bin/fm-branch-prefix-lib.sh. Every future sync should expect conflicts or silent reintroductions of fm/ in these places. Grep the incoming diff for fm/ and route any new default back to that constant. An early resolution of this sync kept the bare default only in the registry parser. Review rejected that, because a missed flag then silently produced fm/<id>.

  • AGENTS.md (3 hunks): upstream replaced the section 2 layout block with a pointer to operational-home-layout, replaced the section 7 PR-ready and landing text with a pointer to ship-landing, and replaced the section 13 list with a pointer to agent-skill-trigger-index. The fork had edited all three (Mission Control layout entries, pr-comments entry, review-comment poll wording, mission-control trigger). Resolution: take upstream's pointers, then port each fork line into the skill that now owns it.
  • bin/fm-bearings-snapshot.sh: upstream maps a PR head to a task by its recorded branch= meta, with an fm/ fallback, reading tasks from a temp file. The fork mapped bare heads through a task-id list. Resolution: upstream's structure, plus a task without a recorded branch also matching a bare head equal to its id. The fork's TASK_IDS list was removed.
  • bin/fm-brief.sh (4 hunks): header paragraphs, the rule 7 block (upstream's $SHARED_INFRA_RULE versus the fork's inline daemon rule plus $RULE8), and the branch checkout line. Resolution: keep both header paragraphs, dropping the fork's --mode is refused sentence that upstream's --mode, --forge, and --shape sentence supersedes. Render $SHARED_INFRA_RULE then $RULE8. Take upstream's git checkout -b $BRANCH_Q --.
  • bin/fm-dod-lib.sh (2 hunks): upstream added the forge gate and branch argument to fm_ship_rule_one, and split fm_dod_block into forge-specific cases. The fork had put $id into the rule text and added the rule 8 PR description steps. Resolution: upstream's structure. The rule 8 clause goes into the direct-PR:* block, and the no-mistakes rewrite lines merged into the no-mistakes:* block.
  • bin/fm-merge-local.sh (2 hunks) and bin/fm-review-diff.sh: upstream reads the branch from meta with an fm/<id> fallback. The fork looped over bare and fm/ candidates. Resolution: upstream's meta read, with the fallback checking for a bare <id> branch first.
  • bin/fm-pr-check.sh and bin/fm-pr-poll.sh (header comments): upstream added Gerrit, and the fork added review-comment detection. Resolution: combined headers. The poll body merged without conflicts, and Gerrit's case stays merge-only.
  • bin/fm-promote.sh (2 hunks): the fork's bare branch versus upstream's $BRANCH_Q. Resolution: upstream's version, with its fm/ default replaced by the shared empty default.
  • bin/fm-test-run.sh: the fork added fm-text-check.test.sh, and upstream added fm-timeout-lib.test.sh to the same family list. Resolution: keep both.
  • docs/architecture.md: the ship-branch sentence. Resolution: upstream's wording with the bare <id> default. The registry paragraph's "(default fm/)" was updated the same way.
  • docs/captain-hold-lifecycle.md (2 hunks): upstream restructured the verify and verification-record sections into lists. Resolution: upstream's structure, with the fork's archive paragraph and regression bullet re-added in the matching sections.
  • docs/scripts.md: the fork's fm-text-check.sh row and review-comment wording versus upstream's fm-pr-check.sh and fm-pr-merge.sh rows. Resolution: keep the fork's row, use upstream's two rows, and add "and review-comment poll" to the fm-pr-check.sh row.
  • tests/fm-bearings-snapshot.test.sh, tests/fm-review-diff.test.sh (2 hunks each): each side added a test at the same spot. Resolution: keep both tests and both invocations.
  • tests/fm-brief.test.sh (2 hunks): each side added a test at the same spot. Resolution: keep both. The fork's bare-branch test resolves the prefix through fm-project-mode.sh the way intake does.
  • tests/fm-task-delivery.test.sh: the promoted-worker checkout assertion. Resolution: upstream's form, updated to the bare default. The project-mode prefix test now expects the empty default and gains a branch=fm/ case.
  • Merged without conflicts, but needed follow-up: tests/fm-control-relaunch.test.sh (upstream's version updated to the bare default, plus the branchless-record case; its Pi relaunch case's sed call was also made portable to macOS), tests/fm-merge-local.test.sh (the missing-branch case now matches upstream's error text), tests/fm-spawn-worktree-settle.test.sh (the secondmate home is now a git repository), tests/fm-fleet-ledger.test.sh (its task branch is now the bare <id>), and .github/workflows/ci.yml (Bearings count).

Verification

  • bin/fm-lint.sh in CI mode (ShellCheck 0.11.0 over the full canonical set, plus actionlint 1.7.12) passes.
  • bin/fm-doc-audience-check.sh passes.
  • The full suite (bin/fm-test-run.sh --all, serial) ran 5110 passing checks. 21 scripts failed, and none of the failures is in code this merge touches. Sixteen are Herdr lab and Herdr end-to-end suites that cannot prepare an isolated lab session on this machine, and fm-afk-launch's Herdr case fails the same way. fm-backend (zsh sourcing the Herdr adapter), fm-extension-binding (a permission-denied rename in its fixture), and fm-wake-queue (an oversized unread status line) fail identically on a plain extract of upstream eb219c8. fm-procevent fails one timing-sensitive case, a different one on each run, and upstream fails the same way. fm-pr-check-security failed one watcher-cycle case under full-suite load and passed when rerun alone.
  • The suites for every file the merge resolved or changed pass on their own: brief, task delivery, merge-local, review diff, Bearings snapshot, PR check and poll, captain-hold lifecycle, text check, Mission Control and its seed, tangle guard, spawn worktree settle, teardown, PR merge, fleet snapshot view, test runner, and documentation audiences.
  • tests/fm-control-relaunch.test.sh's upstream case "Herdr Pi relaunch should complete" failed on macOS on both this branch and plain upstream eb219c8, because it used GNU-only sed -i and needed a real pi binary. The test now uses a portable sed and a stub pi, and the suite passes. That test-only change is worth offering upstream.
  • The new branchless-record relaunch case fails against the merge without the bare-branch fallback in fm-spawn.sh and passes with it.

Review also moved the default into the shared constant, reworded the spawn's mismatch notice, and suppressed ShellCheck's SC2034 on that constant, which only sourcing scripts read. Tests made the Pi relaunch case's sed call portable to macOS. CI caught one more upstream test that assumed the fm/ default: tests/fm-fleet-ledger.test.sh now creates its task branch as the bare <id>, and all 19 checks pass.

After merge, this fleet needs bin/fm-update.sh to pick up the change. Projects that should use fm/ branches need branch=fm/ in data/projects.md.

This PR was prepared with AI assistance.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ⚠️ bin/fm-promote.sh:66 - The merge moves the fork's bare-&lt;task-id&gt; default into the registry parser only (bin/fm-project-mode.sh:112, DEFAULT_BRANCH_PREFIX=). The per-script defaults stay at upstream's fm/: bin/fm-promote.sh:66, bin/fm-brief.sh:192 and bin/fm-spawn.sh:645. That leaves two definitions of the same default that disagree. Before this merge the fork hardcoded the bare branch, so a missed flag could not change the branch name. Now the bare default holds only if firstmate remembers to pass --branch-prefix &#39;&#39; every time (AGENTS.md:191). Example: firstmate runs fm-promote.sh &lt;id&gt; --mode direct-PR --yolo off without the flag on a project with no registered prefix. The promoted worker is told git checkout -b fm/&lt;id&gt; --, and nothing is printed, because fm-promote has no check against the registry prefix. tests/fm-task-delivery.test.sh:352 and tests/fm-control-relaunch.test.sh:1160-1170 now assert exactly this fm/&lt;id&gt; result. A brief plus spawn without the flag also produces fm/&lt;id&gt;. There the spawn only prints a notice (bin/fm-spawn.sh:3196-3199) and carries on. The header comments still describe fm/ as the default: bin/fm-brief.sh:50-56 says 'Defaults to "fm/" when omitted, so every existing installation's branch names are unchanged', and bin/fm-spawn.sh:35 says the same. Both now contradict README.md:48 and docs/architecture.md:379. The commit message says this split was deliberate, to keep the upstream conflict surface small. So this is a question for you, not a mechanical fix. Option 1: set the three script defaults to &#34;&#34; so they match the registry. That also means updating the fm/$ID legacy-brief branch at bin/fm-spawn.sh:3143 and the upstream tests that assert fm/&lt;id&gt;. Option 2: keep the split, correct the stale header comments, and add a registry-agreement notice to fm-promote like the spawn has.
  • ℹ️ bin/fm-spawn.sh:1832 - Branchless-record relaunch fallback probes git -C &#34;$(fm_meta_get &#34;$RELAUNCH_META&#34; worktree)&#34;. If a legacy fork record lacks worktree= or the worktree is gone, the probe fails and the relaunch records fm/&lt;id&gt; even when the fork worker used the bare branch; the later branch existence checks then refuse or diverge. Narrow edge on legacy in-flight tasks only; noting for the upcoming routine-sync skill's conflict notes.

🔧 Fix applied.
3 infos still open:

  • ℹ️ bin/fm-spawn.sh:1832 - Branchless-record relaunch fallback probes git -C &#34;$(fm_meta_get &#34;$RELAUNCH_META&#34; worktree)&#34;. If a legacy fork record lacks worktree= or the worktree is gone, the probe fails and the relaunch records fm/&lt;id&gt; even when the fork worker used the bare branch; the later branch existence checks then refuse or diverge. Narrow edge on legacy in-flight tasks only; noting for the upcoming routine-sync skill's conflict notes.
  • ℹ️ bin/fm-spawn.sh:3200 - The round-1 fix made the bare &lt;task-id&gt; the default and rewrote the comment above this notice (3193-3197). It left the notice text itself unchanged. The notice still says 'the task's branch and PR will read as firstmate-authored' on every mismatch. With the new default the common mismatch is a bare branch against a registered fix/ prefix, and neither of those reads as firstmate-authored, so the message states the wrong cost. The round-1 test tests/fm-task-delivery.test.sh:1419 still asserts that wording for exactly that case (branch=prefix-dev-a1 vs registered 'fix/'), so it locks in the inaccurate text. Fix: reword the notice to a neutral cost, for example 'the task's branch will not follow the project's registered naming', and update the test assertion to match.
  • ℹ️ bin/fm-project-mode.sh:113 - To read one empty constant, the round-1 fix made the small registry parser source bin/fm-dod-lib.sh. That file in turn sources fm-pr-lib, fm-classify-lib (about 2500 lines, forks uname, sources fm-timeout-lib), fm-nm-run-lib and fm-brief-heading-lib. fm-project-mode.sh runs several times per ship spawn and also from fm-home-seed, fm-remote-home-seed and fm-fleet-sync, so each registry lookup now pays for loading that stack and depends on it loading cleanly. Behavior is correct: the script runs under set -eu and I found no variable collisions. The user's decision allowed either 'a small sourced helper or a value owned by one existing library', so this choice is within what was authorized. It is recorded only for the routine-sync follow-up in case lookup latency or coupling becomes a problem.

🔧 Fix applied.
1 info still open:

  • ℹ️ bin/fm-spawn.sh:1832 - Branchless-record relaunch fallback probes git -C &#34;$(fm_meta_get &#34;$RELAUNCH_META&#34; worktree)&#34;. If a legacy fork record lacks worktree= or the worktree is gone, the probe fails and the relaunch records fm/&lt;id&gt; even when the fork worker used the bare branch; the later branch existence checks then refuse or diverge. Narrow edge on legacy in-flight tasks only; noting for the upcoming routine-sync skill's conflict notes.
🔧 **Test** - 1 issue found → auto-fixed ✅
  • ⚠️ tests/fm-control-relaunch.test.sh:2152 - This test came in from upstream (920a7d9, fix: preserve Herdr status on Pi relaunch kunchenguid/firstmate#5161) and failed on macOS in two ways: it used GNU-only sed -i &#39;s/…/&#39; (BSD sed errors with 'invalid command code'), and it ran --harness pi without stubbing pi in fakebin, so it only passes where pi is installed. I fixed it in the test only, with a portable sed &gt; tmp &amp;&amp; mv and a fakebin pi stub copied from the suite's native-ultra case, and the suite now passes. This adds a small fork diff to an upstream file, so it is worth upstreaming to keep future syncs conflict-free.
  • Live validation: ✅ go - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Registry lookup for a project with no prefix, an unregistered project, or no registry prints an empty prefix (bare branch); fix/ and fm/ registrations are honored ✅ pass live branch-default-cli.txt: plainproj->[], fixproj->[fix/], fmproj->[fm/], unknownproj stdout=[], absent-registry stdout=[]
Registry parser loads only the dedicated prefix lib, not the fm-dod-lib dependency stack ✅ pass live branch-default-cli.txt: the bash -x trace shows the only sourced file is bin/fm-branch-prefix-lib.sh
Scaffolding a ship brief without --branch-prefix tells the worker git checkout -b &lt;id&gt; and records Ship branch: &lt;id&gt;; an explicit fm/ prefix still yields fm/<id> ✅ pass live branch-default-cli.txt S2/S3: git checkout -b bare-a1 --, Ship branch: bare-a1; git checkout -b fm/fmx-a2 --
Promoting a scout without --branch-prefix records branch=<id> and tells the worker to create the bare branch; --branch-prefix fix/ records fix/<id> ✅ pass live promote-cli.txt: meta branch=promo-a3, ship-instructions git checkout -b promo-a3 --; branch=fix/promo-a4
Spawning a bare-branch ship on a project that registers fix/ prints the neutral deviation notice ('will not follow the project's registered naming') and continues; a matching prefix stays quiet ⏸️ untested no The earlier payload did not show a live result for this. It was covered only by tests/fm-task-delivery.test.sh, which runs the real fm-spawn.sh through a fake harness and a fake terminal. A live spawn…
Relaunch of a legacy record with no branch= field uses the bare branch its worktree holds, otherwise fm/<id> (legacy fallback kept) ⏸️ untested no The earlier payload did not show a live result for this. It was covered only by tests/fm-control-relaunch.test.sh, which runs the real fm-spawn.sh --relaunch through the suite's fake terminal and harn…
  • bin/fm-project-mode.sh --branch-prefix &lt;plainproj|fixproj|fmproj|unknownproj&gt; and with no registry, in a disposable FM_HOME
  • bash -x bin/fm-project-mode.sh --branch-prefix plainproj to confirm only fm-branch-prefix-lib.sh is sourced
  • bin/fm-brief.sh bare-a1 plainproj --mode no-mistakes (no prefix) and bin/fm-brief.sh fmx-a2 fmproj --mode no-mistakes --branch-prefix fm/
  • bin/fm-promote.sh promo-a3 --mode direct-PR --yolo off (no prefix) and bin/fm-promote.sh promo-a4 ... --branch-prefix fix/ on scout records
  • bash tests/fm-task-delivery.test.sh (includes the spawn registry-prefix deviation notice case, which runs the real fm-spawn.sh with a fake harness)
  • bash tests/fm-brief.test.sh
  • bash tests/fm-control-relaunch.test.sh (failed on macOS, then passed after the test-only fix)

🔧 Fix applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 6 of 8 scenarios driven live against the product
Scenario Result Live Evidence
Registry lookup gives '' for a project with no prefix, 'fix/' or 'fm/' when registered, and '' for an unknown project or missing registry, loading only fm-branch-prefix-lib.sh ✅ pass live project-mode-branch-prefix.txt
Scaffolding a ship brief without --branch-prefix tells the worker git checkout -b &lt;task-id&gt;; with --branch-prefix fix/ it says fix/<task-id> ✅ pass live fm-brief-default-branch.txt
Spawning a ship task without a prefix on a project registered with branch=fix/ records branch=<task-id> and prints the neutral 'will not follow the project's registered naming' notice ✅ pass live fm-spawn-lab-home.txt (sp-a1)
Spawning on a project with no registered prefix is quiet and records the bare branch ✅ pass live fm-spawn-lab-home.txt (sp-a4)
Adversarial: a bare-default brief spawned with --branch-prefix fm/ is refused with a branch-mismatch error and writes no task meta ✅ pass live fm-spawn-lab-home.txt (sp-a3)
Promoting a scout without --branch-prefix records branch=<task-id> and instructs git checkout -b &lt;task-id&gt; ✅ pass live fm-promote-default-branch.txt
The upstream Pi relaunch test passes on macOS (BSD sed, pi not installed) ⏸️ untested no The prior payload established this only through the automated fm-control-relaunch test suite, not a live run of the product, so no live result was established.
Merged upstream brief, delivery and relaunch behaviour still holds under the fork's bare default ⏸️ untested no The prior payload established this only through the automated fm-brief, fm-task-delivery and fm-control-relaunch suites with stubbed backends, not a live run; CI owns full-suite regression for the res…
  • FM_HOME=&lt;tmp&gt; bin/fm-project-mode.sh --branch-prefix {plainproj,fixproj,fmproj,ghostproj} against a throwaway registry, plus a run with no registry at all, plus bash -x to list which libs are sourced
  • FM_HOME=&lt;tmp&gt; bin/fm-brief.sh demo-a1 plainproj --mode direct-PR (no prefix) and ... --branch-prefix fix/
  • Real bin/fm-spawn.sh in a marked lab home (bin/fm-lab-home.sh create) on a private tmux socket: sp-a1 (registry branch=fix/, no flag), sp-a4 (no registered prefix), and sp-a3 (a bare-default brief spawned with --branch-prefix fm/, expected to be refused)
  • Real bin/fm-promote.sh sc-p1 --mode direct-PR --yolo off on a scout spawned in the lab home
  • bin/fm-teardown.sh &lt;id&gt; --force for every lab task, then killing the private tmux server, fm-lab-home.sh teardown, and removing the throwaway treehouse pool slots
  • bash tests/fm-brief.test.sh
  • bash tests/fm-task-delivery.test.sh
  • bash tests/fm-control-relaunch.test.sh (includes the Pi relaunch case on macOS, where pi is not installed)
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)

🔧 Fix applied.
1 warning still open:

  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

mremond and others added 30 commits September 22, 2026 11:41
…nguid#5294)

* fix(bin): map passed-with-override to done instead of unknown

no-mistakes' axi status emits outcome: passed-with-override for a run
that finished with an explicitly approved Test or CI exception. Both
bin/fm-crew-state.sh's outcome resolver and bin/fm-teardown.sh's
pre-teardown terminal-run check only matched the literal passed and
checks-passed tokens, so this outcome fell through to unknown/parked
and a finished worker awaiting merge kept getting re-alerted as stale,
while an abort race during teardown could also leave a finished run
misreported as still parked.

Map passed-with-override to the same done/terminal handling as a
clean passed in both places.

* fix(document): Replace stale outcome mapping with authoritative pointer

* fix(ci): Fixed a pre-existing mock-clock race in tests/fm-contributions.test.sh by advancing time only during the serial issue read. Reproduced the exact CI failure before fixing it. Forced-race replay, all 38 contribution scenarios, scoped ShellCheck, Bash syntax, and diff checks pass. Only the test fixture changed; CI rerun remains with the outer executor
* fix: close landed workers from supervision in both postures and at return

During the 2026-09-22 away window every exemption worker whose pull request
had merged was left sitting for nine hours. The supervision branch received
the stale wake, the merge-landed check, and the hourly inactive-outcome row
for each of them, ran the recovery playbook, found nothing to recover, and
reported "no further action". The branch prompt granted ordinary teardown of
a confirmed-landed task without ever naming the moment or the command, and
the playbook has no landed exit, so the stale path ended at "nothing to
recover". The return brief then listed only blockers, decisions, and the
latest five routine outcomes, so the landed workers stayed invisible after
the captain came back.

- bin/fm-branch-prompt.sh: name the merge-landed wake, and any later stale,
  inactive-outcome, or heartbeat row on a done task with a merged PR, as the
  moment to claim the lease and run bin/fm-teardown.sh with no flags; a
  refusal is reported, never forced or worked around. Add teardown to the
  handling tool list.
- stuck-crewmate-recovery: a landed worker is not a recovery case; point at
  the ordinary teardown owner for each actor.
- bin/fm-afk-return.sh: render a "Landed, cleanup due" section from durable
  records only (a live task record whose recorded PR carries the
  merge-notification marker), between could-not-fix and handled, without
  holding the gate; the afk skill's return step closes each listed task
  through ordinary teardown once the check clears.
- tests: pin the prompt rule in fm-branch-supervision and the brief section
  in fm-afk-return through the real marker writer.

* no-mistakes(document): Document landed-task cleanup ownership
* fix(bin): surface a green no-mistakes PR still in ci merge monitoring

A green PR could sit unreported because neither the worker nor the
supervisor could observe checks-green while the ci step kept monitoring
for the merge.

Supervisor read: fm_nm_select_run's capped-overview inventory reader looked
the repository up by the task worktree path, but no-mistakes registers a
repository once by its main clone path and resolves every linked worktree
to it, so on every task copy of a busy repo the lookup matched no row and
each read reported "complete same-branch run inventory unreadable". Key the
lookup on the overview's own top-level `repo:` line, which every axi
release emits as the resolved working_path.

Even with a readable run, the ci-log classifier treated "base branch
advanced ..., re-arming CI monitor timeout" as not-ready. The monitor logs
a checks state only when it changes and a base advance does not clear
readiness, so a green PR read as still validating for as long as main kept
advancing. Stop treating that line as a marker, matching no-mistakes' own
ci-log parser, and name the run's PR URL in the held-for-merge reading so
the existing inactive-outcome path can act on it without a worker report.

Worker contract: `axi status` never reports checks-passed while the ci
step monitors for merge, so the definition of done no longer makes a
status poll the wait for the next gate or outcome; the drive call's own
return is the green signal, reattached with `no-mistakes axi run` after a
bounded return.

* no-mistakes(review): read the full ci log when checking checks-green

* no-mistakes(review): correct stale ci log tail wording in docs

* no-mistakes(document): Document checks-green supervisor fallback
* fix: derive Lavish polling server from its board session

* no-mistakes(document): Document session-derived Lavish polling

* no-mistakes(document): Correct Lavish routing verification claims
… vanish (kunchenguid#4900)

* fix(bin): ignore vanished state scratch files on secondmate relaunch

Relaunch refused when find(1) exited non-zero while listing a secondmate
home's state directory. A live watcher can delete scratch files between
readdir and processing, which is not evidence that child *.meta records
are unreadable.

Prove the directory is listable from its mode and keep the existing
readable-meta loop as the child-record guarantee. Fixes kunchenguid#4765.

* no-mistakes(review): Skip chmod-000 unlistable-state relaunch test when running as root
…d#4907)

* fix(bin): treat home-owned status closes as already read

Self-announced bookkeeping appends now record their exact byte ranges.
Later drains and signal scans skip those ranges, so two distinct
--resolve-key answers after an OPEN DECISIONS fold do not each wake the
supervisor. Worker-authored lines outside that ledger still signal.

* no-mistakes(review): Keep owned closes in unread status; lock ledger writes

* no-mistakes(review): Drop fold-lag wake suppression so folded worker decisions still wake

* no-mistakes(review): Require real owned growth before ledger marks status seen

* no-mistakes(document): Clarify home-appends ledger scope versus UNREAD STATUS

* no-mistakes(review): Restore fold-lag path, drop owned-range filters, fix test

* no-mistakes(review): Align ledger docs and scope ledger to wake path only

* no-mistakes(review): Restore stranded historical-annotation test comment to its function

* no-mistakes(review): Retire the home-appends lock alongside its ledger

* no-mistakes(document): Note ledger's lock-helper dependency in classify library

* no-mistakes(review): Append-and-coalesce home-appends ledger; fix stamped-line assertions

* no-mistakes(review): Drop redundant empty-span branch; make owned test pin ledger

* no-mistakes(document): Document covers' ascending-order dependency on home-appends ledger

* no-mistakes(document): Note owned-append skip in watcher signal-scan comment
…nguid#5350)

* chore(bin): raise tasks-axi, quota-axi, and lavish-axi floors to latest

Raise the minimum versions to tasks-axi 0.2.6, quota-axi 0.1.50, and
lavish-axi 0.1.77, pin CI's tasks-axi install to 0.2.6, and move the
floor-boundary test fixtures to the new versions.

tasks-axi 0.2.6 makes a failed relation deliverable for a promised-final
expecting pr-merged, so add the regression test: a bound work that ends
failed reports its honest outcome text through fm-public-followup-emit.sh,
consume marks the commitment ready, and deliver posts that text exactly
once.

Also make two hang-guard tests in fm-backlog-atomicity portable to hosts
without coreutils timeout, and stop an installed herdr from leaking into
the secondmate-liveness husk classifier test.

* no-mistakes(review): drop out-of-scope bounded_run hang-guard helper from atomicity test

* no-mistakes(review): pin quota-axi floor at 0.1.49 across fixtures

* no-mistakes(document): Document failed public-followup delivery behavior

* no-mistakes(ci): Updated quota-axi floor and all 0.1.49 fixtures to 0.1.51, corrected bootstrap boundaries to 0.1.51/0.1.52/0.1.50, and bumped the bearings lavish-axi stub to 0.1.77. Bearings, quota procevent, quota chooser, startup budget, and bootstrap floor coverage passed; the full bootstrap suite exceeded the 240-second local command limit after relevant checks passed. git diff --check passed
…rker copy (kunchenguid#4878)

* fix(bin): refuse ship done: when the named head lives only in the worker copy

A ship done: is not current-state done until that exact commit is reachable
outside the disposable copy. The check tests the named head, not whether
some branch moved.

* fix(bin): gate CI-ready ship done: on named-head reachability, not handoff

Keep no-mistakes' first done: as the pipeline handoff, apply the same shared
check when registering a PR and when a secondmate publishes ledger-first,
treat a recorded merged PR as landed after prune, and name the PR head
instead of scanning free-text SHAs.

* no-mistakes(review): Bind named-head gate to recorded PR and forge heads

* no-mistakes(review): Gate direct-PR forge heads and keep pending ledger deliveries

* no-mistakes(review): Align worker done wording, test mapping, pending-retry test

* no-mistakes(test): Raise watcher test time limit to stop load flake

* no-mistakes(document): Restore ledger-path fact and name named-head gate coverage

* ci: re-attest named-head ship-done gate for a fresh serial-3 verdict

* no-mistakes(review): Simplify local-only gate, gate keyed done lines, document recovery

* no-mistakes(document): Name fm-crew-state among named-head gate callers
…all alarm (kunchenguid#5204)

* fix(bin): ring a proven-idle secondmate before a wake-loop stall alarm

A leftover foreign-queue row on an idle, alive, ring-safe mate is still drainable in that home. Ring once, reset the observation interval, and keep the parent alarm for unknown, busy, or still-frozen rows.

* no-mistakes(review): Mark drain steer with from-firstmate fire-and-forget carrier
…unchenguid#5335)

The re-arm recovery cases judged "the watcher stayed live instead of
surfacing recovery" with fixed budgets below what a real stale-lock
recovery costs on a contended host: the arm's default 10s confirmation
deadline, a start helper that returned after about 4s whether or not the
arm had confirmed its watcher, and an 80-poll exit wait.
A changed-suite run beside other suites starves the recovery's many
short-lived processes while this suite's sleeping poll loops keep their
pace, so a watcher still surfacing its recovery read as one that stayed
live (issue kunchenguid#3793).
The original 0.25s window after confirmation was widened to 80 polls in
kunchenguid#3837, which left the same race at a larger size.

Following the CONTRIBUTING.md fixture-budget rule, the re-arm helper now
gives the arm an explicit 30s confirmation budget and waits for its
confirmation or exit within a ceiling that outlasts it, and every wait on
a re-armed watcher uses one named iteration-counted ceiling that outlasts
the same budget.
A passing case returns as soon as the arm reports or exits, and a watcher
that never surfaces its recovery still fails.

A new case delays every mktemp and readlink the re-armed watcher runs
after it publishes its beacon, so its first poll and exit take about 13s
on any host.
It fails with the reported symptom on the previous budgets and passes now.
No bin/ change.
* fix(bin): let one TERM always stop the watcher on bash 5.2

Bash 5.2 runs a pending trap from the parser entry of the next command
substitution it expands, where the trap body is parsed as the inside of
that substitution and fails ("trap: line 2: unexpected EOF while looking
for matching `)'") or is dropped silently, consuming the signal. The
watcher's `trap 'exit 1' HUP INT TERM` could therefore ignore a TERM and
keep polling while its stopper waited: the triage suite's reap waited
forever (CI jobs cancelled at 30 minutes), and the arm's signal path and
the away-mode daemon's shutdown wait for the watcher the same way.
Bash 5.3 fixed the parser; 5.2 is the stock bash on Ubuntu 24.04.

HUP and TERM now keep bash's native fatal-signal handling, which runs the
EXIT trap (watcher_cleanup) and exits on bash 3.2, 5.2, and 5.3. INT keeps
its trap because bash ignores a direct SIGINT while a child runs. The
check-spawn deferral window no longer contains a command substitution.

The triage suite's reap is now bounded and fails the case within 10s with
process evidence instead of hanging the job, and a new regression test
proves TERM stops a watcher blocked inside a poll's pane capture and still
releases its lock and records an acknowledgeable stop.

* no-mistakes(document): Clarify watcher stop-signal documentation
…id#5374)

* fix(bin): submit our own stuck doorbell instead of skipping every later ring

* no-mistakes(review): Confirm and retry Enter once on stuck-doorbell submit

* no-mistakes(document): Clarify doorbell retry and pending-composer documentation
* feat(bin): add the opt-in fleet activity ledger

Homes that create config/fleet-ledger get an append-only JSONL file,
state/fleet-ledger.jsonl, recording task.dispatched, task.status,
task.merged, and task.cleaned_up so outside tools can follow a fleet.
With the flag absent each producer does one file test and nothing else.
docs/fleet-ledger.md owns the record contract and its documented limits.

* no-mistakes(review): Record task.status text verbatim after the first colon

* no-mistakes(document): Clarify fleet ledger status and setup documentation

* no-mistakes(ci): Fixed a timing race in tests/fm-pi-branch-extension.test.sh: the replacement-wake test now waits for the prompt to start before releasing it. The focused test passed twice, and git diff --check passed
…nchenguid#5352)

* fix(bin): format, validate, and surface public-followup deliverables

brief pre-fills report_path=data/<work-id>/report.md and states the accepted
format of every value it cannot know instead of a bare <value> placeholder.
fm-public-followup-emit.sh refuses a deliverable tasks-axi would refuse, in
both the direct and staged destinations, naming the key, value, and format.
consume records the specific deliverable, outcome, or missing key behind a
tasks-axi refusal, and each refusal wakes the owning home once through the
existing relay poll.

* no-mistakes(review): refuse emits missing a required deliverable in both destinations

* no-mistakes(review): require promised deliverables and keep rejections recoverable

* no-mistakes(review): mirror tasks-axi's canonical pull request URL rule

* no-mistakes(review): keep a rejection wake whose line cannot be read

* no-mistakes(review): key emit-time rules on the promise, not the outcome

* no-mistakes(review): bound deliverable keys and values as tasks-axi does

* no-mistakes(review): state rejection wakes as at-least-once and pin it

* no-mistakes(review): enforce the promised contract tasks-axi holds at emit

* no-mistakes(review): stop inferring a staged promise from its outcome

* no-mistakes(document): Refresh public follow-up documentation

* no-mistakes(ci): Fixed both CI flakes. Watcher cleanup is now installed before singleton acquisition, preventing timeout races from leaving stale locks while preserving recovery-failure evidence. Bearings render fixtures now publish a valid isolated Lavish session store and retire each listener after rendering, eliminating false unowned-source races. Verified with checkpoint stress, fm-watch-checkpoint, fm-watcher-lock, repeated fm-bearings-board-render runs, project lint, syntax checks, and git diff checks

* Revert unrelated CI auto-fix edits to the watcher and bearings board test

The CI step's automatic repair changed bin/fm-watch.sh and
tests/fm-bearings-board-render.test.sh to chase two intermittent CI
failures that also occur on main and are not part of this change. Restore
both files so this branch carries only the public-followup deliverable fix.

* no-mistakes(review): Refuse a repeated --deliverable key at emit argument parsing

* no-mistakes(document): Clarify public-followup validation and rejection-wake documentation
* Add verified Devin CLI worker adapter

* no-mistakes(review): Drop Devin resolver refusal and launch marker

* no-mistakes(review): Verify devin in bootstrap, fold kind rule, update docs

* no-mistakes(document): Document Devin sidecar, resume, and worker-only facts

* no-mistakes(document): Document Devin interrupt, liveness anchor, composer signals

* fix(control): never pair Devin interrupt presses on an idle agent

A fast double Escape on an idle Devin opens its /revert picker, where Enter
reverts file changes. fm-control now sends the second press only after the
first renders Devin's 'esc again to interrupt' armed hint, never sooner than
0.5 s, closes a revert picker a mistimed press opened with one Escape, and
refuses to type the exit command while that picker is open. An unarmed
interrupt reports cancel=not-running and leaves the busy record untouched.

* fix(devin): disable Claude hook import and commit attribution for workers

The per-task Devin config now forces read_config_from.claude=false, so a
worker no longer runs the user's or project's Claude Code hooks (including
Herdr's Claude agent-state hook), and attribution=false, so Devin adds no
Co-Authored-By trailer or Generated-with line to commits and PRs.

* test(devin): extend live guard and record Herdr and revert-picker evidence

The credentialed live guard now fails if an imported Claude Code hook runs,
if the worker's commit carries Devin attribution, if an idle interrupt sends
more than one press or opens the revert picker, or if an open picker lets
exit through or is closed with a revert. The Devin reference, agent-control
doc, and verification records carry the 2026-09-22 tmux and Herdr lab results,
including the Herdr exit refusal.

* no-mistakes(document): Correct Devin documentation links and lifecycle guidance

---------

Co-authored-by: Denis Beliaev <[email protected]>
…id#5322)

fm-crew-state classifies the no-mistakes outcome 'passed-with-skips' as
unknown, so a finished worker awaiting merge is re-alerted as stale. The
same blind spot lets fm-teardown's pre-teardown terminal-run check refuse
a legitimate abort race that lands on this outcome.

Map passed-with-skips to done in crew-state resolution, keeping the
skipped publication/CI verification visible in the detail rather than
reporting a clean pass, and recognize it as terminal during teardown.
…nguid#5382)

* fix: refuse missing backend adapter before source

* no-mistakes(review): Gate backend precheck under stock Bash

* no-mistakes(document): Clarify adapter precheck docs

* no-mistakes(lint): Suppress intentional child Bash ShellCheck warning
…kunchenguid#5338)

* fix(test): repair tmux liveness and calm follow-up loaded_off regressions

Both self-tests fail on untouched main on a host whose coreutils are a
multicall binary and whose Chrome has no pre-warmed profile, and each failure
masks the other's file.

tests/fm-tmux-agent-liveness.test.sh - the stand-in harness processes were
symlinks to the host's `sleep`. A single-purpose `sleep` runs happily under
another name, but a multicall coreutils binary (uutils or busybox) resolves its
applet from argv[0]: `claude-link -> sleep` invoked under the harness name runs
the wrong applet and exits immediately, so no foreground process exists and
every positive case reads not-alive ("last verdict for liveness:agent was
missing (expected alive); title=sh comms=[sh ]"). Build a dedicated spinner as
the stand-in target, exactly the way the version-string case already builds its
executable, and require the fallback target to demonstrably survive the rename
before using it. Every assertion is untouched; the stand-in identity signal is
unchanged (the kernel still records the symlink name as the executable
identity).

tests/fm-calm-pi-extension.test.sh - render_export_dom pinned a brand-new
`--user-data-dir` per attempt. On Google Chrome for Testing 151.0.7922.34 that
pristine profile makes Chrome's first-run initialization never complete: the
browser and its renderers start, but --dump-dom never returns, so all three
bounded attempts end exit=0 timed_out=yes bytes=0 and the DOM assertions never
run ("could not render calm-mode HTML export DOM"). Chrome's own profile
creation under a fresh HOME renders the same document in about a second, so the
helper now gives Chrome a private per-attempt HOME instead of the explicit
profile flag. Each attempt still gets an isolated profile, and every DOM
assertion is unchanged.

Root-cause evidence: a pristine --user-data-dir with `--headless=new
--dump-dom` had not returned after 150s, while the same command with an empty
HOME and no --user-data-dir returned the full DOM in ~1s, and reusing an
already-populated profile also returned it in ~1s. The render failure masked
the rest of the file: with it repaired, the Pi follow-up loaded_off case passes
unmodified against an installed @earendil-works/pi-coding-agent package.

These two failures block downstream validation of every lane on hosts with
multicall coreutils or a fresh Chrome profile.

Verification:
- timeout 300 bash tests/fm-tmux-agent-liveness.test.sh -> exit 0, 16 assertions ok
- timeout 700 bash tests/fm-calm-pi-extension.test.sh -> exit 0, 13 assertions ok,
  including the Pi operational follow-up loaded_off case
- bash -n and shellcheck clean on both touched files
- rest of tests/: bin/fm-test-run.sh --all bounded by timeout 900 completed 17 files with 0 failures (fm-afk-contract.test.sh through fm-backend-herdr-launcher-workspace-e2e.test.sh), then the bound cut off the 18th (fm-backend-herdr-presentation-e2e.test.sh, a real-herdr-gated lab test) with no failure recorded

* fix(test): give wake-queue observation checkpoints the alerting ceiling

tests/fm-wake-queue.test.sh's secondmate stall case runs bounded foreground
watcher checkpoints whose job is to record an observation, with the alerting
checkpoint that follows asserting the stall. A checkpoint's exit publishes a
downtime marker, and the next checkpoint consumes it only by reaching the end of
the watcher's poll loop, where the recovery surfacing runs after the stall tick;
the observation itself is recorded by that same stall tick. On a loaded host a
1s ceiling sits under the cost of that iteration (which includes a pane capture
in the active-turn gate), so the observation was never recorded, the downtime
marker stayed pending, and the alerting checkpoint surfaced
`check: rearm-resurface` instead of the stall it asserts:

  not ok - a foreign queue with no progress did not alert: check: rearm-resurface
  not ok - a frozen reprovisioned queue generation was hidden: check: rearm-resurface

Give the observation checkpoints that feed a later alert the same 4s ceiling the
file already documents for alerting checkpoints. The ceiling is only a bound - a
checkpoint still returns on its first actionable wake - so no assertion is
weakened, and the quiet windows get longer, not shorter.

* no-mistakes(document): docs: correct export-DOM Chrome render root cause

* no-mistakes(review): Isolate Chrome profile on macOS, dedupe tmux CC_BIN lookup

* chore: re-trigger fork workflow approval for triage

---------

Co-authored-by: Captain <[email protected]>
Co-authored-by: kunchenguid <[email protected]>
…chenguid#5383)

* fix(bin): classify a status span without re-folding the whole log

A watcher poll could take minutes, so its liveness beacon aged past the
guard's 300s grace and the Stop auto-arm reported the watcher down. On the
main home, cycles ended with beacon_age 91-235s while healthy and 534-706s
while the laptop was CPU-starved.

Cause: whenever a newly appended status span held a keyed needs-decision
or blocked line, status_span_first_actionable_record re-read and re-folded
the ENTIRE log to decide whether that opening was still live, forking
several subshells per line. On a remote second mate's mirrored parent
channel (1.2MB, ~2300 lines) that is 13-20k subshells, about 17s per log
per classification when idle, paid by every signal and heartbeat scan.

Nothing regressed recently: subshell counts per classification were
20,272 from kunchenguid#3268 (2026-08-29, which introduced the whole-log fold) and
13,188 from kunchenguid#3753 onward through HEAD. The cost grew with log size, since
parent-channel logs only grow.

Fix: fold only the captured span. An accepted opening does not depend on
earlier lines and only later lines close or supersede it, and every later
line lies inside the span, so the span fold names the same live openings
at a cost bounded by the span. Old and new classification outputs are
byte-identical across 51 span offsets of real-shaped secondmate and ship
logs.

A real-watcher regression test records every read the classification
makes through the span-reader seam and asserts none reaches before the
classified offset; it fails on the old code (5,157 bytes read from
offset 0 to classify an 84-byte span).

* no-mistakes(document): Clarify span classification and watcher regression coverage
kunchenguid#5362 and kunchenguid#4878) (kunchenguid#5381)

* test: fix watcher timing flakes in fm-pr-check-security

The bounded watcher's hang guard now counts only the watcher's own time: a
case marks the intervals where it holds the watcher on injected work or makes
it wait on concurrent work, and those no longer count against its budget. The
budget itself stays at main's sixty seconds. The helper also stops forcing a
one-second per-check timeout, which killed a correct merged poll whenever that
poll took longer than a second, so the watcher only retried it or exited on a
later check's wake without the merge.

The concurrent-publication case pauses the guard while its arming is in
flight, and its task now sorts before the contributions observer the arming
also registers, so the watcher stops on the poll under test before running
that unrelated fleet snapshot. The case also prints the watcher's stderr when
it fails.

The replacement case pauses the guard while the re-arm runs inside the
watcher, runs that injected arming with the fixture root every other arming
here uses, and waits on the replacement merge's process instead of a
two-second cap. Merged-poll runs retire the contributions observer before the
watcher starts, since no case here exercises it.

The returned-descendant case no longer races a four-second sleep or a TERM
landing at an arbitrary point in the watcher's idle loop: its descendant holds
until killed, and a second check in the same cycle witnesses that it was
drained and stops the watcher.

* no-mistakes(ci): Reproduced the intermittent board-render failure. Its Lavish stub listed an open session but omitted the session-state record required by the listener, so the build could race the listener’s exit. Added matching fixture state; the affected suite passed three consecutive runs, and shell syntax and diff checks passed

* Revert "no-mistakes(ci): Reproduced the intermittent board-render failure. Its Lavish stub listed an open session but omitted the session-state record required by the listener, so the build could race the listener’s exit. Added matching fixture state; the affected suite passed three consecutive runs, and shell syntax and diff checks passed"

This reverts commit 6a59859.
…enguid#5385)

* feat: record task.pr_ready in the fleet ledger when a task PR is registered

* feat: record worker status lines in the fleet ledger as they are written

* no-mistakes(review): Keep worker status append failures and pass the resolved config to the ledger

* no-mistakes(review): Resolve relative config override before embedding in worker command

* no-mistakes(document): Clarify fleet ledger status capture timing
…unchenguid#5386)

* test: synchronize foreign secondmate stall legs on the watcher's recorded observation

Each leg of test_secondmate_foreign_queue_stall_tracks_progress_and_alerts_once
ran the watcher under a 1s or 4s wall-clock checkpoint, but every later leg
depends on the progress observation the previous leg's watcher recorded. Under
load the watcher was killed before its first stall tick, the observation was
never written, and the next leg treated its own sighting as the first one, so
the stall alert never fired.

Run the watcher directly and end each leg on its observable outcome: the
progress marker recording the expected observation, or the watcher's own first
wake. Also move a comment orphaned above this test back to the drain liveness
test it describes.

* no-mistakes(review): Wait for full stall reset before stopping watcher leg
kunchenguid#5391)

The listener resolves its server from that store before it polls. Without a session for this board, it exits in the gap after the build has already sampled a live claim.
…#5390)

* fix(bin): prune a torn-down task's wake rows at teardown

Prune pending durable wake rows (.wake-queue) for a task when it is torn
down, clearing stale wakes for its target window, signal wakes for its status
or turn-ended files, and task-specific check wakes.

Fixes kunchenguid#3419.
Adjacent to kunchenguid#5252.

- bin/fm-wake-lib.sh: add fm_wake_queue_prune_task
- bin/fm-teardown.sh: call fm_wake_queue_prune_task in cleanup_firstmate_home_children and main teardown
- tests/fm-wake-queue.test.sh: add test_wake_queue_prune_task

* no-mistakes(document): docs: note teardown prunes a task's wake rows

---------

Co-authored-by: Captain <[email protected]>
…ixture readiness (kunchenguid#5392)

* Make portable tests match resolved host paths

Summary:
- Match macOS full Node command paths by basename in the Gemini behavior test.
- Mirror symlink-resolved Nix PATH behavior and give the loaded-host race bounded headroom.

Testing:
- bin/fm-lint.sh
- bin/fm-test-run.sh tests/fm-on.test.sh tests/fm-gemini-harness.test.sh tests/fm-procevent.test.sh

Related:
- None

* no-mistakes(review): Mirror production PATH helper rules per directory group in tests

* no-mistakes(test): Wait for orphan runner start marker instead of fixed sleep

* no-mistakes(document): Clarify gemini ancestry test comment for versioned node comm

---------

Co-authored-by: Sandeep Salwan <[email protected]>
…ns (kunchenguid#5389)

The sibling secondmate stall cases in tests/fm-wake-queue.test.sh now wait for the watcher's recorded observation instead of a one-second wall-clock checkpoint, so they can neither fail nor pass vacuously under load. Deterministic proof with a 5s watcher launch delay: before the fix 4 cases passed vacuously and 6 failed; after it all 10 pass on the recorded observation.

Also includes a CI flake fix from validation: fm_control_harness_supported in bin/fm-control-lib.sh finishes reading the harness allowlist before returning, removing intermittent broken-pipe diagnostics. Behavior is unchanged.
… tail (kunchenguid#5336)

* fix(bin): refuse a Herdr submit that would send only a message tail

A long typed payload can sit in the composer as a suffix, or as a paste placeholder plus a remainder, and the following Enter was still reported as delivered. Prove the selected composer holds the payload before Enter, and report failure when it does not.

* no-mistakes(review): Scope Herdr payload proof to Claude, clear composer on refusal

* no-mistakes(test): Clear refused Herdr composer drafts one wrapped row per press

* no-mistakes(test): Accept Claude's multi-line paste placeholder in Herdr submit proof

* no-mistakes(review): Accept Claude read-back that drops U+2063 in Herdr proof

* no-mistakes(document): Document Herdr proof ignoring U+2063 operational mark

* no-mistakes(ci): I made a one-line test change. The failing check comes from a timing race in an existing test that this PR doesn't touch. **What failed:** `tests/fm-procevent.test.sh` failed at "the superseded paced runner invoked its stale command" (line ~3313). The PR only changes the Herdr files and their tests, and the same shard passed on main at the base commit. **Why it can fail:** the fixture starts a second runner with a 3-second launch floor (the minimum wait since the source's last launch). That runner sleeps for the rest of the floor and only then checks whether its registration was replaced (`fm_procevent_launch_floor_wait` in `bin/fm-procevent-lib.sh`). The test then waits for the claim and re-registers the source. If that takes longer than about 3 seconds after the first launch, the old runner wakes up, finds its registration still current, and runs the stale command. That produces the second log line the test reports. The CI shard was slow (this one test took 160 s). **Fix:** in `tests/fm-procevent.test.sh` I raised the superseded runner's floor from 3 to 15 seconds and added a comment explaining why. The floor now outlasts the fixture setup even on a loaded runner. Nothing else changed: the first launch and the later fresh-registration start still use a 3-second floor, and no product code changed. **Verification:** - The full test file can't give a reliable result on this machine (load average about 64 on 8 cores). It failed earlier, at the reconcile assertion around line 1680, before it reached this section. - I ran the changed section by itself (file setup plus the pacing-race block) five times with the fix: all passed, in about 9-13 s each. - The original code also passed five out of five, so the race didn't reproduce locally. The diagnosis rests on the code path and the CI log. - I haven't seen the full file or the CI shard pass with the fix yet

* no-mistakes(test): Accept Claude folder-trust prompt via down+enter in live e2e

* no-mistakes(document): Note unreadable Claude composer refusal in Herdr docs
…unchenguid#5427)

Speaking as Kun's firstmate: squash-merging — opt-in (forge=gerrit registry-gated; default project-mode stdout restored to two words), attestation MATCH, CI+NM green, safe review, MERGEABLE.
…uid#5358)

* feat(bin): add an opt-in per-home worker account pin

A home that mixes work and personal accounts for one runner had no way to
say which account its workers launch on: Claude workers inherited whatever
CLAUDE_CONFIG_DIR the supervising process had, Pi workers the pane's ambient
root, and an ambient API key outranked both, with no signal at launch.

config/claude-account and config/pi-account now pin that choice per home.
With neither file every launch is unchanged. With one, every launch of that
runner from the home (ship, scout, local secondmate, raw Claude command, and
relaunch) runs under the declared root, and the spawn refuses before any
endpoint exists when the file is malformed or the runner's own check
(claude auth status, pi auth check with a model-listing fallback) says the
pinned account is not signed in. The check runs in a cleared environment so
an ambient credential cannot answer for an empty root. A pinned Claude launch
sheds the environment credentials Claude ranks above a stored login; a pinned
Pi launch needs an explicit <provider>/<id> model for a declared provider and
also carries --provider. The chosen account is printed on the spawned line and
recorded in the task record, and relaunch checks the pin before stopping the
running agent.

* test(secondmate): give the concurrent config-push wait room for a slow host

test_config_reread_serializes_concurrent_pushes waited about two seconds for
the first fm-config-push.sh to reach its first send-keys. On a slower host
that push takes four to five seconds, so the test failed on main before the
push ever got there. The loop still leaves as soon as the marker appears, so
the larger bound costs nothing where the push is fast.

* no-mistakes(review): Refuse raw Claude account overrides under a pin
…ts (kunchenguid#5470)

* fix(bin): keep the Herdr lab session option before a -- delimiter

fm-herdr-lab.sh run appended --session <lab> after every argument, so a
command with a passthrough delimiter such as agent start ... -- <agent args>
handed the session flag to the agent and Herdr routed the call by the
caller's ambient socket instead of the lab.
The helper now inserts --session <lab> immediately before the first --
delimiter and keeps the trailing form otherwise.

* no-mistakes(document): Clarify Herdr lab session option placement
kunchenguid and others added 24 commits September 27, 2026 11:34
…nchenguid#5886)

* Keep lab tmux sockets on short private paths

* no-mistakes(review): Fix Linux stat checks and fail-closed lab tmux teardown

* no-mistakes(document): Update lab helper documentation for isolated tmux sockets
* Allow silent task-level no-change outcomes

* no-mistakes(review): Exclude silent outcomes from captain-return handoffs

* fix: look up supervision receipts by exact sequence

* no-mistakes(review): Suppress silent notes in away-return brief

* no-mistakes(review): Clarify visible notes; remove unused mode

* no-mistakes(review): Clarify silent outcomes and avoid false drain promises

* no-mistakes(document): Clarify silent supervision outcome documentation
…chenguid#5928)

* feat: make /quiet a statement where the attended supervision host runs

On a home that opted into the supervision host, quiet mode is what the
attended host already does, so /quiet now enters nothing there instead of
launching the quiet daemon and writing a record that would park a present
captain's main.

- bin/fm-afk-launch.sh quiet-check says quiet mode needs nothing where the
  attended host runs, or that the session is paused while its
  broken-session latch holds; a quiet enter refuses there before writing
  anything.
- Where the home opted in but the attended host lacks a part (engine,
  tools, verified mirror writer, identifiable main session, valid mirror),
  quiet-check names it and quiet mode falls back to the daemon.
- Under a live away record on that home, quiet-check and a quiet enter
  refuse and name the record, so the return runs first, whatever
  state/.afk says.
- A quiet enter records mode: quiet in the posture record, so start and
  start-native launch the quiet daemon without FM_AFK_MODE, and the away
  refusal wording fires only for away.
- bin/fm-host-mirror.sh check validates the dialog mirror read-only and
  exits 1 on a missing, unreadable, or invalid mirror.
- The quiet and afk skills and the supervision-host docs describe the new
  behavior; homes without the opt-in and Pi homes keep the daemon path.

* no-mistakes(review): Archive the quiet record when a quiet daemon start fails

* no-mistakes(document): Clarify quiet-mode documentation and remove stale duplicates
…uid#5884)

* fix(bin): grant Claude workers their task-channel dirs via --add-dir

Since Claude Code 2.1.257, a file-tool read (Read/Glob/Grep, and an
Edit's mandatory prior read) of a path outside the working directories
parks --permission-mode auto panes on a one-time interactive question,
and a "Block" answer lands permissions.blockReadsOutsideWorkingDirectories
in user settings, refusing the same reads even under bypass. Firstmate
launches Claude with no --add-dir, so a secondmate's parent-home steering
inbox and a ship or scout worker's launch record, steering inbox, brief
dir, and code-root .agents/skills were all outside: workers wedged on
the question the first time they read a steer.

Every Claude launch, spawn and relaunch, in both permission modes, now
grants exactly the task's channel directories: state/<id>.inbox for a
secondmate (in the parent home), or state/operational-inbox,
state/<id>.inbox, data/<id>, and the code root's .agents/skills for a
ship or scout. Paths resolve to real paths and lazily created channel
dirs are made before launch so the grant never names a not-yet-existing
directory; the whole state/ is deliberately never granted.

The grant keeps the bypass-mode launch argv changed on purpose: it also
protects bypass workers against a machine-recorded Block answer.

* no-mistakes(document): Consolidate Claude launch guidance in configuration reference

* no-mistakes(document): Clarify Claude permission documentation reference
…nguid#4819)

* fix(supervision): prevent idle recovery loops without stranding wakes

* no-mistakes(review): Remove unused wake-append rollback helper
…id#5889)

* fix(bin): stop the remote-job worker busy-polling an idle queue

The serving loop slept 50ms between passes and re-ran state preparation
(chmod on every queue directory), the heartbeat publish, and the stale sweep
on every pass. It now blocks on a worker.wake FIFO that staging,
cancellation, and lane exit nudge, keeps a short fast-poll window after
activity, refreshes the heartbeat at most once a second, and runs the sweep
(which re-applies the queue directories' 0700 modes) at startup and then on
a bounded interval. Lane-owned records are no longer re-read every pass.

Measured with a fork/execve-interposing counter on a --serve worker in a
disposable HOME and queue, bash 3.2, 20-second windows (the counter slows
the old loop to about 5 passes a second, so real-host rates were higher):
  idle worker             146 forks/s, 61 execs/s -> 4.8 forks/s, 3.1 execs/s
  one running long job    232 forks/s, 100 execs/s -> 15 forks/s, 11 execs/s
Stage-to-result latency for a no-op job, idle and back to back, stayed at
about 0.8-1.2s in both versions (dominated by job execution, not pickup).

* perf(bin): drop per-cycle forks from watcher, drain, and lock helpers

The watcher, drain, inactive-reconcile scan, and branch-outcome reads forked
small external commands on every cycle where bash can do the same work.

- fm-wake-lib.sh gains fm_dirname_to, fm_basename_to, and
  fm_epoch_seconds_to, exact stand-ins for $(dirname --), $(basename --),
  and $(date +%s); the clock uses printf %(%s)T on bash 4.2+ and still forks
  date exactly once on stock macOS bash 3.2.
- fm_lock_abs_path, fm_wake_signal_seen_path, fm_path_age, the watcher's
  age_of and wedge timer, and the recovery-marker line count use them or
  plain reads instead of dirname/basename/tr/date/wc.
- window_to_task reads a meta file once instead of two
  grep | tail -1 | cut -d= -f2- pipelines per file per call.
- fm-classify-lib.sh reads uname -s once at source time instead of in every
  status stat helper.
- Libraries sourced every cycle derive their own directory without forking
  dirname, including the backend adapter siblings a subshell re-sources on
  each probe.

tests/fm-fork-free-helpers.test.sh pins each replacement against the command
it replaces on edge-case inputs, under every available bash and both the C
and a UTF-8 locale; CI's stock macOS bash lane runs it under /bin/bash 3.2.

Measured with a fork/execve-interposing counter in a disposable home, one
tmux crew task, FM_POLL=1 (forks and execs per watcher cycle, per run
otherwise):
  watcher cycle      bash 5.3  299/138 -> 199/66   bash 3.2  341/146 -> 224/80
  drain              bash 5.3  492/238 -> 430/200  bash 3.2  567/250 -> 491/212
  inactive scan      bash 5.3   27/14  ->  17/4    bash 3.2   37/14  ->  17/4
  branch-outcome     bash 5.3   40/21  ->  35/16   bash 3.2   48/24  ->  38/19

* test: note the interpreter-expanded version probe for shellcheck

* no-mistakes(review): Fix worker idle bounds and fork-free contributions snapshot

* no-mistakes(review): Coalesce buffered worker wake nudges into one wake

* no-mistakes(review): Coalesce wake nudges via pending marker so publishers never block

* no-mistakes(review): Claim wake nudges atomically via noclobber pending marker

* no-mistakes(review): Release abandoned wake claims only after a 30-second bound

* no-mistakes(review): Drop worker wake FIFO; load path helpers side-effect free

* no-mistakes(document): Document remote worker polling and preemption cadence

* no-mistakes(ci): Fixed both failing CI shards: isolated remote and teardown test fixtures now include fm-path-lib.sh, which fm-wake-lib.sh requires. The three affected tests, fm-lint.sh, and git diff --check pass locally
…uid#5941)

* fix: keep a successor watcher and remote-reply listeners across the gaps that dropped them

A main-only supervision pass-through exited without leaving a watcher, and each remote-reply poll released its claim until the next cycle, so short-lived listeners stayed down.

* no-mistakes(document): Clarify listener and supervision continuity documentation

* no-mistakes(ci): Fixed the three Greptile findings: failed ingestion leaves one durable capture, failed reads exit instead of relistening, and the disposable-checkout guard rejects state paths outside the marked lab. Added behavioral tests; the remote-reply and watcher-lock suites, shell syntax checks, and git diff checks passed

* no-mistakes(ci): Fixed a race in the wake-queue interruption test: it now waits for the drain to own the lock and enter handling before signaling it. The wake-queue suite, shell syntax check, and diff check pass
…enguid#5925)

* fix: date replayed branch outcomes and ask main to check current state first

A captain outcome main never acknowledged is presented again, which after a
harness or posture switch, or the first drain after the upgrade whose earlier
presenter never advanced the read cursor, can be days after its situation
settled. The replay read as fresh news, so a PR since merged looked ready.

bin/fm-branch-outcome.sh now adds a "recordedAgo" age (minutes, hours, then
days) to present and unprocessed rows, one owner of that wording for both
presenters. The drain's BRANCH OUTCOMES captain lines and the Pi branch's
processing request name that age and ask main to check the task's current
state first; an outcome already settled needs only the acknowledgement, with
nothing relayed to the captain. Nothing is adopted as processed, so a fresh
home's first outcome is still presented until acknowledged.

* no-mistakes(review): Absent processed marker reads 0; never adopt read cursor

* no-mistakes(review): Require recordedAgo in Pi requests; report undated rows to main

* no-mistakes(review): Keep recordedAgo on captain rows only in present output

* no-mistakes(document): Correct cutover documentation and retire stale migration guidance

* fix: keep settled branch outcomes out of main's reply to the captain

A live Pi primary that took over a host-drain home received the carried-over
outcomes dated and check-first, but its processing reply still told the
captain about an outcome whose decision had since been answered. The request
also claimed every outcome was already shown as an anchor entry in this
transcript, which is false for an outcome carried over from before a restart
or a switch of primary.

The Pi processing request now says each outcome was recorded earlier and may
already have been seen or handled, and that a settled outcome gets no
captain-facing mention at all in the reply or any recap, not even that it is
settled. The drain's BRANCH OUTCOMES header and the supervision docs state the
same rule, and the tests check both delivered texts.

* fix: scope main's outcome reply to what is still open

Telling main what not to say about a settled outcome was not enough: in two
live Pi trials the processing reply still told the captain that an answered
decision was settled. Main now sorts the outcomes by current state first, and
its reply to the captain covers only the still-open ones, written as if the
settled ones had never been listed. With that framing three live Pi trials
kept the settled outcome out of the reply and relayed the open one each time.

The drain's BRANCH OUTCOMES header and the supervision docs use the same
framing, and the tests check both delivered texts.

* no-mistakes(review): Clarify that main acknowledges every presented captain outcome

* no-mistakes(document): Clarify outcome cursor ownership across Pi and host

* no-mistakes(ci): Fixed Pi replay by batching unprocessed captain outcomes oldest-first and acknowledging only through each batch. Verified a marker-less backlog over 1 MiB replays through all batches. A real-drain regression confirms an older keyed decision remains under OPEN DECISIONS after a newer branch row is acknowledged; the check-first instruction now names those decisions. Relevant targeted tests and branch-supervision tests passed; the full host suite timed out

* no-mistakes(ci): Fixed the host drain’s check-first wording in bin/fm-wake-drain.sh; the CI fixture now passes. The full host suite passed the affected fixtures but timed out later. Syntax and diff checks passed

* no-mistakes(ci): Fixed ci-1: abbreviated Pi outcome summaries now stay within 1,024 characters and include a row-specific full-outcome lookup command. The delivered instruction requires reading the full outcome before acting, relaying, or acknowledging it. The new extension-driver regression failed before the fix and passes now; the Pi and supervision-host suites pass

* no-mistakes(ci): Corrected the batching sentence in docs/pi-supervision-branch.md. The cancelled CI check needs no code fix; its clean rerun passed. The Pi branch extension suite and git diff check passed
…guid#5961)

* fix: wake an idle Claude primary for attended main-only hand-backs

An attended main-only pass-through confirmed a handling handoff for the
successor it leaves running, which flipped the recovery marker to handling.
The Claude Stop hook only rewakes main while that marker reads downtime, so
the close reached no one and an idle primary slept with wakes queued.

The pass-through now leaves the marker at downtime, and a close that turns
main-only at its turn hands the consumed handoff back to downtime before it
reaches main. Regression tests drive the real Stop hook around the real host
on both paths and for the successor's own later close, and a new opt-in live
guard proves it against an idle interactive Claude primary with a pre-fix
negative control.

* no-mistakes(review): Assert live lab Stop-hook registration via parsed settings JSON

* no-mistakes(document): Correct supervision hand-back documentation

* no-mistakes(ci): Fixed the failed downtime-write path so the Stop hook notifies main instead of silently dropping the close. Corrected the live guard’s tracked-hook check and added the requested at-turn main-only scenario. The new regression failed before the fix and passed after it; the host suite, syntax checks, and diff check pass. The credentialed live guard was not run in this CI phase because it writes outside the worktree

* no-mistakes(ci): Fixed the Stop hook’s retry ordering: a crashed host gets its bounded retry before a non-crash hand-back failure is reported. The Stop-hook suite passes, including the crash regression. The host suite passed the failed-marker-write regression but timed out before completing; syntax and diff checks pass
kunchenguid#5916)

* Fix worker launches to enter recorded worktrees

* no-mistakes(review): placeholder

* no-mistakes(document): Update agent-control.md worktree-refusal note to match new universal cd+assert

* no-mistakes(review): Add regression tests for Orca spawn/relaunch worktree carve-outs

* Fix PR relaunch and prelaunch cwd verification

* no-mistakes(document): Fix docs/agent-control.md: worktree cwd check is pre-launch, not post-launch

* fix: slim worktree launch change onto upstream main
…ardown (kunchenguid#5997)

* WIP: retire task-keyed watcher markers and orphan journals at teardown

Re-applies old PR kunchenguid#5584 on current main: teardown retires the
turn-ended .seen-* signature and an orphaned Herdr presentation
journal whose workspace is already gone, and the wake-drain rotates
its own dead scratch files. Not yet validated through no-mistakes.

* no-mistakes(ci): Fixed the Greptile P1 finding in bin/backends/herdr.sh. fm_backend_herdr_projection_token_workspace_gone used `! ... jq -e ... 2>&1`, which swallowed a jq runtime error (thrown when a non-object workspace entry, e.g. a number before a live token-bearing workspace, hits `.label`) and flipped it to a "gone" verdict, causing teardown to delete a still-live v1 presentation journal. Invariant: a workspace-query error/ambiguity must never be read as token absence; only a cleanly-parsed list with no token-bearing label is "gone". Replaced the body with a single jq verdict (unknown/present/gone): a non-array list or any non-object/non-string-label entry yields "unknown", jq errors/empty output fall through `|| return 1` to unknown, and only "gone" returns 0. Sibling fm_backend_herdr_projection_endpoint_matches_journal already fails safe on jq error (empty match -> journal kept), so it needed no change, matching the author's scoping. Added test_teardown_retains_v1_journal_when_workspace_query_ambiguous driving real teardown with a malformed workspace-list entry, proving the journal is kept and no workspace close occurs. Verified the old logic returns GONE on that input (test fails before, passes after); full tests/fm-teardown.test.sh suite passes (exit 0) and shellcheck is clean. Marker-naming finding left untouched per explicit out-of-scope instruction
…unchenguid#6002)

* fix(tests): disable Claude Code's auto-updater during live harness runs

fm_live_gate let a live run proceed without ever setting
DISABLE_AUTOUPDATER, so a live Claude test could let the real updater
repoint ~/.local/bin/claude into a temporary directory and stop every
Claude process on the machine from starting. Export
DISABLE_AUTOUPDATER=1 on every path where the gate lets a live run
proceed, and assert the export in tests/fm-live-gate.test.sh, including
that it reaches a child process the same way a real harness pane would
inherit it.

* no-mistakes(ci): Greptile flagged that the PR's DISABLE_AUTOUPDATER inheritance test only checked a `bash -c` direct child, not the fm-spawn.sh launch path. The user chose to fix it with a regression on that path. In tests/fm-live-gate.test.sh I replaced the generic child test with test_disable_autoupdater_reaches_the_claude_pane_on_the_fm_spawn_launch_path: it drives the real fm-spawn claude launch through the spawn fixtures, captures the exact staged launch command, and runs it as a synthetic pane whose only `claude` is a stub recording the inherited DISABLE_AUTOUPDATER, asserting it saw 1. Switched the file to source fixtures.sh (pulls in lib.sh, guarded) for the spawn helpers. Verified it is a real guard: the stub records `1` when the ambient var is set and `unset` when absent, so it fails if fm-spawn ever scrubbed the variable (e.g. env -i or -u). This confirms fm-spawn's launch construction never references the name and passes it through via ordinary ambient inheritance with no allowlist. Full suite passes (12 tests ok), shellcheck clean. Note for the outer executor: I embedded the daemon caveat as a code comment in the test, but the finding also asks the PR body to state that a backend daemon already running before the gate exported the variable does not inherit it and fully covering that would need launcher support - that forge-side PR-body sentence is outside this CI phase's scope

* no-mistakes(ci): Fixed Greptile finding ci-1. Root cause: fm-spawn.sh handed its launch command to an already-running backend daemon that never inherited the test process's exported DISABLE_AUTOUPDATER, so ambient inheritance dropped it and Claude's auto-updater could still run. Fix (bin/fm-spawn.sh): when DISABLE_AUTOUPDATER is set in the spawn's own environment, embed `export DISABLE_AUTOUPDATER=<value>;` into the LAUNCH command text (same idiom as the adjacent COMPACT_ADVISER_DISABLE export), so it survives a daemon-built pane, the env -i allowlist path, and relaunch alike; gated on presence so ordinary spawns are unchanged. Added regression test test_disable_autoupdater_survives_a_daemon_pane_that_never_inherited_it in tests/fm-live-gate.test.sh: stages a real claude launch with DISABLE_AUTOUPDATER set in the spawn env, then runs that exact command in a synthetic pane with `env -u DISABLE_AUTOUPDATER` and asserts the claude stub still recorded autoupdater=1. Verified the test fails (autoupdater=unset) without the fix and passes with it; the round-1 ambient test stays green either way. Full suite passes (13 ok); test file and isolated snippet shellcheck-clean (full fm-spawn.sh shellcheck kept getting terminated by the memory-constrained host, not by findings). Forge-side note for the outer executor: the PR-body caveat that fully covering the daemon case would need launcher support no longer applies to the Claude launch path and should be corrected
…cevent record (kunchenguid#6010)

* fix(bin): ring the inbox doorbell only for a newly published procevent result

publish_result rewrote a worker's captured Lavish round idempotently on
every reconcile, unconditionally moved an already-acknowledged inbox
record back out of handled/, and rang the doorbell every time - so an
already-processed round rang the owning worker on every cycle. Snapshot
the existing active and handled records before the idempotent write and
ring, or move anything, only when the write actually created a fresh
record; re-delivery of a still-open round is left to the inbox's own
re-ring ladder.

* no-mistakes(document): docs: reflect worker-board doorbell rings only on fresh inbox record

* no-mistakes(ci): Fixed Greptile finding ci-1 in tests/fm-procevent.test.sh (test-only change). The redelivery regression previously moved the delivered note into handled/ before any repeated reconciles, so it only proved an acknowledged note stays quiet and would still pass if an unchanged active note rang every cycle. Per the user's instruction, I inserted (before the mv into handled/) five repeated `pe reconcile` runs with the note still in the active inbox and asserted the ring log holds exactly one line and 001.msg remains active; the existing acknowledged-note assertion after the move is kept unchanged. No product code changed. bash -n confirms syntax is valid; the block mirrors the already-passing post-move reconcile/ring-count assertion directly below it
…unchenguid#6032)

* fix(bin): make the Claude Stop auto-arm refuse arguments before arming

A model running bin/fm-claude-stop-autoarm.sh --help mid-turn armed a real
supervision-host park owned by its short-lived tool process, leaving
supervision down once that process exited. The Stop hook passes no
arguments, so -h/--help now prints usage and any other argument is refused
before anything is sourced, read, or armed.

* no-mistakes(document): Clarify Claude Stop hook documentation for manual invocations

* no-mistakes(ci): Updated the argument-run regression test to compare checksums of state files as well as entry names. The Stop auto-arm test suite passes, and git diff --check is clean

* docs: restore the bin/ toolbelt intro's manual-use clause

The document step dropped "interactive entrypoints work by hand too" from
docs/scripts.md, which still holds for most bin/ scripts.

* no-mistakes(document): Clarify Claude auto-arm manual-use guidance
…uid#6039)

* feat(calm): show supervision sailboat and anchor notes on Claude Code

The Calm mod follows a bounded display tail copy of the outcome store,
which bin/fm-branch-outcome.sh append now refreshes, and the supervision
host's latch, and appends one dim transcript line per visible routine
outcome, captain outcome, and latch change, replaying unread and
unprocessed outcomes at session start. It shows them whenever the mod is
active, regardless of config/calm, and never marks anything read.

* fix(calm): show each supervision note once per session on Claude Code

Claude Code 2.1.283 stores ui.log lines in the session and restores them
on --continue, so the mod records how far each session has followed the
outcome store and a resume replays only newer outcomes. It also checks
file existence before reads so absent files do not log debug errors.
The live guard gains the supervision-notes scenario and the dated
2.1.283 record documents the observed behavior.

* docs: name the Claude supervision note row as the engine draws it

* no-mistakes(review): Seed outcome tail on present and anchor first tail on markers

* no-mistakes(review): Seed outcome tail at session start; replay against start markers

* no-mistakes(review): Bound outcome tail by bytes; reread recently changed files

* no-mistakes(review): Skip store validation when outcome tail already exists

* no-mistakes(document): Clarify bounded Claude supervision note replay

* no-mistakes(ci): Fixed seed-tail to validate only a bounded suffix of complete store rows and write it through the existing byte- and row-limited tail writer. Added a regression test with malformed history outside that window and updated the script header. Outcome tests and shellcheck passed; the full session-start suite timed out after 240 seconds
…enguid#6033)

* fix(bin): read a quiet-mode record as a present captain, never hold-for-return

Daemon-backed quiet mode writes the away-posture record marked mode: quiet,
but the entry announcement, read-back, and session-start digest rendered it
as "hold-for-return only", and the spend cap and PR merge gate treated it as
away. A present captain's requested actions could then be held for a return
that was not coming.

bin/fm-afk-contract.sh now owns which posture a record is (the mode
subcommand, fm_afk_contract_mode, fm_afk_contract_away_present). A quiet
record announces, reads back, and appears in the digest as a present captain
holding nothing; merges under it stay attended and it binds no spend cap. An
away record is unchanged, an /afk entry over quiet mode rewrites the record
as away, and a quiet entry never turns a standing away record quiet.

* no-mistakes(document): Clarify quiet-mode authority and remove stale away guidance

* no-mistakes(ci): The CI failure came from a race in the supervision-host test: its restart fixture could observe a watcher left by the preceding cycle. The test now retires that watcher and waits for the fixture arm to report its own started cycle. The focused test passed three times; the full suite was attempted but stopped at a separate intermittent test failure

* no-mistakes(ci): Fixed daemon refresh mode selection so an unset-mode refresh follows the posture record: /afk over a running quiet daemon now changes state/.afk to away, while a plain quiet refresh stays quiet. Added script-level regression coverage for start and start-native and corrected a quiet-refresh fixture. The launch test suite, syntax checks, and diff check passed

* no-mistakes(ci): Herdr was blocked before tests ran by a GitHub HTTP 500 downloading pinned Treehouse; no code change was warranted for that check. Fixed the Lint 1 ShellCheck warning in tests/fm-afk-launch.test.sh by annotating the intentional background PID capture. The focused test suite, ShellCheck, syntax check, and diff check passed
…merge (kunchenguid#6053)

* fix(bin): accept a task's next PR once fm-pr-merge confirms the bound one merged

require_recorded_pr_identity now checks fm_pr_poll_merge_already_notified for
the recorded pr= before refusing a different URL, so a task's later PR is
accepted once its earlier PR's merge is confirmed, while it keeps refusing
while the bound PR is still unmerged.

* no-mistakes(document): docs(fm-pr-merge): note next-PR accepted after bound PR merges
Brings in upstream through eb219c8. Fork changes are carried onto
upstream's new structure; the ship-branch prefix now defaults to a bare
task id through the registry parser rather than per-script defaults.
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 334 files, which is 184 over the limit of 150.

To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to Team to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: ad3ea56a-119c-410e-81bc-b0f3aae30f66

📥 Commits

Reviewing files that changed from the base of the PR and between ec2b919 and 1f7db9c.

📒 Files selected for processing (334)
  • .agents/skills/afk/SKILL.md
  • .agents/skills/agent-skill-trigger-index/SKILL.md
  • .agents/skills/ahoy/SKILL.md
  • .agents/skills/away-quiet-supervision/SKILL.md
  • .agents/skills/bootstrap-diagnostics/SKILL.md
  • .agents/skills/captain-hold-lifecycle/SKILL.md
  • .agents/skills/firstmate-codexapp/SKILL.md
  • .agents/skills/firstmate-coding-guidelines/SKILL.md
  • .agents/skills/fmx-respond/SKILL.md
  • .agents/skills/harness-adapters/SKILL.md
  • .agents/skills/harness-adapters/references/common/control-and-recovery.md
  • .agents/skills/harness-adapters/references/common/primary-hooks.md
  • .agents/skills/harness-adapters/references/harness/claude.md
  • .agents/skills/harness-adapters/references/harness/codex.md
  • .agents/skills/harness-adapters/references/harness/cursor.md
  • .agents/skills/harness-adapters/references/harness/devin.md
  • .agents/skills/harness-adapters/references/harness/grok.md
  • .agents/skills/harness-adapters/references/harness/omp.md
  • .agents/skills/harness-adapters/references/harness/opencode.md
  • .agents/skills/harness-adapters/references/harness/pi.md
  • .agents/skills/operational-home-layout/SKILL.md
  • .agents/skills/process-event-sources/SKILL.md
  • .agents/skills/project-management/SKILL.md
  • .agents/skills/quiet/SKILL.md
  • .agents/skills/scout-completion/SKILL.md
  • .agents/skills/secondmate-provisioning/SKILL.md
  • .agents/skills/session-start-recovery/SKILL.md
  • .agents/skills/ship-landing/SKILL.md
  • .agents/skills/stow/SKILL.md
  • .agents/skills/stuck-crewmate-recovery/SKILL.md
  • .agents/skills/validation-supervision/SKILL.md
  • .claude/mods/firstmate-calm/hooks/register.ts
  • .claude/mods/firstmate-calm/lib/fm-branch-notes.ts
  • .claude/mods/firstmate-calm/lib/fm-calm-presentation.ts
  • .claude/mods/firstmate-calm/lib/fm-operational-input.ts
  • .claude/mods/firstmate-calm/tests/branch-notes.test.ts
  • .claude/mods/firstmate-calm/tests/calm.test.ts
  • .claude/mods/firstmate-calm/tests/support.ts
  • .claude/settings.json
  • .cursor/hooks.json
  • .github/workflows/ci.yml
  • .no-mistakes.yaml
  • .omp/extensions/fm-primary-omp-watch.ts
  • .opencode/plugins/fm-primary-watch-arm.js
  • .pi/extensions/fm-branch-supervision.ts
  • .pi/extensions/fm-calm.ts
  • .pi/extensions/fm-primary-pi-watch.ts
  • .pi/extensions/lib/fm-branch-dispatch.ts
  • .pi/extensions/lib/fm-calm-operational-user-layout.ts
  • .pi/extensions/lib/fm-calm-pending-operational-layout.ts
  • .pi/extensions/lib/fm-operational-input.ts
  • AGENTS.md
  • README.md
  • bin/backends/herdr.sh
  • bin/fm-afk-contract.sh
  • bin/fm-afk-launch.sh
  • bin/fm-afk-return.sh
  • bin/fm-afk-start.sh
  • bin/fm-agent-process-lib.sh
  • bin/fm-arm-command-policy.mjs
  • bin/fm-backend.sh
  • bin/fm-backlog-transition-lib.sh
  • bin/fm-bearings-snapshot.sh
  • bin/fm-bootstrap.sh
  • bin/fm-branch-dispatch.mjs
  • bin/fm-branch-outcome.sh
  • bin/fm-branch-prefix-lib.sh
  • bin/fm-branch-prompt.sh
  • bin/fm-branch-report.sh
  • bin/fm-brief-heading-lib.sh
  • bin/fm-brief.sh
  • bin/fm-busy-lib.sh
  • bin/fm-classify-lib.sh
  • bin/fm-claude-stop-autoarm.sh
  • bin/fm-claude-trust.sh
  • bin/fm-composer-lib.sh
  • bin/fm-config-inherit-lib.sh
  • bin/fm-contributions.sh
  • bin/fm-control-lib.sh
  • bin/fm-control.sh
  • bin/fm-crew-state.sh
  • bin/fm-devin-config.sh
  • bin/fm-dispatch-resolve.sh
  • bin/fm-dod-lib.sh
  • bin/fm-ensure-agents-md.sh
  • bin/fm-ff-lib.sh
  • bin/fm-fleet-ledger.sh
  • bin/fm-fleet-snapshot.sh
  • bin/fm-fleet-sync.sh
  • bin/fm-forge-detect.sh
  • bin/fm-gate-refuse-lib.sh
  • bin/fm-git-strip-ai-trailers.sh
  • bin/fm-guard.sh
  • bin/fm-harness.sh
  • bin/fm-herdr-lab.sh
  • bin/fm-home-seed.sh
  • bin/fm-host-mirror.sh
  • bin/fm-inactive-reconcile.sh
  • bin/fm-jev-mem-guard.py
  • bin/fm-jev-mem-guard.sh
  • bin/fm-lab-home.sh
  • bin/fm-lease-lib.sh
  • bin/fm-lint.sh
  • bin/fm-merge-authority-lib.sh
  • bin/fm-merge-local.sh
  • bin/fm-merge-outcome-lib.sh
  • bin/fm-nm-run-lib.sh
  • bin/fm-operational-input.sh
  • bin/fm-parent-channel-lib.sh
  • bin/fm-path-lib.sh
  • bin/fm-pending-reply-lib.sh
  • bin/fm-pr-check.sh
  • bin/fm-pr-lib.sh
  • bin/fm-pr-merge.sh
  • bin/fm-pr-poll.sh
  • bin/fm-procevent-lavish.sh
  • bin/fm-procevent-lib.sh
  • bin/fm-procevent-remote-reply.sh
  • bin/fm-procevent.sh
  • bin/fm-project-mode.sh
  • bin/fm-promote.sh
  • bin/fm-public-followup-emit.sh
  • bin/fm-public-followup-lib.sh
  • bin/fm-public-followup.sh
  • bin/fm-push-transition-lib.sh
  • bin/fm-quota-axi-lib.sh
  • bin/fm-remote-home-provision.sh
  • bin/fm-remote-home-seed.sh
  • bin/fm-remote-inherit-push.sh
  • bin/fm-remote-inherit.sh
  • bin/fm-remote-job-lib.sh
  • bin/fm-remote-job-worker.sh
  • bin/fm-remote-secondmate-control.sh
  • bin/fm-remote-secondmate-relaunch.sh
  • bin/fm-review-diff.sh
  • bin/fm-secondmate-liveness-lib.sh
  • bin/fm-secondmate-restart.sh
  • bin/fm-send.sh
  • bin/fm-session-lock-lib.sh
  • bin/fm-session-start.sh
  • bin/fm-spawn.sh
  • bin/fm-startup-network.sh
  • bin/fm-supervise-daemon.sh
  • bin/fm-supervision-engine-lib.sh
  • bin/fm-supervision-host.sh
  • bin/fm-supervision-instructions.sh
  • bin/fm-task-inbox-lib.sh
  • bin/fm-tasks-axi-lib.sh
  • bin/fm-tasks-axi.sh
  • bin/fm-teardown.sh
  • bin/fm-test-run.sh
  • bin/fm-timeout-lib.sh
  • bin/fm-tmux-lib.sh
  • bin/fm-tool-update-check.sh
  • bin/fm-turnend-guard-cursor.sh
  • bin/fm-wake-drain.sh
  • bin/fm-wake-lib.sh
  • bin/fm-watch-arm.sh
  • bin/fm-watch-checkpoint.sh
  • bin/fm-watch.sh
  • bin/fm-worker-account-lib.sh
  • bin/fm-x-dismiss.sh
  • bin/fm-x-followup.sh
  • bin/fm-x-poll.sh
  • bin/fm-x-reply.sh
  • bin/fm_voice_records.py
  • docs/agent-control.md
  • docs/architecture.md
  • docs/arm-pretool-check.md
  • docs/calm-mode-feasibility.md
  • docs/calm.md
  • docs/captain-hold-lifecycle.md
  • docs/configuration.md
  • docs/documentation-audiences.json
  • docs/fleet-ledger.md
  • docs/fm-test-portable-shards.md
  • docs/gerrit-change-watch.md
  • docs/gerrit-forge-integration.md
  • docs/gitlab-merge-watch.md
  • docs/herdr-backend.md
  • docs/jev-guards.md
  • docs/pi-supervision-branch.md
  • docs/remote-secondmates.md
  • docs/scripts.md
  • docs/secondmate-parent-channel.md
  • docs/sessionstart-nudge.md
  • docs/supervision-host.md
  • docs/supervision-protocols/claude.md
  • docs/supervision-protocols/cursor.md
  • docs/supervision-protocols/grok.md
  • docs/supervision-protocols/omp.md
  • docs/supervision-protocols/pi.md
  • docs/supervision-protocols/supervision-host.md
  • docs/tmux-backend.md
  • docs/trace-context.md
  • docs/turnend-guard.md
  • docs/verification/devin.md
  • docs/verification/dispatch-resolve.md
  • docs/verification/process-event-sources.md
  • docs/verification/public-followup.md
  • docs/verification/runtime-backends.md
  • docs/verification/supervision.md
  • docs/watcher-continuity.md
  • tests/captures/no-mistakes-v1.70.1/README.md
  • tests/fm-afk-contract.test.sh
  • tests/fm-afk-inject-e2e.test.sh
  • tests/fm-afk-inject-herdr-e2e.test.sh
  • tests/fm-afk-launch.test.sh
  • tests/fm-afk-return.test.sh
  • tests/fm-arm-pretool-check.test.sh
  • tests/fm-backend-herdr-launcher-workspace-e2e.test.sh
  • tests/fm-backend-herdr-workspace-per-home-e2e.test.sh
  • tests/fm-backend-herdr.test.sh
  • tests/fm-backend-orca.test.sh
  • tests/fm-backend.test.sh
  • tests/fm-backlog-atomicity.test.sh
  • tests/fm-backlog-read-bound.test.sh
  • tests/fm-bearings-board-lavish-live-e2e.test.sh
  • tests/fm-bearings-board-render.test.sh
  • tests/fm-bearings-board.test.sh
  • tests/fm-bearings-snapshot.test.sh
  • tests/fm-bootstrap-network-parallel.test.sh
  • tests/fm-bootstrap.test.sh
  • tests/fm-branch-supervision.test.sh
  • tests/fm-brief.test.sh
  • tests/fm-calm-claude-mod-live-e2e.test.sh
  • tests/fm-calm-claude-mod-plugin.test.sh
  • tests/fm-calm-claude-mod.test.sh
  • tests/fm-calm-pi-extension.test.sh
  • tests/fm-calm-pi-queue-retention-live-e2e.test.sh
  • tests/fm-captain-hold-lifecycle.test.sh
  • tests/fm-classify-corr-token.test.sh
  • tests/fm-classify-decision-key.test.sh
  • tests/fm-claude-stop-autoarm.test.sh
  • tests/fm-claude-trust.test.sh
  • tests/fm-composer-lib.test.sh
  • tests/fm-contributions.test.sh
  • tests/fm-control-relaunch.test.sh
  • tests/fm-control.test.sh
  • tests/fm-crew-state.test.sh
  • tests/fm-cursor-primary.test.sh
  • tests/fm-daemon.test.sh
  • tests/fm-devin-harness.test.sh
  • tests/fm-devin-signals-live-e2e.test.sh
  • tests/fm-dispatch-resolve.test.sh
  • tests/fm-dod-lib.test.sh
  • tests/fm-extension-binding.test.sh
  • tests/fm-fleet-ledger.test.sh
  • tests/fm-fleet-sync.test.sh
  • tests/fm-forge-detect.test.sh
  • tests/fm-fork-free-helpers.test.sh
  • tests/fm-gate-refuse.test.sh
  • tests/fm-gemini-harness.test.sh
  • tests/fm-git-strip-ai-trailers.test.sh
  • tests/fm-gotmp.test.sh
  • tests/fm-guard-stale-banner.test.sh
  • tests/fm-harness-precedence.test.sh
  • tests/fm-herdr-lab.test.sh
  • tests/fm-herdr-submit-confirm-live-e2e.test.sh
  • tests/fm-host-mirror-live-e2e.test.sh
  • tests/fm-host-mirror.test.sh
  • tests/fm-inactive-reconcile.test.sh
  • tests/fm-jev-mem-guard.test.sh
  • tests/fm-kimi-harness.test.sh
  • tests/fm-lint.test.sh
  • tests/fm-live-gate.test.sh
  • tests/fm-mail-check.test.sh
  • tests/fm-merge-local.test.sh
  • tests/fm-omp-harness.test.sh
  • tests/fm-on.test.sh
  • tests/fm-operational-input.test.sh
  • tests/fm-pi-branch-extension.test.sh
  • tests/fm-pi-codex-native.test.sh
  • tests/fm-pi-primary-live-e2e.test.sh
  • tests/fm-pi-primary-types.test.sh
  • tests/fm-pi-watch-extension.test.sh
  • tests/fm-pr-check-security.test.sh
  • tests/fm-pr-merge.test.sh
  • tests/fm-procevent-quota.test.sh
  • tests/fm-procevent.test.sh
  • tests/fm-public-followup.test.sh
  • tests/fm-quota-choose.test.sh
  • tests/fm-remote-backlog-handoff.test.sh
  • tests/fm-remote-doctor.test.sh
  • tests/fm-remote-job.test.sh
  • tests/fm-remote-reply.test.sh
  • tests/fm-remote-secondmate-lifecycle-e2e.test.sh
  • tests/fm-remote-secondmate-relaunch.test.sh
  • tests/fm-remote-transport-lanes.test.sh
  • tests/fm-review-diff.test.sh
  • tests/fm-secondmate-harness.test.sh
  • tests/fm-secondmate-lifecycle-e2e.test.sh
  • tests/fm-secondmate-liveness.test.sh
  • tests/fm-secondmate-reconcile.test.sh
  • tests/fm-secondmate-restart.test.sh
  • tests/fm-secondmate-safety.test.sh
  • tests/fm-secondmate-sync.test.sh
  • tests/fm-send-resolve-key.test.sh
  • tests/fm-session-lock-ancestry.test.sh
  • tests/fm-session-start.test.sh
  • tests/fm-shared-captain-inheritance.test.sh
  • tests/fm-spawn-compact-adviser-disable.test.sh
  • tests/fm-spawn-dispatch-profile.test.sh
  • tests/fm-spawn-orca-worktree.test.sh
  • tests/fm-spawn-worktree-settle.test.sh
  • tests/fm-startup-memory-budget.test.sh
  • tests/fm-startup-network.test.sh
  • tests/fm-supervision-host-attended-live-e2e.test.sh
  • tests/fm-supervision-host-live-e2e.test.sh
  • tests/fm-supervision-host.test.sh
  • tests/fm-supervision-instructions.test.sh
  • tests/fm-task-delivery.test.sh
  • tests/fm-task-inbox.test.sh
  • tests/fm-tasks-axi.test.sh
  • tests/fm-teardown-endpoint-safety.test.sh
  • tests/fm-teardown.test.sh
  • tests/fm-test-run.test.sh
  • tests/fm-timeout-lib.test.sh
  • tests/fm-tmux-agent-liveness.test.sh
  • tests/fm-tool-update-check.test.sh
  • tests/fm-trace-context-spawn.test.sh
  • tests/fm-turnend-guard.test.sh
  • tests/fm-voice-relay.test.sh
  • tests/fm-wake-drain-unread-status.test.sh
  • tests/fm-wake-queue.test.sh
  • tests/fm-watch-arm.test.sh
  • tests/fm-watch-checkpoint.test.sh
  • tests/fm-watch-triage.test.sh
  • tests/fm-watcher-lock.test.sh
  • tests/fm-worker-account-live-e2e.test.sh
  • tests/fm-worker-account.test.sh
  • tests/fm-x-mode.test.sh
  • tests/lib.sh
  • tests/wake-helpers.sh

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands.

…d by tests/fm-fleet-ledger.test.sh, a test that came in from upstream in this sync. Its setup created the task worktree on "fm/$TASK" but spawned without --branch-prefix. Under the fork's bare-<task-id> default (user decision, review round 1), the spawn records branch=<id>, so fm-merge-local failed with "branch on-lifecycle-t1 does not exist". Fix: the test setup now creates the worktree on the bare "$TASK" (tests/fm-fleet-ledger.test.sh:44), which matches the branch the spawn records. No product code changed. Ran bash tests/fm-fleet-ledger.test.sh locally: all 10 cases pass
@JacyAnderson
JacyAnderson merged commit 9b2d715 into main Sep 29, 2026
22 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.