Skip to content

chore: no-mistakes(test): make teardown content check portable across git versions - #137

Closed
e-jung wants to merge 6 commits into
kunchenguid:mainfrom
e-jung:fm/fm-force-guard-q1
Closed

e-jung wants to merge 6 commits into
kunchenguid:mainfrom
e-jung:fm/fm-force-guard-q1

Conversation

@e-jung

@e-jung e-jung commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Intent

The developer wanted to stop a prime-directive violation where firstmate could self-authorize fm-teardown.sh --force without captain approval. The goal was a deterministic structural guard so --force only takes effect when a captain-authorization token file (state/<id>.force-granted) exists, which firstmate may create only after the captain explicitly authorizes force-teardown of that specific task; without the token, --force must be inert and fall back to the normal safety check. The token must be consumed on every invocation (whether teardown succeeds or refuses), and every --force call must be logged to state/.force-audit.log with timestamp, task id, caller PID, and whether authorization was present. The developer also required a brief documentation comment explaining the two-step model, running existing tests and adding a test for the new guard, and keeping the fix minimal with no unrelated teardown refactoring. The change was to be shipped through the no-mistakes gate rather than any direct push.

What Changed

652237f no-mistakes(test): make teardown content check portable across git versions
cb52304 no-mistakes(review): grant force token in grok teardown test
7beb028 no-mistakes(document): docs: document teardown --force token guard in secondmate skill
3c53050 fix(teardown): clean up stale force-granted token on normal teardown
d6191c8 no-mistakes(document): docs: document teardown force-authorization token guard
c10d4e5 fix(teardown): require captain-authorization token for --force

Risk Assessment

✅ Low: The change is a well-bounded, well-tested structural guard with consistent docs; the single Round 1 finding is resolved and no new correctness, security, or behavioral issues were substantiated.

Testing

Baseline test command (full suite) ran green through every test file before timing out on cleanup (all ok lines printed); the three test files this change touches (fm-teardown, fm-secondmate-safety, fm-grok-harness) each pass in isolation with exit 0. The 4 new force-guard tests in fm-teardown.test.sh verify inert behavior, token consumption, the audit-log format (ISO-8601 UTC timestamp, task id, caller_pid, pid, authorized verdict), and stale-token cleanup. Beyond pass/fail, a manual end-to-end script drove the real fm-teardown.sh against a realistic local-only task holding unlanded crewmate work and captured the actual stderr, exit codes, and audit-log contents a firstmate user would see: --force without the token refused the unlanded work (exit 1, authorized=no), --force with the token discarded it (exit 0, authorized=yes), the token was one-shot, and a stale token did not survive normal teardown. Working tree left clean; evidence files are in the dedicated evidence directory.

Evidence: End-to-end force-guard demo transcript

>>> SCENARIO 1: --force WITHOUT captain-authorization token (must be INERT) worktree HEAD (unlanded work): 8d3ab88 token before: ABSENT exit code: 1 (expect 1 = safety check refused despite --force) --- stderr (what firstmate sees) --- WARNING: --force on task-x1 is not captain-authorized (no .../inert/state/task-x1.force-granted token). firstmate cannot self-authorize --force; falling back to normal safety checks. REFUSED: local-only worktree .../inert/wt has work not yet merged into main and not on any remote. commits not yet on main: 8d3ab88 unpushed crewmate work that has NOT landed Merge the branch into local main first ... or get the captain's explicit OK to discard, then --force. --- audit log line --- 2026-07-01T10:18:52Z task=task-x1 caller_pid=867322 pid=867368 authorized=no token after: ABSENT (consumed even though the run was inert) >>> SCENARIO 2: --force WITH captain-authorization token (escape hatch takes effect) token before: present exit code: 0 (expect 0 = captain-authorized discard succeeded) --- audit log line --- 2026-07-01T10:18:53Z task=task-x1 caller_pid=867322 pid=867468 authorized=yes token after: ABSENT (consumed on success) >>> SCENARIO 3: token consumed even on a successful run -> a second --force needs a fresh captain OK first authorized --force exit: 0 token after first run: ABSENT (one-shot: gone after use) audit entries for task-x1: 1 >>> SCENARIO 4: normal teardown (no --force) cleans a stale token so it cannot linger token before normal teardown: present exit code: 0 (expect 0 = landed work torn down normally) token after normal teardown: ABSENT (stale authorization must not survive)


========================================================
>>> SCENARIO 1: --force WITHOUT captain-authorization token (must be INERT)
========================================================
worktree HEAD (unlanded work): 8d3ab88
token before: ABSENT
exit code: 1  (expect 1 = safety check refused despite --force)
--- stderr (what firstmate sees) ---
WARNING: --force on task-x1 is not captain-authorized (no /tmp/fm-force-guard-demo.B3WQNy/inert/state/task-x1.force-granted token).
firstmate cannot self-authorize --force; falling back to normal safety checks.
REFUSED: local-only worktree /tmp/fm-force-guard-demo.B3WQNy/inert/wt has work not yet merged into main and not on any remote.
commits not yet on main:
8d3ab88 unpushed crewmate work that has NOT landed
Merge the branch into local main first (bin/fm-merge-local.sh after the captain approves), or push to a fork/remote, or get the captain's explicit OK to discard, then --force.
--- audit log line ---
2026-07-01T10:18:52Z task=task-x1 caller_pid=867322 pid=867368 authorized=no
token after: ABSENT   (consumed even though the run was inert)

========================================================
>>> SCENARIO 2: --force WITH captain-authorization token (escape hatch takes effect)
========================================================
token before: present
exit code: 0  (expect 0 = captain-authorized discard succeeded)
--- stderr ---
--- audit log line ---
2026-07-01T10:18:53Z task=task-x1 caller_pid=867322 pid=867468 authorized=yes
token after: ABSENT   (consumed on success)

========================================================
>>> SCENARIO 3: token consumed even on a successful run -> a second --force needs a fresh captain OK
========================================================
first authorized --force exit: 0
token after first run: ABSENT   (one-shot: gone after use)
audit entries for task-x1: 1

========================================================
>>> SCENARIO 4: normal teardown (no --force) cleans a stale token so it cannot linger
========================================================
token before normal teardown: present
exit code: 0  (expect 0 = landed work torn down normally)
token after normal teardown: ABSENT   (stale authorization must not survive)

========================================================
>>> DEMO COMPLETE - all four guard behaviors verified end-to-end
========================================================
Evidence: Demo script (reproducible)
#!/usr/bin/env bash
# End-to-end demonstration of the fm-teardown --force captain-authorization
# guard (prime directive #3). Drives the REAL bin/fm-teardown.sh against a
# realistic local-only task with UNLANDED work - exactly the scenario --force
# is meant to discard, and exactly what must be protected unless the captain
# explicitly authorized it.
set -u
ROOT="/home/ubuntu/.no-mistakes/worktrees/507cc8072d97/01KWEG6A3YP7ZWWMKXJ19Z2BZZ"
. "$ROOT/tests/lib.sh"
fm_git_identity fmtest fmtest@example.invalid

TEARDOWN="$ROOT/bin/fm-teardown.sh"
TMP_ROOT=$(fm_test_tmproot fm-force-guard-demo)

make_case() {
  local name=$1 case_dir fakebin
  case_dir="$TMP_ROOT/$name"
  fakebin="$case_dir/fakebin"
  mkdir -p "$case_dir/state" "$case_dir/config" "$fakebin"
  printf '#!/usr/bin/env bash\nexit 0\n' > "$fakebin/treehouse"; chmod +x "$fakebin/treehouse"
  printf '#!/usr/bin/env bash\nexit 0\n' > "$fakebin/tmux"; chmod +x "$fakebin/tmux"
  cat > "$fakebin/gh-axi" <<'SH'
#!/usr/bin/env bash
case "${1:-} ${2:-}" in
  "pr list") printf '%s\n' "count: 0 (showing first 0)" "pull_requests[]: []" ; exit 0 ;;
  "pr view") echo "error: pull request not found" >&2 ; exit 1 ;;
esac
exit 0
SH
  cat > "$fakebin/gh" <<'SH'
#!/usr/bin/env bash
case "${1:-} ${2:-}" in
  "pr view") echo "error: pull request not found" >&2 ; exit 1 ;;
esac
exit 0
SH
  chmod +x "$fakebin/gh-axi" "$fakebin/gh"
  git init -q --bare "$case_dir/origin.git"
  git -C "$case_dir/origin.git" symbolic-ref HEAD refs/heads/main
  git clone -q "$case_dir/origin.git" "$case_dir/_seed" 2>/dev/null
  git -C "$case_dir/_seed" -c user.email=t@t -c user.name=t commit -q --allow-empty -m "origin baseline"
  git -C "$case_dir/_seed" push -q origin main
  rm -rf "$case_dir/_seed"
  git clone -q "$case_dir/origin.git" "$case_dir/project"
  git -C "$case_dir/project" remote set-head origin main 2>/dev/null || true
  git -C "$case_dir/project" worktree add -q -b fm/task-x1 "$case_dir/wt" main
  touch "$case_dir/state/.last-watcher-beat"
  printf '%s\n' "$case_dir"
}

write_meta() {
  fm_write_meta "$1/state/task-x1.meta" \
    "window=fm-task-x1" "worktree=$1/wt" "project=$1/project" "kind=$3" "mode=$2"
}
grant_force() { touch "$1/state/task-x1.force-granted"; }
wt_commit() { git -C "$1/wt" -c user.email=t@t -c user.name=t commit -q --allow-empty -m "${2:-wt work}"; }
run_teardown() {
  local case_dir=$1; shift
  FM_ROOT_OVERRIDE="$ROOT" FM_STATE_OVERRIDE="$case_dir/state" FM_CONFIG_OVERRIDE="$case_dir/config" \
    PATH="$case_dir/fakebin:$PATH" "$TEARDOWN" task-x1 "$@"
}
# token status without nested-quote pitfalls: echoes "present" or "absent"
tok() { if [ -f "$1/state/task-x1.force-granted" ]; then echo "present"; else echo "ABSENT"; fi; }
banner() { printf '\n========================================================\n>>> %s\n========================================================\n' "$1"; }

banner "SCENARIO 1: --force WITHOUT captain-authorization token (must be INERT)"
c=$(make_case inert)
write_meta "$c" local-only ship
wt_commit "$c" "unpushed crewmate work that has NOT landed"
echo "worktree HEAD (unlanded work): $(git -C "$c/wt" rev-parse --short HEAD)"
echo "token before: $(tok "$c")"
set +e; run_teardown "$c" --force >"$c/out" 2>"$c/err"; rc=$?; set -e
echo "exit code: $rc  (expect 1 = safety check refused despite --force)"
echo "--- stderr (what firstmate sees) ---"; cat "$c/err"
echo "--- audit log line ---"; cat "$c/state/.force-audit.log"
echo "token after: $(tok "$c")   (consumed even though the run was inert)"

banner "SCENARIO 2: --force WITH captain-authorization token (escape hatch takes effect)"
c=$(make_case authd)
write_meta "$c" local-only ship
wt_commit "$c" "unpushed crewmate work the captain approved discarding"
grant_force "$c"
echo "token before: $(tok "$c")"
set +e; run_teardown "$c" --force >"$c/out" 2>"$c/err"; rc=$?; set -e
echo "exit code: $rc  (expect 0 = captain-authorized discard succeeded)"
echo "--- stderr ---"; sed -n '1,5p' "$c/err"
echo "--- audit log line ---"; cat "$c/state/.force-audit.log"
echo "token after: $(tok "$c")   (consumed on success)"

banner "SCENARIO 3: token consumed even on a successful run -> a second --force needs a fresh captain OK"
c=$(make_case refuse-consume)
write_meta "$c" local-only ship
wt_commit "$c" "unpushed work"
grant_force "$c"
set +e; run_teardown "$c" --force >"$c/out1" 2>"$c/err1"; rc1=$?; set -e
echo "first authorized --force exit: $rc1"
echo "token after first run: $(tok "$c")   (one-shot: gone after use)"
echo "audit entries for task-x1: $(grep -c 'task=task-x1' "$c/state/.force-audit.log" 2>/dev/null || true)"

banner "SCENARIO 4: normal teardown (no --force) cleans a stale token so it cannot linger"
c=$(make_case stale)
write_meta "$c" local-only ship
wt_commit "$c" "landed work"
git -C "$c/project" update-ref refs/heads/main "$(git -C "$c/wt" rev-parse HEAD)"
grant_force "$c"
echo "token before normal teardown: $(tok "$c")"
set +e; run_teardown "$c" >"$c/out" 2>"$c/err"; rc=$?; set -e
echo "exit code: $rc  (expect 0 = landed work torn down normally)"
echo "token after normal teardown: $(tok "$c")   (stale authorization must not survive)"

banner "DEMO COMPLETE - all four guard behaviors verified end-to-end"
- Outcome: 🔧 1 issue found → auto-fixed ✅ across 2 runs (25m18s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

🔧 **Rebase** - 2 issues found → auto-fixed ✅
  • ⚠️ AGENTS.md - merge conflict rebasing onto origin/main
  • ⚠️ tests/fm-teardown.test.sh - merge conflict rebasing onto origin/main

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

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ tests/fm-grok-harness.test.sh:110 - test_grok_teardown_removes_pointer_and_token invokes &#34;$TEARDOWN&#34; &#34;$id&#34; --force WITHOUT creating the state/&lt;id&gt;.force-granted token first, unlike every other force-teardown test in this PR (which all grant via grant_force/grant_domain_force). With the new guard, --force is INERT here, so FORCE is cleared and the normal safety checks run. The test still passes only incidentally: the fixture worktree (fm_git_worktree) has HEAD identical to the default-branch commit, so content_in_default() (fm-teardown.sh:239) returns true and teardown is allowed. This means the test no longer exercises its original intent (force-bypass of checks) and becomes fragile — any future commit added to that fixture worktree would make content_in_default return false, causing teardown to REFUSE and the test to fail with a confusing message unrelated to what the test asserts. Add touch &#34;$home/state/$id.force-granted&#34; before the teardown call to mirror the established grant pattern and restore the intended force-teardown semantics.

🔧 Fix: grant force token in grok teardown test
✅ Re-checked - no issues remain.

🔧 **Test** - 1 issue found → auto-fixed ✅
  • 🚨 tests failed with exit code 1
  • 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"

🔧 Fix: make teardown content check portable across git versions
✅ Re-checked - no issues remain.

  • 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"
  • tests/fm-teardown.test.sh (full suite, incl. test_force_without_token_is_inert, test_force_consumes_token, test_force_audit_log, test_normal_teardown_cleans_stale_force_token) -> all pass, exit 0
  • tests/fm-secondmate-safety.test.sh (force-teardown cases now grant the domain force token) -> all pass, exit 0
  • tests/fm-grok-harness.test.sh (grok teardown grants the force token) -> all pass, exit 0
  • manual e2e: bash /tmp/no-mistakes-evidence/01KWEG6A3YP7ZWWMKXJ19Z2BZZ/force-guard-demo.sh driving the REAL bin/fm-teardown.sh against a local-only task with unlanded work across 4 scenarios (inert --force, authorized --force, one-shot token consumption, stale-token cleanup by normal teardown) -> exit 0
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@e-jung e-jung changed the title feat: add X-mode, persistent secondmates, and away-mode supervision fix(teardown): require captain-authorization token for --force Jun 29, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Thanks for the PR. Wheelhouse found that this branch currently has a merge conflict with the base branch, so it is stepping out of the maintainer queue for now.

Please rebase on or merge the base branch into your branch, resolve the conflict, and push the result. Once GitHub reports the PR as mergeable again, Wheelhouse will resurface it for maintainer review.

Conflict noted for firstmate#137 at 55380474.

@e-jung
e-jung force-pushed the fm/fm-force-guard-q1 branch from 5538047 to 652237f Compare July 1, 2026 10:32
@e-jung e-jung changed the title fix(teardown): require captain-authorization token for --force chore: no-mistakes(test): make teardown content check portable across git versions Jul 1, 2026
crewmate and others added 6 commits July 1, 2026 10:35
--force bypasses teardown's work-not-landed, dirty, scout-report, and
secondmate-child safety checks, so it can discard unreviewed work. Per prime
directive #3 firstmate must never self-authorize it, but the script had no
structural barrier: firstmate could run --force on its own judgment.

Add a two-step guard that separates decision from authorization:
  1. The captain explicitly OKs discarding THIS task's work.
  2. firstmate records that as state/<id>.force-granted.
  3. firstmate runs fm-teardown.sh <id> --force.

--force takes effect only when the token exists; without it, --force is INERT
(FORCE is cleared, normal safety checks run). The token is consumed on every
--force invocation (success or refuse), so each force-teardown needs a fresh
captain OK and a stale token can never carry over. Every --force invocation is
logged to state/.force-audit.log with timestamp, task id, caller pid, and the
authorization verdict.

By reassigning FORCE based on authorization, all existing --force comparisons
behave correctly with no changes to the rest of the teardown logic.

Update the force-teardown tests to grant the token (they model
captain-authorized discards), and add coverage for the inert-without-token,
token-consumed, and audit-log behaviors. Document the two-step model in
AGENTS.md (prime directive #3, secondmate teardown, state layout).
The --force guard only runs (and consumes the captain-authorization token)
when --force is passed. If firstmate recorded a token at state/<id>.force-granted
but then ran a NORMAL teardown without --force, the token survived teardown and
could linger as stale authorization. Add the token to the final per-task state
cleanup so it is removed alongside the task's other volatile state regardless of
how teardown ran. On an authorized --force teardown the token is already consumed
up front, so this is a harmless no-op there; it only matters for the stale-token
case. Addresses the review finding from the gate run.
@e-jung
e-jung force-pushed the fm/fm-force-guard-q1 branch from 652237f to d7b917d Compare July 1, 2026 10:36
@kunchenguid

Copy link
Copy Markdown
Owner

Thanks for the PR! It looks like this branch has a merge conflict with the base branch right now. When you get a chance, could you rebase onto (or merge in) the latest base branch, resolve the conflict, and push? Once GitHub shows the PR as mergeable again, it'll be picked back up for review.

Noted for firstmate#137 at d7b917d7.

@kunchenguid

Copy link
Copy Markdown
Owner

Quick reminder: this PR still looks blocked on a rebase or merge conflict fix.

If you are still interested, please rebase onto the current base branch, resolve the conflict, and push.

If I do not hear back, I may close this as inactive.

@kunchenguid

Copy link
Copy Markdown
Owner

I am closing this because it has been waiting on a rebase or merge-conflict fix since 2026-07-01, and I have not seen a comment or push since then.

If you still want to keep working on this, please reopen it or open a new PR and mention this one.

Happy to take another look when there is an update.

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…
@AustinDKB

Copy link
Copy Markdown

Old vs new kill odds per map and level

In-sight kill odds per pair-poll (all bins, per 1,000; near is 0-700 units flat, far is 1,100+ units):

Map Level 22 Oct 26 Oct gated Change Near Far
Estate 1 7.23 5.48 -24% 60.2 to 51.0 3.70 to 2.26
Estate 50 9.98 7.06 -29% 73.5 to 63.7 6.82 to 3.75
Estate 100 9.91 5.94 -40% 77.7 to 64.6 7.43 to 3.10
Estate 150 10.09 5.32 -47% 80.8 to 59.7 7.68 to 2.66
Estate 200 10.14 5.21 -49% 86.0 to 62.3 7.85 to 2.76
Highrise 1 11.69 8.57 -27% 46.0 to 41.8 6.02 to 2.76
Highrise 50 15.51 10.20 -34% 57.7 to 53.0 9.09 to 3.81
Highrise 100 14.68 9.10 -38% 51.8 to 49.2 8.52 to 3.07
Highrise 150 14.09 9.03 -36% 52.4 to 50.2 7.89 to 2.85
Highrise 200 14.45 8.39 -42% 52.8 to 51.3 8.29 to 2.50
Invasion 1 13.11 10.40 -21% 42.4 to 43.0 3.67 to 2.45
Invasion 50 14.84 11.56 -22% 48.5 to 49.6 6.20 to 3.32
Invasion 100 17.92 11.00 -39% 60.5 to 48.5 8.52 to 3.08
Invasion 150 17.39 10.45 -40% 55.3 to 49.9 8.15 to 2.45
Invasion 200 17.99 9.84 -45% 61.0 to 45.7 8.21 to 2.64
Rust 1 23.98 20.54 -14% 43.4 to 43.8 6.35 to 3.79
Rust 50 32.82 26.23 -20% 58.8 to 53.9 11.47 to 6.00
Rust 100 32.22 24.81 -23% 54.8 to 51.7 11.26 to 4.81
Rust 150 35.02 25.94 -26% 60.1 to 56.3 13.36 to 4.55
Rust 200 36.07 25.29 -30% 64.5 to 56.1 14.93 to 4.39

Head-only exposures (gated vs 22 Oct, 20 recordings per map and level)

map level | head-only kills/1000 dir-polls: old (gate off) -> gated [ungated same matches] | body: old -> gated | head-only share of gated exposures
mp_estate L1 | 0.19 (2/10265) -> 0.07 (1/14087) [0.08] | 4.27 -> 3.33 | 8.0%
mp_estate L50 | 0.27 (2/7291) -> 0.15 (2/13695) [0.29] | 6.73 -> 4.20 | 8.5%
mp_estate L100 | 0.89 (9/10126) -> 0.27 (4/14680) [0.83] | 6.22 -> 3.99 | 8.3%
mp_estate L150 | 0.92 (8/8710) -> 0.26 (4/15550) [0.52] | 6.75 -> 3.28 | 8.8%
mp_estate L200 | 0.92 (7/7627) -> 0.34 (5/14741) [0.94] | 6.80 -> 3.16 | 8.1%
mp_highrise L1 | 0.00 (0/3252) -> 0.32 (2/6314) [0.54] | 6.91 -> 5.05 | 3.5%
mp_highrise L50 | 1.35 (5/3704) -> 0.30 (2/6652) [0.68] | 9.18 -> 5.91 | 3.9%
mp_highrise L100 | 0.00 (0/4033) -> 0.53 (3/5682) [1.66] | 8.75 -> 5.41 | 3.5%
mp_highrise L150 | 0.34 (1/2962) -> 0.34 (2/5875) [2.48] | 8.15 -> 5.17 | 3.9%
mp_highrise L200 | 0.73 (3/4118) -> 0.00 (0/5986) [2.29] | 7.94 -> 4.79 | 3.7%
mp_invasion L1 | 0.00 (0/2224) -> 0.00 (0/3139) [0.95] | 8.15 -> 6.43 | 2.9%
mp_invasion L50 | 0.34 (1/2916) -> 0.00 (0/3987) [0.50] | 8.71 -> 7.18 | 3.8%
mp_invasion L100 | 1.20 (2/1670) -> 0.00 (0/3876) [0.80] | 11.30 -> 6.38 | 3.8%
mp_invasion L150 | 0.99 (2/2018) -> 0.50 (2/4022) [1.13] | 11.23 -> 5.48 | 3.9%
mp_invasion L200 | 0.00 (0/1461) -> 0.29 (1/3502) [1.33] | 12.64 -> 5.77 | 3.9%
mp_rust L1 | 0.25 (1/4023) -> 0.28 (2/7068) [0.30] | 14.97 -> 12.68 | 7.2%
mp_rust L50 | 0.77 (3/3897) -> 0.54 (4/7447) [1.07] | 20.13 -> 16.44 | 8.4%
mp_rust L100 | 1.58 (6/3790) -> 0.39 (3/7646) [1.37] | 21.41 -> 15.79 | 8.8%
mp_rust L150 | 1.90 (7/3677) -> 0.94 (7/7477) [2.52] | 23.09 -> 17.33 | 9.4%
mp_rust L200 | 1.76 (8/4557) -> 0.14 (1/7081) [1.78] | 24.88 -> 16.67 | 9.2%

Sanity check (sim_evolve.py header, same 300 seeds)

Before (22 Oct fits):

sanity: pressure-v1 vs pressure-v2 sim 53% (16/30) real 57% (57/100); pressure-v2 vs pressure-v1 sim 57% (17/30) real 43% (43/100); neat-v6 vs pressure-v1 sim 43% (13/30) real 61% (30/49); neat-v6 vs pressure-v2 sim 48% (14.5/30) real 36% (12/33); neat-v3 vs pressure-v1 sim 57% (17/30) real 42% (25/59); neat-v3 vs pressure-v2 sim 43% (13/30) real 56% (143/256); rtneat-v1 vs pressure-v1 sim 47% (14/30) real 60% (65/108); rtneat-v1 vs pressure-v2 sim 33% (10/30) real 46% (109/236); cosyne-v1 vs pressure-v1 sim 33% (10/30) real 0% (0/3); cosyne-v1 vs pressure-v2 sim 20% (6/30) real 60% (3/5)
kills/match: pressure-v1-pressure-v2 135.4, pressure-v2-pressure-v1 137.9, neat-v6-pressure-v1 143.4, neat-v6-pressure-v2 140.8, neat-v3-pressure-v1 142.9, neat-v3-pressure-v2 143.6, rtneat-v1-pressure-v1 143.4, rtneat-v1-pressure-v2 139.6, cosyne-v1-pressure-v1 134.3, cosyne-v1-pressure-v2 136.0

After (26 Oct gated fits):

sanity: pressure-v1 vs pressure-v2 sim 60% (18/30) real 57% (57/100); pressure-v2 vs pressure-v1 sim 48% (14.5/30) real 43% (43/100); neat-v6 vs pressure-v1 sim 50% (15/30) real 61% (30/49); neat-v6 vs pressure-v2 sim 50% (15/30) real 36% (12/33); neat-v3 vs pressure-v1 sim 43% (13/30) real 43% (26/60); neat-v3 vs pressure-v2 sim 40% (12/30) real 56% (143/256); rtneat-v1 vs pressure-v1 sim 53% (16/30) real 60% (65/108); rtneat-v1 vs pressure-v2 sim 50% (15/30) real 46% (109/236); cosyne-v1 vs pressure-v1 sim 17% (5/30) real 0% (0/3); cosyne-v1 vs pressure-v2 sim 37% (11/30) real 60% (3/5)
kills/match: pressure-v1-pressure-v2 112.9, pressure-v2-pressure-v1 115.2, neat-v6-pressure-v1 116.8, neat-v6-pressure-v2 112.3, neat-v3-pressure-v1 115.7, neat-v3-pressure-v2 113.6, rtneat-v1-pressure-v1 111.0, rtneat-v1-pressure-v2 108.1, cosyne-v1-pressure-v1 107.1, cosyne-v1-pressure-v2 114.1

Real kills a match, levels 1-100, same lab matches: 112.0.

fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
…d a test registry (kunchenguid#137)

* feat(test): register the gateway-v2 suite and pin teardown's browse degrade

TD1, the isolated browse session close in bin/fm-teardown.sh, is already a
compliant hook and is carried unchanged: an -x guard, a best-effort call, and
the purge of state/browse/<id> deliberately outside the guard so it runs either
way. What it lacked was a test. An absent fork script must not block teardown
and must not leave a worker's browser profile behind, and nothing asserted
that. The new case builds a faithful root by symlink with exactly that one file
missing, so the real checkout is never mutated, and asserts teardown completes
and the browse state is gone. It catches the regression that matters most here,
the purge being moved inside the guard.

The gateway-v2 suite's family label also moves out of the runner's own family
case into the fork registry. Its declared surface follows: the capability now
modifies the registry rather than the runner, and its anchor points at the
registry row rather than the case line it no longer has.

Not carried, and worth recording: bin/fm-brief.sh adds two fork lines to each
generated brief telling workers to use an isolated browse session. Upstream has
the surrounding instruction but not those lines, so it is real divergence. The
hook-point map has no entry for it, it is prose rather than behaviour, and
inventing a hook to inject four lines of text into a heredoc would cost more
than it saves, so it stays declared rather than extracted.

* no-mistakes(document): docs: pin teardown browse purge invariant in worker-browsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants