Skip to content

fix: sync upstream kunchenguid/firstmate 706254de as a true merge - #33

Merged
digbycampbell merged 292 commits into
mainfrom
fm/fm-upstream-sync-r2
Sep 23, 2026
Merged

digbycampbell merged 292 commits into
mainfrom
fm/fm-upstream-sync-r2

Conversation

@digbycampbell

@digbycampbell digbycampbell commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Intent

Merge upstream kunchenguid/firstmate into this fork as a TRUE merge. This is a firstmate-repo task: the firstmate-coding-guidelines apply (one sentence per line in tracked Markdown, plain dash, bin/*.sh pass shellcheck via bin/fm-lint.sh, tests in tests/.test.sh exercising behavior through executable interfaces, never asserting implementation-source bytes).

THE PR MUST BE LANDED WITH A MERGE COMMIT. Say so at the top of the PR body so a reviewer does not squash it. Never squash, never rebase the fork's commits, never force-push. (The pipeline's rebase step is skipped on this run for that reason; main has not moved.)

Situation (from the brief): this repo is a fork of kunchenguid/firstmate (remote upstream). Upstream tip at intake: 706254d (2026-09-22). The last sync, PR 30 (d3f1819, 2026-09-01), merged upstream a56a78a but was SQUASH-merged onto main, so main carried a56a78a's content with no shared ancestry past 52d20f1. The real delta was a56a78a..upstream = 220 commits across 434 files. The fork carries deliberate divergence that MUST survive: the Slack captain adapter, mirror, quota topic and post helper (bin/fm-procevent-slack-captain.sh, bin/fm-slack-*.sh, bin/fm-procevent-quota-topic.sh); bin/fm-board.sh and its --repo projectItems path plus the board wiring in fm-spawn.sh and fm-pr-check.sh (PR 32); bin/fm-pr-merge.sh merge-queue detection and REST outcome fallback; bin/fm-procevent-github-assigned.sh; bin/fm-git-identity.sh and its hook guard; issue-linked crewmate branch naming (fm-issue-); the overboard, onboard-cloud-crewmate, ahoy, bearings skills; the test-sandbox containment boundary; the AGENTS.md house rules (captain address, section 9 etiquette, section 7 folding-in default, the "Captain instruction precedence" section, the slimmed startup load).

Method required by the brief, as done:

  • Step A 21714ff "restore ancestry" = git merge --no-ff a56a78a keeping main's side everywhere; parents 3f7fbb0 (origin/main) and a56a78a; git diff --stat 3f7fbb0b 21714ff1 is EMPTY (tree identical to main).
  • Step B 2e369db = git merge --no-ff upstream 706254d; parents 21714ff and 706254d; 220 upstream commits taken (all non-merge); 33 conflicted paths resolved keeping BOTH intents: upstream's structure with every fork rule folded back in; where upstream replaced a mechanism the fork extended, upstream's mechanism kept and the fork's extension re-applied on top, or the reason stated below.
  • Three test-only follow-up commits (930fcf1, 0fcc209, 3307376) adapt fork tests and fixtures to new upstream contracts; no product code changed in them.
  • After landing the fork is 5 commits behind upstream/main (a8a2959, 82dec2e, a5d78f8, 52fca51, c576c2b), all landed after the intake tip; this is deliberate: the standing posture is that the fork takes upstream fixes and may stay a few commits behind rather than tracking upstream's tip.

Deliberate resolution decisions a reviewer must not flag as mistakes:

  • bin/fm-send.sh: for reserved pending-reply-* keys the fork refused --resolve-key outright (6f33d03, 2026-08-31); upstream 3c1e86d (2026-09-03) fixed the same silent no-op by closing them with the owning library's vocabulary and refusing only when that close cannot take effect. Upstream's mechanism is kept; the fork's blanket refusal, its test, and the now-unused fm_decision_key_reserved_prefix helper in bin/fm-classify-lib.sh are removed; the fork's --no-reply-expected flag and its lookalike-key control test are kept; the --no-reply-expected header no longer claims nothing typed in chat can close such a decision.
  • bin/fm-fleet-snapshot.sh: upstream 31cba0d (fix(bin): avoid fleet snapshot argument limits kunchenguid/firstmate#3677) fixed the same argv-limit crash as fork 0e20704; upstream's code is kept and the fork's 1400-record regression test stays (fleet-snapshot view count 19 in ci.yml = upstream 18 + fork 1).
  • AGENTS.md: upstream's new rules folded into the fork's slimmed text (captain address now chat-only per upstream fix: restrict captain address rule to user chat kunchenguid/firstmate#4075 while keeping the fork's bad-news clause; new config/state names in the compact layout block; STATUS OUTCOME BACKSTOP, inactive-outcome scan, dispatch-resolve, mid-task captain-intent, resolved-state validation, non-draft ready signal, check-unregister, crew-hosted Lavish board, final-response rule, fm-captain-hold wrapper, three new section 13 triggers). The fork's "all GitHub operations / all browser operations" wording is kept. The fork's removed "Stuck-worker trigger" subsection stays removed because section 13 carries upstream's extended trigger. Merged AGENTS.md is 8,607 words, under upstream VISION.md's 9,000-word ceiling.
  • Skill descriptions keep the fork's slimmed one-paragraph form with upstream's new trigger text.
  • Upstream fix: clean up workers after their pull requests land kunchenguid/firstmate#5317 now tears down landed workers from supervision; the fork's overboard skill stays as the manual path and routes through the same bin/fm-teardown.sh owner, so no change was needed.
  • bin/fm-dod-lib.sh: upstream's new fm_ship_rule_one takes the fork's branch name, and the no-mistakes rule one names the branch (fork behavior); tests/fm-control-relaunch.test.sh updated accordingly.
  • Test adaptations: upstream fixtures that copy the test runner now copy the fork's containment libraries (install_runner); tests/fm-test-fixtures.test.sh passes its global-config path via a file because the fork's boundary clears every FM_* variable; fork spawn tests use fixtures.sh's fm_test_spawn_brief because spawn now requires Captain's intent / Firstmate spec subsections; fm-merge-local fixture home gains data/; fm-spawn-dispatch-profile's new Ultra batch case gets a second worktree for the fork's double-allocation guard; fm-pr-merge's GraphQL-down mock lets upstream's pre-merge live-head read succeed and rate-limits only the post-merge read the REST fallback covers, the REST enqueue case passes --attended-override (now required for --auto), and upstream's gh-axi fallback test names the fork's REST read in its refusal wording; fm-config-reread's tmux stub lists the mates' windows because upstream no longer rings doorbells into panes read as exited; fm-slack-mirror-live-e2e opens with fm_live_gate (opt-in) per upstream's live-gate contract; fm-test-sandbox's fixture checkout carries tests/git-config-helpers.sh. The REST fallback tests were proven red by disabling the fallback.

Host prerequisites before/at landing (captain consent needed, not done by this PR): upstream raised tool floors to tasks-axi >= 0.2.6, quota-axi >= 0.1.51, lavish-axi >= 0.1.77; this host has 0.2.5, 0.1.48, 0.1.75. Local verification used 0.2.6 / 0.1.52 / 0.1.78 from a private /tmp prefix.

Verification required by the brief, as done: bin/fm-lint.sh clean at full CI rigor (both partitions); bin/fm-doc-audience-check.sh ok; 157 targeted suites covering every fork-preserved surface and every file both sides changed, every failure rerun serially on an idle host and, when still red, reproduced on a pristine upstream 706254d clone; real exercise in scratch FM_HOMEs under /tmp (never this home's data/state/config): bin/fm-session-start.sh --help and a full session start, bin/fm-bearings-snapshot.sh --json on a copy of the live backlog, bin/fm-board.sh status 1455 and 1454 --repo digio-nz/fcdispatch (Inbox on project 2), fm-procevent-github-assigned.sh list, fm-brief.sh --issue, fm-git-identity.sh apply/commit/disarm.

The PR body must state: both merge commits with their parents (true-merge shape, as git show -s --format=%P shows), the 220 upstream commits taken, the 5-commits-behind gap and why it is deliberate, each fork adjustment and how it was preserved, every conflict file and its resolution in one line, the upstream commits that change firstmate's operating contract (automatic landed-worker cleanup kunchenguid#5317; brief Captain's intent/Firstmate spec requirement kunchenguid#3597; mid-task captain intent; non-draft done report kunchenguid#5141; live-head merge gates and --attended-override for --auto kunchenguid#4199; captain address chat-only kunchenguid#4075; /quiet mode kunchenguid#4337 and durable /afk away-posture record kunchenguid#4048/kunchenguid#5260/kunchenguid#5076; typed dispatch resolution kunchenguid#4692; quota-axi schema 6 kunchenguid#4904; raised axi floors kunchenguid#5350; mail plane kunchenguid#3765; new gemini/rovo/omp/agy runtimes; status events stamped [at=] kunchenguid#3764; claude-permission-mode kunchenguid#4239; home brief include kunchenguid#5115; Lavish feedback routed to owning workers kunchenguid#5099/kunchenguid#5334; no-mistakes required check pinned to v1.80.1 with kunchenguid exempt kunchenguid#5195/kunchenguid#5256), a ## Findings not fixed list, and a ## Lessons note.

Findings not fixed (each reproduces on pristine upstream 706254d unless noted; none is a regression from this merge): tool floors above (fm-captain-hold-lifecycle and fm-pr-merge fail on installed tasks-axi, pass with the floor versions); host tooling gaps (fm-ci-workflow and fm-x-mode need ruby, fm-cursor-primary needs a C compiler); WSL adopts orphans with a subreaper, not init, so fm-procevent, fm-remote-job-orphan-reap, fm-session-lock-ancestry and fm-test-run's proven-family case fail; the host's global ~/.config/git/ignore .fm-* pattern leaks into fixtures because tests/git-config-helpers.sh neutralises only config, failing fm-secondmate-sync; harness-version drift (fm-composer-codex-idle-live-e2e on codex-cli 0.155.1, fm-harness-liveness-drift-live-e2e on kimi 2.0.2, fm-control-herdr-smoke and fm-backend-herdr on herdr 0.8.0); fm-backend-tmux-smoke (also fails on pre-merge main); fm-on (composed child PATH); fm-pr-check-security (fixture PATH lacks jq); pre-existing fork gaps: bin/fm-test-run.sh --changed has no mapping for bin/slack-mirror/**, and the containment boundary clears FM_LIVE and per-guard live switches so a live guard cannot be forced on through the runner (CI passes none).

Lessons: the fork's deliberately strict test runner (refuses without its containment libraries, clears every FM_* variable) turns each new upstream fixture that copies the runner or passes an FM_* variable into a conflict git cannot see; nine post-merge fixture fixes here were that one class. WSL crashed mid-resolution in the prior attempt: commit a merge as soon as the tree is resolved and fix forward.

MUST BE LANDED WITH A MERGE COMMIT. Do not squash, do not rebase, do not force-push — this branch restores real shared ancestry with upstream and a squash would collapse that back to the state this PR fixes.
Later accepted firstmate requirement (post-review F1, commit 87e983d on top of pipeline head 39bac99): the merge raises FM_QUOTA_AXI_MIN to 0.1.51, and from quota-axi 0.1.49 Grok's credits window is emitted as {id:credits,label:week,kind:weekly}, so bin/fm-procevent-quota-topic.sh's select(.kind == "credits" and .id == "credits") always missed and the Slack quota topic rendered Grok as n/a. Fix: select(.id == "credits") at that line, and the GROK_OK fixture in tests/fm-procevent-quota-topic.test.sh uses the live shape {"id":"credits","label":"week","kind":"weekly",...}. Proven red then green: with the fixture changed and the old selector, the test failed with "unexpected topic: ... Grok: n/a ..."; with the new selector it passes. Record that proof in the PR body. Nothing else changes: the review's N1-N6 findings stay untouched.

What Changed

THIS PR MUST BE LANDED WITH A MERGE COMMIT — do not squash, do not rebase, do not force-push. The last upstream sync (PR 30, d3f1819) was squash-merged and lost shared ancestry past 52d20f1; this branch restores real ancestry with upstream and a squash here would collapse that fix right back out.

Merge shape (true merge, two --no-ff commits)

  • 21714ff1 "restore ancestry": git merge --no-ff a56a78a, keeping main's side everywhere. Parents: 3f7fbb0b (origin/main) and a56a78ac. git diff --stat 3f7fbb0b 21714ff1 is empty — tree identical to main.
  • 2e369db5 "Merge upstream kunchenguid/firstmate 706254d into the fork": git merge --no-ff upstream 706254de. Parents: 21714ff1 and 706254de. Brings in 220 non-merge upstream commits across 434 files.
  • Three follow-up test-only commits (930fcf19, 0fcc2090, 3307376d) adapt fork tests/fixtures to new upstream contracts; no product code in them.
  • After landing, the fork sits 5 commits behind upstream/main (a8a2959c, 82dec2ee, a5d78f8b, 52fca517, c576c2bb) — all landed after the intake tip. This is deliberate: the fork's standing posture is to take upstream fixes and may lag the tip rather than chase it.

Fork divergence preserved through the merge

Slack captain adapter/mirror/quota-topic/post helper (bin/fm-procevent-slack-captain.sh, bin/fm-slack-*.sh, bin/fm-procevent-quota-topic.sh); bin/fm-board.sh --repo/projectItems path and its wiring in fm-spawn.sh/fm-pr-check.sh; bin/fm-pr-merge.sh merge-queue detection and REST outcome fallback; bin/fm-procevent-github-assigned.sh; bin/fm-git-identity.sh and its hook guard; issue-linked fm-issue-<n> branch naming; the overboard, onboard-cloud-crewmate, ahoy, bearings skills; the test-sandbox containment boundary; and the AGENTS.md house rules (captain address, section 9 etiquette, section 7 folding-in default, "Captain instruction precedence", slimmed startup load).

Notable conflict resolutions (33 conflicted paths, fork intent folded onto upstream structure)

  • bin/fm-send.sh / bin/fm-classify-lib.sh: kept upstream's 3c1e86d7 fix for reserved pending-reply-* keys (closes via the owning library's vocabulary); removed the fork's now-superseded blanket refusal, its test, and the unused fm_decision_key_reserved_prefix helper; kept the fork's --no-reply-expected flag and lookalike-key test, with its header wording corrected.
  • bin/fm-fleet-snapshot.sh: kept upstream's 31cba0db argv-limit fix; kept the fork's 1400-record regression test (view count 19 in ci.yml = upstream 18 + fork 1).
  • AGENTS.md: folded upstream's new rules (captain address chat-only per upstream fix: restrict captain address rule to user chat kunchenguid/firstmate#4075 while keeping the fork's bad-news clause; new compact-layout config/state names; STATUS OUTCOME BACKSTOP; inactive-outcome scan; dispatch-resolve; mid-task captain-intent; resolved-state validation; non-draft ready signal; check-unregister; crew-hosted Lavish board; final-response rule; fm-captain-hold wrapper; three new section 13 triggers) into the fork's slimmed text; kept the fork's "all GitHub operations / all browser operations" wording; kept the fork's removed "Stuck-worker trigger" subsection removed since section 13 now carries upstream's extended trigger. Merged file is 8,607 words, under upstream VISION.md's 9,000-word ceiling.
  • Skill descriptions: kept the fork's slimmed one-paragraph form, added upstream's new trigger text.
  • bin/fm-dod-lib.sh: took upstream's fm_ship_rule_one, adapted to name the fork's branch (fork behavior); tests/fm-control-relaunch.test.sh updated to match.
  • No change needed for upstream fix: clean up workers after their pull requests land kunchenguid/firstmate#5317 (auto teardown of landed workers from supervision) — the fork's overboard skill stays the manual path and already routes through the same bin/fm-teardown.sh owner.
  • Test fixture adaptations (nine): upstream fixtures that copy the test runner now copy the fork's containment libraries; fm-test-fixtures passes its global-config path via a file because the fork's boundary clears every FM_* variable; fork spawn tests use fixtures.sh's fm_test_spawn_brief (spawn now requires Captain's intent / Firstmate spec subsections); fm-merge-local fixture home gains data/; fm-spawn-dispatch-profile's Ultra batch case gets a second worktree for the fork's double-allocation guard; fm-pr-merge's GraphQL-down mock lets upstream's pre-merge live-head read succeed and rate-limits only the post-merge read, the REST enqueue case passes --attended-override, and the gh-axi fallback test names the fork's REST read in its refusal wording (REST fallback tests proven red by disabling the fallback, then green); fm-config-reread's tmux stub lists mates' windows per upstream's no-doorbell-into-exited-panes behavior; fm-slack-mirror-live-e2e opens with fm_live_gate per upstream's live-gate contract; fm-test-sandbox's fixture checkout carries tests/git-config-helpers.sh.

Upstream commits that change firstmate's operating contract

Automatic landed-worker cleanup (kunchenguid#5317); brief Captain's intent/Firstmate spec requirement (kunchenguid#3597); mid-task captain intent; non-draft done report (kunchenguid#5141); live-head merge gates and --attended-override for --auto (kunchenguid#4199); captain address chat-only (kunchenguid#4075); /quiet mode (kunchenguid#4337) and durable /afk away-posture record (kunchenguid#4048/kunchenguid#5260/kunchenguid#5076); typed dispatch resolution (kunchenguid#4692); quota-axi schema 6 (kunchenguid#4904); raised axi floors (kunchenguid#5350); mail plane (kunchenguid#3765); new gemini/rovo/omp/agy runtimes; status events stamped [at=<epoch>] (kunchenguid#3764); claude-permission-mode (kunchenguid#4239); home brief include (kunchenguid#5115); Lavish feedback routed to owning workers (kunchenguid#5099/kunchenguid#5334); no-mistakes required check pinned to v1.80.1 with kunchenguid exempt (kunchenguid#5195/kunchenguid#5256).

Follow-up fix (commit 87e983d, on top of prior pipeline head 39bac99)

Raised FM_QUOTA_AXI_MIN to 0.1.51. From quota-axi 0.1.49, Grok's credits window is emitted as {id:credits,label:week,kind:weekly}, so bin/fm-procevent-quota-topic.sh's select(.kind == "credits" and .id == "credits") always missed and the Slack quota topic rendered Grok as n/a. Fixed the selector to select(.id == "credits"), and updated the GROK_OK fixture in tests/fm-procevent-quota-topic.test.sh to the live shape {"id":"credits","label":"week","kind":"weekly",...}. Proven red then green: with the fixture changed and the old selector, the test failed with unexpected topic: ... Grok: n/a ...; with the new selector it passes.

Host prerequisites (captain consent needed, not part of this PR)

Upstream raised tool floors to tasks-axi >= 0.2.6, quota-axi >= 0.1.51, lavish-axi >= 0.1.77; this host currently has 0.2.5, 0.1.48, 0.1.75. Local verification used 0.2.6/0.1.52/0.1.78 from a private /tmp prefix.

Verification

  • bin/fm-lint.sh clean at full CI rigor (both partitions); bin/fm-doc-audience-check.sh ok.
  • 157 targeted suites covering every fork-preserved surface and every file both sides changed; every failure rerun serially on an idle host and, when still red, reproduced on a pristine upstream 706254de clone.
  • Real exercise in scratch FM_HOMEs under /tmp (never this home's data/state/config): fm-session-start.sh --help and a full session start; fm-bearings-snapshot.sh --json on a copy of the live backlog; fm-board.sh status 1455 and 1454 --repo digio-nz/fcdispatch (Inbox on project 2); fm-procevent-github-assigned.sh list; fm-brief.sh --issue; fm-git-identity.sh apply/commit/disarm.

Findings not fixed

Each reproduces on pristine upstream 706254de unless noted; none is a regression from this merge.

  • Tool floors above: fm-captain-hold-lifecycle and fm-pr-merge fail on installed tasks-axi, pass with floor versions.
  • Host tooling gaps: fm-ci-workflow and fm-x-mode need ruby; fm-cursor-primary needs a C compiler.
  • WSL adopts orphans with a subreaper, not init: fm-procevent, fm-remote-job-orphan-reap, fm-session-lock-ancestry, and fm-test-run's proven-family case fail.
  • The host's global ~/.config/git/ignore .fm-* pattern leaks into fixtures because tests/git-config-helpers.sh neutralises only config, failing fm-secondmate-sync.
  • Harness-version drift: fm-composer-codex-idle-live-e2e on codex-cli 0.155.1, fm-harness-liveness-drift-live-e2e on kimi 2.0.2, fm-control-herdr-smoke and fm-backend-herdr on herdr 0.8.0.
  • fm-backend-tmux-smoke (also fails on pre-merge main).
  • fm-on (composed child PATH).
  • fm-pr-check-security (fixture PATH lacks jq).
  • Pre-existing fork gaps: bin/fm-test-run.sh --changed has no mapping for bin/slack-mirror/**; the containment boundary clears FM_LIVE and per-guard live switches so a live guard cannot be forced on through the runner (CI passes none).

Lessons

The fork's deliberately strict test runner (refuses without its containment libraries, clears every FM_* variable) turns each new upstream fixture that copies the runner or passes an FM_* variable into a conflict git cannot see; nine post-merge fixture fixes here were all that one class. WSL crashed mid-resolution in a prior attempt at this merge: the working rule going forward is to commit as soon as the tree is resolved and fix forward, rather than resolving the whole merge before the first commit.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: Single-line selector fix plus matching fixture update, consistent with the accepted intent, no other logic or files touched, and the sibling GROK_STALE fixture still matches the new selector correctly.

Testing

Drove the fork's own regression test (tests/fm-procevent-quota-topic.test.sh) against the real fm-procevent-quota-topic.sh adapter for the F1 fix: the fixed select(.id == \"credits\") renders Grok's quota correctly against quota-axi 0.1.49+'s {id:credits,kind:weekly} shape, and reverting to the old kind==credits selector reproduces the exact reported failure (Grok: n/a), proving the fix red-then-green as required. Change scope confirmed as exactly the two files/lines described; no other product code touched.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Grok credits window renders correctly under quota-axi 0.1.49+ shape ✅ pass live bash tests/fm-procevent-quota-topic.test.sh — all 9 assertions ok, including 'the topic renders Claude, Codex, Grok, and Kimi from their authoritative sources' with GROK_OK fixture {id:credits,label:w…
Adversarial: old kind==credits selector must fail on the live shape ✅ pass live Reverted select() to the pre-fix .kind == &#34;credits&#34; and .id == &#34;credits&#34; and reran the same test: failed with 'unexpected topic: ... Grok: n/a ...', reproducing the exact reported bug; restored the…
Evidence: Regression proven red then green
RED (old selector `.kind=="credits" and .id=="credits"`): not ok - unexpected topic: Claude: session 81% week 93% // Codex: week 40% // Grok: n/a // Kimi: session 90% week 65%

GREEN (fixed selector `.id=="credits"`): ok - the topic renders Claude, Codex, Grok, and Kimi from their authoritative sources (plus 8 other ok lines)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Grok credits window renders correctly under quota-axi 0.1.49+ shape ✅ pass live bash tests/fm-procevent-quota-topic.test.sh — all 9 assertions ok, including 'the topic renders Claude, Codex, Grok, and Kimi from their authoritative sources' with GROK_OK fixture {id:credits,label:w…
Adversarial: old kind==credits selector must fail on the live shape ✅ pass live Reverted select() to the pre-fix .kind == &#34;credits&#34; and .id == &#34;credits&#34; and reran the same test: failed with 'unexpected topic: ... Grok: n/a ...', reproducing the exact reported bug; restored the…
  • bash tests/fm-procevent-quota-topic.test.sh (green, fixed selector)
  • bash tests/fm-procevent-quota-topic.test.sh (red, reverted selector, restored after)
  • git show --stat 87e983d to confirm change scope is exactly the 2-line selector fix + fixture update
  • grep for FM_QUOTA_AXI_MIN in bin/fm-quota-axi-lib.sh to confirm floor already at 0.1.51
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

kunchenguid and others added 30 commits August 27, 2026 13:12
* fix(pi): stop reporting one merge to the captain twice

The supervision branch's captain-outcome note told main, unconditionally,
that the note "is not your own earlier output" and to relay it now. When
main had already reported the same event, that assertion was false and the
order turned the correct response - saying nothing new - into a mechanical
re-report, so the captain saw one merge reported twice in 16 seconds.

Two independent changes, both needed:

- The relay instruction is now conditional. It still names itself as a
  supervision outcome so main cannot mistake it for its own earlier answer
  (the silent loss that instruction exists to prevent), and it now lets
  main stay quiet about an outcome it has already given the captain.

- The merge case is closed at its source rather than left to that judgment.
  One merge reaches a home on two independent paths by design - main's own
  permanently main-owned merge poll, and the branch's task-local status
  wake - and main's captain-facing text only reaches the branch's mirror at
  main's turn end, so the branch can escalate before it could possibly see
  the captain was already told. bin/fm-pr-merge-notified.sh answers that
  question from bin/fm-pr-lib.sh's canonical merge-notification marker, so
  the answer holds regardless of mirror timing. A captain outcome naming an
  already-published merge is delivered as the ordinary rendered note
  instead of opening a follow-up turn: still appended, still visible, still
  recorded with the verdict the branch decided, minus the wasted turn.

Any error, timeout, or unreadable state relays the outcome. A duplicate
announces itself; a lost outcome does not.

Regression coverage drives the real delivery path in both directions: a new
outcome must still reach the captain in exactly one follow-up turn even
beside an unrelated published merge, and an already-published merge must
open no second turn while a different PR in the same task still does. The
merge path's real producer and this new consumer are exercised end to end
in tests/fm-pr-merge.test.sh.

Pi-only by construction: the delivery path lives in .pi/extensions, so no
other harness loads it, and the new script only reads existing markers.

* no-mistakes(review): Document accepted latest-marker suppression residual

* no-mistakes(review): Recheck ownership before merge outcome delivery

* no-mistakes(document): Document merge-outcome suppression exception

* refactor(pi): drop the source-level merge suppression, keep the envelope fix

The captain reviewed this branch and judged the source-level duplicate
suppression overly complicated for the problem it solved, and asked for
the change to be reduced to the envelope wording alone.

Remove the mergeIntoMain downgrade path, bin/fm-pr-merge-notified.sh, and
every test and document that existed only for it. What remains is the
conditional captain-outcome instruction: main is told to stay quiet about
an outcome it has already reported and to relay anything else, which
covers the duplicate without a second mechanism.

The silent-loss protection is untouched - the note is still typed,
self-describing, and delivered as one invisible follow-up turn - and the
behavioral tests still assert that, now requiring both halves of the
conditional instruction.

* no-mistakes(ci): Clarified in code comments and owned documentation that this is intentionally an M1-only, model-facing conditional relay fix—not source-level suppression—addressing Greptile’s mistaken scope expectation without changing runtime behavior. Net diff remains 3 files and 27 insertions. Verified with fm-pi-branch-extension tests, fm-lint, doc audience check, and git diff --check; all passed

* no-mistakes(ci): Strengthened the runtime delivery test to verify the captain outcome retains its required self-description and outcome text. Verified with `bash tests/fm-pi-branch-extension.test.sh`, `bin/fm-lint.sh`, `bin/fm-doc-audience-check.sh`, and `git diff --check`; all passed. The outer pipeline can now commit and attest the new head
* fix(bin): bind the live pipeline-owned run instead of a superseded failed row

fm-crew-state.sh bound a superseded FAILED no-mistakes run to a task instead
of the LIVE replacement run: the live run's pipeline-owned lane head is not a
git object in the task worktree, so head-equality attribution rejected it and
the coarse runs-list fallback silently continued past the RUNNING row onto an
older failed row whose head equalled the stale worktree HEAD. The home summary
then flipped invalid and Bearings hid the home's live work (F10).

Attribution precedence now follows the daemon's own identity:
- An ACTIVE run for the task's branch binds without head equality while
  branch_sync.state is pipeline_owned (fm_nm_run_is_pipeline_owned_active);
  the pipeline owning the branch is itself the attribution.
- A genuinely failed run with no later run on the branch still reports failed
  through the unchanged head-equality path - real failures are not hidden.
- In the coarse runs scan, an unresolvable head is unknown attribution and
  stops the scan (fm_nm_head_resolvable) instead of falling through to an
  older row; a resolvable-but-mismatched head keeps the historical
  reused-branch skip.

The exemption never applies to a terminal run and requires pipeline_owned
specifically, both pinned by negative-control tests. Fixture shape verified
against the live incident run's real axi status output.

* no-mistakes(document): Updated run-attribution documentation ownership
…unchenguid#3211)

* fix(pi): surface requested supervision outcomes

* no-mistakes(review): Mirror in-flight captain requests before branch dispatch

* no-mistakes(review): Exercise real branch ownership and main outcome access

* no-mistakes(review): Preserve request tails and align verdict guidance

* no-mistakes(review): Preserve complete current captain requests

* no-mistakes(review): Require visible requested outcomes and realistic classification

* no-mistakes(document): Align supervision outcome documentation

* no-mistakes(ci): Fixed Greptile’s runtime-ordering finding. The extension now stages Pi’s authoritative `before_agent_start` prompt before SessionManager persistence and suppresses the later duplicate entry. Updated docs and behavioral regression to reproduce real Pi ordering and verify each prompt is mirrored exactly once. Passed branch-extension tests, supervision tests, strict Pi typecheck, full lint, and diff checks

* no-mistakes(review): Use canonical operational input classification

* no-mistakes(review): Filter legacy operational inputs canonically

* no-mistakes(document): Clarify captain request mirroring boundary

* no-mistakes(ci): Fixed the CI time-boundary failure in tests/fm-public-followup.test.sh by pinning its clock, including context-registry setup. This prevents follow-up fixtures from expiring based on wall time. Verified the full regression suite passes, project-owned lint passes, and git diff checks are clean

* no-mistakes(document): Clarify captain-visible supervision outcome documentation
…#3210)

* feat(bin): per-home remote transport lanes with cancellation, bounded send, and closed stdin

All remote commands for every home on one host used to serialize through one
single-job-at-a-time worker on one shared queue: a timed-out caller abandoned a
staged job that kept running, retries convoyed behind it, fm-send's remote leg
had no time bound, and staging captured the caller's stdin to EOF so any
fm-on.sh caller with an open stdin wedged staging indefinitely.

- The worker now serves one lane per staged home: same-home jobs run strictly
  FIFO in a new staging-sequence order while different homes run concurrently,
  each lane as its own top-level worker process (a backgrounded subshell does
  not reliably reap dead children, so a zombie group leader kept a finished
  command's process group signalable). Long-poll preemption is lane-scoped.
- A caller that disconnects or times out cancels its job: the entrypoint marks
  the record on any post-staging exit and probes its parent so a dead ssh
  channel cancels without a signal; the worker skips cancelled queued jobs,
  terminates a running cancelled job's process group, and reaps the record.
- fm-send's remote leg is bounded by FM_SEND_REMOTE_BUDGET (default 30s) and a
  bound hit exits through the existing unconfirmed-delivery contract, which
  stays idempotent because the remote enqueue deduplicates.
- fm-on.sh defaults the remote command's stdin to /dev/null; the three payload
  callers pass the new --stdin flag. Abandoned .stage.* litter is age-reaped.
- The job execution deadline no longer loses up to a second to clock
  truncation.

* no-mistakes(review): Protect live stages and validate send budgets early

* no-mistakes(review): Preserve sequence lock ownership during stale recovery

* no-mistakes(review): Allocate job sequences at publication boundary

* no-mistakes(review): Bound remote keys and extend stale lock recovery

* no-mistakes(document): Document bounded remote transport behavior

* no-mistakes(lint): Suppress intentional deferred-expansion lint warning

* no-mistakes(ci): Fixed stale sequence-lock recovery by reconciling the counter against published job records before allocating the next sequence, preventing duplicate sequences and same-home FIFO violations. Added a behavioral regression test reproducing displacement after publication and verifying execution order. Passed fm-remote-transport-lanes.test.sh, fm-remote-job.test.sh, fm-lint.sh, and git diff --check

* no-mistakes(review): Use atomic sequence claims and lossless lane keys

* no-mistakes(review): Recover regressed sequence hints and rate-limit claim reaping

* no-mistakes(review): Restrict worker heartbeats to serving loop

* no-mistakes(review): Verify supervisor identity before lane recovery signals

* no-mistakes(review): Verify tracked lane and claim owner identities

* no-mistakes(document): Clarify remote lane and transport contracts

* no-mistakes(ci): Fixed the CI time-boundary failure by pinning fm-public-followup tests to a deterministic clock, including context-registry setup. Verified tests/fm-public-followup.test.sh, tests/fm-remote-transport-lanes.test.sh, shellcheck, and git diff --check

* no-mistakes(review): Preserve assigned lane ownership of queued jobs

* no-mistakes(review): Reserve homes owned by foreign queued lanes

* no-mistakes(review): Preserve completed results during crash recovery

* no-mistakes(review): Harden claim cleanup, expiry, and cancellation races

* no-mistakes(review): Verify process groups and reap abandoned results

* no-mistakes(review): Stop leaderless groups and reap cancelled publications

* no-mistakes(document): Correct remote transport lifecycle documentation

* no-mistakes(lint): Quote done state comparisons for ShellCheck
* fix(tests): make the changed-file map select per script and stabilize a budget flake

The changed-file map's bin/ fallback resolved a direct test reference to that
test's whole FAMILY. bin/fm-push-transition-lib.sh is named by exactly one
real-Herdr E2E, so a one-line change to it selected all 12 real-herdr-gated
scripts, including a 341s presentation E2E with no dependency on it.

Resolve direct test references per script, and keep resolving consumer bin/
scripts through the curated map so recorded family-level coupling survives.

Also fix a load-sensitive flake: the tool-update budget deadline is whole-second
granular, so a test budget of 1 left headroom anywhere in (0, 1] seconds and the
first budget check could already read as exhausted.

* feat(bin): make suite wall clock a result and let a family's concurrency be proven

--max-wall-ms fails a run whose wall clock exceeds the caller's budget, after
reporting the per-script results. A suite that stays green while outgrowing its
caller's invocation budget is the regression that got an agent killed mid-run
and retried invisibly, so duration has to be a result rather than a log note.

--pool on the isolation-proof harness runs the same concurrent proof over a
whole family, so 'is this family safe to parallelize?' is answered by a command
instead of a guess. Measured watcher-wake-lock and refused it: 3 of 18 scripts
fail under concurrency on wall-clock assertions about reaching the next poll.

* perf(bin): schedule the changed suite concurrently, longest first

The watcher-wake-lock family is proven concurrent-safe (two clean runs, 18
candidates, 0 failures at 4 workers; docs/fm-test-isolation-proof.md), so
--changed now schedules its proven-concurrent scripts with bounded parallelism
and runs any unproven remainder serially afterwards, never beside them.

Concurrent runs are ordered longest-hint-first. Workers are handed scripts in
order, so alphabetical order started the 193s fm-watch-triage last and stranded
it running alone: 395s wall against a 205s balanced four-worker sum.

An explicit --jobs keeps its strict refusal, so every CI lane is unchanged.

* fix(bin): bound a hung test instead of letting it hang the suite

tests/fm-calm-pi-extension.test.sh was observed running 17+ minutes against a
464ms recorded hint, and the suite had no per-script bound to stop it. An
unbounded suite is precisely what silently outruns a caller's invocation budget,
and --max-wall-ms is evaluated after the run so it cannot end one that never
finishes.

--per-script-timeout-secs terminates a script that outruns it and records exit
124, so the run still completes, accounts for the script, and fails. The
auto-concurrent --changed path applies 900s, far above the slowest real script
(the 341s Herdr presentation E2E), so it only ever converts a hang.

* no-mistakes(review): Enforce safe concurrency and descendant timeouts

* no-mistakes(review): Validate empty runs and isolation proof pools

* no-mistakes(review): Measure selection time in wall budget

* no-mistakes(review): Reap interrupted workers and bound finalization

* no-mistakes(review): Contain shutdown descendants and watchdog finalization

* no-mistakes(review): Honor remaining budget and close launch races

* no-mistakes(review): Restore timeout helper and simplify runner cleanup

* no-mistakes(review): Record isolation pool admission metadata

* no-mistakes(review): Bound Chrome reap and scope proof admission

* no-mistakes(review): Align proof scheduling and preserve budget summaries

* no-mistakes(review): Remove unreliable finalization watchdog

* no-mistakes(review): Freeze budget duration and enforce admission caps

* no-mistakes(document): Refresh test runner concurrency documentation

* no-mistakes(lint): Fix ShellCheck findings in test runner scripts

* no-mistakes(ci): Fixed Greptile’s concurrency-consent finding. `--changed` now remains serial by default; `--changed --jobs auto` explicitly opts into bounded concurrency and the automatic hang timeout. Updated documentation and added behavioral coverage proving serial default behavior, explicit concurrent scheduling, and refusal of `--jobs auto` outside `--changed`. Verified with `bash tests/fm-test-run.test.sh`, `bin/fm-lint.sh`, and `git diff --check`

* no-mistakes(review): Restore automatic changed-suite concurrency and timeout

* no-mistakes(review): Correct changed-suite contributor guidance

* no-mistakes(review): Reject gate-skipped isolation proofs

* no-mistakes(review): Correct automatic concurrency evidence

* no-mistakes(review): Isolate nested runner process groups

* no-mistakes(review): Remove unreliable signal cleanup machinery

* no-mistakes(test): Narrow changed-suite selection to executable contract owners

* no-mistakes(document): Document isolation proof skip and artifact semantics

* no-mistakes(ci): Fixed Greptile’s concurrency-consent finding. `--changed` now remains serial by default; bounded concurrency requires explicit `--jobs auto`. Updated behavioral coverage, contributor guidance, and isolation-proof commands accordingly. Verified with `tests/fm-test-run.test.sh`, `bin/fm-doc-audience-check.sh`, `bin/fm-lint.sh`, Bash syntax checks, and `git diff --check`; all passed

* no-mistakes(review): Restore plain changed-suite automatic concurrency

* no-mistakes(review): Record resolved changed-suite worker count

* fix(bin): keep a runner change selecting its whole curated family

A pipeline fix round narrowed the curated changed-file map so bin/fm-test-run.sh
and bin/fm-test-isolation-proof.sh selected only their own two contract tests,
and the documentation surfaces only the audience test. That cut this branch's
own changed selection from 33 scripts to 5.

The runner executes every pure-contract-unit script, so its contract test
passing proves its logic is right, not that the suite it drives still runs.
Narrowing it also makes any wall-clock claim about the changed suite trivially
true by not running the work.

Only the unmapped bin/* grep fallback resolves per script; curated mappings keep
their recorded family coupling.

* perf(bin): admit the pure-contract-unit family to bounded concurrency

A runner-file change selects pure-contract-unit, so that family decides the
changed suite's wall clock. With only watcher-wake-lock admitted, 14 of its 33
selected scripts fell to the serial tail and the selection measured 327.3s
against a 300s budget: the concurrent group was 19 scripts totalling 273.4s
while the tail alone was 215.7s.

bin/fm-test-isolation-proof.sh --pool pure-contract-unit --jobs 4 passes twice,
32 candidates, 0 failures, so the family is admitted on recorded evidence.

Full 33-script plain --changed: 327.3s -> 181.8s / 178.5s / 172.7s, 0 failures,
inside a 300000ms budget. Also states the per-script guard's derivation.

* no-mistakes(review): Align contract-unit concurrency cap with recorded proof

* no-mistakes(document): Record final changed-suite performance evidence

* fix(bin): keep an empty changed selection clean on stock macOS Bash

Under set -u, bash 3.2 treats "${arr[@]}" on an EMPTY array as an
unbound-variable error, while bash 4.4+ makes it a harmless no-op. The
concurrency work removed the early exit for an empty selection, so execution
fell through to the unguarded existence loop: on stock /bin/bash 3.2.57 a
contributor who changes only documentation and runs --changed got

  bin/fm-test-run.sh: line 1713: SCRIPTS[@]: unbound variable

with exit 1 and no summary, instead of a clean total=0 pass.

Restore the early exit, and guard every remaining array expansion reachable
with an empty selection. The reported duration is real elapsed invocation
time rather than a hardcoded zero, so a selection phase that outran
--max-wall-ms still fails.

Verified on this host with /bin/bash 3.2.57: exit 1 with the unbound-variable
error before, exit 0 with FM_TEST_SUMMARY total=0 after.

* no-mistakes(document): Document shell-bound changed-suite performance

---------

Co-authored-by: Kun Chen <kun-1@kunchenguid.com>
* feat(bin): publish per-home summary ledger

* no-mistakes(review): Bound and schedule home summary publication

* no-mistakes(review): Prove recurring watcher summary refresh cadence

* no-mistakes(review): Bound refresh workers and publish durable spawns

* no-mistakes(review): Fix atomic kill process-group coverage

* no-mistakes(review): Bound state initialization within refresh timeout

* no-mistakes(document): Document recurring bounded home-summary publication

* no-mistakes(review): Bound and log all best-effort refresh failures

* no-mistakes(review): Harden cadence and timeout regression coverage

* no-mistakes(document): Document home-summary runtime tuning

* no-mistakes(lint): Fix direct exit-code check in refresh test

* no-mistakes(ci): Fixed remote secondmate retirement recreating the deleted home: teardown now skips side-band summary refresh when its overridden state directory was removed. Verified with remote lifecycle E2E, teardown tests, home-summary tests, ShellCheck, and git diff checks

* no-mistakes(document): Clarify atomic home-summary publication guarantee
* fix(pi): gate first call on startup context

* no-mistakes(document): Correct Pi startup prerequisite verification date

* no-mistakes(review): Captain, fix startup process-group retirement after leader exit

* no-mistakes(review): Captain, release reload exit listeners on shutdown

* no-mistakes(review): Captain, complete startup exit lifecycle ownership

* no-mistakes(review): Captain, release empty startup process-group ownership promptly

* no-mistakes(review): Captain, supervise startup ownership and restore failure fallback

* no-mistakes(review): Captain, restore live Pi supervisor execution

* no-mistakes(document): docs: clarify Pi startup prerequisite delivery
* fix(pi): restore 0.84.4 adapter compatibility

* no-mistakes(review): Restore Pi collapsed and expanded outcome parity

* no-mistakes(review): Preserve Pi stock previews through capability probing

* no-mistakes(document): Document Pi 0.84.4 renderer compatibility
…nchenguid#3273)

* fix(bin): keep home-summary publication bounded and off the watcher beat

A home whose tasks had accumulated ordinary status history could not publish
state/home-summary.json at all, and every attempt starved the watcher's
liveness beacon while it failed silently.

The producer's per-task open-decision fold spent tens of milliseconds per
status line on a bash 3.2 global bracket-class substitution used only as a
blank-line guard. On a real home that made the whole ledger producer take
minutes, so publication burned its full FM_HOME_SUMMARY_TIMEOUT on every
attempt and never completed. Replace that guard with an equivalent case glob
in the one fold owner, which both the whole-file and cursor-backed folds use.

Bound each per-task current-state read in the snapshot with
FM_SNAPSHOT_CREW_STATE_TIMEOUT. For a remote secondmate that read crosses ssh,
whose dead-peer detection deliberately never kills a slow-but-alive remote
command, so nothing else bounded it.

Detach the watcher's two publication triggers from the poll loop. The loop
owns the beacon that fm-guard.sh reads as proof supervision is alive, and an
inline publication put up to a full publication deadline between two beacon
touches. A single in-flight publication is tracked so a slow one cannot
accumulate clones.

Report a repeatedly failing publication at session start. Publication stays
deliberately non-fatal to its caller, so the existing bounded home-local
failure record is now surfaced as a HOME_SUMMARY bootstrap line once the
ledger is absent or stale and failures have been recorded since.

* no-mistakes(review): Preserve home-summary failure attempt ordering

* no-mistakes(review): Enforce durable home-summary single-flight and ordering

* no-mistakes(review): Derive failure ordering from publication boundaries

* no-mistakes(review): Restore best-effort failure logging and publication scoping

* no-mistakes(review): Make ordering regression sensitive to one failure

* no-mistakes(document): Correct HOME_SUMMARY diagnostic guidance
…henguid#3268)

* fix(supervision): classify the appended status span, not the last line

An actionable project update could be classified as routine and absorbed, so
a worker that raised a decision, hit a blocker, failed, or finished stalled
silently with the captain never told.

Trigger, mask, symptom. A worker appends a captain-relevant event
(`needs-decision`, `blocked`, `failed`, `done`). Any later routine append -
a `working:` progress note - lands before the supervisor classifies the
batch; the watcher's 30s signal-grace linger exists precisely to coalesce a
status write with the same turn's turn-end, so this window is ordinary
rather than rare. Both supervisors then asked "is the LAST line
captain-relevant?", read the routine line, and absorbed the wake. The
`.seen-*` suppressor advanced either way, so nothing ever re-read the event.
When the crew was also provably working, the no-verb fallback absorbed it
too, which is why the event disappeared completely instead of surfacing late.

Reproduced end to end against a real watcher before any change: with the
trailing `working:` append the watcher never exits and the wake queue stays
empty; with that one line removed - the smallest counterfactual - the same
`needs-decision` surfaces and queues. The away-mode daemon's `classify_signal`
returns `self|routine signal` for a `blocked:` event under the same mask,
which is the worse case because no captain is present to notice.

The proven path was already in the tree: `status_open_decisions` fixed this
exact masking for the durable decision fold, and its header states the rule -
reading an append-only event log last-event-wins cannot represent an earlier
event that a later unrelated line moved past. The classification path was
never migrated to that read model. That is the earliest divergence, and the
fix is to migrate it rather than to special-case the symptom.

`status_span_first_actionable` in bin/fm-classify-lib.sh is the new single
owner: it reads the bytes at or after a caller-supplied position and returns
the first still-live captain-relevant event. Each supervisor supplies its own
position, because the always-on watcher and the away-mode daemon classify the
same stream independently and must not share one cursor: the watcher reads
the size already recorded in its `.seen-*` signature (no new state) and its
`.hb-surfaced-<task>` backstop marker, and the daemon its
`.subsuper-seen-status-<task>` marker. Those two markers held the escalated
line and now hold the escalated-through byte offset, which also removes a
second defect in the same code - content dedup silently swallowed a genuinely
new event whose text repeated an older one. An absent, malformed, or
past-the-end position reads the whole log, so uncertainty surfaces events
rather than losing them, and a marker an older build wrote as a status line
reads that way too. Status logs are only ever appended to, including across a
reused task id, so a recorded position keeps its meaning.

A `needs-decision`/`blocked` event in the span is retired only when the
whole-file fold proves its key closed; `status_open_decisions` stays the sole
owner of that rule, so same-key reopening and reserved-key namespaces need no
second implementation here. Every other captain-relevant event is terminal
and always actionable.

Both backstops now walk every status log instead of only those whose last
line looks captain-relevant, because the event a backstop most needs to catch
is exactly one a later append has moved past. That leaves
`scan_captain_relevant_statuses` with no callers, and it is removed rather
than left as a working copy of the defective read model.

Regression coverage exercises the classifier and both supervisors through
their own interfaces: the masked decision, the captain-reported
release/install completion followed by cleanup chatter, and the away-mode
blocker all surface; a routine append after an already-classified event stays
absorbed, so the fix does not convert ordinary progress into wakes; and the
heartbeat backstop catches a masked event the per-wake path missed. The
end-to-end watcher tests drive a real fm-watch.sh with the crew reported as
provably working, which is the configuration that made the original stall
silent.

Two further claims in the supplied RCA are deliberately not patched here.
"Repeated operational recoveries produced all-clear replies despite known
actions" is downstream of this same cause, not an independent contributor: an
all-clear reply is the documented response when the specific event needs no
action, so a classification that wrongly reported "no action" produces it, and
correcting the classification removes it. "The project was subjected to
validation requirements outside its accepted path" is delivery-mode selection,
which AGENTS.md section 7 owns; no code changed here touches it, so it is out
of scope.

Harness and backend axes were inspected rather than assumed: nothing in this
path reads a vendor-emitted signal. The status log's format and append
protocol are Firstmate's own and identical for every harness, and no runtime
backend reads or writes `.status` files (`bin/backends/*` contain no reference
to them). The surrounding triage's only backend touchpoints - pane capture and
the authoritative crew-state read - are unchanged. No live-harness guard
applies and no per-harness verification record changes.

Verified with `bin/fm-lint.sh`, `bin/fm-doc-audience-check.sh`, and
`bin/fm-test-run.sh --changed --base origin/main`.

* no-mistakes(review): Prevent status races and surface classification failures

* no-mistakes(review): Surface unreadable signals and preserve AFK endpoints

* no-mistakes(review): Route stale wakes through captured span verdicts

* no-mistakes(review): Retire supervision offsets with reused task state

* no-mistakes(review): Bind status offsets and preserve live decision origins

* no-mistakes(review): Strengthen status identity with verified birth time

* no-mistakes(review): Skip turn-end markers during status classification

* no-mistakes(review): Preserve status presentation with platform-strength identities

* no-mistakes(review): Retain failed wakes and advance routine checkpoints

* no-mistakes(review): Surface all events and retain unreadable wakes

* no-mistakes(review): Treat absent status logs as successful empty spans

* no-mistakes(review): Bound repeated classification failures with durable receipts

* revert(supervision): drop the failure-receipt and durable-retry machinery

Captain-authorized revert to the minimal fix. Review rounds added a durable
failure-receipt store and wake-retention-on-failure to bound repeated
classification failures. That machinery grew larger than the fix it protected
and kept producing its own defects: an unreadable log still looped forever
because the always-on watcher never consulted the receipt, and the receipt was
persisted before its diagnostic was durably queued, so a crash in between
swallowed the alarm outright. Those two defects go away with the code that
contained them rather than being repaired.

Removed: the failure-receipt path, fingerprint, record and clear helpers and
their retirement bookkeeping; the retention of a durable wake when
classification fails; and the error-propagation plumbing in both supervisors
that existed only to drive them.

Kept, because it is the accepted fix rather than the declined machinery: span
classification of the events appended since a supervisor last looked, in both
supervisors and both backstops; reporting every actionable event in a span and
committing a position only through what was reported; naming the live opening of
a reopened decision; treating an absent log as ordinary and an unreadable one as
worth reporting; the non-.status filter; and the platform-strength identity that
guards a position commit without failing a read.

Replacement behavior for a log that cannot be classified: report it once, do NOT
advance the classification position so the content is classified from where it
stopped once readable, and DO advance the wake signature so the report is
bounded to one per distinct file state. Reporting and reading are different acts:
telling the captain about a log is not the same as having read it, and only the
latter may move a classification position.

The residual risk is explicit and accepted: there is no guaranteed automatic
retry inside a crash-mid-read window, and the locked session-start replay of the
durable queue covers it. That rationale is recorded at mark_escalated_seen so a
future reader does not reintroduce the retry as a "missing" guarantee.

Also fixes lint failures that arrived with the review-fix commits and were never
caught because the run never reached its lint step: an unfollowable conditional
source directive, a second unquoted-expansion site left after a call was split
across lines, cleanup of the file being read inside its own read loop (restructured
to one post-loop teardown rather than three in-loop copies), stub functions in
tests that are invoked indirectly, and a test local left unused when its
assignment was replaced by a helper. bin/fm-lint.sh passes on the default branch,
so these were introduced here.

Verified with `bin/fm-lint.sh`, the end-to-end masked-decision and away-mode
reproductions, and `bin/fm-test-run.sh` over the supervision, wake-queue,
wake-drain, watch-arm and inactive-reconcile suites (6 scripts, 0 failures).

* no-mistakes(review): Correct classification failure contract documentation

* no-mistakes(review): Bound unreadable status reports without skipping classification

* no-mistakes(review): Preserve escalation markers when buffering fails

* no-mistakes(review): Detect permission recovery without advancing classification

* no-mistakes(document): Document status span classification contract

* no-mistakes(ci): Fixed CI failures by lazily loading classification helpers in fm-wake-lib, preserving minimal recovery/remote fixtures; added a public current-status marker helper and updated behavioral fixtures to use the v2 marker contract; resolved ShellCheck variable collisions in fm-control and fm-public-followup-lib. Verified fm-lint, bash syntax, fm-control, public-followup, wake-queue, send-resolve-key, captain-hold, pending-reply, remote-reply, remote-backlog-handoff, turnend-guard, and Claude autoarm tests. The Pi branch suite reached a separate local stock-render mismatch under Node 24; its CI-reported missing-classifier failure path is fixed

* no-mistakes(review): Escalate blockers while preserving declared-wait cadence

* no-mistakes(review): Clarify actionable events override wait self-handling

* no-mistakes(review): Surface rejected decisions and dangling status links

* no-mistakes(document): Document reserved-key reconciliation classification

* no-mistakes(ci): Fixed the flaky portable serial CI test by modeling the retained staging directory as genuinely owned by a live process and aging both fixtures deterministically. This removes scheduler-timing dependence while verifying the worker reaps abandoned staging and preserves live staging. Verified with fm-remote-transport-lanes.test.sh, bin/fm-lint.sh, bash syntax, and git diff --check

* no-mistakes(document): Correct away-mode classification documentation
…#3289)

* docs: split harness adapter operations reference

* no-mistakes(review): Fix harness adapter routing and ownership contracts

* no-mistakes(review): Prune duplicate harness adapter ownership prose

* no-mistakes(review): Fix default effort routing and Grok max semantics

* no-mistakes(review): Remove source-only routing test and duplicate semantics

* no-mistakes(review): Add local harness adapter instruction evaluation

* no-mistakes(review): Fix harness evaluation gating and change mapping

* no-mistakes(test): Captain, require explicit harness instruction evaluator model

* no-mistakes(document): Fix harness adapter documentation references
* test(fixtures): share fake-toolchain and spawn-world builders

Future tests can start from tests/fixtures.sh instead of copying stubs, and a
no-mistakes version-floor bump is one constant rather than a multi-file edit.

Migrated this round: fm-busy-adapter-wiring, fm-spawn-pool-base-freshen,
fm-grok-harness, fm-tangle-guard, fm-gate-refuse, fm-spawn-dispatch-profile.
Left for opportunistic migration: remaining make_spawn_fakebin copies
(trace-context, kimi, muse, backend), the make_stubs send cluster, and the
fake no-mistakes version banners in bootstrap/session-start/secondmate suites.
Did not touch tests/fm-pr-check-security.test.sh.

* no-mistakes(review): Prevent fake SSH test from blocking on stdin

* no-mistakes(document): Clarify shared fixture documentation

* no-mistakes(ci): Fixed the flaky watcher triage test by extending its startup-sensitive timer-repair wait from 3s to 10s, matching existing loaded-runner budgets. Verified with the full tests/fm-watch-triage.test.sh suite, bash syntax validation, and git diff checks

* no-mistakes(ci): Fixed portable serial shard 4 by updating the inactive-reconcile fixture to prime status through the public fm_wake_status_mark_current API, ensuring classifier helpers load correctly and preventing the idle watcher from exiting. Verified the test three consecutive times, ran fm-test-fixtures, ShellCheck, bash syntax checks, and git diff checks. The outer no-mistakes executor can now bind a fresh attestation to the new head

* no-mistakes(ci): Added behavioral coverage proving the shared spawn tmux fixture defaults an unset FM_FAKE_PANE_PATH to empty. Verified the fixture suite, ShellCheck, syntax/diff checks, and all six migrated test suites; all passed. The outer executor can now bind a fresh no-mistakes attestation to the updated head
* feat(bin): retire completed PR-check migration machinery

Every registered home already carried both completion markers, and no
installer still creates pre-migration checks. Remove the one-time migrate
script, its bootstrap/watch/teardown/docs surface, and migration-path tests
without weakening live check-trust or PR-poll authentication.

* no-mistakes(review): Restore live PR-check security coverage

* no-mistakes(document): Refresh retired PR-check documentation

* no-mistakes(ci): Fixed both failing CI checks. Updated inactive-reconcile setup to use the public status-marking interface, preventing false watcher exits. Made remote-job shutdown deterministic by stopping the complete worker tree before tampering. Verified both affected test suites, repeated inactive reconciliation, shell syntax, and git diff checks
…3247)

* feat(extensions): bind trusted external process-event adapters

* no-mistakes(review): Enforce owner and remote-home conformance

* no-mistakes(review): Enforce serialized remote extension package lifecycle

* no-mistakes(review): Enforce identity-conditional extension retirement

* no-mistakes(review): Serialize extension retirement and recover crash cuts

* no-mistakes(review): Unify retirement worker and lifecycle lock ownership

* no-mistakes(review): Harden extension lifecycle retirement serialization

* no-mistakes(review): Unify extension registration and overridden-state lifecycle boundaries

* no-mistakes(document): Clarify built-in-only captain answer routing

* no-mistakes(lint): Captain: fix extension binding ShellCheck findings

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes(review): Use isolated UID mapping for owner conformance

* no-mistakes(review): Captain: remove forbidden CI ownership wrapper

* no-mistakes(review): Serialize extension binding publication

* no-mistakes(review): Document ordinary CI owner-fixture exclusion

* no-mistakes(review): Quarantine orphaned handshake descendants

* no-mistakes(test): Fix orphan attribution

* no-mistakes(test): Harden process tracker baseline

* no-mistakes(test): Harden detached descendant attribution

* no-mistakes(test): Use exact invocation-group cleanup

* no-mistakes(test): Bound remote conformance transport crossings

* no-mistakes(test): Parallelize isolated extension conformance tests

* no-mistakes(test): Lifecycle suite still exceeds deadline

* feat(extensions): bind trusted external process-event adapters

* no-mistakes(review): Enforce owner and remote-home conformance

* no-mistakes(review): Enforce serialized remote extension package lifecycle

* no-mistakes(review): Enforce identity-conditional extension retirement

* no-mistakes(review): Serialize extension retirement and recover crash cuts

* no-mistakes(review): Unify retirement worker and lifecycle lock ownership

* no-mistakes(review): Harden extension lifecycle retirement serialization

* no-mistakes(review): Unify extension registration and overridden-state lifecycle boundaries

* no-mistakes(document): Clarify built-in-only captain answer routing

* no-mistakes(lint): Captain: fix extension binding ShellCheck findings

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes(review): Use isolated UID mapping for owner conformance

* no-mistakes(review): Captain: remove forbidden CI ownership wrapper

* no-mistakes(review): Serialize extension binding publication

* no-mistakes(review): Document ordinary CI owner-fixture exclusion

* no-mistakes(review): Quarantine orphaned handshake descendants

* no-mistakes(test): Fix orphan attribution

* no-mistakes(test): Harden process tracker baseline

* no-mistakes(test): Harden detached descendant attribution

* no-mistakes(test): Use exact invocation-group cleanup

* no-mistakes(test): Bound remote conformance transport crossings

* no-mistakes(test): Parallelize isolated extension conformance tests

* no-mistakes(test): Lifecycle suite still exceeds deadline

* no-mistakes(review): Split extension conformance and forward remote transfer input

* no-mistakes(review): Forward malformed remote payloads through fm-on

* no-mistakes(review): Bound extension coordinator failure cleanup

* no-mistakes(test): Skip repeated orphan sweep in coordinator children

* no-mistakes(test): Queue isolated extension sections through bounded workers

* no-mistakes(test): Bound extension coordinator lane cleanup

* no-mistakes(test): Split remote lifecycle coordinator sections

* no-mistakes(test): Coordinator probes pass; aggregate deadline remains

* no-mistakes(test): Launch extension sections concurrently

* no-mistakes(test): Fix coordinator marker publication

* no-mistakes(test): Stabilize extension binding coordinator timing

* no-mistakes(lint): Fix extension binding ShellCheck warnings

* fix(extensions): prove invocation cleanup before retirement

* no-mistakes(review): Harden process-event inbox confinement

* no-mistakes(review): Preserve legacy capture parity

* no-mistakes(review): Protect external registry staging

* no-mistakes(test): Stabilize bounded extension conformance aggregate

* no-mistakes(document): Document external evidence confinement

* no-mistakes(ci): CI phase fixed. The failure was a flaky fixture in `tests/fm-remote-transport-lanes.test.sh`: its “fresh/in-use” staging directory had no live owner identity, so the real worker correctly reaped it once the 1-second age boundary elapsed on slower CI. The fixture now records the active test shell’s exact PID/start identity and cleans those records before removal. Verified: `bash tests/fm-remote-transport-lanes.test.sh` exits 0 with all checks passing; `git diff --check` passes. Provider check retrieval was also retried successfully, resolving the selected manual CI finding. Changed file: `tests/fm-remote-transport-lanes.test.sh`

* no-mistakes(review): Harden extension staging and lifecycle reservation

* no-mistakes(review): Harden external staging and lifecycle reservations

* no-mistakes(review): Wire capture helper into remote conformance

* no-mistakes(review): Pin external capture handoff and signal failures

* no-mistakes(review): Bind pinned capture authority to inherited descriptor

* no-mistakes(review): Harden descriptor-bound capture authority

* no-mistakes(review): Harden core capture reservation authority

* no-mistakes(review): Harden capture reservation boundaries

* no-mistakes(review): Harden capture reservations and cleanup

* no-mistakes(review): Harden capture handoff and reservation cleanup

* no-mistakes(review): Bind capture handoff to claim descriptors

* no-mistakes(review): Release lifecycle locks after host crashes

* no-mistakes(review): Pin reservation recovery to recorded state roots

* no-mistakes(review): Reject control bytes in claim state roots

* no-mistakes(test): Stabilize extension capture descriptor handoff

* no-mistakes(document): Document extension capture authority boundary

* no-mistakes(lint): Fix ShellCheck extension binding warnings

* no-mistakes(ci): CI phase result: fixed `bin/fm-procevent.sh` by initializing the shared `capture_state` sentinel for built-in adapters under `set -u`. This prevents normal built-in captures from aborting before publication. Verified: `bash -n bin/fm-procevent.sh` and `git diff --check` pass. The focused process-event suite was run locally but stopped earlier at a local detached-runner claim failure (`reconcile never claimed the registered source`), before the CI-reported post-capture path; CI evidence confirms the fixed unset-variable failure affected the failing remote, board, watcher, and process-event checks

* no-mistakes(document): Correct extension namespace creation timing

* no-mistakes(lint): Initialize capture locals for ShellCheck
* fix(bin): deliver the real definition of done to a promoted scout, and ban --yes

A promoted scout used to receive a free-form placeholder instead of the
mode-specific Definition of done a briefed ship worker gets, so it never
saw the ask-user escalation rule or the --yes prohibition. That gap is the
concrete reason one incident's worker drove validation with --yes and
answered its own ask-user findings.

- Add bin/fm-dod-lib.sh as the single owner of a ship task's mode-specific
  Definition of done, rendered by both bin/fm-brief.sh and bin/fm-promote.sh
  so the two contracts cannot drift.
- bin/fm-promote.sh now writes data/<id>/ship-instructions.md carrying the
  scratch inventory, clean base, ship branch, and that Definition of done,
  and prints the fm-send.sh command that delivers it.
- State the --yes ban as a prohibition rather than a preference, without
  claiming an enforcement the tool does not provide.
- Cover both through the real promotion and brief paths in
  tests/fm-task-delivery.test.sh and tests/fm-brief.test.sh.

* no-mistakes(review): Publish promotion instructions before committing task state

* no-mistakes(review): Supersede conflicting scout delivery rules after promotion

* no-mistakes(review): Reject invalid promotion instruction destinations

* no-mistakes(document): Align documentation with promotion delivery contracts

* no-mistakes(ci): Fixed both CI findings. Promoted workers now receive an explicit worktree-isolation check before branch creation, with instructions to stop and escalate if they are in the primary checkout. Updated behavioral coverage to verify the delivered promotion payload, and aligned the ask-user authority test with the new fleet-wide --yes prohibition. Verified with bin/fm-lint.sh, tests/fm-brief.test.sh, tests/fm-ask-user-authority.test.sh, tests/fm-task-delivery.test.sh, and git diff --check

* no-mistakes(ci): Made tests/fm-ask-user-authority.test.sh executable so the modified colocated behavioral test runs directly like the surrounding test suite. Verified bin/fm-lint.sh, fm-brief, ask-user-authority, and task-delivery tests; all pass. git diff --check is clean

* no-mistakes(ci): Strengthened tests/fm-task-delivery.test.sh to behaviorally verify that real promotion and brief generation deliver byte-identical Definition-of-done blocks for all three modes. Verified tests/fm-task-delivery.test.sh, tests/fm-brief.test.sh, bin/fm-lint.sh, and git diff --check. The outer pipeline can now commit and attest the updated head

* no-mistakes(ci): Fixed promotion isolation instructions so any checkout other than the launched disposable worktree requires escalation, including another non-primary worktree. Updated behavioral coverage against the delivered promotion payload. Verified fm-task-delivery, fm-brief, fm-ask-user-authority, full fm-lint/ShellCheck, workflow lint, and git diff checks
)

* fix(bin): present complete Lavish board feedback as structured output

Give the Lavish adapter a read-only presentation so a handler sees every
annotation and the session-ending tag=message as its own field, instead of
grepping a truncated raw capture.

* no-mistakes(review): Preserve unquoted messages and prioritize captain prose

* no-mistakes(document): Document structured Lavish result reads

* no-mistakes(ci): Fixed Lavish `read` completeness: rows missing declared fields are excluded from presented items, counted as malformed, and force `complete: no`. Added behavioral regression coverage through the adapter interface. `bin/fm-lint.sh`, syntax checks, and focused valid/malformed read checks passed. The portable-serial failure was an unrelated secondmate cooldown timing flake
* fix(records): pair backlog transitions with the record that moves

Dispatch and completion each moved a task's physical record and its
backlog row as two independently timed steps, so a crash or a forgotten
follow-up could leave the two disagreeing: a record with no in-flight
row, an in-flight row with no owner, or a finished task still shown in
flight.

Fold each backlog transition into the script that performs the physical
change, under the per-task lock it already holds and before it reports
success. Dispatch moves the item to In flight after publishing the task
record and fails loudly, removing its provisional record, when that
transition cannot land. Completion records an authoritative close and
performs it before removing the record, so an interrupted cleanup can be
finished later, and its closing message now confirms what already
happened rather than instructing a future step.

Add a same-home reconciliation sweep to session start so a home that was
interrupted mid-transition settles its own books on restart, replaying a
recorded close and restoring an in-flight row it already owns a worker
for. It never reads or writes another home; the fleet snapshot and the
cross-home nudge stay as backstops.

Close records are validated before they are trusted: the file is read as
raw bytes and rejected outright when it carries a NUL or other control
byte, every field must be well formed and non-duplicated, the id must
match the record it was found under, the data location must resolve
inside this home, and each close argument must carry a permitted,
well-formed value. Writer and reader share one validator so a record
this home publishes always remains replayable, independent of locale.

Homes configured for a manual backlog, and homes with no backlog at all,
stay exempt and are unaffected.

* no-mistakes(review): Remove stale bootstrap migration helper invocation

* no-mistakes(review): Preserve pending closes and narrow signal deferral

* no-mistakes(review): Record close before destructive teardown

* no-mistakes(review): Refuse pending closes before creating resources

* no-mistakes(review): Guard relaunches and preserve cleanup warnings

* no-mistakes(review): Reject symlinked records and clarify cleanup guidance

* no-mistakes(review): Align dispatch eligibility and protect close replay

* no-mistakes(review): Unify exact task incarnation parsing

* no-mistakes(review): Render resolved configured backlog path

* no-mistakes(review): Harden transition path boundaries against symlinks

* no-mistakes(review): Validate lifecycle state before resource actions

* no-mistakes(review): Enforce transition tooling and continuous state locks

* no-mistakes(review): Consolidate same-home lifecycle file boundaries

* no-mistakes(review): Enforce canonical lifecycle containment and tooling contracts

* no-mistakes(review): Reject final-component lifecycle record symlinks

* no-mistakes(document): Document lifecycle record path boundaries

* no-mistakes(lint): Quote literal done tokens in atomicity tests

* no-mistakes(ci): Fixed all PR-caused CI failures: bootstrap now treats an absent state directory as an empty fresh home while retaining unsafe-state checks; nested remote secondmate retirement accepts records already removed with the retired home; teardown fixtures now provide valid data/manual-backend configuration; and the manual reminder assertion checks the configured absolute backlog path. Verified the reported tests, remote lifecycle E2E, backlog atomicity suite, Bash syntax, diff checks, and ShellCheck. The documented pre-existing captain-hold failure was intentionally untouched

* no-mistakes(ci): Fixed Behavior portable serial 3 by adding `od` to the teardown test’s lsof-free PATH fixture. The new close-record validator legitimately requires `od`; its omission caused teardown to fail before process-group cleanup and stall the shard. Verified the full `tests/fm-teardown.test.sh` suite passes, plus Bash syntax, ShellCheck, and `git diff --check`

* no-mistakes(ci): Fixed close replay to durably retain incomplete-cleanup evidence before removing task metadata. Subsequent retries now emit the reconciliation warning even after a backlog probe or close failure. Updated the behavioral regression and verified the full atomicity suite under stock macOS Bash 3.2, plus shellcheck and diff checks

* fix(records): validate record bytes without an uncurated tool

The byte validation added for close records and directory paths shelled
out to od. The spawn and teardown lifecycle runs under a curated command
set that deliberately excludes it, so on any restricted PATH the check
could not run, the data directory read as unresolvable, and dispatch and
cleanup refused - wedging the lifecycle rather than protecting it.

An earlier attempt made the failing test pass by adding od to that
curated set. That fixed the test to agree with the defect and quietly
widened the contract the fixture exists to pin, so it is reverted here.

Inspect the bytes with perl instead, which is already in the curated set
and already used in this repo for the same portability reason. The
emitted values are identical to od's, so the rejection semantics are
unchanged: NUL and other control bytes are still refused, legitimate
paths containing spaces or non-ASCII characters still round-trip, and
the check stays independent of the process locale.

The restricted-PATH teardown case now passes because the validator no
longer needs od, not because the fixture was loosened.

* no-mistakes(review): Enforce dispatch eligibility and atomic remote record publication

* no-mistakes(document): Document dispatch eligibility and cleanup alerts
…3342)

* fix: publish promote and Relay meta rewrites through contained replace

Bare mv still rewrote live task records in place, so a symlink meta could
be followed to a target outside state/. Route those field rewrites through
the shared publisher and drop the unused library aliases.

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes(review): Refuse dangling symlinks during X metadata clear

* no-mistakes(review): Refuse unsafe metadata before follow-up and promotion side effects

* no-mistakes(review): Exercise dangling symlink refusal through clear helper

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…d#2877)

* fix(watch): absorb a turn-end whose pane churned since the previous poll

The watcher's "absorb a benign turn-end when the crew is provably working"
triage was structurally unreachable for any harness whose semantic busy state
has no verified source. crew_absorb_class only reports working for an actively
running no-mistakes step or an exact busy verdict, and bin/fm-crew-state.sh can
only answer unknown for such an adapter, so codex crewmates surfaced a signal
wake at every turn boundary with nothing to act on - a full supervisor drain,
inspect and acknowledge turn per worker turn, scaling with the number of workers
in flight and drowning the wakes that matter in identical noise.

Widen the proof rather than bound the wake rate. A wake carrying only bare
turn-ended markers is now also benign when the task's pane content changed since
the previous poll, compared against the same state/.hash-* marker the staleness
backbone already records and already trusts as liveness. That evidence claims no
harness semantics, so it fabricates no busy verdict an adapter has not earned,
and it needs no adapter cooperation.

Absorb stays evidence-driven in both directions. A wake naming any status file
keeps the strict proof, every captain-relevant verb still surfaces immediately,
and an unresolvable task, a missing prior hash, a failed or empty capture, or an
unchanged pane all surface exactly as before. The absorb defers rather than
swallows: a crew that has stopped renders nothing further, so its now-static pane
surfaces through the staleness backbone within a poll or two. Bounding the
surfacing rate instead would have suppressed genuinely stopped workers.

The derivation lives with the .hash-* marker format in bin/fm-watch.sh, which
owns it, and costs one bounded capture reached only for a no-verb turn-end whose
crew is not already provably working.

* no-mistakes(review): Captain, guard pane-churn absorption from collisions and secondmates

* no-mistakes(review): Captain, make watcher marker identities injective

* no-mistakes(review): Captain, isolate ambiguous legacy markers and restore Herdr sourcing

* no-mistakes(review): Captain, localize pane-churn collision guard

* no-mistakes(review): Captain, reject malformed pane-churn hashes

* no-mistakes(document): Document pane-churn turn-end evidence

* no-mistakes: apply CI fixes

* fix(watch): gate and bound the pane-churn turn-end absorb

Make the pane-churn form of positive work evidence opt-in per home and
bound how long it may defer one endpoint's bare turn-ends.

Absorbing a bare turn-end on pane churn is now reached only when the home
creates config/turnend-churn-absorb. The other two proofs read a verdict
the harness itself vouches for, while this one infers execution from
rendered bytes, so widening the absorb is a home's choice rather than a
default every fleet inherits. With the flag absent the predicate returns
on its first line and triage is unchanged.

Churn and pane staleness read the same pane, so neither can be the
other's only backstop. A pane that renders continuously never presents
the two consecutive identical hashes the staleness backbone needs, so an
unbounded churn absorb left a worker that had genuinely stopped behind
such a renderer with no path to surface at all. One endpoint's turn-ends
may now ride churn evidence for at most FM_TURNEND_CHURN_ABSORB_SECS,
tracked in state/.churn-since-*, after which the wake surfaces and the
window restarts. The bound is evaluated before any .stale- state is
touched, so a wake that surfaces there leaves the staleness backbone's
own classification alone.

Covers both with behavioral tests: the same churning fixture that absorbs
with the flag surfaces and queues without it, and a spent deferral window
surfaces and restarts. The four existing safety guards now run with the
flag enabled so they keep proving their specific guard.

* no-mistakes(review): Fail closed on invalid churn deferral state

* no-mistakes(review): Validate persisted churn deadlines before arithmetic

* no-mistakes(review): Make churn deadlines transactional and bounds safe

* no-mistakes(review): Compose turn-end evidence per task from one snapshot

* no-mistakes(review): Restore strict turn-end fallback guards

* no-mistakes(document): Clarify pane-churn supervision documentation

* no-mistakes(lint): Fix watcher arithmetic lint issues

* no-mistakes: apply CI fixes

* no-mistakes(document): Clarify pane-churn fail-closed documentation

* fix(bin): prioritize active pipeline-owned crew runs (kunchenguid#3194)

* fix(bin): bind the live pipeline-owned run instead of a superseded failed row

fm-crew-state.sh bound a superseded FAILED no-mistakes run to a task instead
of the LIVE replacement run: the live run's pipeline-owned lane head is not a
git object in the task worktree, so head-equality attribution rejected it and
the coarse runs-list fallback silently continued past the RUNNING row onto an
older failed row whose head equalled the stale worktree HEAD. The home summary
then flipped invalid and Bearings hid the home's live work (F10).

Attribution precedence now follows the daemon's own identity:
- An ACTIVE run for the task's branch binds without head equality while
  branch_sync.state is pipeline_owned (fm_nm_run_is_pipeline_owned_active);
  the pipeline owning the branch is itself the attribution.
- A genuinely failed run with no later run on the branch still reports failed
  through the unchanged head-equality path - real failures are not hidden.
- In the coarse runs scan, an unresolvable head is unknown attribution and
  stops the scan (fm_nm_head_resolvable) instead of falling through to an
  older row; a resolvable-but-mismatched head keeps the historical
  reused-branch skip.

The exemption never applies to a terminal run and requires pipeline_owned
specifically, both pinned by negative-control tests. Fixture shape verified
against the live incident run's real axi status output.

* no-mistakes(document): Updated run-attribution documentation ownership

* no-mistakes(review): Captain, make watcher marker identities injective

* no-mistakes(review): Captain, localize pane-churn collision guard

* no-mistakes(review): Compose turn-end evidence per task from one snapshot

* no-mistakes(review): Restore strict turn-end fallback guards

* no-mistakes(document): Align pane-churn watcher documentation

* no-mistakes(ci): Captain, fixed the flaky cooldown boundary test by freezing its executable clock. The failure reproduced before the fix and passed five consecutive full-suite runs afterward. Extended ShellCheck passed; full lint stopped because actionlint 1.7.12 is not installed

---------

Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
* fix(bin): add a safe owner for custom-check retirement

Agents were improvising rm of check files with unset STATE/ID, which wedges
headless panes. Unregister validates the id and state directory first.

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes(review): Refuse explicitly empty custom-check state overrides

* no-mistakes(document): Document custom-check retirement safety contract

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…o dedicated scripts (kunchenguid#3221)

* Add quota exhaustion detection and safe fallback helpers

- bin/fm-procevent-quota.sh: generic procevent adapter that arms a
  recurring quota-axi --json poll and wakes firstmate when a tracked
  provider's effectivePercentRemaining drops below a threshold or its
  runway.status becomes exhausted_now.
- bin/fm-quota-choose.sh: worker-side helper that picks the first ranked
  harness:model candidate with positive effectivePercentRemaining.
- AGENTS.md and .agents/skills/quota-array-dispatch/SKILL.md: document
  the new helpers and the mid-task quota-exhaustion wake path.
- tests/fm-quota-choose.test.sh: unit tests with a mocked quota-axi JSON
  source.

* no-mistakes(review): Fix quota polling and scope bounds

* no-mistakes(review): Enforce safe default quota selection

* no-mistakes(review): Handle decimal quota values safely

* no-mistakes(review): Fail closed on invalid quota inputs

* no-mistakes(review): Reject empty quota candidate segments

* no-mistakes(review): Harden quota parsing and timeout ownership

* no-mistakes(review): Reuse captured quota snapshots consistently

* no-mistakes(review): Match quota using explicit candidate providers

* no-mistakes(review): Centralize fail-closed quota schema validation

* no-mistakes(review): Reject out-of-range quota percentages

* no-mistakes(review): Validate quota runway status enum

* no-mistakes(review): Tighten quota scope and status contracts

* no-mistakes(review): Preserve unknown quota and exact product bounds

* no-mistakes(review): Preserve provider-level unknown quota

* no-mistakes(review): Reuse canonical verified harness validation

* no-mistakes(document): Document mid-task quota handling

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* fix(docs): restore default routing contract, keep quota helper optional

Restore the AGENTS.md section 4 always-loaded routing paragraph the PR
had deleted, so the standing TOON-first intake, spendPriority ranker,
every-candidate accounting, and load-trigger contract stay exactly as
before this PR. The mid-task quota wake is optional and must not alter
default routing.

Restore the quota-array-dispatch skill ownership line to section 4 as
the always-loaded intake boundary owner; keep the worker-side helper
section as an addition only, without rewiring ownership or load
triggers to section 13.

* fix(bin): use harness-keyed quota matching in optional helper

Revert fm-quota-choose.sh from harness:provider:model tuples back to
harness:model candidates with harness-keyed provider matching, per the
resolved ask-user finding. The helper is optional; authoritative
multi-provider routing (provider discovery from the harness catalog and
quota matching by that explicit provider) stays owned by AGENTS.md
section 4 and the quota-array-dispatch skill intake procedure, not the
helper.

Document the multi-provider limitation in the helper header and the
quota-array-dispatch skill: the helper maps each harness to one primary
provider family only, so a candidate whose established provider differs
from that primary family is checked against the wrong quota row. Use it
only when the brief fixed the candidate order and every candidate's
provider is the harness's primary family.

The helper still consumes one already-captured default-TOON or JSON
snapshot via stdin or --snapshot and never calls quota-axi itself, so
it selects from the same quota state as the intake.

* no-mistakes(review): Fix Muse quota mapping and helper contract docs

* no-mistakes(review): Reject known-empty quotas and map quota tests explicitly

* no-mistakes(review): Preserve unmeasured candidates and enforce snapshot reuse

* no-mistakes(review): Fix quota retirement and dependent regression coverage

* no-mistakes(review): Accept zero-row quota TOON snapshots

* no-mistakes(review): Enforce quota semantics status consistency

* no-mistakes(review): Veto dispatch on any exhausted applicable scope

* no-mistakes(review): Record exhausted quota scope in wake details

* no-mistakes(review): Fix quota help and control dependency coverage

* no-mistakes(review): Decode quoted TOON fields and document quota wakes

* no-mistakes(review): Validate zero-row TOON and map timeout coverage

* no-mistakes(review): Reject multi-value JSON and malformed TOON envelopes

* no-mistakes(review): Validate complete nonzero TOON envelopes

* no-mistakes(review): Accept producer-shaped quota TOON envelopes

* no-mistakes(review): Support empty quota arrays and validate counted rows

* no-mistakes(review): Harden TOON completion, scopes, and quoted fields

* no-mistakes(review): Preserve unknown-headroom exhaustion and reject trailing fields

* no-mistakes(review): Allow unknown headroom under known semantics

* no-mistakes(review): Reject noncanonical quota identities

* no-mistakes(review): Preserve empty quota polling and validate attention identities

* no-mistakes(review): Reject noncanonical provider watches

* no-mistakes(review): Validate all candidates before quota selection

* no-mistakes(document): Correct quota helper safety documentation

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes
* fix(bin): keep typed Lavish comments when an element is also annotated

read preferred element text over prompt, so an annotate-and-comment
item dropped the captain's words. Surface prompt as its own field.

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes(review): Filter non-comment prompts from Lavish reader output

* no-mistakes(document): Clarify Lavish comment presentation contract

* no-mistakes(ci): Fixed Lavish reader comment provenance: non-choice prompts are now emitted even when identical to element text. Added observable regression coverage for identical selector+comment input while retaining pure annotation/message coverage. Reader cases, bash syntax, and diff checks pass. Full fm-procevent suite stops earlier at unrelated “reconcile never claimed” setup failure

* no-mistakes(ci): Fixed duplicate pure-annotation prompts by emitting `prompt:` only when it differs from captured element text. Updated behavioral coverage for selector+comment, pure annotation, and pure message cases. Focused reader regressions, syntax checks, and diff checks pass. Full suite remains blocked by the pre-existing “reconcile never claimed the registered source” failure

* fix(bin): always emit Lavish comments and use real annotation fixtures

Stop inferring comment provenance from prompt==text. Real pure
annotations have no prompt, so always-emit does not duplicate.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…uid#3420)

* Fix public-followup register crashing on empty lock arrays under bash 3.2.

bash 3.2 with set -u treats "${arr[@]}" on an empty array as unbound, so the first register in a fresh home aborted before taking the registry lock.
The empty-lock regression also runs under the existing stock macOS Bash CI lane so pre-fix code would fail there.

* no-mistakes(document): Document stock Bash registration coverage

* no-mistakes(ci): Pinned the stock macOS Bash CI lane to tasks-axi@0.2.5, eliminating dependency drift. Verified workflow YAML parsing, git diff checks, and the focused regression under /bin/bash 3.2.57 with tasks-axi 0.2.5

* no-mistakes(ci): Fixed the flaky portable CI test: it treated exited zombie processes as live because `kill -0` succeeds for zombies. The watcher and descendant assertions now check process state and regard zombies as exited. Verified `tests/fm-pr-check-security.test.sh`, ShellCheck, `git diff --check`, and the focused Bash public-followup regression
* fix(herdr): isolate server launch environment

* no-mistakes(review): Clear inherited supervision model from Herdr launches

* no-mistakes(document): Document Herdr server launch environment isolation
* fix: surface inbound Relay attachments to the responding agent

A Discord support thread's screenshots were never seen by the agent
handling the mention. The relay delivered them and the poll stashed
them: the reporter's images arrived on the `thread_starter` entry of
`in_reply_to_chain` while the mention's own media list was empty. The
gap was in the responder's playbook, which enumerated a fixed field
list (`request_id`, `text`, `in_reply_to`, `in_reply_to_chain`) and so
made every other field, attachments included, invisible.

Fix it where the gap is, in prose:

- Read the complete payload object rather than a fixed field list, so
  media and later relay fields are never skipped again.
- Fetch and view attached media with the agent's own tools, on the
  mention and on every chain entry, and call out the common shape where
  only the thread starter carries the screenshots.
- Restrict those fetches to known-good platform media hosts over https
  (Discord: cdn.discordapp.com, media.discordapp.net,
  images-ext-1.discordapp.net, images-ext-2.discordapp.net; X:
  pbs.twimg.com, video.twimg.com), report a blocked host instead of
  working around it, and treat everything fetched as untrusted public
  input on the same terms as the surrounding thread text.

The poll stays out of it and downloads nothing, so no third-party bytes
are pulled on the polling path.

The new test pins the contract the playbook depends on: a mention in the
incident's shape, with an empty top-level media list and screenshots on
the thread starter, must reach the inbox with the payload intact and its
media URLs unfetched.

* no-mistakes(review): Preserve media authority and enforce poll-only fetching

* no-mistakes(document): Clarify Relay attachment safety prose
)

* Defer inactive startup reconciliation

* no-mistakes(review): Queue deferred inactive reconciliation diagnostics durably

* no-mistakes(review): Require worker phases to cover startup requests

* no-mistakes(review): Make diagnostic wakes safely acknowledgeable

* no-mistakes(document): Document deferred startup phase coverage
* fix: bound status presentation lock waits

* no-mistakes(review): Distinguish malformed presentation locks from live contention

* no-mistakes(review): Bound no-ack drain queue lock acquisition

* no-mistakes(document): Document bounded presentation-lock drain behavior

* no-mistakes(lint): Annotate bounded lock output global

* no-mistakes(ci): Added deterministic regression coverage for successful bounded-lock acquisition after live contention, verifying helper-to-caller PID ownership handoff and caller release. Verified with bash syntax checks, git diff checks, and the full fm-wake-queue test suite
* fix(relay): close a public loop whose work lives in a remote secondmate home

A public-followup loop bound to a REMOTE secondmate could never be closed.
`clear_public_followup_link` (bin/fm-public-followup.sh:701) required an
absolute recorded `work_home_path` for a `secondmate:*` work home, but a remote
route has no local path on this machine, so registration records that field
empty (bin/fm-public-followup.sh:291). Every close ran that clear first, so
`retire` died with "could not clear the legacy X link ... retained for
reconciliation" forever, and `deliver` posted the public reply and then stranded
the loop at `posted`. `--force` never covered that step.

The clear now goes to the remote home over that route's SSH transport, running
`fm-x-followup.sh --clear <work-id>` through `bin/fm-on.sh`. The route is decided
from `data/secondmates.md` before any local path is consulted, so a same-named
local directory can never stand in for a remote home, and registrations already
on disk retire without needing a new field. `fm-on.sh` passes ssh's status
through, so 255 stays the established "delivered but completion unknown" result
this codebase already reconciles: the close is refused, the registration and the
remote link are left exactly as they were, and the message names the unknown
completion instead of claiming a definite failure.

Local secondmate and `main` work homes are untouched, and `--force` still
governs only the unresolved-obligation refusal.

Three regression cases drive a remote route end to end, faking only the ssh
binary at the FM_SSH_BIN seam and then running the real remote entrypoint
against a local checkout, so the clear that must reach the remote home actually
happens there.

* no-mistakes(review): Guard remote link clears by request identity

* no-mistakes(review): Fail guarded clears on unreadable remote state

* no-mistakes(review): Reject guarded clears on non-writable remote state

* no-mistakes(review): Allow no-link retirement in non-writable remote state

* no-mistakes(document): Correct public-followup verification guarantee count

* no-mistakes(ci): Fixed the guarded link-clear race by ensuring absence is decided under the metadata lock whenever publication is possible. Added a behavioral concurrency regression test. Verified with fm-x-mode and fm-public-followup suites, Bash syntax checks, diff checks, and bin/fm-lint.sh

* no-mistakes(ci): Fixed the guarded link-clear race by refusing an unlocked absence decision when a publisher already owns the metadata lock in a non-writable directory. Added a behavioral concurrency regression test. Verified with fm-x-mode, fm-public-followup, syntax/diff checks, and fm-lint

* no-mistakes(ci): Fixed the guarded-clear race by refusing all guarded clears when the metadata parent is non-writable, including apparent link absence. Added a behavioral regression with a publisher waiting to create the lock, updated remote-retirement expectations and verification docs. Passed fm-x-mode, fm-public-followup, fm-lint, documentation audience, Bash syntax, and diff checks

* fix(relay): bound the guarded remote link clear so it refuses instead of hanging

The guarded clear checks that the remote state directory is writable before
taking the metadata lock, but that check cannot close the window: the parent can
turn non-writable between the check and lock creation, and a lock held by a live
holder is indistinguishable from that at the acquire. `fm_lock_acquire_wait` is
an unbounded `while ! try; do sleep 0.1; done`, so either case retried forever
and `deliver` or `retire` wedged with nothing reported, instead of returning the
retained-for-reconciliation refusal the guard exists to produce. This path runs
unattended over the secondmate transport, where a wedge is worse than either
outcome the guard defines.

The guarded clear now acquires through `fm_lock_acquire_wait_bounded`
(FMX_LINK_CLEAR_LOCK_TIMEOUT, default 10 seconds) and refuses on timeout through
the existing failure path. Unguarded local callers keep the ordinary unbounded
wait, so local behavior is unchanged.

The bounded primitive's header no longer claims presentation-only scope, since
this is a second authorized caller; nothing else in the shared lock
infrastructure changed.

The regression holds the metadata lock with a genuinely live process while
leaving the state directory writable, so the refusal can only come from the
bound and never from the writability precondition. Against the unbounded wait it
does not terminate at all; with the bound it refuses, retains the registration,
writes no receipt, and leaves the remote link untouched.

* no-mistakes(review): Harden lock-timeout regression with independent deadline

* no-mistakes(review): Restore no-op guarded clears on read-only state

* no-mistakes(document): Clarify remote public-followup cleanup contract
)

* fix(bin): resolve process-event state roots before validating them

The process-event module validated the caller's spelling of a home's state
root instead of the directory it operates on: it required the supplied path
to equal its own lexical normalization, which rejects any path reached
through a symlinked ancestor. On macOS both /tmp and $TMPDIR are symlinks,
so an operator home under either could never claim a source. Reconcile still
reported the runner started, while the detached runner died writing "cannot
claim source" to the discarded stderr, and the source silently never fired.

Resolve the state root to its physical directory once, then apply the
existing private-directory validation to that resolved directory and derive
every path, recorded claim identity, and later confinement check from it.
This keeps the confinement contract for the directory actually operated on
rather than only for callers that already spelled it physically, and removes
the window where an ancestor symlink could be repointed between check and
use. Homes already spelled physically behave identically.

This was the single cause of both deterministic macOS failures in
tests/fm-procevent.test.sh ("reconcile never claimed the registered source")
and tests/fm-procevent-when.test.sh ("the winning concurrent arm did not
produce an outcome"). The new case pins the behavior with an explicit
symlinked-ancestor home, so it fails without the fix on any platform rather
than only where the temp root happens to be a symlink.

* fix(bin): pin the external capture staging boundary to its physical path

The extension capture path pinned its registry staging boundary by comparing
`pwd -P` against the caller-spelled registry directory, so a home reached
through a symlinked ancestor still refused to start an extension-backed
source after the state root itself resolved correctly. That left such a home
half working: built-in sources ran while external ones failed.

The staging preparer now prints the physical registry directory it validated,
matching the inbox and reservation preparers beside it, and the start path
pins on that returned path. The new end-to-end case drives the shipped
file-signal package from a symlinked home spelling.

* no-mistakes(review): Propagate canonical process-event state roots

* no-mistakes(review): Propagate canonical state to process-event adapters

* no-mistakes(document): Document physical process-event state roots
…kunchenguid#3312)

* fix(pi): persist captain outcomes visibly

* no-mistakes(review): Recover captain outcomes after cold-start lock acquisition

* no-mistakes(document): Document cold-start captain-outcome recovery

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes(review): Prove immediate Pi captain-outcome transcript delivery

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* fix(pi): process captain outcomes through a sequence-keyed turn

PR kunchenguid#3312 made every captain-facing supervision outcome a durable, exact-once
visible transcript entry with the read cursor advancing only after that entry
exists. That is the display half of the delivery contract. Left alone it turns
a probabilistic silent loss into a deterministic one: the captain sees an
anchor line, and firstmate never acts, because nothing opens a turn and
nothing records whether main ever processed the outcome.

The 2026-08-31 timeline showed the two shapes this must survive on the
previous hidden-turn path: seven delivered decision outcomes each answered by
an empty assistant message (cursor advanced, no retry, unanswered for close
to three hours), and two answered by an unrelated prior reply. Both happened
because delivery advanced the cursor at enqueue and accepted whatever the
next assistant message was.

Add the processing half on top of the persistence half:

- bin/fm-branch-outcome.sh keeps a processed marker separate from the read
  cursor (`unprocessed`, `mark-processed --through`, `processed-init`). It
  only advances through an explicit sequence-bound acknowledgement, never
  past the read cursor and never backwards; an absent marker reads as zero
  and `processed-init` migrates delivered history once so an upgraded home
  is not re-presented its past.
- After the visible entry for a captain outcome exists, the extension hands
  every still-unprocessed captain row to main as one hidden, typed
  `fm-branch-process` request listing each `[seq N] task: summary`, opening
  exactly one main turn. Main closes it only by calling the new
  `fm_branch_processed` tool with the highest sequence listed. An unrelated,
  empty, or paraphrased answer leaves the sequence open, and the same request
  is presented again at the end of the next main run and at session start.
  The first two presentations of a sequence set open a turn of their own;
  after that the request rides the captain's next prompt so an ignored
  request cannot loop, and a session replacement resets that budget.
  Routine outcomes stay turn-free.
- The regressions cover exactly those incident shapes against the real store
  scripts: an empty answer and an unrelated prior answer neither advance the
  marker nor stop re-presentation, the acknowledgement is refused beyond the
  read cursor and outside lock ownership, a partial acknowledgement keeps the
  newer sequence open, and kunchenguid#3312's own assertions now forbid an unkeyed turn
  rather than any turn. The store suite pins the marker's bounds and the
  migration; the real-SDK guard for appendEntry persistence and model
  exclusion is unchanged.

Docs move the protocol from "no model turn" to "one sequence-keyed processing
turn closed only by its acknowledgement", and the verification record carries
the dated run against Pi 0.84.4.

* no-mistakes(review): Harden outcome listing and sequence-bound acknowledgements

* no-mistakes(review): Harden outcome state validation and request pacing

* no-mistakes(review): Reject unsafe sidecars and unterminated outcome stores

* no-mistakes(review): Validate canonical mark-read cursor state

* no-mistakes(review): Guard cursor advancement against corrupt processed state

* no-mistakes(review): Bind acknowledgements to active processing requests

* no-mistakes(review): Reset pacing when processing sequence membership changes

* no-mistakes(review): Enforce silent outcome invariants at storage boundary

* no-mistakes(document): Document hardened captain outcome processing contracts

---------

Co-authored-by: kunchenguid <kun@kunchenguid.com>
sdivanl and others added 20 commits September 21, 2026 19:30
…nchenguid#5174)

* fix: preserve Pi watcher ownership across session replacement

* no-mistakes(document): Scope Pi predecessor retention away from omp

* no-mistakes(ci): Diagnosed all three failing checks; only one was code-caused. (ci-3, genuine) Stock macOS Bash snapshot compatibility: `tests/fm-pi-watch-extension.test.sh` failed the macOS Bash 3.2 `bash -n` parse sweep with `line 4265: unexpected EOF while looking for matching '`. I built GNU Bash 3.2.0 from source locally and reproduced it. Root cause: the PR added a comment containing an apostrophe (`// Replacement shutdown deliberately retains module 2's established arm until`) inside a quoted here-document (`<<'EOF'`) nested inside a `$(...)` command substitution. Bash 3.2 has a parser bug (fixed in later bash) where an unmatched single quote inside such a here-doc body is treated as opening a shell quote and never closed, aborting the whole file parse. The base commit parses cleanly under Bash 3.2, confirming this PR introduced the break. Minimal fix: reworded the comment to remove the apostrophe (`... retains the established module-2 arm until`), preserving meaning. Verified `bin/fm-lint.sh --list-files` (the 6 changed shell files) now all pass `/tmp/bash-3.2/bash -n`; Bash 5 also parses. (ci-1, infrastructure) Behavior portable serial 8: GitHub API shows the `Run portable serial shard 8` step conclusion=success; only `Upload portable serial shard 8 timing artifact` failed with `Failed to FinalizeArtifact ... (403) Forbidden`. This is a transient artifact-service/cancellation failure, not a test or code failure. No change. (ci-2, infrastructure) Lint 1: fetched the job log via the GitHub API; it ends with `##[error]The runner has received a shutdown signal...` then exit 143. The step was cancelled mid-run, not a ShellCheck finding. Independently ran `bin/fm-lint.sh --partition 1of2 --telemetry ...` locally with pinned ShellCheck 0.11.0 and actionlint 1.7.12: exited rc=0 (no findings). No change. The only code change is the apostrophe removal in tests/fm-pi-watch-extension.test.sh; no other files modified
…d#5236)

* fix(bin): retire windowless leftovers and stop claiming a Pi daemon teardown

Catch-up correctly refuses while a leftover task record has no status file.
Cleanup used to deadlock on those same records when they also had no spawn_gen and no window, so they lingered and wedged every later away-mode return. Teardown now treats a windowless leftover as a missing-endpoint legacy record, and stop reports that no daemon terminal was running when none was launched.

Co-authored-by: Cursor <cursoragent@cursor.com>

* no-mistakes(review): Narrow windowless teardown exception to tmux legacy leftovers

* no-mistakes(review): Validate windowless leftover identity via shared endpoint validator

* no-mistakes(review): Refuse windowless leftovers carrying other backends' endpoint identity

* no-mistakes(document): Clarify windowless teardown retry documentation

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…rted (kunchenguid#5250)

* fix: surface parked launch prompts as not started

* no-mistakes(document): docs: record launch-prompt busy backstop classification

* no-mistakes(document): docs: align tail40 and rendered-text comments with launch-prompt backstop
* feat(afk): make /afk itself the go with a same-turn record write

Collapse the propose-then-confirm away entry into one 'enter' step that
writes state/.afk-contract immediately and prints the announcement and
read-back after the record exists, never asking for a go. The retired
propose, confirm, and --proposal inputs are refused by name, and a stale
proposal left by an older version is removed rather than promoted.
Refresh and replace semantics, verbatim words, the single writer, the
never-set, and per-harness launch behavior are unchanged.

* no-mistakes(document): Refresh away-entry documentation evidence
…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
PR 30 merged upstream a56a78a but was squash-merged onto main, so main
carries that content while git sees no shared history past 52d20f1.
This merge records a56a78a as a parent and resolves every conflict to
main's side; the resulting tree is identical to main's.
Takes the 220 upstream commits a56a78a..706254d on top of the fork's
restored ancestry (21714ff), resolving 33 conflicted paths and keeping
both intents. Fork divergence is re-applied on upstream's structure;
where upstream replaced a mechanism the fork had extended, upstream's
mechanism is kept:

- bin/fm-send.sh: upstream's reserved-key close through the owning
  library's vocabulary replaces the fork's blanket --resolve-key refusal
  for pending-reply-* keys (both fixed the same silent no-op); the fork's
  --no-reply-expected flag is kept, and the now-unused
  fm_decision_key_reserved_prefix helper is dropped.
- bin/fm-fleet-snapshot.sh: upstream's argv-limit fix (kunchenguid#3677) replaces
  the fork's staging-directory version; the fork's regression test stays.
- tests/fm-config-reread-no-decision.test.sh: its tmux stub now lists
  the mates' windows, because upstream stopped ringing doorbells into
  panes it reads as exited (c499f84).
- AGENTS.md: upstream's new rules folded into the fork's slimmed
  startup load and house rules.
Three places where a fork-only mechanism met a new upstream test or gate
after the merge, each adapted so both intents hold:

- tests/fm-test-run.test.sh: upstream's new fixtures (task-marker
  primary-checkout refusal, cross-family phases, unmapped-test family)
  copied the runner alone; the fork's runner refuses to run without its
  containment libraries, so they now use the existing install_runner
  helper, as the fork's own fixtures already do.
- tests/fm-pr-merge.test.sh: upstream's gh-axi fallback test pinned the
  two-read refusal wording; it now names the fork's REST read as the
  fork's sibling test already does.
- tests/fm-pr-merge.test.sh: upstream's live-head gate (kunchenguid#4199) reads the
  pull request before merging, so the fork's GraphQL-down mock now lets
  that read succeed and rate-limits only the post-merge outcome read the
  REST fallback stands behind; the REST enqueue case passes
  --attended-override, which upstream now requires for --auto.
- tests/fm-test-fixtures.test.sh: upstream's runner Git-isolation
  fixture copied the runner without the fork's containment libraries and
  handed the suite its global-config path as FM_TEST_GIT_CONFIG, which
  the fork's boundary clears with every other FM_* variable. The fixture
  now copies the libraries and passes the path through a file beside the
  suite, leaving the boundary unwidened.
- tests/fm-slack-mirror-live-e2e.test.sh: upstream's live-gate contract
  requires every live guard to open with tests/lib.sh's fm_live_gate; the
  fork's Slack-mirror guard now does, staying opt-in because it submits a
  real prompt.
Fork-only suites written before this merge built fixtures that upstream's
new contracts now reject; each fixture moves to the upstream shape
without changing what it asserts:

- fm-spawn-git-identity, fm-spawn-issue-board, fm-worktree-claim: spawn
  now requires filled Captain's intent and Firstmate spec subsections
  (upstream kunchenguid#3597), so their briefs come from fixtures.sh's
  fm_test_spawn_brief.
- fm-merge-local: the local merge now checks the captain-hold record,
  which needs the home's data/ directory; the fixture home has one.
- fm-spawn-dispatch-profile: upstream's new native-Ultra batch case
  spawns two tasks, which the fork's worktree double-allocation guard
  refuses on one slot; it gets the second worktree the fork's sibling
  batch case already uses.
- fm-test-sandbox: the runner now sources tests/git-config-helpers.sh
  per suite, so the sandbox's fixture checkout carries it.
@digbycampbell

Copy link
Copy Markdown
Owner Author

Supplement to the pipeline-generated body: the per-file conflict resolutions, findings, and lessons this sync's brief requires, as headed sections.

Land with a merge commit; do not squash or rebase.

Merge shape

  • 21714ff1 parents 3f7fbb0b (main) and a56a78ac: ancestry restore, tree identical to main.
  • 2e369db5 parents 21714ff1 and 706254de (upstream tip at intake): 220 upstream commits, 33 conflicted paths.

Conflicted paths and resolutions

  • .agents/skills/afk/SKILL.md: upstream's away-posture trigger, fork's one-sentence description.
  • .agents/skills/bearings/SKILL.md: fork's /bearings-modes description plus upstream's contributions trigger.
  • .agents/skills/bootstrap-diagnostics/SKILL.md: fork's standalone-run trigger plus upstream's PRESENTATION_UNAVAILABLE.
  • .agents/skills/harness-adapters/SKILL.md: fork's one-line description with upstream's harness list (gemini, rovo, omp, agy).
  • .agents/skills/process-event-sources/SKILL.md: one-line description with upstream's stranded/failed-to-start triggers; fork's Slack, quota-topic, GitHub-assigned sections kept.
  • .agents/skills/stuck-crewmate-recovery/SKILL.md: upstream's dead-pipeline trigger, fork's trimmed description.
  • .agents/skills/updatefirstmate/SKILL.md: fork's two-line description.
  • .github/workflows/ci.yml: fleet-snapshot view count 19 (upstream 18 plus the fork's argv-limit test; verified 19 ok).
  • AGENTS.md: upstream's structure and new rules folded into the fork's slimmed text; all 17 hunks resolved keeping both (captain address chat-only + bad-news clause; .claude/mods and new config/state names in the compact layout block; inactive-outcome scan and STATUS OUTCOME BACKSTOP in the compact session start; essential-tools/presentation rule keeping the fork's "all" wording; fm-dispatch-resolve rule; mid-task captain-intent rule; resolved-state validation rule; non-draft ready signal and URL provenance; fm-check-unregister rule; crew-hosted Lavish board; final-response rule in section 9; fm-captain-hold wrapper in section 10; three new section 13 triggers). The fork's removed "Stuck-worker trigger" subsection stays removed; section 13 carries upstream's extended trigger.
  • bin/fm-bearings-snapshot.sh: fork's stdin slurp of snapshot and candidate_prs on upstream's projection.
  • bin/fm-brief.sh: fork's --issue and BRANCH_NAME on upstream's [at=] stamps and fm_ship_rule_one.
  • bin/fm-dod-lib.sh: fork's branch-name parameter and verification clause; fm_ship_rule_one takes the branch.
  • bin/fm-lint.sh: fork's slack-mirror roots in upstream's partitioned lint.
  • bin/fm-pr-check.sh: fork's board move after upstream's parent-channel ready line.
  • bin/fm-pr-merge.sh: fork's REST outcome fallback on upstream's live-head gates.
  • bin/fm-send.sh: upstream's reserved-key close plus fork's --no-reply-expected (fork's blanket refusal dropped, see above).
  • bin/fm-spawn.sh: fork's --issue, worktree-claim guard, git identity, and board move on upstream's reformatted parser and new isolation predicate.
  • bin/fm-teardown.sh: fork's worktree-claim refusal and git-identity disarm in upstream's teardown.
  • bin/fm-test-run.sh: fork's containment boundary and captured output with upstream's per-suite git-config isolation; fork family entries kept.
  • docs/architecture.md, docs/documentation-audiences.json, docs/scripts.md: both sides' entries.
  • tests/fm-backend-herdr-presentation-e2e.test.sh: upstream's recovery project and looping sleeper; fork's post-legacy move onto it.
  • tests/fm-bearings-snapshot.test.sh: upstream's toolbin superset.
  • tests/fm-brief.test.sh: fork's tests with upstream's stamp.
  • tests/fm-fleet-snapshot-view.test.sh: both sides' tests.
  • tests/fm-gotmp.test.sh: fork's claim-lib and git-identity symlinks in upstream's fake root.
  • tests/fm-lint.test.sh: fork's slack-mirror inventory, upstream's header.
  • tests/fm-procevent.test.sh: fork's FM_HOME scoping on upstream's Lavish fixture.
  • tests/fm-send-resolve-key.test.sh: upstream's reserved-key tests; fork's refusal test dropped, lookalike-key control kept.
  • tests/fm-tangle-guard.test.sh: fork's permanent-clone wording with upstream's stamp.
  • tests/fm-test-run.test.sh: fork's install_runner with upstream's fixtures.
  • tests/fm-watch-arm.test.sh: same fix on both sides; upstream's form.
  • Auto-merged but adjusted: tests/fm-control-relaunch.test.sh (promoted no-mistakes rule names the branch), tests/fm-config-reread-no-decision.test.sh, bin/fm-classify-lib.sh.

Review-round fixes (fresh-context review of the fork divergence on top of upstream)

  • 33799e27: the re-applied fork git-identity disarm in bin/fm-teardown.sh ran on a pool slot reassigned to another task, stripping that task's identity and commit guard; it now passes the worktree only when teardown_owns_worktree, with a regression assertion in tests/fm-teardown-endpoint-safety.test.sh proven red against the old behavior. Also a stale comment in tests/fm-config-reread-no-decision.test.sh.
  • e80efb33: removed a duplicate run-start assignment in bin/fm-test-run.sh left from an earlier sync.
  • 296147b3: corrected the matching fixture comment in tests/fm-gotmp.test.sh.

Findings not fixed (each re-confirmed on pristine upstream 706254d unless noted; none is a regression from this merge)

  • Host tool floors: tasks-axi 0.2.5 / quota-axi 0.1.48 / lavish-axi 0.1.75 installed, below upstream's new floors (see prerequisites). With the installed tasks-axi, fm-captain-hold-lifecycle and fm-pr-merge fail identically on upstream; both pass with the floor versions.
  • Host tooling gaps: tests/fm-ci-workflow.test.sh and tests/fm-x-mode.test.sh need ruby; tests/fm-cursor-primary.test.sh needs a C compiler.
  • WSL reparenting: orphans are adopted by a subreaper (pid 935), not init, so tests/fm-procevent.test.sh ("listener was not reparented"), tests/fm-remote-job-orphan-reap.test.sh, tests/fm-session-lock-ancestry.test.sh, and the fm-test-run.test.sh proven-family case that runs session-lock-ancestry fail on upstream the same way.
  • Host global git ignore leaks into fixtures: tests/git-config-helpers.sh neutralises global/system config but git still reads the default ~/.config/git/ignore, whose .fm-* pattern hides the marker tests/fm-secondmate-sync.test.sh expects to see (upstream isolation gap; fails identically on upstream).
  • Harness-version drift on this host: tests/fm-composer-codex-idle-live-e2e.test.sh (codex-cli 0.155.1), tests/fm-harness-liveness-drift-live-e2e.test.sh (kimi 2.0.2), tests/fm-control-herdr-smoke.test.sh and tests/fm-backend-herdr.test.sh (herdr 0.8.0 process-info reads 'shell'); tests/fm-backend-tmux-smoke.test.sh ("task shell did not become ready", also fails on pre-merge main); tests/fm-on.test.sh ("composed child PATH did not match the portable contract").
  • tests/fm-pr-check-security.test.sh: "merge-outcome-committed ... requires jq on PATH" (upstream's fixture PATH lacks jq; previously listed by PR 30 with a different message).
  • Pre-existing fork gaps surfaced, not introduced here: bin/fm-test-run.sh --changed has no mapping for bin/slack-mirror/** and refuses with "no changed-test mapping"; the fork's containment boundary clears FM_LIVE and per-guard FM_*_LIVE_E2E switches, so forcing a live guard on through the runner silently skips it (CI passes none, so CI coverage is unaffected).

Lessons

  • A fork mechanism that is "deliberately" strict (the test runner refusing to run without its containment libraries, and clearing every FM_* variable) turns every new upstream test fixture that copies the runner or passes an FM_* variable into a merge conflict that git cannot see; nine post-merge fixture fixes in this sync were that one class.
  • WSL crashed mid-resolution in the previous attempt; commit a merge as soon as the tree is resolved and fix forward, so an interruption loses at most the verification.

digio crew added 2 commits September 23, 2026 18:19
…failure — all 16 real-Herdr suites reported ok/exit=0 with failed=0. It was a step-level timeout: `.github/workflows/ci.yml` step "Run real-Herdr family (serial, required)" had `timeout-minutes: 20`, but the merge's upstream real-Herdr e2e suites (fm-afk-inject-herdr-e2e, fm-backend-herdr-launcher-workspace-e2e, fm-afk-launch, etc.) pushed legitimate total runtime to ~20m6s (duration_ms=1206625), just over the cap, so the suite finished successfully but the step was killed moments later. Fixed by raising that step's timeout-minutes from 20 to 30 (job-level backstop stays 75) and updating its stale "7-10 minute wall" comment to match. Verified the workflow YAML still parses. No product code or tests changed
@digbycampbell digbycampbell changed the title chore: merge upstream kunchenguid/firstmate (706254de) into fork via true merge chore: merge upstream kunchenguid/firstmate 706254de as a true merge Sep 23, 2026
@digbycampbell

Copy link
Copy Markdown
Owner Author

Addendum: CI-round finding and its fix.

Herdr presentation-lock regression (found by CI, fixed in 39bac991)

  • The first CI run's real-Herdr job overran its 20-minute hang tripwire. The pipeline's first repair (a8eb3487) raised the tripwire to 30 minutes; 39bac991 reverts that, because the overrun was a real regression, not legitimate growth.
  • Evidence: upstream CI run 35836717173 runs tests/fm-backend-herdr-presentation-e2e.test.sh in 448s (family 652s); this branch took 1010s (family 1206s), with every other Herdr suite matching upstream.
  • Cause: the fork's PR 30 change made every presentation-order lock acquisition wait up to 300s for a live holder, but only the recovery/resume path (no flat-layout fallback) needed that. Fresh projection and abort cleanup fall back safely, and upstream's contract there is bounded contention then fallback; the two bounded-contention fixtures, and any real spawn behind a held lock, stalled the full 300s.
  • Fix: the lock wait takes an optional cap; resume keeps FM_HERDR_PRESENTATION_LOCK_WAIT_SECS (300), the fallback paths use FM_HERDR_PRESENTATION_FALLBACK_WAIT_SECS (15, wall clock), documented in docs/configuration.md, with a regression in tests/fm-backend-herdr.test.sh.
  • End-to-end result on head 39bac991 (CI run 35843603604, real Herdr): presentation e2e 476s, family 684s, all 16 Herdr suites green, all 20 checks green.

…ly kind

quota-axi 0.1.49+ emits grok's credits window as {id:credits,label:week,kind:weekly},
so the kind==credits filter always missed and the Slack quota topic rendered Grok as n/a.
The GROK_OK fixture now carries the live shape; it fails on the old selector.
@digbycampbell digbycampbell changed the title chore: merge upstream kunchenguid/firstmate 706254de as a true merge fix: sync upstream kunchenguid/firstmate 706254de as a true merge Sep 23, 2026
@digbycampbell
digbycampbell merged commit 1a92002 into main Sep 23, 2026
20 checks passed
@digbycampbell
digbycampbell deleted the fm/fm-upstream-sync-r2 branch October 4, 2026 09:53
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.