Skip to content

fix(afk): force-deliver wedged escalations past max-defer - #160

Closed
rfbr wants to merge 1 commit into
kunchenguid:mainfrom
rfbr:fm/fix-afk-wedge-v3
Closed

rfbr wants to merge 1 commit into
kunchenguid:mainfrom
rfbr:fm/fix-afk-wedge-v3

Conversation

@rfbr

@rfbr rfbr commented Jun 30, 2026 •

Copy link
Copy Markdown

Intent

Fix a firstmate away-mode (afk) supervision bug where a buffered escalation could never be delivered to the supervisor pane, which left a stalled crewmate un-recovered for ~8h overnight (state/.subsuper-inject-wedged read 'WEDGED: 29325s undelivered'). Root cause: the sub-supervisor daemon's max-defer escape (housekeeping block 1b in bin/fm-supervise-daemon.sh) only RE-TRIED the same composer-guarded escalate_flush; once a prior injection's Enter was swallowed, the daemon's own marker-prefixed digest sat unsubmitted in the supervisor composer, and pane_input_pending then read that as 'pending input' on every tick, so the composer guard deferred delivery forever. The wedge alarm is invisible in afk because nobody is watching firstmate's pane. Fix: past FM_MAX_DEFER_SECS, on a pane that is NOT genuinely busy, the daemon now FORCE-delivers: it clears the stale self-injected composer text and submits the digest. Deliberate decisions/tradeoffs the reviewer should NOT flag as mistakes: (1) a genuinely busy mid-turn pane STILL defers even under force because an active agent turn must never be clobbered, and it raises the visible wedge alarm; (2) the force path is afk-only -- block 1b is afk-gated -- so when afk is OFF a human's half-typed line is never cleared, fully preserving the captain-return-race human-safety guard; (3) clear-before-type also prevents two sentinel-prefixed digests from concatenating into one corrupted turn, fixing the self-poison at its source; (4) fm_tmux_clear_composer intentionally fails OPEN (treats an unreadable pane as cleared) because the whole point of the force path is to stop deferring. Implementation: new fm_tmux_clear_composer primitive in bin/fm-tmux-lib.sh (sends Ctrl-A/K/U, verifies empty); a force flag threaded through escalate_flush -> inject_msg, set only by block 1b. Tests: new tests/fm-afk-wedge.test.sh (force-delivers stale self-injection, busy pane still defers, afk-off never clobbers a human line, clear primitive); the prior 'max-defer on a pending composer alarms without typing' daemon test was intentionally RETARGETED to a genuinely-busy pane (the case that still defers under the new contract) and the fake tmux taught to honor clearing keys; afk SKILL.md and the CONTRIBUTING test index updated. The change is deliberately tight and scoped to the wedge fix with no broader refactor of safety-critical supervision code.

What Changed

  • Past FM_MAX_DEFER_SECS, the sub-supervisor daemon's max-defer escape (housekeeping block 1b in bin/fm-supervise-daemon.sh) now force-delivers on a pane that is not genuinely busy: it clears any stale, self-injected marker-prefixed digest left in the supervisor composer and submits the escalation, instead of re-trying the same composer-guarded flush that could defer forever once a prior injection's Enter was swallowed. A genuinely busy mid-turn pane still defers and raises the visible wedge alarm; the force path is afk-gated, so an afk-off human's half-typed line is never cleared.
  • Added the fm_tmux_clear_composer primitive to bin/fm-tmux-lib.sh (sends Ctrl-A/K/U with a settle delay, verifies empty, fails open on an unreadable pane, and returns 1 only when readable text stubbornly remains so the caller can decline), and threaded a force flag through escalate_flush → inject_msg set only by block 1b. When residual text won't clear the force path defers and alarms rather than concatenating a new digest.
  • Added tests/fm-afk-wedge.test.sh covering force-delivery of a stale self-injection, busy-pane defer, afk-off human-line safety, the unclearable-composer decline, and the clear primitive; retargeted the daemon max-defer test to the still-deferring busy-pane case and taught the fake tmux to honor clearing keys; updated the afk SKILL.md, CONTRIBUTING.md test index, and architecture/configuration/scripts docs.

Risk Assessment

✅ Low: Tightly scoped afk wedge fix with correct force-flag threading, preserved busy-pane and afk-off safety guards, a settle-corrected clear primitive, and thorough regression tests; all findings from two prior review rounds are resolved.

Testing

Baseline test command had already passed; I re-ran the full e2e suite (all 26 test files pass; the two slow lock/watcher files were run individually under timeout after the aggregate 2-min cap), then ran the two change-relevant suites with full output (fm-afk-wedge 5/5, fm-daemon 41/41 including the intentionally retargeted busy-pane test). To show the fix at the level the captain actually experiences it, I reproduced the original overnight-wedge incident against the real daemon functions with the repo's fake-tmux harness: a marker-prefixed digest left in the poisoned composer, an escalation buffered 29325s. The transcript shows the pre-fix non-force flush deferring forever (nothing reaches firstmate) versus the new afk force-deliver clearing the stale text and submitting the digest exactly once, buffer cleared, no residual wedge alarm — the intended end-to-end recovery. This is a CLI/daemon behavior change with no rendered UI surface, so evidence is a CLI transcript rather than a screenshot.

Evidence: Incident reproduction transcript: old wedge (defers forever) vs new force-deliver (recovers)

INCIDENT: composer poisoned by swallowed-Enter injection; escalation undelivered 29325 s OLD non-force flush -> DEFERRED (returned non-zero); delivered to pane: <NOTHING> (stranded forever); buffer still holds: needs-decision: pick A NEW housekeeping force-deliver -> delivered digest to pane; submitted (Enter) 1 time; digest typed 1 time (no concatenation); buffer now <empty — cleared>; wedge alarm marker absent — clean recovery

############################################################
# INCIDENT: supervisor composer poisoned by a swallowed-Enter injection.
#   composer line (pending input, marker shown as <US>):
############################################################
  composer  : │ > <US>Supervisor escalate (1 event(s)): needs-decision: pick A │
  buffered  : needs-decision: pick A  (undelivered 29325 s)

>>> OLD max-defer escape (non-force flush, the code before this fix):
    escalate_flush -> DEFERRED (returned non-zero)
    delivered to pane: <NOTHING>  <-- escalation stranded; this repeats every tick FOREVER (the ~8h wedge)
    buffer still holds: needs-decision: pick A

############################################################
>>> NEW max-defer escape (this change: housekeeping block 1b, afk force-deliver):
    delivered to pane: <US>Supervisor escalate (1 event(s)): needs-decision: pick A (pre-read; re-arm not needed — watcher daemon-managed)
    submitted (Enter) : 1 time(s)
    digest typed      : 1 time(s)  (exactly once — no concatenation)
    buffer now        : <empty — cleared>
    wedge alarm marker: absent — clean recovery

RESULT: the escalation that was stranded ~8h is now force-delivered to firstmate on the first max-defer tick.
Evidence: Reproduction harness (uses real daemon code + repo fake-tmux)
#!/usr/bin/env bash
# Faithful reproduction of the afk overnight-wedge incident and its fix.
# Uses the repo's own hermetic test harness (fake tmux) so it exercises the
# REAL daemon code paths — no live firstmate touched.
set -u
ROOT_REPO="$1"
cd "$ROOT_REPO"
. tests/wake-helpers.sh
export FM_TEST_DAEMON_SOURCED=1
. bin/fm-supervise-daemon.sh
TMP_ROOT=$(fm_test_tmproot fm-wedge-evidence)

MARK=$'\x1f'
setup() {
  dir=$(make_bordered_case "$1"); state="$dir/state"; fakebin="$dir/fakebin"
  sent="$dir/sent.log"; : > "$sent"
  # A prior injection's Enter was swallowed: the daemon's OWN marker-prefixed
  # digest sits unsubmitted in the supervisor composer (this is the poison).
  printf '│ > %sSupervisor escalate (1 event(s)): needs-decision: pick A │' "$MARK" > "$dir/composer"
  escalate_add "$state" "needs-decision: pick A"      # a NEW escalation is buffered
  echo $(( $(date +%s) - 29325 )) > "$state/.subsuper-escalations.since"  # buffered ~8.15h (the real incident age)
  afk_enter "$state"
}

echo "############################################################"
echo "# INCIDENT: supervisor composer poisoned by a swallowed-Enter injection."
echo "#   composer line (pending input, marker shown as <US>):"
echo "############################################################"

# ---- OLD behavior: max-defer only RE-TRIED the same non-force guarded flush ----
setup old-path
printf '  composer  : '; sed "s/$MARK/<US>/g" "$dir/composer"; echo
echo "  buffered  : $(cat "$state/.subsuper-escalations")  (undelivered $(( ($(date +%s) - $(cat "$state/.subsuper-escalations.since")) )) s)"
echo
echo ">>> OLD max-defer escape (non-force flush, the code before this fix):"
if PATH="$fakebin:$PATH" FM_FAKE_COMPOSER="$dir/composer" FM_FAKE_SENT="$sent" \
   FM_INJECT_CONFIRM_SLEEP=0.05 escalate_flush "$state"; then
  echo "    escalate_flush -> SUCCESS (delivered)"
else
  echo "    escalate_flush -> DEFERRED (returned non-zero)"
fi
if [ -s "$sent" ]; then echo "    delivered to pane: $(sed "s/$MARK/<US>/g" "$sent")"
else echo "    delivered to pane: <NOTHING>  <-- escalation stranded; this repeats every tick FOREVER (the ~8h wedge)"; fi
echo "    buffer still holds: $(cat "$state/.subsuper-escalations")"
echo

# ---- NEW behavior: afk-gated force-deliver via the actual housekeeping block 1b ----
setup new-path
echo "############################################################"
echo ">>> NEW max-defer escape (this change: housekeeping block 1b, afk force-deliver):"
PATH="$fakebin:$PATH" FM_FAKE_COMPOSER="$dir/composer" FM_FAKE_SENT="$sent" \
  FM_ESCALATE_BATCH_SECS=99999 FM_MAX_DEFER_SECS=60 FM_INJECT_CONFIRM_SLEEP=0.05 \
  housekeeping "$state"
if [ -s "$sent" ]; then
  echo "    delivered to pane: $(sed "s/$MARK/<US>/g" "$sent" | grep escalate)"
  echo "    submitted (Enter) : $(grep -c '\[ENTER\]' "$sent") time(s)"
  echo "    digest typed      : $(grep -c 'Supervisor escalate' "$sent") time(s)  (exactly once — no concatenation)"
else
  echo "    delivered to pane: <NOTHING>  <-- FAIL"
fi
echo "    buffer now        : $( [ -s "$state/.subsuper-escalations" ] && cat "$state/.subsuper-escalations" || echo '<empty — cleared>')"
echo "    wedge alarm marker: $( [ -e "$state/.subsuper-inject-wedged" ] && echo 'present (FAIL)' || echo 'absent — clean recovery')"
echo
echo "RESULT: the escalation that was stranded ~8h is now force-delivered to firstmate on the first max-defer tick."

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed (2) ✅
  • ℹ️ bin/fm-supervise-daemon.sh:644 - The force path proceeds to type the digest even when fm_tmux_clear_composer returns 1 (real text stubbornly remains after 3 rounds): clear_composer &#34;$target&#34; || log ... only logs and falls through to fm_tmux_submit_core. This concatenates the new marked digest after the un-cleared text. If that residual text is NOT the daemon's own marker-prefixed digest, the submitted message won't start with FM_INJECT_MARK, so firstmate's afk-exit contract reads it as an unmarked (captain-return) message and could exit afk prematurely. In afk the residual text is normally the daemon's own marked digest, so the corrupted line still begins with the marker and stays recognized — making this low-probability — but the fail-open-on-confirmed-remaining-text behavior is worth a deliberate guard or an explicit note.
  • ℹ️ bin/fm-tmux-lib.sh:172 - fm_tmux_clear_composer's contract comment states it 'Returns 1 only when real text stubbornly remains, so the caller can still decline to type over confirmed content.' The only caller (inject_msg force path) does not decline — it logs and types anyway. The documented purpose of the return-1 value is never honored, making the comment misleading for future maintainers.
  • ℹ️ bin/fm-supervise-daemon.sh:487 - The housekeeping function-summary comment for block (1b) still reads 'attempt one normal delivery; if it cannot confirm, raise the wedge alarm' — the pre-fix behavior. The detailed block-1b comment just below was updated to describe force-delivery, but this summary was not, so the two now contradict each other.

🔧 Fix: defer force-inject when composer residual text won't clear
2 issues (1 warning, 1 info) still open:

  • ⚠️ bin/fm-tmux-lib.sh:181 - fm_tmux_clear_composer reads the composer state immediately after sending C-a/C-k/C-u with NO settle delay, unlike every other keystroke→read path in this file: fm_tmux_submit_enter_core sleeps $sleep_s after Enter before reading (line 210) and fm_tmux_submit_core sleeps $settle after typing before reading (line 221). On a real tmux/TUI composer, send-keys is asynchronous — the harness may not have processed the clearing keystrokes by the time capture-pane runs. All three rounds can then read the pre-clear 'pending' state and the function falsely returns 1, driving the force path into the decline branch and raising a spurious wedge alarm even though the clear would have worked given a brief moment. That partially defeats the force-delivery fix in production. The fake tmux in the tests writes the composer synchronously, so this race is invisible under test. Add a short settle (e.g. reuse FM_INJECT_CONFIRM_SLEEP / a small fixed delay) between the clear keystrokes and the fm_tmux_composer_state read in each loop iteration, matching the established pattern.
  • ℹ️ .agents/skills/afk/SKILL.md:105 - After commit e51f29e added the decline path (readable composer text that won't clear also defers + alarms), SKILL.md now understates the behavior: both max-defer blocks say the escalation defers only on 'a genuinely busy pane' ('Only a genuinely busy pane (agent mid-turn) still defers'). The daemon's own block-1b comment was updated to name the second defer case ('a busy pane, or residual text that won't clear'), but SKILL.md was not, so the skill doc and the code comment now disagree. Add the unclearable-composer decline case to both SKILL.md paragraphs.

🔧 Fix: settle composer clear before re-read; document decline path
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • bash tests/fm-afk-wedge.test.sh — 5/5 pass (force-delivers stale self-injection; busy pane still defers; afk-off never clobbers human line; unclearable composer declines + alarms; clear-composer primitive)
  • bash tests/fm-daemon.test.sh — 41/41 pass incl. retargeted test_max_defer_busy_pane_alarms_without_typing
  • Full suite for t in tests/*.test.sh; do bash &#34;$t&#34;; done — all 26 files pass (2 slow lock/watcher files run individually via timeout)
  • Manual incident reproduction against real daemon code: /tmp/no-mistakes-evidence/01KWBZECVYWYTB4MMRCDQ68FBN/reproduce-wedge-incident.sh — old non-force escalate_flush DEFERS (buffer stranded); new housekeeping force path clears + delivers digest once, clears buffer, no wedge alarm
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid

kunchenguid commented Jul 10, 2026 •

Copy link
Copy Markdown
Owner

Thanks for the PR! This branch currently has a merge conflict with the base branch.

When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again.

Noted for firstmate#160 at c153b409.

@rfbr
rfbr force-pushed the fm/fix-afk-wedge-v3 branch from c153b40 to 691e36f Compare July 11, 2026 06:22
@rfbr

rfbr commented Jul 11, 2026

Copy link
Copy Markdown
Author

Thanks for having a look, should be good now !

@kunchenguid kunchenguid removed the wheelhouse:pending-contributor-action Managed by Wheelhouse label Jul 15, 2026
@kunchenguid

kunchenguid commented Jul 18, 2026 •

Copy link
Copy Markdown
Owner

Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch.

When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again.

Noted for firstmate#160 at 691e36f9.

Past FM_MAX_DEFER_SECS the away-mode daemon now force-delivers instead of
deferring forever: on a not-busy pane a 'pending' composer verdict is treated
as the daemon's own swallowed-Enter injection, cleared via the new
backend-dispatched fm_backend_clear_composer (tmux implementation in
fm-tmux-lib.sh; other backends decline safely), then the digest is submitted.
A genuinely busy pane and an 'unknown' verdict still defer even under force,
unclearable readable text declines rather than concatenating onto residue, and
the force path is afk-only so a human's half-typed line is never clobbered.

Re-expressed against the new fm-backend.sh/fm-composer-lib.sh three-valued
composer model (was a boolean pane_input_pending in the original PR).
@rfbr
rfbr force-pushed the fm/fix-afk-wedge-v3 branch from 691e36f to d0a7c3b Compare July 20, 2026 17:17
@rfbr

rfbr commented Jul 20, 2026

Copy link
Copy Markdown
Author

Done!

@kunchenguid kunchenguid removed the wheelhouse:pending-contributor-action Managed by Wheelhouse label Jul 22, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: closing this as stale. It has been waiting on a contributor update for 14+ days with no author push or comment. Reopen if you want to pick it back up.

umeranjum17 referenced this pull request in umeranjum17/juggernaut Oct 25, 2026
* fix(nm-drain): register and unregister checks with FM_STATE_OVERRIDE unset (#32)

* fix(nm-drain): install registers and unregisters checks with FM_STATE_OVERRIDE unset

fm-check-unregister.sh treats an exported empty FM_STATE_OVERRIDE as set, so install.sh failed at its
unregister step when a caller exported it empty. Run both calls with env -u FM_STATE_OVERRIDE, and add an
install case that exports it empty against stubs that fail if it reaches them.

* no-mistakes(document): Fix stale nm-drain test scope; lint clean

* feat(pipeline-quota-failover): run requested model first in quota failover chain (#29)

* feat(pipeline-quota-failover): requested model first, then the rest of the chain in order

B2: with the pipeline profile set to Muse 1.3 Contributor, a quota error now
fails over to GLM 5.3 Flash, then DeepSeek v4.1 Flash, instead of skipping
the chain models listed before the requested one.

* docs(pipeline-quota-failover): README states the requested-model-first order

* no-mistakes(document): docs: align pi-quota-failover header comment with requested-first order

* fix(host-memory): hold wrapped emulator and Gradle jobs at their memory-gate caps (#34)

* host-memory: move fm-mem-gate.sh and its test verbatim from Main's config

* host-memory: hold wrapped emulator and Gradle jobs at their caps; install step and CI test

The gate matched the emulator and Gradle caps on its first word only, so a job run as
flock L timeout 60 bash -c "emulator ..." started a third emulator on a cap of 2.
It now looks past timeout, flock, nice, ionice, env, exec, NAME=VALUE and bash/sh -c
to the real program. host-memory/install.sh installs the gate under
~/.local/share/fm-host-memory/, and the gate's integration test runs in CI.

* fleet-flow: read the gate policy from the installed host-memory gate when present

Once Main's config/fm-mem-gate.sh is a one-line shim, the capacity census found no
cap defaults in it. It now reads ~/.local/share/fm-host-memory/fm-mem-gate.sh when
installed, else config/fm-mem-gate.sh, and gate_source names the file read.

* no-mistakes(document): docs: name memory gate test in CI-gate list; lint clean

* feat(merge-on-green): auto-merge green yolo PRs through fm-pr-merge (#33)

* feat(merge-on-green): merge a yolo task's PR through fm-pr-merge once checks are green

Watcher check per home: for each state/<task>.meta with yolo=on and a recorded
pr= and pr_head=, gate on fm-crew-state.sh saying checks green / PR ready, then
run fm-checks-lint.sh (PASS required), verify the run receipt (PASS verdict,
head == pr_head, spawn_gen match), and merge through bin/fm-pr-merge.sh only -
no --auto, no direct gh merge, refusals never bypassed or retried in-cycle.
One wake line per merge or refusal; one merge attempt per task per head,
remembered under the add-on's own data dir; silent otherwise; every command
timeout-bounded. install.sh mirrors nm-drain/install.sh; e2e test drives a
fixture home with stub fm-checks-lint / fm-pr-merge / fm-crew-state.

* no-mistakes(review): Reserve merge budget against watcher bound before recording head

* no-mistakes(review): Remember gate refusals per head and reason; wake once

* no-mistakes(review): Align timing contract comments with budget-reservation behavior

* no-mistakes(review): Treat own timeout kills as retried no-attempts, not refusals

* no-mistakes(review): Remember timeout wakes per head and reason like refusals

* no-mistakes(review): Scope timeout-wake contract to evidence gates and merge

* no-mistakes(document): Add merge-on-green section to README catalog

* no-mistakes(ci): Fixed CI check 'Add-on self-checks' (github-check-run:117075290612), which failed ShellCheck SC2002 (useless cat) at three sites in merge-on-green/tests/merge-on-green.test.sh (lines 62, 109, 117 — the only `cat ... | wc -l` instances in the repo, verified by grep). Invariant violated: every add-on script must pass the ShellCheck gate at every severity, per the workflow's own stated policy. Root-cause fix, smallest diff: replaced `cat "$STUB_DIR/lint-calls" [2>/dev/null] | wc -l` with `wc -l 2>/dev/null < "$STUB_DIR/lint-calls" || echo 0` — the identical-count semantics were verified empirically before editing: absent file yields `0` silently (the `2>/dev/null` must precede `<` or the shell's redirect-error line leaks to stderr), existing file yields the unpiped line count, and the `|| echo 0` keeps the `before=$(...)` assignment safe under set -euo pipefail. Applied the same canonical form at all three sibling sites; no workflow exclusion was added, so the style check stays on as the gate requires. Re-traced the ordinary path: the full e2e suite (bash merge-on-green/tests/merge-on-green.test.sh) passes end to end, exercising the absent-file case (test a) and present-file cases (f/j/k); shellcheck -x -e SC2015 on the file is clean under ShellCheck 0.11.0 (stricter than CI's 0.9.0). No behavior outside the three test-count expressions changed

* feat(merge-on-green): skip merge=manual and "not proven" PRs; write the merged status line

maintainer request conditions before merge: a task whose meta says merge=manual is
skipped silently (the lead marks it at intake on destructive, irreversible or
security-sensitive work and on work waiting for the captain's own review), and
a PR whose ## Checks block says "not proven" is skipped silently (filing the
proof gap stays with the lead). Each merge appends the normal
'done [at=<epoch>]: merged <PR URL>' line to state/<task>.status and runs the
fleet-ledger hook, so leads relay it. e2e asserts cover both skips (no body
read / lint / merge / recorded attempt), not proven outside the Checks block,
an unreadable PR body waking once, and the merged line.

* no-mistakes(review): Align condition-(b) skip with the evidence gate's Checks-block grammar

* no-mistakes(review): Stop the not-proven block extraction at bare ## lines like the evidence gate

* no-mistakes(review): Anchor the not-proven skip to evidence lines like the evidence gate

* no-mistakes(review): Skip not-proven PRs from the evidence gate's own PASS

* docs: add FORK-EXIT.md, the fork-exit list for every commit not on Kun's main (#35)

* fix(merge-card): resolve bare Checks evidence names against the task folder before done-done checks them (#37)

On done-done 0.3.0 (no --citation-base) merge-card ran done-done in the work
copy, so every bare evidence name read as missing (ENOENT) even though the files
were in $FM_HOME/data/<task>; the old fallback only rewrote the verdict after the
check had already failed. Now merge-card resolves each relative name in the
Checks block itself and hands it to done-done check --from -, naming the PR
branch as --claim-id. Absolute names stay unchanged; a name still missing is
reported at its resolved path. The e2e stub now models done-done's existence
check and covers the PR 24 shape, an absolute name and a missing name.

* feat(route-change): one command moves dispatch, gate and lead pins together (#38)

* feat(route-change): one command moves dispatch, gate and lead pins to a route

route-change [--dry-run] <fm-home> <route> takes a route from the
pipeline-quota-failover chain (read from the wrapper the gate runs, via the
new PI_QUOTA_FAILOVER_PRINT_CHAIN), refuses a route quota-axi reads exhausted
or quota-failover holds out, backs up every file, moves crew-dispatch.json,
the no-mistakes gate keys and non-Claude lead pins together, then sends one
real request through pi and restores every backup when it fails.
E2E test with a fixture home wired into the add-on CI.

* no-mistakes(review): fix(route-change): match prefixed dead-file entries, keep gate-line comments, refuse unusable quota reading

* no-mistakes(review): ci: provision python3-yaml before the route-change e2e step

* no-mistakes(document): CI job comment now names the route-change test

* pipeline-literal-delete: deliver the literal-path delete rule to pipeline agents (#40)

* pipeline-literal-delete: give pipeline agents the literal-path delete rule at the runtime instruction surface

Pipeline agents never read the worker brief and the gate neutralizes repo
AGENTS.md/CLAUDE.md, so review/test/document/lint steps kept deleting a $VAR
set in an earlier command and losing the step to a delete-guard block.

New add-on delivers the worker rule once, where every pipeline agent in every
home already reads it: a pi extension appending the rule on before_agent_start
(gate agents run with project context files disabled but user extensions load)
and a Claude Code SessionStart hook whose additionalContext carries the rule.
One per-user install covers every FM_HOME and every step; idempotent, .bak
backups, dry-run, no no-mistakes config touched.

Also names the literal-path fix in the delete-guard block message itself, so
any blocked agent (pipeline or not) sees rm -rf -- /tmp/tmp.Ab12 and the
same-command mktemp form instead of retrying.

* test: silence intentional SC2016 (literal $VAR/$(...) text is the subject)

* feat(quota-failover): move limit-stopped pool workers to the next account behind account-pool-autorelaunch (#41)

* feat(quota-failover): move limit-stopped pool workers to the next account behind account-pool-autorelaunch

A worker on a pool account (account= in its meta, usable config/account-pool)
that stops on a limit now moves through bin/fm-control.sh relaunch --account
next while config/account-pool-autorelaunch exists and its tool is in the D1
set fixed in code (Claude Code, Cursor, Pi subscription logins); when that
fails the existing route move runs. Otherwise (file absent, OpenCode Go, Codex
or an OpenAI login) the account only rests once and one wake line names it and
the manual command; check.sh prints that line as the watcher's wake. An
account limit no longer takes the route out of dispatch. Codex stays rest +
wake: OpenAI's consumer terms (effective 1 Jan 2026) bar circumventing rate
limits.

* no-mistakes(review): Key pool rest+wake dedupe on worker generation and wake on rest failure

* no-mistakes(review): Guard pool rest+wake against mid-pass worker relaunch like sibling paths

* no-mistakes(review): Let route-scoped probe evidence mark pool workers' routes out of dispatch

* no-mistakes(review): Dedupe pool rest+wake per stop identity, not label text

* no-mistakes(review): Dedupe rest-failed log+wake on stop identity

* no-mistakes(document): Fix stale pool-worker docs and probe-exception wording

* zai-quota-check: ship the GLM quota wake check with the repeat-signature fix (#43)

Main's state/zai-quota.check.sh (16 Oct) as an add-on: same thresholds, 10 min
read limit, message text and file-argument test mode. Repeat fix: the 5 h step
(fp//10) joins the signature only while the 5 h condition (fp<30, left>45)
holds, otherwise the week step alone - the old fp//10|wp//10 signature woke
about 10 times per 5 h window while the week-ahead condition stayed true all
week. ZAI_QUOTA_MARK names the repeat-state file in test mode so a fixture
sequence can prove the repeat logic. Integration test wired into addons-ci.

* fleet-stall: ship the fleet stall check with the paused-reason match on reason text only (#44)

Main's state/fleet-stall.check.sh (16 Oct) as an add-on: missed-wake guard,
fleet-pause marker, zero-busy guard, 2700 s age, live-lane filter, slot
exclusion and message unchanged. Fix: the paused word list now matches the
reason text with absolute paths, URLs, key=value tokens and [key=...] stamps
removed, so a /home/fixture/users/user-019/.treehouse/firstmate-... evidence path no longer
counts a worker waiting on its own run as waiting on the lead (17:18Z false
stall for muxr and writeboost). FM_STALL_ROOT/FM_STALL_BASE default to the
live paths for the fixture test. install.sh copies the check to
~/.local/share/fm-fleet-stall and writes the home's check as an exec shim.
Integration test wired into addons-ci.

* FORK-EXIT: add the PR 84 row (watch-triage drain-ack retry, diagnostics only) (#45)

* FORK-EXIT: add the PR 84 row (watch-triage drain-ack retry + miss diagnostics)

* FORK-EXIT: name the PR 84 merged commit (5758e520) per MainLead correct

---------

Co-authored-by: firstmate worker <worker@firstmate.local>

* feat(fleet-flow): free lane slots after long external waits and add counted/dry to pulse (#39)

* fleet-flow: move Main's config/fm-flow-check.sh in verbatim

* fleet-flow: long external waits free their lane slot; --summary adds counted and dry

A lane whose last status event is paused, blocked or failed, stamped more than
4 h ago, not waiting on the captain, and still that wait in bin/fm-crew-state.sh
stops counting toward config/lane-caps in fm-flow-check.sh: the --can-start
hard cap and the over-cap line use the counted lanes, and --summary appends
counted and dry (ready = 0 and counted < cap) for the fleet pulse.
install.sh installs the check; the fixture-home test runs in Add-ons CI.

* no-mistakes(review): fix(fleet-flow): skip long-wait probes for --target by moving its exit above the probe block

* no-mistakes(review): fix(fleet-flow): drop committed pycache artifact and ignore __pycache__

* no-mistakes(review): fix(fleet-flow): dry reads working < cap per intent, docs and test aligned

* no-mistakes(review): docs(fleet-flow): add operator install and symlink runbook

* no-mistakes(review): test(fleet-flow): export PYTHONDONTWRITEBYTECODE in check test

* no-mistakes(review): test(fleet-flow): correct dry-case comment to working = 1

* no-mistakes(document): docs: scope fleet-flow dormancy claim to the reader

* no-mistakes(review): fix(fleet-flow): tolerate non-UTF-8 crew-state probe output

* no-mistakes(document): docs: record flow check exit in FORK-EXIT list

* delete-guard: accept plain $NAME and ${NAME} in a same-command mktemp template (#46)

* delete-guard: wake Main only for literal-path blocks outside temp and scratch folders (#47)

The check now wakes only for a block whose target is a literal path, or a
variable the same command set to one, outside temp and scratch folders, from
an agent not itself working in one, and not a repeat the guard already woke
on. Every other block is counted per UTC day in state/delete-guard.counted for
the daily fleet summary. guard.mjs and the blocks are unchanged.

The test replays the 16 Oct log one sweep per row and asserts the only wake is
the 14:22 /home/fixture/users/user-019/mt-test block.

* feat(claude-quota): wake on the burn rate only under 40% of the week, with an install shim (#48)

* claude-quota: add Main's state/claude-quota.check.sh verbatim

Moved from /home/fixture/users/user-019/firstmate/state/claude-quota.check.sh (16 Oct 12:27) unchanged, so the next commit shows only the rule change.

* claude-quota: wake on the burn rate only under 40% of the week, and ship an install shim

Captain 16 Oct 15:00Z: Opus (effort medium) may take build work while the Claude week is at or above 40%, but the
state copy's burn-rate wake ('no new Opus workers') fired on every 10% step of the 5 h window or the week, 14 times
on 16 Oct. The burn rate alone no longer wakes; under 40% one week wake names the action (no new Opus build workers,
leads to the GLM/Go mix, Main reports to the captain) and carries the rate. The 5 h rule is unchanged.
install.sh writes Main's state/claude-quota.check.sh as an exec shim with a backup and re-registers it; the test
replays 16 Oct's readings and drives the install.

* fix(delete-guard): require mktemp delete variable to use the agent's own name (#49)

* delete-guard: rule text and block message name the own-variable requirement

The 21:08:45Z block set TMP=$(mktemp -d ...) and deleted "$TMP" in the same
command: correctly refused (SHELL_VARS never trusts a runtime name - an
inherited value would be deleted), but the rule text and block message never
said the variable must be the agent's own, so the agent could keep retrying
with TMP. One clause in the rule (rule.txt, README, block message); one
blocked and one allowed test case for the reduced shape.

* no-mistakes(document): Fix stale block-message description; lint clean

* fix(claude-quota): week wake fires at or under 40% left, not under 40 (#50)

The captain rule is 40% of the week LEFT: above 40% left stays quiet,
at or below 40% left fires once with the mix change. The check had
low = wp<40, so exactly 40% left stayed quiet. Now wp<=40, wake text
and comments say 'at or under 40% left' (LEFT, never 'use'), the 5 h
rule is unchanged, and the replay covers 41% left (quiet), 40% left
(one wake) and 39% left (no second wake right after 40).

* feat(glm-queue): queue GLM calls locally to cap concurrent Z.AI requests and stop 1302 refusals (#36)

* feat(glm-queue): one local queue in front of Z.AI so GLM calls wait instead of drawing 1302

* no-mistakes(review): Validate GLM_QUEUE_MAX loudly at proxy startup and install.sh

* no-mistakes(review): Add upstream idle timeout, end client response on stream error

* no-mistakes(review): Destroy client socket on truncated upstream responses for fast failure

* no-mistakes(review): Test truncated upstream response fails fast, slot drains

* no-mistakes(document): Document glm-queue fast-fail contract and full test coverage

* no-mistakes(review): Bound glm-queue test clients with timeouts so a wedged queue fails named, not hung

* feat(git-identity): pin lane git identity and refuse pushes of commits made as anyone else (#52)

* feat(git-identity): pin lane git identity and refuse pushes of commits made as anyone else

* docs(fork-exit): cite fork PR 90 for the launch-env hook

* no-mistakes(review): Fix pre-push guard to refuse uninspectable pushes; correct README leak PR list

* feat(fleet-flow): take FM_BIN for the fork helper libraries ahead of the fork shim (#53)

* feat(fleet-flow): take FM_BIN for the fork helper libraries ahead of the fork shim

The fork's bin/fm-flow.sh becomes a thin shim that execs this reader with
FM_BIN pointing at the fork bin/, so the reader resolves fm-classify-lib.sh,
fm-tasks-axi-lib.sh, fm-backlog-transition-lib.sh and the fm-tasks-axi.sh
consumer from ${FM_BIN:-its own directory}, exactly like fleet-dashboard.
The moved test now requires FM_BIN and drives the fork's model/skill readers
from it; the README tells the shim story and retires the parity section.

* docs(FORK-EXIT): cite the merged-flow fork shim PR for the fleet-flow row

* parked-homes: one shared reader parks a secondmate home for every supervision producer (#42)

* feat(parked-homes): one shared reader parks a secondmate home for every supervision producer

config/parked-homes lists parked home ids; the add-on's fm_parked_home reader
gates the supervision session (fm-send steer/answer/nudge), relaunch
(fm-control, remote relaunch, secondmate restart pass), reconcile and reread
nudges, config push (fm-config-push + bootstrap CONFIG_REREAD), pending-reply
retries, the model-outage scan, the wake-loop stall check, and quota-failover.
A parked home gets one log line per skip and nothing else; the fork hook PR
carries only the shim and one predicate call per producer (FORK-EXIT row).
The e2e drives a fixture fleet of two homes, one parked, through every path.

* style(parked-homes): inline the e2e EXIT trap for ShellCheck 0.9 (CI)

* fix(parked-homes): initialize locals in fm_parked_meta_id (set -u) and honor FM_CONFIG_OVERRIDE as the config dir

fm_parked_meta_id declared kind/home/fixture/users/user-015 without values and used an undeclared
line, so under the set -u producers (fm-watch, quota-failover) a meta without
kind= printed unbound-variable noise every pass and a remote secondmate meta
without home= aborted instead of being reported parked. The lead review found
it; both cases are now e2e cases run under set -u. fm_parked_homes_file also
treats FM_CONFIG_OVERRIDE as the config directory itself (the fork-wide
override convention) instead of appending /config twice.

* docs(fork-exit): rows for merged fork PRs 86, 91, 92; mark PR 90 merged (#54)

* README: a one-minute top for new users (#55)

* README: a one-minute top for new users

One-line purpose, who the add-ons are for, one plain line per add-on
with how it wires in, the shortest true install (a loop verified with
--dry-run against a throwaway home), one ran check command per add-on,
and per-add-on removal. The long per-add-on sections move under
Details unchanged.

* README: per-add-on list instead of a table, so phones render it without a cut column

* README review: standalone intro, upstream wording, plain-words add-on one-liners

* README: remove owner details; agnostic for any Firstmate user

* Scrub owner details from add-ons: generic paths, identities, history (#56)

* feat(owner-guard): refuse commits and pushes matching private owner-details patterns (#57)

* Add owner-guard hook: refuse commits and pushes matching private owner-details patterns

New owner-guard add-on shaped like delete-guard: a pre-commit and
pre-push guard matched against the home's private
config/owner-details-patterns (mode 600, never committed), chained
through a new hooks.d hook point in git-identity so every lane
commit runs it. Refusals print file:line plus a placeholder hint
and are final. Fixture test covers refused and clean commits,
refused push, removal-only pass, repo-hook chaining, and the
missing-patterns note.

* no-mistakes(review): Fix owner-guard new-push deadlock, root scans, diff parsing, fail-open

* no-mistakes(review): Scope guard matching to added content only; fix installer comment

* no-mistakes(review): Remove OWNER_GUARD_PATTERNS override; home patterns file only

* no-mistakes(document): Document hooks.d chaining; fix owner-guard shellcheck failures

* no-mistakes(document): Document hooks.d chaining in usage header; tighten owner-guard README

* no-mistakes(document): Wire owner-guard fixture test into CI

* fix(owner-guard): scan added lines that follow a missing trailing newline (#58)

* Fix owner-guard marker match: scan the line after a missing trailing newline

* no-mistakes(document): Fix owner-guard newline scan; add missing README row

* no-mistakes(document): Revert README owner-guard row; lints pass

* feat(owner-guard): daily scan of public repos for owner details (#59)

* feat(owner-guard): daily scan of public repos for owner details

Adds scan-check (once-a-day shallow clone of every fleet public repo,
matched against the private patterns file; one wake line with hit counts
and a private file:line report), install-scan.sh in the fleet-stall shape,
scan-e2e.sh fixture proof, and the README wiring.

* fix(owner-guard): detached scan loop and silent due run

The clone loop cannot finish inside the watcher timeout, so a due run
records the marker, starts the loop detached, and returns with no output.
A finished loop with hits leaves one wake line under state for the next
run to print once. Proof extended for the detached flow.

* fix(owner-guard): keep scan run dir and report owner-only

umask 077 so the copied patterns, the report and the result file are
never group- or world-readable; e2e asserts the report is mode 600.

* feat(owner-guard): extend owner-details guard to plain-shell commits and pushes via global hooksPath (#60)

* Guard owner details in plain-shell commits and pushes via global hooksPath

Point the user's global core.hooksPath at generated per-hook wrappers:
pre-commit and pre-push run the guard first, then chain the previous
global hooks dir and the repository's own hook. Install stays idempotent,
records a replaced global value instead of dropping it, and uninstall
restores it; repo-local config is never touched. Fixture tests cover
plain-shell and lane refusals, clean pass-through, hook chaining, double
install and uninstall.

* Document pipeline push bypass as a known owner-guard limit

The pipeline pins a per-worktree hooksPath and pushes with hooks
skipped, so only its own authored commits are unguarded.

* no-mistakes(review): Pin GIT_CONFIG_GLOBAL in owner-guard tests; assert real hooksPath unchanged

* feat(owner-guard): chain server-side hooks with byte-exact stdin replay (#61)

* fix(owner-guard): chain receive hooks in local bare repos under the global hooks dir

* no-mistakes(review): Replay stdin via here-string so chained hooks' verdicts win; dedupe stdin hook list

* no-mistakes(review): Add post-rewrite to stdin replay set so chained consumers all get git's input

* no-mistakes(review): Capture hook stdin to temp file for byte-exact NUL-safe replay

* no-mistakes(document): Document server-side hook chaining in owner-guard README

* feat(owner-guard): refuse PR merges that add owner details via the home merge gate (#62)

* feat(owner-guard): refuse PR merges that add owner details via the home merge gate

The no-mistakes pipeline pushes its own fix-round commits with client hooks
skipped, so a leak it authors is never checked at commit or push time.
owner-guard now has a merge-gate mode for the home's config/merge-gate
contract: it fetches the PR's exact head and base branch into a scratch
repo and scans every line the PR adds against their merge-base with the
same patterns and refusal text as the commit/push guard. Forge or fetch
failures refuse (nothing merges unscanned); a missing patterns file allows
with one note. install.sh chains the home's existing merge gate behind the
scan (moved aside, restored on uninstall), idempotently.

* no-mistakes(document): Fix merge-card docs for owner-guard merge-gate chaining

* no-mistakes(document): README Check/Remove list owner-guard tests and uninstall

* chore: update pull request (#64)

* feat(pipeline-quota-failover): fail GLM over to Claude Haiku 5.5

The default chain was GLM 5.3 Flash, Go Muse, DeepSeek; Go is locked and
DeepSeek is out, so a quota-dead GLM left the pipeline with no model.
The chain is now zai/glm-5.3-flash, then claude-bridge/claude-haiku-5-5:
GLM stays first, Claude Haiku 5.5 only as its failover, never Opus,
Sonnet, Fable or Step 5.

pi does not list Haiku 5.5 under claude-bridge yet; it runs the id as a
custom model and Claude Code serves claude-haiku-5-5. claude-bridge words
a Claude subscription limit as "Claude rate limit (...): You're out of
extra usage", which matched no quota pattern, so a quota-dead Haiku
would have passed through instead of ending in "quota exhausted"; both
phrasings now count as quota errors.

route-change's journeys pin their own three-route list so they keep
testing route switching independent of the default chain.

* feat(pipeline-quota-failover): skip a quota-dead model for an hour

A dead GLM spends 13-16 min in pi's own retries before the wrapper sees
its quota error, so after GLM runs out every pipeline call would wait
that long before reaching Haiku 5.5. A quota error now leaves a marker
(model and time) under the wrapper's state dir, and later calls skip
that model for PI_QUOTA_FAILOVER_DEAD_SECS (default 3600); after the
window it is tried again, and an answer without a quota error clears
the marker. With every model inside its window the call fails at once
with the terminal "quota exhausted" line and no pi call.

zai-quota-check's advice no longer says to set the pipeline to Muse or
"never Claude for reviews": the pipeline fails over to Claude Haiku 5.5
on its own.

* no-mistakes(document): Align README with skip-window failover; lint clean

* fix(owner-guard): stamp absolute tool paths into hooks and refuse scans on missing tools (#65)

* fix(owner-guard): run hooks without PATH lookups for bash

The global guard hooks started with `#!/usr/bin/env bash`, so every ref
update (git branch fires reference-transaction) failed with
"env: bash: No such file or directory" under a PATH without bash.

install.sh now writes the absolute bash path into each installed wrapper
and copy of owner-guard, plus absolute cat, mktemp and rm paths for the
wrapper, resolved at install time. Chained hooks still get the caller's
environment unchanged.

The scan refuses by name when a scan tool (grep, sed, awk, ...) is not on
PATH, so a missing tool can never read as "no match".

Tests: the global test adds a git-only PATH case (git branch passes, a
commit is refused naming the missing tool). Proof: learn-from-mistakes
apply test with a PATH holding every system tool except bash fails on
main's guard (4 env: bash lines) and passes on this change.

* no-mistakes(document): docs(owner-guard): scope stamped-path claim, list git-only-PATH test

* feat(fleet-dashboard): newest-first asks with sort toggle and typed filter (#66)

* feat(fleet-dashboard): newest-first asks with sort toggle, type tags and type filter

* feat(fleet-dashboard): live Needs you list gets newest-first, sort toggle, type tags and filter

* no-mistakes(review): ask-type rule: pick/choose verbs, approv/merg stems, dual option markers

* no-mistakes(review): Add visible keyboard focus ring to static ask controls

* no-mistakes(document): Update dashboard fork-provenance docs for asks change

* feat(bearings-board): add the Bearings board as a standalone dormant add-on (#63)

* feat(bearings-board): add the Bearings board as a dormant add-on copy

Standalone copy of the fork's Bearings board script and template, with the
milestone fields, evidence thumbnails, home-board links and reconcile choice
the fork's 9ad8e1fb and 08472745 added. It runs against any Firstmate home
named by FM_HOME and calls that home's own lifecycle helpers.

The test is a new behavior suite over stub helpers and a stub lavish-axi;
the fork's process-event and live-Lavish tests stay on the fork. FORK-EXIT
moves the row to dormant copy, fork shim next.

* no-mistakes(review): wire bearings-board test suite into addons CI

* fix(bearings-board): wrap the Captain's Call header at 390 px and show only the last path segment for repo names

The Captain's Call header wrapped its label off-screen at 390 px. Project names
that arrive as a path now show only their last segment, so no home path is shown.

* no-mistakes(document): Aligned FORK-EXIT bearings status punctuation; docs and lint verified clean.

* test(bearings-board): use a placeholder user in the home-path example paths

The owner-details guard refuses the real home user name in the test's example
paths. The example paths now use the placeholder 'you'; the test's meaning is
unchanged.

* fix(fleet-dashboard): wrap long ask text and tag multi-option asks as pick (#67)

* fix(fleet-dashboard): wrap long ask text and tag multi-option asks as pick

Long unbroken URLs in an ask pushed the age past the right edge at 390 px;
the text cells now wrap (overflow-wrap:anywhere, min-width:0) in the static
page, the Needs you view and the overview card.

Ask type reads an optional type column (yn|pick|approval) before the wording,
falling back to inference when it is empty or unknown. The wording rule now
tags three or more comma-separated choices ending in 'or ...?' and single-letter
option markers ('A Foo, C Bar') as pick; plain yes/no wording stays yes/no.

* no-mistakes(review): Document captain-asks.tsv optional fifth type column in fleet-dashboard README

* no-mistakes(document): Ask-type docs already consistent; all lint checks pass

* chore(bearings-board): remove dormant bearings-board add-on (#68)

* chore: remove the bearings-board add-on

Kun's plain board (bin/fm-bearings-board.sh) is the fork's Bearings board.
Nothing in the repo, the live homes, scripts or systemd units calls the
add-on, so drop its folder, its README line, its CI test step and its test
command, and point the FORK-EXIT.md Bearings row at Kun's helper.

* no-mistakes(review): Mark Bearings row dropped in FORK-EXIT.md

* no-mistakes(document): Document Bearings add-on drop and dropped status

* fix(fleet-flow): read captain holds from the backlog in the flow check (#69)

fm-captain-hold.sh hold records the hold on the task's backlog line, not in
the status file, so a captain-held lane still flagged red. A lane whose open
backlog item carries hold-kind captain (active until hold-until) is now
captain-held: no wait or red line. The status-key path is unchanged.

* refactor(sentinel): replace the copied restart supervisor with a thin wrapper (#70)

The sentinel script and its two tests were a verbatim copy of the Firstmate
checkout's files. The add-on now holds only a wrapper that runs the checkout's
bin/fm-sentinel.sh with the same argv, plus a hermetic wrapper test. Copied
upstream lines in sentinel/: 450 before, 0 after.

* refactor(signoff): remove the copied sign-off adapter; add-on holds no code (#71)

* refactor(signoff): remove the copied sign-off adapter; add-on holds no code

The adapter and its journey test were a verbatim copy of Firstmate files (fork
commit 0689b4b9). Upstream has since dropped the sign-off source, and its runner
cannot dispatch an add-on adapter, so the copy cannot run. Removed here, and the
upstream seam is written up for the lead. Recoverable at 33a8de8.

Overlap with current upstream main: 0 whole-line matches before (238 counted
lines), 0 after; the signoff/ folder holds only README.md.

* fix(signoff): restore the sign-off adapter as a thin layer on the Firstmate checkout

The adapter is our own logic and stays in the add-on, dormant until the fork
dispatch hook lands. It now resolves the runner, the keyed-answer intake and the
libraries from the Firstmate checkout (FM_CODE_ROOT, default FM_HOME), not from
its own directory. Its test sources tests/lib.sh from that checkout.

Copied upstream lines: 0 whole-line matches against kunchenguid/firstmate main
c7b7798 in signoff/ (12 idiom lines and 5 test lines rewritten to equivalent
forms; the beads fixture is our own, since upstream exposes no sourceable helper).
The ack-contract drift between upstream and the fork is in the seam record.

* fix(pipeline-quota-failover): skip exhausted routes and fail over on silent calls (#72)

* fix(pipeline-quota-failover): skip exhausted routes and fail over on a silent pi

Before each route, ask quota-axi for its provider; an exhausted_now runway
skips the route without a call and writes its dead marker. quota-axi missing,
slow (10s cap) or failing leaves the route to be tried as before.

A pi call with no stdout and no stderr for PI_QUOTA_FAILOVER_IDLE_SECS
(default 300) is killed (TERM, then KILL) and counts as a quota failure.

A dead marker is cleared only when the attempt answered (exit 0, no
errorMessage); a kill, timeout or other failure keeps it.

* no-mistakes(review): skip routes only on structured exhausted_now match

* no-mistakes(review): add SIGINT idle-path test, real quota-axi rejection stub

* no-mistakes(review): Signal pi's process group on idle and forwarded signals

* fix(pipeline-quota-failover): skip exhausted routes and fail over on a silent pi

Before each route, ask quota-axi for its provider; an exhausted_now runway
skips the route without a call and writes its dead marker. quota-axi missing,
slow (10s cap) or failing leaves the route to be tried as before.

A pi call with no stdout and no stderr for PI_QUOTA_FAILOVER_IDLE_SECS
(default 300) is killed (TERM, then KILL) and counts as a quota failure.

A dead marker is cleared only when the attempt answered (exit 0, no
errorMessage); a kill, timeout or other failure keeps it.

* no-mistakes(review): skip routes only on structured exhausted_now match

* no-mistakes(review): add SIGINT idle-path test, real quota-axi rejection stub

* no-mistakes(review): Signal pi's process group on idle and forwarded signals

* no-mistakes(review): Stop failover when signalled during idle-kill grace

* no-mistakes(review): install signal traps before forking pi

* test(pipeline-quota-failover): fix ShellCheck SC2034 and SC2261 in e2e test

* no-mistakes(review): Forward received INT or TERM to pi; kill orphaned sleep in test 9h

* no-mistakes(review): stop path escalates to KILL, exits 128+signal

* no-mistakes(review): Drop signal forwarding; idle kill signals pi's full tree

* no-mistakes(review): no changes; both findings not legitimate on current code

* no-mistakes(review): Forward INT to pi and wait full grace before KILL

* no-mistakes(review): Simplify run_watched reap loop to single wait

* no-mistakes(document): Document quota pre-check and idle watchdog; fix SC2086

* feat(sentinel): restore the sentinel as the add-on's own code, with install and uninstall (#73)

Restores bin/fm-sentinel.sh from the fork's current file (origin/main of
umeranjum17/firstmate) under sentinel/bin, and removes the PR 70 wrapper and
its test. The sentinel calls the host tool's scripts and libraries from
$FM_HOME/bin and copies none of them.

Adds install.sh and uninstall.sh: install copies the sentinel to the data dir
and points the fm-sentinel user unit at that copy for one home, restarting
the service in the same step; uninstall restores the unit recorded before the
first install and restarts on it. Both are idempotent, and install takes
--dry-run.

Slice 1. The restart tests (dead relaunch, restart resume, live e2e) follow
in slice 2 from commit d670f4e, which holds them.

The fork's reconcile loop guard becomes two `|| continue` statements instead
of one `&&` test, the same logic, so no run of three lines matches upstream.

* fix(pipeline-quota-failover): a stall is not a quota error (#74)

A pi call silent for the idle window was counted as a quota failure, so
the route got a dead marker for 3600s and the whole chain had no model
under host load. A stall now moves on to the next chain model for that
call only and writes no marker; only a real quota error or quota-axi
exhausted_now marks a route dead. A chain that only stalled fails without
the terminal 'quota exhausted' line, so the pipeline may retry it.

The skip log shows the time left for a future-dated marker instead of a
negative age.

* test(sentinel): move the restart tests into the add-on (#75)

Slice 2 of the sentinel restore. Brings the three restart tests from the fork
onto the add-on: dead relaunch (runs without a live host), restart resume (a
real-Herdr lab), and the live Herdr e2e (opt-in). Each sources the fork
checkout's tests/lib.sh through FM_UPSTREAM_ROOT and runs the add-on's
bin/fm-sentinel.sh. Fixture homes symlink the checkout's bin/ because the
sentinel runs the host tool's scripts from FM_HOME/bin.

Only dead-relaunch runs here. restart-resume and the live e2e skip without a
live Herdr and a signed-in Claude.

* fix(fleet-stats): source fm-wake-lib.sh from the Firstmate checkout, not the add-on (#76)

The outcome recorder sourced a sibling fm-wake-lib.sh that only exists in the
fork tree. Source it from FM_BIN, else $FM_HOME/bin, and exit 2 with the path
when it is missing. The library is not copied into the add-on.

* feat(backlog-lock-reclaim): reclaim a 0-byte backlog lock left by a dead tasks-axi writer (#77)

tasks-axi 0.2.6 creates <backlog>.lock with wx and writes its token after;
a writer killed between the two leaves an empty lock that is never reclaimed,
so every later write fails LOCKED. This add-on's watcher check removes a
0-byte lock older than 60 s that no process has open, logs the reclaim, and
prints one wake line. Install and uninstall are delete-guard style.

* fix(fleet-flow): a paused lane whose own run is executing counts as busy (#78)

A lane that waits on its own no-mistakes run writes paused:, so the flow
check's working count (field 3 of --summary, read by the fleet-stall
zero-busy guard, and the --can-start spawn gate) left it out. crew-state reads
the same lane's run-step as working. Probes ran only for paused lanes older
than 4 h and only freed slots, so a busy paused lane never counted.

Paused lanes are now probed at any age; a paused lane whose crew-state reads
working is busy. Blocked and failed waits keep the 4 h rule. fleet-stall gives
the check 20 s, above its 15 s probe deadline, so a slow probe does not read
as no answer.

Repro: fleet-flow test (working count and --can-start) and fleet-stall e2e
(no muxr 0-busy line). Both fail on origin/main.

* fix(pipeline-quota-failover): idle limit 120 s and one retry for a stalled last route (#79)

* fix(pipeline-quota-failover): set the idle limit to 120 s from measured Haiku streams

pi in --mode json streams text and thinking deltas as they are produced:
two Haiku 5.5 calls on a 103 KB review prompt gave 1390 and 1574 events,
with the longest mid-stream gap 12 s. The longest gap of the whole call was
26 s, before pi's first event. So idle is a real liveness signal and the
watchdog stays, but 300 s was far above what a live call ever goes silent for.
120 s is about 4.5x the worst measured gap.

A route that stalls now fails over after 2 min instead of 5. The stall still
writes no quota marker. Adds an e2e case: a route that streams for longer
than its idle limit is not killed.

* fix(pipeline-quota-failover): retry a stall once on the last route

Measured stalls on Haiku were silent calls: no byte on stdout or stderr for 300 s,
then killed. They cluster in time and carry no quota text. When the stalled route
is the last live one, the call failed on its first attempt, and no-mistakes does
not retry a wrapper stall. A stall on the last route now gets one more try on the
same route before failing. A second stall fails as before. e2e 9o covers a route
that is silent on its first call and answers on the next.

* fix(pipeline-quota-failover): GPT-6 Luna fallback, pi without pi-hermes-memory, codex quota mapping (#80)

* fix(pipeline-quota-failover): default fallback is GPT-6 Luna, quota-axi codex mapping, log successes

The claude-bridge Haiku route left the default chain: every pi start waits on
pi-hermes-memory's session_start persistence sync, and the 120 s no-output
watch killed those starts. The chain is now GLM 5.3 Flash, then
openai-codex/gpt-6-luna.

quota-axi knows the openai-codex provider as codex, so the pre-check maps the
pi name before asking; it no longer exits 2 for the fallback route.

Each successful call writes one log line with the model, duration and bytes.

* fix(pipeline-quota-failover): run pi without pi-hermes-memory

pi-hermes-memory's session_start sync runs before pi emits agent_start and kept
pipeline calls silent for 5 s to 134 s on this host, so the 120 s watch killed
them. Every wrapped call now runs pi with -ne plus -e for each extension pi
would load except pi-hermes-memory: user packages from pi list, the user
extensions dir (fm-rm-guard, fm-literal-delete), settings extensions, and the
built-ins minus any settings turn off. An unreadable list runs pi as before
with one log line.

Proof: GPT-6 Luna large review through the wrapper, 17.4 s total, session
header 1.0 s after pi starts, agent_start 82 ms later.

* refactor(pipeline-quota-failover): compact the extension set code and tests

Same behaviour as the previous commit: one listing helper and the built-in list
inline, shorter comments and README, and a smaller extension test block. Keeps
the PR under 300 changed lines against main.

* supervisor-guard: own the supervisor-work guard, zero copied upstream lines (#81)

* feat(supervisor-guard): own the supervisor-work guard; install and uninstall; drop upstream copies

The add-on owns the supervisor-work guard, which upstream Kun does not ship. The
upstream-copied transport and test lines are gone: the scope predicate and the
shell lexer are read from the Firstmate checkout the hook is installed for.
install.sh copies the guard to the user's data dir and merges one PreToolUse
Bash hook into ~/.claude/settings.json; uninstall.sh removes it. Both are
idempotent, take --dry-run, and back up what they change. The guard stays
inert outside a supervisor home and fails open on any missing piece.

* no-mistakes(review): Harden hook array expansion, uninstall no-op, tests, docs

* no-mistakes(review): Drop unused hook args, restore prefilter, align docs

* no-mistakes(review): strip newline continuations from supervisor prefilter

* no-mistakes(review): Remove Grok toolInput fallback from pretool hook

* refactor(supervisor-guard): export decision inline; drop the copied-looking export line

* feat(kill-guard): block kill, pkill and killall outside the caller's own tree (#82)

* feat(kill-guard): block kill, pkill and killall outside the caller's own tree

A worker killed the systemd user manager as a "stray" parent on 18 Oct and
every lane and lab on the host dropped. kill-guard/ is the guard that stops
it: kill, pkill and killall (any signal, kill -9 included) may signal only the
caller's own descendants, found from /proc. PID 1, the systemd --user manager
and the herdr server are always refused, and so is any target the guard cannot
resolve (a $VAR, %job, xargs input, an unknown PID or a pattern it cannot read).
A refusal names the target and tells the worker to write blocked:.

Same hook wiring as delete-guard: guard.mjs (the rule and the Claude hook CLI),
a pi extension, an OpenCode plugin, and install.sh. The Claude hook passes
--caller $PPID so the agent's children are the ones allowed. The e2e test
signals only sleep children and fake named processes it starts itself.

The watcher check and block log are a second slice.

* no-mistakes(review): strip redirections from kill operands; execute adapters in tests

* no-mistakes(review): Close kill -l and unreadable-/proc bypasses

* no-mistakes(review): Judge wrapped kills and refuse ambiguous pkill patterns

* no-mistakes(review): Close nested substitution, killall path and wrapper bypasses

* no-mistakes(review): Trim kill guard to intent, drop heredoc bodies

* fix(kill-guard): judge shell heredoc bodies; narrow heredoc delimiters

Only a letter or underscore delimiter opens a heredoc, so $((1<<2)) never drops a line.
A body fed to bash, sh, zsh or dash is kept and judged, since the shell runs it.

* fix(kill-guard): compare realpaths in the hook entry check; document known gaps

A symlinked install dir made argv[1] differ from the resolved module path, so the hook
exited 0 and allowed every command. The e2e journey now runs the hook through a symlink.

* chore(kill-guard): drop the known-gap README and a repeated PID 1 case

Known gaps move to the PR body; the PID 1 rule stays proven by the sh -c, installed hook and adapter cases.

* no-mistakes(review): Fix kill -l signal-list parsing

* no-mistakes(review): Trim kill guard below the 300-line cap

* test(kill-guard): drop the unused argument pass-through in the install helper

ShellCheck (SC2119/SC2120) flagged inst() forwarding "$@" that no call passes.

* Support multiple supervisor guard homes (#83)

* fix(kill-guard): close the parser bypasses that slice 1 left open (#84)

* docs: correct fork exit audit facts (#85)

* Retry stalled final quota-failover route three times (#86)

* Add uninstall scripts for first add-on slices (#87)

* fix(kill-guard): load in compiled pi, ask for the literal PID, treat quoted text as data, add uninstall.sh (#88)

The pi extension failed to load in the compiled pi binary: guard.mjs's entry check ran realpathSync on argv[1], which is /$bunfs/root/pi there. An argv[1] that does not resolve is now just not this file.
A kill whose PID the shell sets ($pid, $!, %1, $(...)) now asks for the literal PID instead of a final block; a final block anywhere in the command still wins.
Heredoc writes to a *.sh file are data; an unquoted heredoc's $( ) and backticks are checked.
uninstall.sh removes the rule, adapters, the disabled/ pi copy and only the kill-guard hook (backup, --dry-run).

* Add uninstall scripts for next add-on slices (#89)

* Add uninstall scripts for next add-on slices

* Label uninstall test evidence distinctly

* Unregister shared checks through Firstmate

* Weight heavy memory-gate scopes against app.slice (#90)

* Scope heavy memory-gate jobs in weighted slice

* Weight heavy scopes against app slice without replacing caps

* Add uninstallers for remaining add-on slices (#91)

* Allow kill guard targets in task worktree (#92)

* feat(parked-homes): add refusal and skip gates (#93)

* feat(parked-homes): add refusal and skip gates

* test(parked-homes): keep fallback checks shellcheck-clean

* docs(parked-homes): keep fork inventory out of add-on repo

* host-memory: expose optional sampler lifecycle library (#94)

* Protect Herdr from CPU-heavy pane jobs (#95)

* Add fleet read guard for agent tools (#96)

* Add fleet read guard

* Block reads through protected directories and code paths

* Allow non-secret runtime state reads

* read-guard: block only real login paths and path fields (#97)

* read-guard: block only real login paths and path fields

Wildcard-only fragments such as bold markers matched every protected
file, and non-bash tools scanned body text like content. A fragment is
now a glob only when it is rooted at a slash or at a home-relative
prefix, and non-bash tools scan only path-like fields. Adds tests for a
markdown heredoc, a Pi-style write, and a glob through a wildcard home.

* read-guard: scan find patterns as paths too

Pi's find tool takes a glob pattern, so the pattern field is scanned for
find as well as glob. Adds a test for a home-rooted codex login glob.

* read-guard: stop false matches on text-only commands and doc-comment openers (#98)

* read-guard: block only real file access, not text-only commands or doc-comment openers

A bare doc-comment opener fragment is no longer a root-wide glob: a path
glob now needs a literal segment. echo, printf and fm-send.sh may name a
login path as text; substitution, redirects and a ';' chained read still
block. Adds regression cases for both false matches.

* read-guard: a pipe in the command ends the text-only exemption

printf or echo of a login path piped to xargs cat or sh passed the text-only
exemption and then read the file. The exemption now needs the whole command
to have no pipe, backtick, substitution, or redirect.

* Skip captain-held lanes in land actions (#99)

* fix(pipeline-quota-failover): default failover chain to claude-haiku-5-5 (#100)

* pi-quota-failover: default failover to claude-bridge Haiku 5.5 instead of GPT-6 Luna

Both chain models were out of quota, so every fleet pipeline call failed.
Haiku through claude-bridge becomes the GLM failover. The e2e suite pins
the GLM -> GPT-6 Luna pair for its failover cases and checks the new
default chain.

* no-mistakes(review): Reword stale GPT-6 Luna failover comment in wrapper

* feat(pipeline-quota-failover): own idle limit for claude-bridge models (#101)

Add PI_QUOTA_FAILOVER_BRIDGE_IDLE_SECS (default 300) for claude-bridge/*
models; PI_QUOTA_FAILOVER_IDLE_SECS (default 120) keeps applying to every
other model. The kill log line and stall detail name the limit used.

Fleet logs show Haiku calls over claude-bridge answering in 30-166 s, so the
120 s limit killed slow answers and failed whole sign-off reviews.

Tests: e2e cases for a silent bridge route under its limit (not killed), a
silent non-bridge route over its limit (killed), and the bridge kill naming
its own limit.

* feat(pipeline-quota-failover): add DeepSeek Flash to the failover chain (#102)

Default chain is now zai/glm-5.3-flash, deepseek/deepseek-flash, then
claude-bridge/claude-haiku-5-5. quota-axi answers provider deepseek with
no exhausted scope, so the pre-check passes it through unchanged.

* fix(pipeline-quota-failover): DeepSeek hop, GLM off the chain, quota failures move on (#103)

- DeepSeek gets its own idle limit (PI_QUOTA_FAILOVER_DEEPSEEK_IDLE_SECS,
  default 300); the generic 120 s watch killed its slow first answers and
  moved every call to Haiku.
- Default chain is DeepSeek Flash then claude-haiku-5-5; GLM is removed.
- QUOTA_RE matches Z.AI balance and rate-limit texts and DeepSeek's
  Insufficient Balance, so those move on instead of ending the run.
- A call pinned outside the chain runs the chain in chain order, so a
  Codex-pinned fix step cannot bypass the failover.
- e2e journey covers the DeepSeek hop, the GLM-free chain, and GLM
  quota failures that move on.

* feat(bearings-board): run the Bearings board from the Firstmate checkout as a thin wrapper (#104)

* feat(bearings-board): thin wrapper over the checkout's board (slice 1)

Runs the Firstmate checkout's bin/fm-bearings-board.sh unchanged: no copied
upstream code. Dormant until wired by install.sh. Extras (projects strip,
underway/landed rows, Captain's Call cards, evidence thumbnails) follow in
later slices.

* no-mistakes(review): fix bearings-board install order, uninstall launcher safety, recursion guard, arg forwarding

* no-mistakes(review): uninstall no longer restores a backup naming the launcher

* no-mistakes(review): Found all review findings already fixed; corrected remaining doc claims

* no-mistakes(review): Verified hook symlink/mode and hook-ownership fixes already hold

* no-mistakes(review): install leaves launcher-naming hooks alone; uninstall drops backup grep

* no-mistakes(review): Test install rerun and dry-run paths; warnings already fixed

* no-mistakes(document): Fix bearings-board install doc facts; shellcheck pass

* fix(claude-model-guard): allow Sonnet, keep Fable refused (#105)

* merge-card: move fork merge gate and post-merge hook into the add-on (step A) (#106)

* WIP: extract merge-card adapters and stage integration journey

* test: retain failed merge fixtures and create their data directory

* feat(account-pool): launch-side pool pick and fm-spawn hook as an add-on (fork exit 7, slice 1) (#107)

* feat(account-pool): launch-side pool pick and fm-spawn hook events as an add-on (slice 1)

* test(account-pool): use the exact hook setup line

* lead-wake: move the fork's lead-wake policy into an add-on behind one watch-policy seam (step A) (#109)

* merge-card: refuse a PR merge with no checks-lint PASS row for its head; log the evidence folder on post (#110)

* alerts: serve the model-outage observer from the add-on (step A) (#108)

* alerts: run the model-outage observer from the add-on with fork-bin dependencies; add hook e2e

* alerts: silence SC2317 on the test stubs

* pipeline-quota-failover: fail over on WaitDelay, extension-warning exits and no credit (#111)

* pipeline-quota-failover: free MiniMax OpenRouter route in the default chain (#112)

* pipeline-quota-failover: add free MiniMax OpenRouter route after Haiku; never credit-probe :free models

* pipeline-quota-failover: drop DeepSeek from the default chain

* pipeline-quota-failover: fail over on OpenRouter's 402 requires-more-credits error (#113)

* merge-card: stop passing a bare --judge to done-done 0.4.1 (needs a route) (#114)

* merge-card: skip the card for a merge that declares screen: none (#115)

* brief-inherit: shared worker-instruction include behind a fork seam (step A) (#116)

* wait-timers: run the timer library from the add-on with fork-bin dependencies; add hook e2e (#117)

* receipts: serve acceptance and publisher from the add-on (step A) (#118)

* WIP receipts step A (paused)

* receipts: serve acceptance and brief/meta helpers from the add-on; publisher reads fork libs from fork bin; add hook e2e

* feat(merge-card): attach passed-test receipt to evidence cards (#119)

* merge-card: attach the passed-test receipt (run) to the evidence card when a sealed done-done run backs the pass

* no-mistakes(review): Bind passed-test receipt to merge head and cited file

* no-mistakes(review): Bind passed-test receipts to sealed file bytes; drop line cap

* no-mistakes(review): Scrub local folders from receipt evidence and proof

* no-mistakes(review): test abspath fixture with absolute proof path

* no-mistakes(review): cut passed-test receipt to head-matched clean run only

* no-mistakes(review): restore media gate so receipts never change posting

* no-mistakes(document): Document merge-card passed-test receipt in root README

* test(merge-card): run merge hook e2e against the real fork seam (#120)

* merge-card: run merge-hooks e2e against the real fork seam

* no-mistakes(review): Update merge-card README for merged fork seam

* no-mistakes(document): update merge-card docs for merged fork seam

* fix(alerts): define fm_alerts_push_suppress for the fork's push-transition hook (#121)

* alerts: define fm_alerts_push_suppress for the fork's push-transition hook

* no-mistakes(document): document push-suppress hook in alerts README

* no-mistakes(ci): Root cause: ShellCheck reported SC2317 (unreachable command) on the `fm_meta_get` and `task_captain_call_open` stubs defined inside the push-transition subshell in alerts/tests/model-outage-hook-e2e.sh (lines 73-74). The existing disable directive above that block listed only SC2031 and SC2329. Fix: added SC2317 to that directive in alerts/tests/model-outage-hook-e2e.sh. The stubs are invoked indirectly by the sourced hook, so the directive is accurate. Verified locally: the edited file and alerts/bin/fm-model-outage-lib.sh pass `shellcheck -x -e SC2015,SC1091`, and a full run of the CI ShellCheck loop over all 148 add-on bash scripts reports zero failures. Local shellcheck is 0.11.0 while CI uses 0.9.0, so the full loop was not run on the CI version. I did not run the e2e test itself because it needs FM_TEST_FORK. The declined simplify-push-suppress-guard item was not touched

* test(brief-inherit): compare e2e against a pinned pre-seam reference (#122)

* test(brief-inherit): compare against a pinned pre-seam reference, not the live fork checkout

* no-mistakes(review): harden pre-seam patch and compute seam presence once

* no-mistakes(document): Update brief-inherit README for pinned pre-seam reference

* feat(owner-rules): refuse a lane brief with no owner ask or no-mistakes without a risk reason (#123)

* feat(owner-rules): merge gate refuses a merge with no done-done receipt (#124)

* feat(owner-rules): merge gate refuses a merge with no done-done receipt

* test(owner-rules): silence SC2119/SC2120 on the gate helper

* feat(owner-rules): leads skill stating both rules, the refusal lines and their fixes (#125)

* feat(owner-rules): merge gate refuses a merge with no checks-lint PASS for the PR head (#126)

* feat(owner-rules): merge gate refuses a merge with no checks-lint PASS for the PR head

* fix(owner-rules): skill quote matches the lint refusal; test counts four

* feat(owner-rules): name the skill firstmate-addons-owner-rules (#127)

* fix(owner-rules): install line links firstmate-addons-owner-rules (#128)

* feat(merge-card): accept a sealed clean run from done-done's default evidence root (#129)

receipt_run asks done-done (doctor) for its evidence root and also reads
<root>/*/.done-done/runs; the per-task lookup and acceptance test are kept,
and with no done-done only the task folder counts.

* test(alerts): port the model-outage scan cases from the fork (#130)

* feat(receipts): fm_receipts_accept_done, call-site signatures for inherit and promote (#131)

* Test wait timers with post-step-B fork hooks (#132)

* fix(sentinel): restore recorded Claude models after restart (#133)

* fix(sentinel): reconcile model mismatches in lead homes (#134)

* Require fleet evidence cards before PR merges (#135)

* Accept sign-off evidence commit in owner gate (#138)

* Replace dismissed merge evidence cards (#139)

* Inherit fleet board from main home (#137)

* Inherit fleet board from main home

* Fix board fallback test lint

* Keep merge-card media in task evidence folder (#136)

* Post merge evidence per PR head (#140)

* Add Firstmate sign-off engagement route (#141)

* Show captured command output on text evidence cards (#142)

* test: cover wait timer Main escalation hook (#143)

* test: cover wait timer main escalation hook

* test: run focused wait escalation journey in CI

* fix: record task-owned device processes in kill guard (#144)

* feat: refuse blocked status lines that declare waits (#146)

* feat(merge-on-green): route checks lint through done-done (#147)

* test(owner-rules): verify evidence gate contract (#145)

* fix: normalize trailing status verb colon (#148)

* Refuse sentinel relaunch without stored model (#150)

* fix(merge-on-green): resolve lint input paths and receipts (#149)

* fix(addons): reverse parked homes and owner guard installs (#151)

* fix(addons): reverse parked homes and owner guard installs

* test(addons): isolate uninstall journeys from user homes

* test(addons): isolate quota failover uninstall home

* Fail clearly when owner guard is missing (#152)

* Fail clearly when owner guard is missing

* Add owner guard installation doctor

* fix(addons): use moved receipt publisher path (#153)

* fix(addons): use moved receipt publisher path

* test(addons): exclude regression test from scan

* Make owner-rules card hint runnable across homes (#155)

* Add private captain chat TSV extractor (#154)

* Add private captain chat TSV extractor

* Filter injected chat transcript wrappers

* Filter Firstmate wake text from chat backfill

* Filter system-style transcript XML wrappers

* Add fleet-pulse chat TSV refresh hook (#156)

* Add incremental fleet-pulse refresh hook

* Add done-done proof for fleet-pulse refresh

* Add fleet pulse gate audit (#157)

* test(owner-rules): match stable checks-lint refusal (#158)

* Add stable Firstmate pane titles (#159)

* Fix quota failover screen matching (#160)

* Fix quota failover screen matching

* Add done-done proof for quota failover

* Keep quota proof out of code-only journey detection

* Make failover proof captures judgeable

* pipeline-quota-failover: pin the pipeline route to the OpenRouter DeepSeek floor route (#161)

* pipeline-quota-failover: pin the pipeline route to the OpenRouter DeepSeek floor route

The no-mistakes config holds agent_config.pi.model =
openrouter/deepseek/deepseek-v4.1-flash-1017:floor, but the wrapper's
default chain was claude-bridge/claude-haiku-5-5 then
openrouter/minimax/minimax-m3.1-flash:free. A pinned model outside the
chain does not run, so the config's route was not the route that ran: the
pipeline answered through claude-bridge while the config named the
OpenRouter DeepSeek floor route.

The default chain is now that one route, so the config's route is the
route that runs. An openrouter/* route also takes the deepseek idle
limit (300 s) instead of the generic 120 s one, because the floor route
answers on the same clock as direct DeepSeek.

The route fixture test pins the chain, the off-chain pin and the idle
class; the add-on README and the root README record the route and the
daemon environment caveat: the OpenRouter key lives only in the systemd
user manager environment, so after a reboot or a manager restart it has
to be re-imported from ~/.config/openrouter/api_key before the daemon
starts. The key is never copied into a file and never printed.

* pipeline-quota-failover: add the done-done route journey and its proof script

The verify skill names the persisted pipeline route as a feature, so
done-done needs a journey that drives it: run-proof.sh captures the
chain the wrapper holds and the fixture journey's output in the
evidence root, with a result.json summary and the exit code of each
capture. The route feature file names the paths the journey covers.

* pipeline-quota-failover: capture the route proof in the names the PR cites

The judge checks that every cited evidence file is tied to a done-done
run, so the journey now captures exactly the files the Checks block
names: the chain the wrapper holds, the live config's agent and model
read-only next to that chain, the fixture journey's output and the same
journey against the wrapper in main, which must fail.

* pipeline-quota-failover: persist the pipeline agent and route switch (#162)

* pipeline-quota-failover: persist the pipeline agent and route switch

The no-mistakes pipeline agent is global: every step (intent, rebase,
review, test, document, lint, push, PR, CI) runs the configured `agent`,
and a route that is not the one the config names changes what the whole
pipeline runs on. Switching that by hand meant editing the config
without a backup, without a check that the model actually answers, and
without a way back.

switch.sh does the switch the safe way: it edits only the two keys by
name (agent, agent_config.<agent>.model), leaves every other key, value
and comment alone, writes a timestamped backup next to the config first,
and keeps the backup's version unless a real request on the model
answers PONG. --dry-run prints the planned edit and writes nothing,
--restore-latest puts the last backup back. The script is persisted
byte-identical from the copy that runs this host's pipeline.

The test drives the real script against a fixture config and a stub pi:
the two keys change and nothing else does, a backup is written, a model
that does not answer PONG leaves the config alone, and the backup
restores it. The default model is the pipeline route the wrapper's
chain holds.

* pipeline-quota-failover: group the switch test with its add-on checks, restore the CI file's trailing newline

* Insights: name each waiting task's recorded reason, count parked apart from open (#164)

* Insights: show each waiting task's recorded reason and count parked work apart from open

* Insights: split recorded waits by real reason; Open counts active only

* Add done-done journey for the Insights wait-reasons card

* run-proof: stop the browser it started

* claude-accounts: quota reader and dashboard card (slice 1) (#165)

* claude-accounts: quota reader for every signed-in Claude account, plus dash…
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
…85e28b (kunchenguid#160)

* fix(pi): surface requested outcomes without replaying fleet events (#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

* feat(bin): add concurrent bounded remote transport lanes (#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(bin): accelerate and bound changed test runs (#3250)

* 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 ledgers (#3222)

* 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 provider call on startup context (#3158)

* 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 Pi 0.84.4 renderer compatibility (#3261)

* 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

* fix(bin): keep home-summary publication from starving supervision (#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

* fix(bin): prevent routine updates from hiding actionable status (#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

* docs(skills): split harness adapter operations reference (#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: centralize shared shell fixtures (#3296)

* 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

* refactor: retire legacy PR-check migration machinery (#3299)

* 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

* feat(bin): add trusted process-event extension bindings (#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 safety rules to promoted workers (#3269)

* 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 Lavish feedback as structured output (#3321)

* 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: keep task records and backlog transitions atomic (#3322)

* 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

* fix(bin): contain promote and Relay metadata publishing (#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.

* 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

---------

* fix(bin): absorb turn-end wakes during bounded pane churn (#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 (#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): safely unregister custom checks (#3369)

* 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.

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

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

---------

* refactor(quota): extract mid-task polling and candidate selection into dedicated scripts (#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: surface comments on Lavish annotations (#3371)

* 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.

* 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.

---------

* fix: support first public-followup registration on Bash 3.2 (#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(bin): isolate new Herdr server environments (#2792)

* fix(herdr): isolate server launch environment

* no-mistakes(review): Clear inh…
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
…unchenguid#192)

* feat(desk-floater): smaller button, voice controls, hotkeys and dictation

The floater's talk button is half its former size and sits beside four
small controls: Stop talking, Repeat the last reply, Mute voice, and Type.
Holding Right Option talks to Firstmate like holding the button; tapping
Right Command, or clicking Type, starts and finishes dictation, which
pastes the transcript into the focused text box and restores the
clipboard, never touching Firstmate's mailbox.

bin/fm-speak.sh gains --stop, --repeat, --mute, --unmute and --muted to
back the voice controls.

* no-mistakes(review): Treat mouse clicks during hotkeys as shortcut chords

* no-mistakes(review): Skip concealed clipboard items; show muted status on Repeat

* no-mistakes(ci): I fixed the failing "Declared fork surface" check. Its "Fail on changed source without test ownership" step stopped with `no changed-test mapping for source path: desk-floater/Sources/DeskFloater.swift`. **Cause:** PR kunchenguid#155 added a rule in `bin/fm-test-run.sh` that sent `desk-floater/Package.swift` and `desk-floater/Sources/*` to `tests/fm-deepgram-desk.test.sh`. The re-base in kunchenguid#160 (70082c3) removed that rule. Since then, test ownership for fork-only paths has been declared in `tests/fork-test-registry.conf`, but nobody moved the floater rule there. No test mentions the Swift sources by name, so the runner's fallback search finds no owner either. This PR is the first change to `DeskFloater.swift` since the re-base, so it is the first to hit the gap. **Fix** (two files, not yet committed): - `tests/fork-test-registry.conf`: added `covers` rows so that `desk-floater/Package.swift` and `desk-floater/Sources/*` both map to `tests/fm-deepgram-desk.test.sh`. That is the same owner as before, now declared where fork paths belong. - `fork-surface.conf`: added `modifies = tests/fork-test-registry.conf` to the `desk-floater-voice` capability, since the capability now edits that file. **Checks run locally:** - `bin/fm-fork-surface.sh check` passes: `FORK_SURFACE OK capabilities=76 owned_paths=232`. - `bin/fm-test-run.sh --list --changed --base 62182cb…` now exits 0 and includes `tests/fm-deepgram-desk.test.sh`. The CI log is the before case: that same command stopped with exit code 2. - `tests/fm-deepgram-desk.test.sh`, `tests/fm-fork-surface.test.sh` and `tests/fm-test-run.test.sh` all pass. The last one checks the registry's no-shadow rules. **Not handled:** "Behavior portable parallel 1" was cancelled without a result. It still needs a decision from you, not a code fix

* fix(desk-floater): turn hotkeys back on after a rebuild

macOS ties the floater's Accessibility grant to the exact build, so every
rebuild left Right Option and Right Command silently off: the floater only
ever asked for the permission once, and the only sign was a small
"(keys off)" label. It now asks once per build, shows an orange ! badge
and an orange status line while keys are off, and the badge asks again and
opens the Accessibility settings.
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
Merge kunchenguid/firstmate main at 8d2ee29
into the fork as a true two-parent merge, so git records the creator's
history as contained and startup drift reports the real gap.

The three-way merge used b85e28b (the tree the squashed kunchenguid#160 re-base
landed on) as its base and brings in 135 creator commits.
Every fork capability stays on top, adapted to the creator's code.

Fork pieces retired because the creator now does the same thing:
- session-lock own-acquisition ancestry check (creator's anchor pid and
  session sidecar own lock identity)
- Herdr lab --session delimiter placement (the fork keeps its stricter
  delimiter-shape validation)
- procevent pacing-race adaptive retry (creator's 15s floor)
- the one-off 45-minute serial CI cap (creator's timeout tiers and nine
  serial shards)

fork-surface.conf now records 8d2ee29 as upstream_base and the base
path snapshot is re-synced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants