Skip to content

feat: sync upstream firstmate through fe939017 - #72

Merged
TastyTom13 merged 583 commits into
mainfrom
fm/fm-upstream-sync-nov29
Nov 30, 2026
Merged

TastyTom13 merged 583 commits into
mainfrom
fm/fm-upstream-sync-nov29

Conversation

@TastyTom13

@TastyTom13 TastyTom13 commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Intent

Yes on pulling the newest firstmate version, make sure it doesn't overwrite the adjustments and tweaks we made ourselves meanwhile. Asses first which changes the new firstmate version has and if they are relevant/valuable for us before implementing them blindly.

(Context. The assessment is done. It found about a third of upstream valuable here, the rest unused and switched off on arrival, 63 real conflicts once the 1 October sync link is restored, and named for each conflict which side wins so that none of our own changes is lost.)

What the assessment found and decided, in substance:

  • Take the update from upstream kunchenguid/firstmate pinned at commit fe93901, after restoring the 1 October sync link (a no-change merge of upstream 23e5584, which our squashed PR merge: sync upstream kunchenguid/firstmate through 23e55847, keeping every fork change #48 already synced) so only the 63 real conflicts remain.
  • Valuable upstream parts: Claude-primary robustness, watcher and wake-queue correctness, Herdr fixes, safer cleanup that never loses late worker changes, safer PR merges, smarter stuck-worker alarms, captain-hold improvements, Pi worker fixes, CI shape, test portability. New worker tools, runtimes, forges, account switching and other opt-in features arrive switched off and stay off.
  • Base branch option: upstream's --base-branch becomes the canonical name, our --base keeps working as an alias, and both the base= and base_branch= task record keys are read, so live task records and the cockpit keep working; our --expect-base merge check stays.
  • Features built on both sides: upstream wins for wait-no-turns, the Lavish list-form answer parser (our board answers must still reach the captain hold), the test split and shard layout (our duplicate -2/-3 split files go), and the lock wait when its folder is gone; our watcher exit when its state folder vanishes stays.
  • Our behaviour wins or is kept alongside upstream for: a no-mistakes ship's done line must name a PR URL (pr=manual projects exempt); the brief scaffold sections, flags and placeholders the cockpit depends on, merged with upstream's new flags; the fleet ledger and retained close note on captain holds; the context-budget nudge in the turn-end guard, routed through upstream's exit, with upstream's stow guard left off; the GitHub token cache in the contribution poll; free-lane and Pi node launch placeholders in spawn; cleanup's follow-ups gate, owner-notes collection, Chrome bridge sweep, model attribution note and Herdr presentation retire, beside upstream's cleanup additions; the PR merge base check and required checks, beside upstream's new merge options; the bearings board panels and the durable board path, so board input is never lost; and our declared-pause and watcher threshold rules.
  • Docs and lists: take both sides' entries.

What Changed

  • Merges upstream kunchenguid/firstmate through fe939017, after a no-change merge that restores the 23e55847 sync link. It changes supervision, the watcher and wake queue, Herdr handling, cleanup, PR merging, stuck-worker alarms, captain holds, Pi workers, CI and the test layout.
  • Adds upstream's new runtime backends (Paseo, Rex, T3 Code, tern, hc), worker harnesses, forge and PR options (Forgejo, external review, pr=manual) and tools such as /lavish-url, the usage warner and the stow guard. Optional features stay opt-in, though Rex and hc can also be auto-detected from inside their own environments.
  • Keeps fork behaviour alongside the upstream changes, including --base as an alias for --base-branch (older base= task records are still read), the --expect-base merge check, required PR checks, brief scaffold sections, the PR URL done-line rule, captain-hold ledger records, the context-budget nudge, extra cleanup steps, the contribution poll's GitHub token cache, board input handling and declared-pause rules.

🤖 Generated with Claude Code

Risk Assessment

⚠️ Medium: No new defect found in the clash resolutions and follow-up fixes I read, but this is a 662-file upstream sync whose upstream-only code, most tests and most docs were not read line by line, and no tests were run in this review.

Testing

Go, with 6 scenarios not tested live. I drove these for real in disposable homes: brief creation, worker start on a named base branch (in a Herdr lab, a safe practice terminal setup), the done-needs-a-PR-link rule, cleanup guards, captain holds (questions that wait for the owner), the context nudge, the watcher exit, and a real board click in a private Lavish server and browser. Not tested live: - List-form board answer. I rewrote a real capture by hand, and the real parser read it. This Lavish version sent table form. - PR merge base check. Test file only, with a stand-in GitHub. - Contribution poll. Test file only, with a stand-in GitHub. - Free-lane and Pi node worker start. Test files only. - Declared pause and watcher thresholds. Test files only. - Chrome bridge sweep (cleanup of leftover browser processes). Test file only, with stand-in processes. Other limits: lab workers were stand-in commands, not real AI agents. For the done-line check I set the worker's idle state by hand. Targeted test files ran one at a time with no failing case seen. fm-watch-triage-pause was cut by my 10 minute timer after 45 passing cases, so its other cases did not run. The fm-teardown test file was not run (I drove cleanup live instead). The fm-contributions exit code was not recorded because I restarted the runner to reorder it, but its log reached the last case with no failure. I did not drive the other upstream fixes (Pi worker fixes, stuck-worker alarms, Herdr presentation retire) one by one, and I did not audit every one of our own changes line by line.

  • Live validation: ✅ go - 13 of 19 scenarios driven live against the product
Scenario Result Live Evidence
Making a brief with --base-branch or the old --base gives the same brief; a bad base, a local-only base and a missing --done-when are refused ✅ pass live 01-brief-flags.txt; the two briefs were identical apart from the task id
A pr=manual brief carries no PR-URL done rule, a --ui brief keeps screenshots committed, and forgejo briefs name no gh command ✅ pass live 02-brief-content.txt
Starting a worker on a base branch uses that branch and records it; a missing or different base is refused ✅ pass live 03-spawn-base.txt (Herdr lab, stand-in worker command)
A task record with only the old base= key still diffs against that base ✅ pass live 05-legacy-base-key.txt
A no-mistakes worker saying done without a PR URL (or with only an issue link) reads as blocked; a pr=manual project reads as done ✅ pass live 04-done-needs-pr-url.txt
Cleanup never throws away late worker changes and refuses until follow-ups are recorded ✅ pass live 06-teardown-guards.txt
A successful cleanup collects the owner's notes, writes the model note on the closed task and closes the worker pane ✅ pass live 07-teardown-success.txt
Cleaning up a task with an open question keeps it held with the model note; answering closes it and the fleet ledger records each step ✅ pass live 08-captain-hold.txt
An idle primary with a large context gets one /stow nudge, and the upstream stow guard stays off unless switched on ✅ pass live 09-turnend-nudge.txt
The watcher exits when its state folder is deleted, and a lock wait on a missing folder returns ✅ pass live 10-watcher-folder-gone.txt
The bearings board builds at the durable data/.lavish path with its panels, and refuses a temp-folder path ✅ pass live 11-board-before-answer.png; fm-bearings-board and fm-bearings-board-render tests in 16-targeted-tests.txt
Clicking an answer on the board, with or without a typed note, reaches the captain hold and closes it ✅ pass live 13-board-answer-sent.png, 14-board-answer-to-hold.txt, 17-board-answer-with-note.txt
A list-form Lavish capture of a board answer is still read as that answer ⏸️ untested no No live result. Both live board rounds used the installed Lavish, which sent table form only. The only list-form check used a real capture rewritten by hand (noted in 17-board-answer-with-note.txt). A…
PR merge refuses a base that differs from --expect-base and keeps its merge guards ⏸️ untested no No live result. Only tests/fm-pr-merge.test.sh with a stand-in GitHub covered this (log 16-targeted-tests.txt). A real merge attempt would act on a real repository. A live check needs a disposable Git…
The contribution poll reads the GitHub token once per poll and marks final records settled ⏸️ untested no No live result. Only tests/fm-contributions.test.sh with a stand-in GitHub covered this, and its exit code was not recorded. A live check needs authority to run the poll with a real GitHub token again…
Free-lane and Pi node launch placeholders are filled at worker start ⏸️ untested no No live result. Only tests/fm-spawn-free-lane.test.sh and tests/fm-spawn-pi-node.test.sh covered this. No real Pi or free-lane worker was launched. A live check needs a configured Pi harness and free-…
A declared pause is not treated as a stuck worker, and the watcher threshold file is honoured ⏸️ untested no No live result, and no live drive of this was recorded. Only tests/fm-watch-thresholds.test.sh and tests/fm-watch-triage-pause.test.sh covered it. The pause test file was cut by a 10 minute timer afte…
Cleanup's Chrome bridge sweep retires the worker's browser processes ⏸️ untested no No live result, and no live drive of this was recorded. Only tests/fm-chrome-bridge-sweep.test.sh with stand-in processes covered it. A live check needs a lab worker that starts its own isolated Chrom…
The duplicate -2/-3 test files are gone and the runner still covers every test file ✅ pass live 15-test-layout.txt

Board before the answer

Evidence: Board click closes the captain hold

Source: Board click closes the captain hold

--- captured browser result
session:
  file: <worktree>/.fmv-lab/data/.lavish/bearings-board.html
  status: feedback
prompts[1]{uid,prompt,selector,tag,text}:
  "1","Captain's Call answer - Pick the button colour: blue\n\nContext data:\n{\n  \"schema\": \"fm-bearings-answer.v1\",\n  \"question\": \"pick-colour\",\n  \"selection\": \"blue\",\n  \"note\": \"\
next_step: "Apply the requested changes to <worktree>/.fmv-lab/data/.lavish/bearings-board.html. Do not respond to the user just yet. I
dom_snapshot: "uid=2 body \"bearings 1 NEED YOU 1 UNDERWAY 0 LANDED RECENTLY 0 CHARTED NEXT CAPTAIN'S CALL 1\"\n  uid=3 header \"bearings\"\n    uid=4 div \"bearings\"\n      uid=5 span \"bearings\"\n
--- backlog after the click
- [x] pick-colour - Pick the button colour (repo: repo) (kind: captain) (done 2026-11-30) (hold: fm-hold-v1:UGljayB0aGUgYnV0dG9uIGNvbG91cg==) (hold-kind: captain)
  Resolution recorded by fm-captain-hold.
  Decision digest: f4a78e30f324d0c97f3a94736acab4c66019a292920ede7def6df859df3f3955
  Resolution mode: answered

  Captain decision:
  Captain answered this call through the captured result lavish-386593f549ab5d5c sequence 1.
  Task: pick-colour
  Answer: blue
  Answer as shown to the captain: Pick the button colour -> blue
Evidence: Answer with a note, table form and list form

Source: Answer with a note, table form and list form

--- real capture from the browser (answer plus typed note)
pick-colour	green	Pick the button colour -> green
prompts[2]{uid,prompt,selector,tag,text}:
  "1","Captain's Call answer - Pick the button colour: green\n\nContext data:\n{\n  \"schema\": \"fm-bearings-answer.v1\
  "",Also keep the border thin.,"",message,Freeform message
next_step: "Apply the requested changes to <worktree>/.
dom_snapshot: "uid=2 body \"bearings 1 NEED YOU 1 UNDERWAY 0 LANDED RECENTLY 0 CHARTED NEXT CAPTAIN'S CALL 1\"\n  uid=3 
--- same real answer rewritten into Lavish list form (hand-converted, not emitted by this lavish-axi run)
prompts[2]:
  - uid: "1"
    prompt: "Captain's Call answer - Pick the button colour: green\n\nContext data:\n{\n  \"schema\"
    selector: "div#bb-call > div > div > form"
    tag: "choice"
    text: "Pick the button colour -> green"
  - uid: ""
    prompt: "Also keep the border thin."
    selector: ""
$ fm-procevent-lavish.sh answers
pick-colour	green	Pick the button colour -> green
Evidence: Brief flags and refusals

Source: Brief flags and refusals

$ fm-brief.sh a1 repo --mode no-mistakes --done-when x --base-branch integration
scaffolded: $LAB/data/a1/brief.md (ship, mode=no-mistakes; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh a2 repo --mode no-mistakes --done-when x --base integration
scaffolded: $LAB/data/a2/brief.md (ship, mode=no-mistakes; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh a3 repo --mode local-only --done-when x --base integration
error: fm-brief.sh --base-branch: a base branch cannot ship mode=local-only, whose landing fast-forwards local main; ship no-mistakes or direct-PR, which open a pull request against the base
exit=1
$ fm-brief.sh a4 repo --mode no-mistakes --done-when x --base bad..name
error: fm-brief.sh --base-branch: base branch 'bad..name' is not a valid git branch name
exit=1
$ fm-brief.sh a5 repo --mode no-mistakes
error: ship and scout briefs require --done-when "<text>": one runnable check proving the task is finished (a command, a scenario, or a screen walk), or for a scout the question its report must answer
exit=1
$ fm-brief.sh a6 repo --mode no-mistakes --done-when x --pr manual
scaffolded: $LAB/data/a6/brief.md (ship, mode=no-mistakes pr=manual; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh a7 repo --mode no-mistakes --done-when x --ui
scaffolded: $LAB/data/a7/brief.md (ship, mode=no-mistakes; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh g1 repo --mode direct-PR --done-when x --forge gerrit
scaffolded: $LAB/data/g1/brief.md (ship, mode=direct-PR forge=gerrit shape=squash; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh g2 repo --mode no-mistakes --done-when x --forge gerrit --shape squash
scaffolded: $LAB/data/g2/brief.md (ship, mode=no-mistakes forge=gerrit shape=squash; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh f1 repo --mode direct-PR --done-when x --forge forgejo
scaffolded: $LAB/data/f1/brief.md (ship, mode=direct-PR forge=forgejo; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh f2 repo --mode no-mistakes --done-when x --forge forgejo
scaffolded: $LAB/data/f2/brief.md (ship, mode=no-mistakes forge=forgejo; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
$ fm-brief.sh e1 repo --mode direct-PR --done-when x --forge external
error: forge=external needs $LAB/config/external-review.md, the worker instructions for this home's review tool (docs/configuration.md "External review tool"); without it a worker has no way to publish except a push
exit=1
$ fm-brief.sh s1 repo --scout --done-when why?
scaffolded: $LAB/data/s1/brief.md (scout; replace {TASK} and {FIRSTMATE_SPEC})
exit=0
Evidence: Brief content checks

Source: Brief content checks

== g1: lines naming gh / gh-axi
134:- For GitHub repo metadata and all GitHub work - issues, pull requests, checks, releases - prefer `gh-axi` over either browse tool.
180:There is no pull request, no `gh-axi` call, and no forge CI result to report: a human reviewer approves and submits the change on the server, and firstmate relays that outcome.
== g2: lines naming gh / gh-axi
138:- For GitHub repo metadata and all GitHub work - issues, pull requests, checks, releases - prefer `gh-axi` over either browse tool.
235:There is no pull request, no `gh-axi` call, and no forge CI result to report: a human reviewer approves and submits the change on the server, and firstmate relays that outcome.
== f1: lines naming gh / gh-axi
== f2: lines naming gh / gh-axi
== a1: done/PR-URL rules
11:Done when: x
50:   On this no-mistakes task the only `done:` line is the PR line your Definition of done names, so start the pipeline yourself; a `done:` without a PR URL is read as not done.
183:Done when: x
190:The only `done:` line on this task is the CI-ready PR line below; a `done:` without a PR URL is read as not done.
230:After /no-mistakes reports CI green (the CI-ready return point - do not wait for it to keep monitoring in the background until merge), read the PR back from the forge and confirm it is not a draft (`gh-axi pr view <number>` must print `draft: no`, where <n
== a6: done/PR-URL rules
11:Done when: x
181:Done when: x
232:Then read the PR back from the forge and confirm it is not a draft (`gh-axi pr view <number>` must print `draft: no`, where <number> is the PR number from your PR URL); if it is a draft, mark it ready with `gh-axi pr ready <number>`.
== a7 --ui: outside-worktree rule and screenshot rule
33:   The one exception is any UI screenshots under `docs/evidence/a7/`, which you commit in this worktree.
95:11. This task touches the UI: before you report the work done, save a screenshot of each changed view at viewport widths 375, 768 and 1440 under `docs/evidence/a7/`, and cite those paths in the PR body.
== wait-no-turns text without config/wait-no-turns:
0
Evidence: Worker start on a base branch

Source: Worker start on a base branch

--- brief records a base, spawn omits it
fm-gate-refuse: gate agent lifecycle permitted only against lab home <lab>/home
error: <lab>~/ship1/brief.md records a Base branch line but the spawn has no --base-branch; pass the brief's base with --base-branch or re-scaffold the brief without one
--- spawn base differs from brief
fm-gate-refuse: gate agent lifecycle permitted only against lab home <lab>/home
warn: no registry at <lab>~/projects.md; defaulting repo to no-mistakes off
error: <lab>~/ship1/brief.md must record Base branch: main and no other Base branch line to spawn with --base-branch main; scaffold it with bin/fm-brief.sh --base-branch main
--- spawn with --base alias
fm-gate-refuse: gate agent lifecycle permitted only against lab home <lab>/home
warn: no registry at <lab>~/projects.md; defaulting repo to no-mistakes off
notice: ship1 ships mode=direct-PR while the standing posture for repo is no-mistakes - less rigor than the captain's standing posture; proceed only on a current explicit captain instruction or an intake judgment you can state
error: task ship1 has no backlog item in this home, so dispatching it would leave a worker no record owns; add it first (bin/fm-tasks-axi.sh add ship1 '<title>' --kind ship) and re-run
--- task record
--- spawn with --base alias (backlog item added)
fm-gate-refuse: gate agent lifecycle permitted only against lab home <lab>/home
warn: no registry at <lab>~/projects.md; defaulting repo to no-mistakes off
notice: ship1 ships mode=direct-PR while the standing posture for repo is no-mistakes - less rigor than the captain's standing posture; proceed only on a current explicit captain instruction or an intake judgment you can state
warning: herdr presentation parent is absent or ambiguous; using the ordinary flat layout without projection
A new version of treehouse is available: v2.3.0 → v3.1.8
Run "treehouse update" to update

🌳 Setting up worktree...
🌳 Leased worktree at <lab>/th/.treehouse/repo-9c9f94/1/repo. Run 'treehouse return <lab>/th/.treehouse/repo-9c9f94/1/repo' to release it.
spawned ship1 harness=echo kind=ship mode=direct-PR yolo=off window=fm-lab-upsync2-31225-4915:w1:p2 worktree=<lab>/th/.treehouse/repo-9c9f94/1/repo
--- task record
window=fm-lab-upsync2-31225-4915:w1:p2
endpoint_task_id=ship1
worktree=<lab>/th/.treehouse/repo-9c9f94/1/repo
project=<lab>~/repo
harness=echo
kind=ship
mode=direct-PR
yolo=off
branch=fm/ship1
tasktmp=/tmp/fm-ship1
base_branch=integration
model=default
effort=default
spawn_gen=s1795999379.46110.27964
backend=herdr
herdr_session=fm-lab-upsync2-31225-4915
herdr_workspace_id=w1
herdr_tab_id=w1:t2
herdr_pane_id=w1:p2
--- worktree HEAD vs origin/integration
9503a2a integ
9503a2a integ
AGENTS.md
INTEG.md
README.md
--- what the worker pane ran
Evidence: Done line needs a PR URL, manual PR exempt

Source: Done line needs a PR URL, manual PR exempt

$ [nm1] status line: done: implemented and committed
  -> state: blocked · source: status-log · no-mistakes done: names no PR URL, so it is not done: the only done line on a no-mistakes ship is the PR line, so start the pipeline with /no-mistakes
$ [nm1] status line: done: see https://github.com/o/r/issues/3
  -> state: blocked · source: status-log · no-mistakes done: names no PR URL, so it is not done: the only done line on a no-mistakes ship is the PR line, so start the pipeline with /no-mistakes
$ [nm1] status line: done: PR https://github.com/o/r/pull/7 checks green
  -> state: done · source: status-log · PR https://github.com/o/r/pull/7 checks green
$ [man1] status line: done: implemented and committed
  -> state: done · source: status-log · implemented and committed
$ [man1] status line: done: see https://github.com/o/r/issues/3
  -> state: done · source: status-log · see https://github.com/o/r/issues/3
$ [man1] status line: done: PR https://github.com/o/r/pull/7 checks green
  -> state: done · source: status-log · PR https://github.com/o/r/pull/7 checks green
(nm1 = no-mistakes project, man1 = no-mistakes pr=manual project)
Evidence: Legacy base key

Source: Legacy base key

--- review-diff, task record has base_branch=integration
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
diff base: origin/integration
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index ce01362..1f71346 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,2 @@
 hello
+late-change
--- review-diff, legacy task record has only base=integration
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
diff base: origin/integration
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index ce01362..1f71346 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,2 @@
 hello
+late-change
Evidence: Cleanup refusals

Source: Cleanup refusals

--- teardown with an unpushed late commit
REFUSED: worktree <lab>/th/.treehouse/repo-9c9f94/1/repo has work not on any remote and not landed.
unpushed commits:
773b23d late worker change
Push the branch, land its PR, or get the captain's explicit OK to discard, then --force.
worktree still there: 773b23d late worker change
--- teardown with an uncommitted late edit
REFUSED: worktree <lab>/th/.treehouse/repo-9c9f94/1/repo has uncommitted changes.
uncommitted changes present (includes tracked edits)
Commit them (or get the captain's explicit OK to discard, then --force).
 M README.md
--- work landed, but no follow-ups record
REFUSED: task ship1 has not recorded its follow-ups.
Have the worker write each one as a line in <lab>~/ship1/follow-ups.md, or record that there are none with: <worktree>/bin/fm-followups.sh ship1 --none
Evidence: Successful cleanup, owner notes and attribution

Source: Successful cleanup, owner notes and attribution

--- work landed, follow-ups recorded
collected 1 owner-words file(s) from ship1 into <lab>~/owner-notes/repo.md
A new version of treehouse is available: v2.3.0 → v3.1.8
Run "treehouse update" to update

🌳 Worktree returned to pool.
repo: already current
teardown ship1 complete (window fm-lab-upsync2-31225-4915:w1:p2, worktree <lab>/th/.treehouse/repo-9c9f94/1/repo)
Backlog: ship1 is closed in <lab>~/backlog.md. Run bin/fm-tasks-axi.sh ready for dependency-cleared candidates, check date gates, and dispatch only work whose blockers are gone and date is due.
--- owner notes collected
# Owner notes: repo

The captain's own words on repo, verbatim, collected from Firstmate tasks at cleanup and from dated entries of data/captain.md.
Entries are appended in collection order and their words are never edited; bin/fm-owner-notes.sh place adds where each one went.

## 2026-11-30 - ship1
<!-- fm-owner-notes task=ship1 file=captain-notes-2026-11-30.md sha256=be86d56fcec73f996bb1ec32338ba627649ee26f705dece21f665192f41d2491 -->
Source: captain-notes-2026-11-30.md

# Captain notes
"Keep the readme short." Done.
--- backlog
# Backlog

## In flight
- [ ] man1 - lab man1 (kind: ship) (since 2026-11-30)
- [ ] nm1 - lab nm1 (kind: ship) (since 2026-11-30)
## Queued
## Done
- [x] ship1 - Add a readme line (kind: ship) (done 2026-11-30)
  model=default effort=default
--- task state left
none
--- herdr panes left
w2:p2
w3:p2
Evidence: Captain hold and fleet ledger

Source: Captain hold and fleet ledger

--- hold
man1
recorded: task man1 has no follow-ups
--- worker window cleaned up while the question is still open
Run "treehouse update" to update

🌳 Worktree returned to pool.
manualrepo: already current
teardown man1 complete (window fm-lab-upsync2-31225-4915:w3:p2, worktree <lab>/th/.treehouse/manualrepo-b040d2/1/manualrepo)
Backlog: man1 stays open in <lab>~/backlog.md, still held for the captain with its deliverable recorded. Relay the question and close it only with bin/fm-captain-hold.sh answer.
--- backlog
- [ ] man1 - lab man1 (kind: ship) (since 2026-11-30) (hold: fm-hold-v1:UGljayB0aGUgY29sb3Vy) (hold-kind: captain)
  Captain hold set: 2026-11-30T00:44:51Z

  Deliverable of the finished work: model=lab-model effort=default
## Done
- [x] ship1 - Add a readme line (kind: ship) (done 2026-11-30)
  model=default effort=default
--- captain answers
answered: man1
--- backlog
- [x] man1 - lab man1 (kind: ship) (done 2026-11-30) (hold: fm-hold-v1:UGljayB0aGUgY29sb3Vy) (hold-kind: captain)
  Resolution recorded by fm-captain-hold.
  Decision digest: 61fef1f8bd76280537a73dc317bac1c99bd3403793fe785eb99e7a96926b3c36
  Resolution mode: answered

  Captain decision:
  Use blue.

  Deliverable of the finished work: model=lab-model effort=default

- [x] ship1 - Add a readme line (kind: ship) (done 2026-11-30)
  model=default effort=default
--- fleet ledger (hold events)
<lab>~/fleet-ledger.jsonl
<lab>~/fleet-ledger.jsonl
{"v":1,"ts":1795999499,"event":"task.cleaned_up","task":"man1"}
--- fleet ledger files, man1 events
# state/fleet-ledger.jsonl
{"v":1,"ts":1795999492,"event":"task.status","task":"man1","state":"done","key":null,"text":" PR https://github.com/o/r/pull/7 checks green"}
{"v":1,"ts":1795999492,"event":"hold.opened","task":"man1","reason":"Pick the colour","until":null}
{"v":1,"ts":1795999499,"event":"task.cleaned_up","task":"man1"}
{"v":1,"ts":1795999502,"event":"hold.answered","task":"man1","mode":"answered","decision":"Use blue."}
# data/fleet-ledger.jsonl
{"v":1,"ts":1795999492,"event":"task.status","task":"man1","state":"done","key":null,"text":" PR https://github.com/o/r/pull/7 checks green"}
{"v":1,"ts":1795999492,"event":"hold.opened","task":"man1","reason":"Pick the colour","until":null}
{"v":1,"ts":1795999499,"event":"task.cleaned_up","task":"man1"}
{"v":1,"ts":1795999502,"event":"hold.answered","task":"man1","mode":"answered","decision":"Use blue."}
Evidence: Context nudge and stow guard

Source: Context nudge and stow guard

--- turn-end guard, idle primary, context 350k tokens
context 350k tokens, 70% of the 500k window (CLAUDE_CODE_AUTO_COMPACT_WINDOW), 70% of the 500k budget - suggest /stow now
exit=2
--- same session, same step again
exit=0
--- stow guard without config/stow-guard
exit=0
--- adversarial: stow guard once opted in (proves the off state above is the switch)
{"decision":"block","reason":"fm-stow-guard: context is 350000 tokens, near auto-compaction. Run the /stow skill now (full pass), then continue the turn you were in."}
exit=0
Evidence: Watcher exits when its folder is gone

Source: Watcher exits when its folder is gone

watcher running before delete: yes; lock: $LAB/w/state/.watch.lock
deleted state folder
watcher exited rc=1 after ~1s
watcher: exiting - state directory no longer exists: <lab>/w/state
--- lock wait when its folder is gone
returned rc=1
Evidence: Test layout coverage

Source: Test layout coverage

$ bin/fm-test-run.sh --check-coverage
FM_TEST_COVERAGE ok total=371 parallel=27 parallel_max_ms=1243475 parallel_imbalance_ms=213 parallel_unhinted=0 serial=328 serial_shards=20 serial_unhinted=5 serial_max_ms=940120 serial_budget_ms=900000 herdr=16
exit=0
split files named *-<n>.test.sh: 0
tests/fm-supervision-host-attended-live-e2e.test.sh
tests/fm-supervision-host-drain.test.sh
tests/fm-supervision-host-herdr-live-e2e.test.sh
tests/fm-supervision-host-hook.test.sh
tests/fm-supervision-host-live-e2e.test.sh
tests/fm-supervision-host-park.test.sh
tests/fm-supervision-host.test.sh
tests/fm-watch-triage-busy.test.sh
tests/fm-watch-triage-pause.test.sh
tests/fm-watch-triage-wedge-defer.test.sh
tests/fm-watch-triage.test.sh
Evidence: Targeted test results

Source: Targeted test results

Targeted test files, run one at a time (tests/<name>.test.sh)
fm-brief rc=0 secs=44 ok=67 notok=0
fm-dod-lib rc=0 secs=17 ok=38 notok=0
fm-pr-merge rc=0 secs=695 ok=163 notok=0
fm-captain-hold-lifecycle rc=0 secs=372 ok=42 notok=0
fm-captain-hold-teardown rc=0 secs=551 ok=29 notok=0
fm-fleet-ledger rc=0 secs=35 ok=17 notok=0
fm-contributions rc=unrecorded ok=88 notok=0
fm-bearings-board-render rc=0 secs=72 ok=35 notok=0
fm-spawn-pi-node rc=0 secs=19 ok=8 notok=0
fm-spawn-free-lane rc=0 secs=26 ok=9 notok=0
fm-watch-thresholds rc=0 secs=3 ok=7 notok=0
fm-context-budget rc=0 secs=6 ok=21 notok=0
fm-chrome-bridge-sweep rc=0 secs=18 ok=9 notok=0
fm-watch-triage-pause rc=142 secs=601 ok=45 notok=0
fm-spawn-pool-base-freshen rc=0 secs=217 ok=38 notok=0
fm-pr-health rc=0 secs=153 ok=48 notok=0
fm-bearings-board rc=0 secs=57 ok=20 notok=0
fm-turnend-guard rc=0 secs=120 ok=98 notok=0
DONE
note: fm-contributions exit code unrecorded because the first runner was stopped to reorder; its log ran through the last case with no 'not ok'.
note: fm-watch-triage-pause was cut by the 600s wrapper timer (rc=142) after 45 passing cases and no failing case; the remaining cases did not run.

Selected passing cases:
ok - a declared pause is absorbed on first sight, then re-surfaced as a recheck past the threshold, never wedge-escalated
ok - a declared pause outranks an active run-step: absorbed on the long cadence, never wedge-escalated
ok - contribution polling resolves the keyring token once and exports it only in memory
ok - a record that turns terminal settles after one confirming observation and is never polled again
ok - fm-pr-merge refuses a base that differs from --expect-base, before merging
ok - fm-pr-merge consumes --expect-base without disturbing the forge arguments
ok - fm-pr-merge rejects a malformed --expect-base before doing anything
ok - fm-pr-merge without --expect-base reads no base and records none
--- fm-spawn-pi-node
ok - an absent config/pi-node leaves the pi launch command exactly as it was
ok - a valid config/pi-node runs the resolved pi path under the configured node
ok - config/pi-node naming a missing path refuses before any launch command
ok - config/pi-node naming a non-executable file refuses before any launch command
ok - a relative config/pi-node path refuses before any launch command
ok - config/pi-node naming a directory refuses before any launch command
ok - comment lines, blank lines, and surrounding whitespace do not break config/pi-node
ok - a raw launch command is neither refused nor rewritten by config/pi-node
--- fm-spawn-free-lane
ok - a paid pi model spawns exactly as before, with no free-lane probing at all
ok - a free-lane model refuses before any launch command when the launcher is not installed
ok - a launcher that is not shaped like a generated av-inject launcher refuses
ok - a free-lane model refuses fast, naming the missing vault key, when it is absent from the vault
ok - an unblessed launcher refuses within the bounded probe window instead of hanging the spawn
ok - a blessed launcher with its key present wraps the real pi launch through --exec
ok - a secondmate pinned to a free-lane model is wrapped through the blessed launcher
ok - a raw launch command is neither wrapped nor refused by the free-lane path
ok - an unreadable lane table refuses instead of launching a possible free-lane model unwrapped
--- fm-chrome-bridge-sweep
ok - task mode selects only the bridge owned by that worktree
ok - task apply retires the owned bridge, MCP, and Chrome descendants
ok - global mode requires records and protects live owners
ok - startup summary is concise and actionable
ok - the ownership watcher stops when the task record is removed
ok - the ownership watcher stops when its state directory is removed
ok - fixture-root watcher reap uses path boundaries
ok - the ownership watcher stops when the task worktree is removed
ok - the ownership watcher stops at its deadline

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - medium risk

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 13 of 19 scenarios driven live against the product
Scenario Result Live Evidence
Making a brief with --base-branch or the old --base gives the same brief; a bad base, a local-only base and a missing --done-when are refused ✅ pass live 01-brief-flags.txt; the two briefs were identical apart from the task id
A pr=manual brief carries no PR-URL done rule, a --ui brief keeps screenshots committed, and forgejo briefs name no gh command ✅ pass live 02-brief-content.txt
Starting a worker on a base branch uses that branch and records it; a missing or different base is refused ✅ pass live 03-spawn-base.txt (Herdr lab, stand-in worker command)
A task record with only the old base= key still diffs against that base ✅ pass live 05-legacy-base-key.txt
A no-mistakes worker saying done without a PR URL (or with only an issue link) reads as blocked; a pr=manual project reads as done ✅ pass live 04-done-needs-pr-url.txt
Cleanup never throws away late worker changes and refuses until follow-ups are recorded ✅ pass live 06-teardown-guards.txt
A successful cleanup collects the owner's notes, writes the model note on the closed task and closes the worker pane ✅ pass live 07-teardown-success.txt
Cleaning up a task with an open question keeps it held with the model note; answering closes it and the fleet ledger records each step ✅ pass live 08-captain-hold.txt
An idle primary with a large context gets one /stow nudge, and the upstream stow guard stays off unless switched on ✅ pass live 09-turnend-nudge.txt
The watcher exits when its state folder is deleted, and a lock wait on a missing folder returns ✅ pass live 10-watcher-folder-gone.txt
The bearings board builds at the durable data/.lavish path with its panels, and refuses a temp-folder path ✅ pass live 11-board-before-answer.png; fm-bearings-board and fm-bearings-board-render tests in 16-targeted-tests.txt
Clicking an answer on the board, with or without a typed note, reaches the captain hold and closes it ✅ pass live 13-board-answer-sent.png, 14-board-answer-to-hold.txt, 17-board-answer-with-note.txt
A list-form Lavish capture of a board answer is still read as that answer ⏸️ untested no No live result. Both live board rounds used the installed Lavish, which sent table form only. The only list-form check used a real capture rewritten by hand (noted in 17-board-answer-with-note.txt). A…
PR merge refuses a base that differs from --expect-base and keeps its merge guards ⏸️ untested no No live result. Only tests/fm-pr-merge.test.sh with a stand-in GitHub covered this (log 16-targeted-tests.txt). A real merge attempt would act on a real repository. A live check needs a disposable Git…
The contribution poll reads the GitHub token once per poll and marks final records settled ⏸️ untested no No live result. Only tests/fm-contributions.test.sh with a stand-in GitHub covered this, and its exit code was not recorded. A live check needs authority to run the poll with a real GitHub token again…
Free-lane and Pi node launch placeholders are filled at worker start ⏸️ untested no No live result. Only tests/fm-spawn-free-lane.test.sh and tests/fm-spawn-pi-node.test.sh covered this. No real Pi or free-lane worker was launched. A live check needs a configured Pi harness and free-…
A declared pause is not treated as a stuck worker, and the watcher threshold file is honoured ⏸️ untested no No live result, and no live drive of this was recorded. Only tests/fm-watch-thresholds.test.sh and tests/fm-watch-triage-pause.test.sh covered it. The pause test file was cut by a 10 minute timer afte…
Cleanup's Chrome bridge sweep retires the worker's browser processes ⏸️ untested no No live result, and no live drive of this was recorded. Only tests/fm-chrome-bridge-sweep.test.sh with stand-in processes covered it. A live check needs a lab worker that starts its own isolated Chrom…
The duplicate -2/-3 test files are gone and the runner still covers every test file ✅ pass live 15-test-layout.txt
  • bin/fm-brief.sh with --base-branch, the --base alias, invalid base, local-only plus base, missing --done-when, --pr manual, --ui, gerrit, forgejo, external and scout
  • Herdr lab through bin/fm-herdr-lab.sh (provision, then teardown): bin/fm-spawn.sh refused a missing or different base and started ship tasks on integration and in no-mistakes and manual-PR projects
  • bin/fm-crew-state.sh on done lines with and without a PR URL, normal and pr=manual projects
  • bin/fm-review-diff.sh with a base_branch= record and a legacy base= record
  • bin/fm-teardown.sh with an unpushed commit, an uncommitted edit, missing follow-ups, then a successful cleanup
  • bin/fm-captain-hold.sh hold, cleanup while held, answer, with config/fleet-ledger on
  • bin/fm-turnend-guard.sh --claude and bin/fm-stow-guard.sh in a disposable primary copy
  • bin/fm-watch.sh with its state folder deleted, and fm_lock_acquire_wait on a missing folder
  • bin/fm-bearings-board.sh build, then answer clicks in an isolated browser against a private Lavish server, checked in the backlog
  • bin/fm-procevent-lavish.sh answers on a real capture and on a hand-converted list-form copy
  • bin/fm-test-run.sh --check-coverage
  • One at a time: tests/fm-brief, fm-dod-lib, fm-pr-merge, fm-captain-hold-lifecycle, fm-captain-hold-teardown, fm-fleet-ledger, fm-contributions, fm-bearings-board-render, fm-bearings-board, fm-spawn-pi-node, fm-spawn-free-lane, fm-spawn-pool-base-freshen, fm-watch-thresholds, fm-watch-triage-pause (partial), fm-context-budget, fm-chrome-bridge-sweep, fm-pr-health, fm-turnend-guard (.test.sh)
  • git merge-base --is-ancestor for 23e55847 and fe939017, and git diff b68e629c d4ba2d31 (empty)
✅ **Document** - passed

✅ No issues found.

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

✅ No issues found.

Sync ledger (worker)

Plan source: the assessment's merge plan steps O1 to O4 and rules R1 to R18. O5 (cockpit), O6 (treehouse, config/firstmate-role, /updatefirstmate) and O7 (turning features on) are out of scope and not done. No config/, data/ or state/ file of the home was touched. Every new opt-in feature stays off.

Acceptance criteria

  1. The 1 October sync link is restored. Proof: d4ba2d31 has parents b68e629c and 23e55847, and git diff d4ba2d31^1 d4ba2d31 prints nothing.
  2. Upstream fe939017 is merged. Proof: merge commit 8e4bd6e5 has parents d4ba2d31 and fe939017.
  3. Our own behaviours are kept by R1 to R18, with the exceptions named under "Hand merged" below. Proof: the tests in criterion 4 and the live scenarios in the Testing section.
  4. Every test named in plan step O4 passes. Measured, one file at a time with bash, on 8e4bd6e5 plus the fixes below: fm-brief, fm-dod-lib, fm-crew-state, fm-inactive-reconcile, fm-spawn-pool-base-freshen, fm-spawn-free-lane, fm-spawn-pi-node, fm-pr-merge, fm-base-green, fm-teardown, fm-owner-notes, fm-gotmp, fm-chrome-bridge-sweep, fm-captain-hold-lifecycle, fm-procevent, fm-bearings-board, fm-bearings-snapshot, fm-bearings-idea-capture, fm-watch-triage plus -busy, -pause and -wedge-defer, fm-watch-thresholds, fm-validation-restart-resume, fm-evidence-only-finding, fm-task-inbox, fm-send-inbox, fm-context-budget, fm-contributions, fm-memory-check, fm-disk-check, fm-hp-runner-check, fm-capture-intake, fm-env-sync, fm-quota-pools, fm-usage-history, fm-free-lane-run, fm-free-tier-guard, fm-ci-workflow, fm-test-run all exit 0. bin/fm-test-run.sh --check-coverage prints FM_TEST_COVERAGE ok total=371. bin/fm-doc-audience-check.sh prints ok surfaces=148. bin/fm-lint.sh printed no findings on the merge tree before the review fixes (its exit code was not captured). The pipeline's test step then re-ran the targeted tests on the final tree.
  5. CI on this PR is green. Proof: the CI checks on this PR.

Taken as is (upstream wins)

  • R4 wait-no-turns, R5 Lavish result parser (lavish_result_parser), R6 test split and shard layout (our -2/-3/*-helpers.sh split files deleted), R7 lock wait in bin/fm-wake-lib.sh, R12 runner pin ubuntu-24.04 and CI gates, R13 per-read retry and failure-cause text, R18 doc and list entries from both sides.
  • Upstream's removal of the unused decision-hold-lifecycle skill.
  • All upstream T1 to T20 code, with its opt-in features left off.

Hand merged (both sides kept)

  • R1: --base-branch is canonical, and --base is a working alias in bin/fm-brief.sh and bin/fm-spawn.sh. base_branch= and the older base= meta keys are both read (spawn relaunch, promote, teardown, review diff, and now the PR health check). --expect-base stays. AGENTS.md states the rule once.
  • R8: a no-mistakes ship's done: without a PR URL reads not done. pr=manual projects are exempt in the gate, and a pr=manual brief no longer carries our done rule.
  • R9 brief scaffold, R10 captain holds with ledger_record, R11 context-budget nudge through upstream's allow_exit (stow guard off), R14 spawn placeholders __FREELANE__ and __PINODE__, R15 teardown, R16 PR merge, R17 bearings fields and the durable data/.lavish/bearings-board.html path.
  • The CI serial matrix is 20 shards, not upstream's 19, because this fork's own test files make the serial set longer. bin/fm-test-run.sh, .github/workflows/ci.yml, the shard doc and tests/fm-ci-workflow.test.sh agree on 20. Our fork-only suites have timing hints in tests/fm-test-ci-timings.tsv.

What we kept of our own beyond the plan (review findings, firstmate decisions)

  • Herdr presentation recovery waits up to 60 seconds for the shared session lock by default (our fix: harden test fixtures and Herdr recovery #24). Upstream's --herdr-resume-lock-wait still overrides it. The plan's R14 said upstream's refuse-by-default should win. The owner rule that our adjustments are not overwritten decided it the other way.
  • The contribution poll keeps our outer retry of a whole failed observation (FM_CONTRIBUTIONS_RETRY_DELAY, our fix: suppress stale contribution poll noise #37) beside upstream's per-read retry, with its two tests restored. R13 had let upstream's retry replace it.
  • The contribution poll writes settled: true on final records again (our fix: suppress stale contribution poll noise #37). Nothing depends on it today: firstmate checked the cockpit and found no reader of it.
  • With --ui, the screenshots folder docs/evidence/<id>/ is committed in the worktree and is the named exception to upstream's keep-proof-outside rule, in the brief and in the promotion text.
  • A merge after --update-branch re-checks our required-checks list and --expect-base on the new head.

Places where a rule turned out wrong once the code was visible (ours kept)

  • Backlog close: our per-model attribution note and upstream's Gerrit or GitLab link note were sent as two --note flags, and tasks-axi refuses a second one. They now share one note (bin/fm-backlog-transition-lib.sh). Red: tests/fm-teardown.test.sh failed with error: "Unknown flag: --note" on the Gerrit and GitLab close cases. Green after the fix.
  • Board answers: upstream's choice reader read only a prompts block, but our fix(bin): read list-form Lavish results so board answers reach the captain hold #60 also reads a feedback block. bin/fm-procevent-lavish.sh reads both again. Red: not ok - a list result under a feedback block lost its keyed answer. Green after the fix.
  • Declared pauses: upstream raises one alert the first time it sees a live worker that declared a pause. Our feat(bin): auto-resume workers after validation daemon restart #59 rule says a declared wait outranks the pane. Ours is kept, and four upstream watcher test cases were fitted to it (tests/fm-watch-triage-pause.test.sh, tests/fm-watch-triage-wedge-defer.test.sh). Red: not ok - first sight of a worker paused on its background job did not surface and not ok - watcher classification treated a malformed dated pause as overdue: paused. Green after fitting.
  • One test from our fix(bin): read list-form Lavish results so board answers reach the captain hold #60 expected a list-form board row with no element text to count as malformed. Upstream's reader presents that row instead, which loses nothing, so the test now asserts the row is presented.
  • Our tests/agent-standin-fixture.sh (fix(tests): keep four behaviour tests working on Ubuntu 26.04 runners #68, Ubuntu 26.04 fix) was dropped, because upstream's tests/lib.sh handles the same uutils case and nothing sources the fixture any more.

Skipped

  • Lint run file by file and stopped at 3 GB of memory, each skipped and left to CI's capped lint: tests/fm-procevent.test.sh (4.5 GB), bin/fm-brief.sh with sources followed (3.1 GB, clean without them), tests/fm-daemon.test.sh (4.8 GB), tests/fm-watch-triage.test.sh (3.7 GB).
  • The pipeline's full local lint reported information-level ShellCheck notes (SC2031, SC2030, SC2329) only in tests/fm-daemon.test.sh (unchanged from upstream) and tests/fm-watch-triage.test.sh, from following shared helper files. That step was accepted so CI's capped lint is the judge.
  • Non-GitHub brief wording (Forgejo, Gerrit, external) and one argument-order comment in bin/fm-dod-lib.sh are left as a follow-up. Every project here is on GitHub.

CI fixes after the first CI run (commit 13bc9538, test files only)

Charter boxes: none

Built by: claude/claude-opus-5-5 at high

kunchenguid and others added 30 commits October 22, 2026 12:05
* Isolate real Rex tests with private servers

* no-mistakes(review): Trap Rex cleanup early and prove passive-read autostart guard

* no-mistakes(document): Consolidate Rex test isolation documentation
* fix(bin): report an outdated bootstrap tool instead of a missing one

detect_local_tools printed "MISSING:" for a treehouse without --lease, a
no-mistakes below 1.46.0, a gh-axi below its floor, and an incompatible
tasks-axi or quota-axi, so a supervisor read an installed tool as absent
and took the first-install remediation again.

Report those as "OUTDATED:" with the installed version, the requirement
and the tool's own upgrade command: treehouse update, no-mistakes update,
gh-axi update and quota-axi update. tasks-axi ships no self-updater, so it
keeps its install command. "MISSING:" stays for absent tools only, and
lavish-axi keeps PRESENTATION_UNAVAILABLE with its text fallback.

Update the bootstrap-diagnostics handler, the AGENTS.md section 13 trigger
list and the operator diagnostics in docs/configuration.md, and cover
absent, below-floor and at-floor for every floored tool in
tests/fm-bootstrap.test.sh.

* no-mistakes(document): Documented distinct bootstrap tool diagnostics

* fix(bin): reuse the tasks-axi check's own probe results

Rendering the tasks-axi OUTDATED requirement text ran the two `--help`
capability probes again after the compatibility check had already run
them, including when session start handed bootstrap an incompatible
verdict. The check now records the reason behind its verdict - the
version floor, or the capability probes the build fails - and reuses it,
both within the process and across the existing one-hop handoff, so
naming a missing capability costs no second probe pass. A build below the
floor is answered by its version alone and never pays for capability
probes it cannot use.

The bootstrap tests that simulate a tool as absent removed it from the
fake bin directory while bootstrap kept searching the fallback base PATH,
so a real host install could satisfy the lookup instead of the expected
MISSING line. Those cases now hide the tool from the base path as well,
and a new case pins the contrast between a bare and a curated fallback.

Verified: the touched bootstrap suite passes, and its probe-count and
capability assertions fail against the pre-fix scripts. Run with a
fallback base PATH carrying real installs of the absent tools, the
pre-fix suite fails on "absent treehouse reports a missing tool" while
the fixed suite passes every case.

* no-mistakes(document): Documented missing versus outdated tool diagnostics

* no-mistakes(document): Refresh outdated-tool documentation

* no-mistakes(review): Reuse shared version parser for outdated diagnostics

* no-mistakes(document): Correct outdated-tool diagnostics documentation

* no-mistakes(document): Align toolchain upgrade documentation

* fix(skills): keep main's bootstrap-diagnostics description and only add OUTDATED
…e verbatim match (#7530)

* Clarify ahoy legacy startup exclusion

* Fix quoted payload code span
…7637)

* fix(timeout): bypass shell builtins when invoking external runners

* no-mistakes(review): Remove redundant slashless runner resolution from external timeout
…urable (#6094)

* fix: count answered captain holds in the Done archive at the completion gate

Done retention moves closed markdown rows into the configured Done archive,
which tasks-axi show never reads, so verify, complete, and scout teardown
refused an answered captain hold once retention archived it. The completion
gate now reads the newest archived block for an attested entry, under its
exact or legacy identity, and accepts it only through a recorded resolution.
Unanswered archived closes and holds found nowhere still refuse.

* no-mistakes(document): document Done-archive durability in captain-hold verification record

* no-mistakes(ci): Fixed the selected Greptile findings in bin/fm-captain-hold.sh (all in the Done-archive read path added by this PR). code_change_needed=true. ci-3 (Archived reads can hang): task_show_archived() now bounds the replayed archive `tasks-axi show` with the same read bound the live backlog read uses (FM_BACKLOG_ROW_TIMEOUT_SECS via fm_run_timed, sanitising a non-positive/padded value to 10s, mirroring fm_backlog_row_show). A bound hit is treated as 124, not absence: task_show_archived returns 124 and prints a loud reason; archived_entry() propagates 124; verify_entry_durable() exits 124 on the archived-read bound (alongside its existing resolve 124 handling); verify_hold_durable() exits 124 rather than reading the row as absent. So verify can no longer hang and complete can no longer stay blocked while holding the origin metadata lock. ci-4 (User-level archive setting ignored): added captain_markdown_archive_setting(), which resolves the [markdown] archive key with tasks-axi's own source precedence — the backlog root's .tasks.toml first, then $HOME/.tasks-axi/config.toml — before the existing default of done-archive.md beside the backlog; a relative value still resolves against the backlog root, which I verified empirically matches tasks-axi (root config wins over home config; a relative home-config value resolves against the backlog root; default stays data/done-archive.md). tasks-axi exposes no command for the archive path, so re-parsing with matched precedence is the available approach. Added test_archived_answer_in_a_user_configured_archive_satisfies_the_gate, which sets the archive only in a fixture $HOME/.tasks-axi/config.toml and drives the whole hold→answer→retention→verify/complete/teardown flow with that HOME, asserting the answered call archived to the relocated location still satisfies the gate. ci-5 (repeated archive scans, P2): left unchanged per the instruction's opt-out. A clean reuse of the row archived_entry already found is not small: archived_entry runs inside a command substitution, so its TASK_SHOW_OUTPUT dies with the subshell and cannot be handed to verify_hold_durable without restructuring both to pass the loaded row through the current shell. The growth is bounded (O(archive size) per attested entry) and P2, so hardening it would add more machinery than the fix warrants. Unanswered archived closes and holds found nowhere still refuse (existing test coverage retained). Verification: `bash -n` clean; pinned ShellCheck 0.11.0 (`shellcheck -x bin/fm-captain-hold.sh`) reports 0 findings; tasks-axi archive-precedence behaviour confirmed by direct experiment. The full fm-captain-hold-lifecycle.test.sh suite (which exercises both the pre-existing archived-gate test and the new user-config test) is slow due to beads spawns and was still running at report time; recommend confirming it green before merge. ci-1/ci-2 need no code change (action_required fork workflow runs awaiting maintainer approval), per the recorded user decision

* no-mistakes(document): Document Done-archive reads under backlog row timeout

* docs: say only the archive row replay is bounded, not the archive scan

* no-mistakes(document): Move Done-archive rule to the complete section
… (#7627)

* fix(bin): optionally read a PR with no CI checks as unverified, not checks green

nm_ci_checks_state maps the ci log marker "no CI checks reported - still
monitoring" to green, the same verdict as "all CI checks passed". A pull
request that no check ever ran against therefore surfaced as "checks green: PR
ready for review" (#3216).

Add a no-checks verdict for that marker, returned only in a home that creates
config/ci-no-checks-not-green. The run-step consumer reports working with a
detail naming the real condition, and the status-log override no longer
promotes a crew's own "checks green" report while that marker is the latest.
Without the flag every reading is unchanged.

Co-authored-by: Harlan Do <[email protected]>

* no-mistakes(document): document ended-monitor reading under the zero-checks flag

* fix(bin): read a PR with no CI checks as unverified on every home

The ci log marker "no CI checks reported - still monitoring" now always
yields the no-checks verdict, so a pull request that no check ran against is
reported as working instead of checks green (#3216). The opt-in flag, its
docs section, and its skill entry are removed, the default-path test now
expects working, and the usage header and architecture note describe the
no-checks reading.

---------

Co-authored-by: Harlan Do <[email protected]>
… test root-safe (#7650)

* no-mistakes(review): correct the counter-reset log line, the sentinel comment, and the root proof

Three findings the review step recorded but never applied, all in this branch's own change.

The clean-rollback branch of the counter-reset guard logged "cap state rolled back", copied
from the sibling marker-write branch. That is wrong here: the cap marker was already written
before this block and _wedge_cap_rollback only truncates the counter, re-arms the since-file
and clears write tracking - it never clears the markers. The window therefore stays silenced
for FM_CAP_HORIZON_SECS, so the one operator-facing line must say that rather than claim the
cap state was rolled back. The rollback behaviour is unchanged and no marker-clear call is
added: the marker is deliberately kept so the window stays quiet.

The sentinel short-circuit comment opened "from either route that has to defend cap state"
and then enumerated three routes. Wording only.

The new regression case injected its fault with chmod 444, which does not restrict root, so
under root the guard would never fire and the case would fail on its own exit-code
assertion. It now skips as root the way this suite's other mode-based faults do. The
assertions are untouched: as the ordinary user the case still proves the guard.

* no-mistakes(review): name both ways a capped window leaves the silence in the reset log line

The tier-0 message for a refused post-fire escalation-counter reset says the cap marker
stands, so the window stays silent until its horizon elapses. That names one release route
where there are two: wedge_episode_end drops the marker through _wedge_cap_markers_clear, so
any episode-ending route ends the silence early, and docs/configuration.md records deleting
the marker as the operator's way to re-engage a capped window at once. This tier writes no
sentinel, so the marker is the only thing left to remove.

The message now names the horizon, an episode-ending route, and the operator remedy, in one
line in the same shape and position as its sibling tier-0 messages. The rollback behaviour,
the marker handling and the tier are unchanged.

* no-mistakes(document): correct root-skip comment's mode-bit precedent in wedge-cap test
* fix(bin): resurface wakes appended while a handling successor is parked

The supervision host parks on the handling successor it starts for a wake
its engine handled, and a handling successor never resurfaced recovery, so
a row another script appended during the park (a captain inbox note from
the Basecamp integration) sat queued until an unrelated close - four hours
in the observed case.

A handling successor now records the newest queued sequence at its start
and closes once with the recovery wake while a newer row is still queued;
a newer row already consumed only advances that mark, so the predecessor's
delivered episode is still never re-announced.

Follow-ups, not built here:
- A row appended in the short window between a handled close and its
  successor's start (about a second) is below the successor's mark; if the
  engine handles that close without claiming the row, the row waits for the
  next close. Closing that window needs the host to treat rows left queued
  after a handled attended turn as main's, which is a separate host change.
- After a machine reboot the primary session does not restart on its own,
  so queued wakes wait until it is resumed by hand. Either auto-resume the
  primary session after boot, or alert the owner when the primary session
  is down while wakes are queued.

* no-mistakes(review): Close handling-successor startup wake race

* no-mistakes(test): Stabilize parked-host inbox wake regression timeout

* no-mistakes(document): Clarify handling-successor wake continuity guarantees

* no-mistakes(ci): Stabilized the flaky remote secondmate lifecycle test by extending the auto-relaunch watcher deadline from ~30 to ~60 seconds. The CI runner exceeded the old deadline by about 3 seconds; the changed production branch was not reachable in this fixture. `bash -n` and `git diff --check` pass. The full test was attempted but exceeded the 600-second local execution limit before reaching this case

* no-mistakes(ci): Fixed flaky concurrent Herdr recovery testing by retrying only documented session-lock contention after both competitors finish. Cleanup now handles fixture-owned read-only hooks. Targeted E2E passed; bash syntax and diff checks passed. Shellcheck reported only existing SC1091 source-following notices

* no-mistakes(test): Preserve successor wake boundaries across handoffs

* no-mistakes(test): Revert successor boundaries and drain teardown fixture wake

* no-mistakes(test): Notify main when downtime handback publication fails

* no-mistakes(test): Revert downtime handback notification changes

* no-mistakes(document): Correct stale supervision wake routing documentation

* fix(bin): stop the supervision host deadlocking and re-announcing handed-back closes

Two defects in this branch's handling-successor changes surfaced as the
"Behavior portable serial 2" shard hanging at its 30-minute limit.

A TERM that lands while the host settles a handled turn's successor handoff
left the host holding the wake-queue and recovery-marker locks; its exit
cleanup then waited forever on the queue lock it still owned. The cleanup now
releases those locks if this process owns them before releasing its grant.

When an accepted close turns main-only at its turn, the host hands it back and
leaves the successor running, but republished the episode as pending
downtime, so that successor re-announced the same close and exited. The
handback now republishes the episode as already announced; a later durable
append still opens a pending episode the successor recovers.

* no-mistakes(test): Park on successor after handling settlement failure

* no-mistakes(test): Use tab-delimited handled-settlement failure logs

---------

Co-authored-by: Caleb LeNoir <[email protected]>
* fix(bin): keep accented letters in pending-reply request summaries

fm_pending_reply_summarize deleted every byte outside printable ASCII, so a Portuguese summary lost its accents: "não faça a correção" was stored as "no faa a correo". It now removes control characters only. The 120-character cap counts UTF-8 characters from lead bytes, so it never splits a letter under any caller locale, including the C locale.

* no-mistakes(document): Documentar preservação de acentos nos resumos

---------

Co-authored-by: Alexandre Custodio <[email protected]>
* Add explicit OpenRouter Jev dispatch resolution

* no-mistakes(document): Clarify dispatch documentation and remove stale duplicates

* chore: exclude local Stele binding from PR

* no-mistakes(document): Correct dispatch help and never-send documentation

* ci: retrigger CI after a timed-out test shard

* no-mistakes(document): Correct dispatch architecture documentation ownership
…imits (#6983)

Opt-in: fm-watch.sh publishes state/lane-capacity.json via bin/fm-capacity.sh --publish only while config/lane-capacity exists; adds beat pressure and keyed limits to fm-capacity.sh. Unconfigured fm-capacity output unchanged.
* fix(bin): transport contribution-input JSON through slurpfile, not argjson

bin/fm-fleet-snapshot.sh --contribution-input passed the full backlog and
task-record JSON to jq through --argjson. A single --argjson argument is
capped by the kernel's MAX_ARG_STRLEN (131072 bytes on Linux), so a large
enough backlog made the kernel refuse to exec jq while the script still
exited 0 with a broken result.

Transport both documents through temporary files and --slurpfile, matching
the pattern the default snapshot path already uses, and propagate a
non-zero exit when that jq invocation fails.

Fixes #5349

* test: narrow contribution-input regression to final assembly failure

The ARG_MAX transport is already fixed on main by #6830, so keep only the regression proving a failing final jq assembly exits non-zero.
* Fix Rex secondmate session lifecycle

* no-mistakes(review): Retire Rex secondmate sessions under the owning home identity

* no-mistakes(review): Limit Rex FM_ROOT label override to secondmate launches

* no-mistakes(document): Clarify Rex secondmate grouping and lifecycle documentation
…gins, and exit (#7336)

* feat(opencode): add OpenCode 2 support with version-gated launch and plugins

OpenCode 2 dropped the v1 server-plugin hook API, so the five fm.primary.*
plugins now export a default definition with an id and a setup function
alongside their legacy OpenCode 1 server export, backed by a new shared
lib/fm-opencode2.js helper; the turn-end guard, watch-arm, cd-check,
pretool-check, and sessionstart-nudge install their behavior from setup(ctx)
on OpenCode 2 and keep the server entrypoint for OpenCode 1.

fm-spawn probes the resolved opencode executable's --version once and branches
the launch, model flag, reasoning config, exit key, and busy-state plugin off
the detected major. A parsed major >= 2 takes the OpenCode 2 shape (no --model,
the model pinned through OPENCODE_CONFIG_CONTENT, a raw Ctrl-C exit, the
session.execution.* busy plugin); OpenCode 1.x and any undetected or
unparseable version fall back to the 1.x shape (--model, 1.x config, /exit)
everywhere. The worker busy-state plugin is always provisioned, but OpenCode 1
keeps the pre-port session.status/session.idle plugin so its busy-state wiring
is unchanged, and only a major >= 2 gets the session.execution plugin. Adapter
and supervision docs, OpenCode 2 live fixtures, and regression tests for the
unknown->1.x launch path and the version-gated busy-plugin shape are included.

* no-mistakes(review): gate OpenCode 2 busy plugin turn-end touch on notifyTurnEnd

* feat(opencode): launch detected OpenCode 2 workers with --standalone

OpenCode 2's default launch attaches to the shared background service, which
hosts plugins with the service's environment and ignores the pane's
OPENCODE_CONFIG_CONTENT. A private server keeps per-worker model, permissions,
FM_HOME, and lock ancestry correct. 1.x and undetected versions are unchanged.

Ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* fix(opencode): resolve the OpenCode 2 project location and treat every terminal turn as a turn end

OpenCode 2.0.x hands plugins the project only as ctx.location.project.directory
and takes ctx.session.prompt({ sessionID, text }), so the V2 setup path never
found its root or delivered a prompt. Interrupted and failed turns now end a
turn like a succeeded one, while a server shutdown does not.

Ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* test(opencode): add a token-free OpenCode 2 native plugin fixture to the live e2e

A private opencode serve plus a loopback provider proves the five primary
plugins load and act on OpenCode 2: startup nudge, cd and watcher-redirection
guards, turn-end guard, watcher arming across succeeded, interrupted, and
failed turns. The fixture declares the complete model capabilities object,
which OpenCode 2.0.11 requires and 2.0.22 accepts. FM_OPENCODE_LIVE_BINS runs
it across several OpenCode 2 executables. The credentialed half now picks its
run flags and session tables by detected major, so it keeps working on 1.x.

Fixture ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* feat(opencode): send one Enter when an OpenCode 2 launch leaves the brief unsent

OpenCode 2.0.11 prefills the --prompt brief without submitting it, while 2.0.22 submits it.
After launch, fm-spawn waits for the worker's busy-state plugin to report the turn start, sends one Enter only if it has not started and the composer is not empty, and fails the spawn if the turn never starts.

* docs(opencode): document the OpenCode 2 launch, delivery gate, and standalone primary homes

Records the 2.0.11 and 2.0.22 live evidence for the native plugin fixture and the post-launch brief delivery gate.

* no-mistakes(review): Trim OpenCode 2 adapter shapes and harden Ctrl-C exit

* no-mistakes(review): Record OpenCode 2 live seatbelt and exit evidence

* no-mistakes(test): Document OpenCode 2.0.22 wide-pane sidebar exit refusal limitation

* no-mistakes(document): Refresh OpenCode 2 exit-key and seatbelt payload docs

* test(opencode): verify OpenCode 1.x live with the dual-export plugins

Pin the live e2e TUI panes to the resolved opencode executable, and record
OpenCode 1.15.7, 1.18.20, and 1.18.31 evidence for plugin loading, the
turn-end guard, watcher continuity, and 1.x worker launch and exit.

* no-mistakes(review): Defer OpenCode 2 Enter on unknown composer; widen turn-end docs

* no-mistakes(document): Document OpenCode 2 delivery gate unknown-composer test outcomes

---------

Co-authored-by: Niranjan <[email protected]>
Co-authored-by: Girik Bajaj <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
…t the most recent group member (#7662)

* fix(bin): resolve the tmux container from the caller's own session, not the most recent group member

* no-mistakes(test): Fall back when the $TMUX session id is stale

* no-mistakes(document): Document tmux container choice under grouped sessions
…er (#7647)

* fix(bin): read a fully dim Cursor placeholder as an empty composer

cursor-agent 2026.10.19 draws the composer glyph and its idle placeholder
as one SGR 2 run with no reverse-video cell, so ghost stripping empties the
row and the empty-content guard returned unknown. Relaunch and exit then
refused on every idle Cursor pane on tmux.

When a styled bare row strips to empty and the plain row is an agent glyph
followed by an anchored idle placeholder, read it empty. Bright typed text,
other dim text, and unstyled rows keep their existing verdicts.

Fixes #7413

* docs(verification): record the fully dim Cursor placeholder verdict and refresh command
… composer as empty (#6163)

* fix(bin): recognize a named Claude session's titled composer rule on cursorless backends

`claude -n <name>` right-aligns the session name in the rule above the
composer. Cursorless backends (Herdr) accepted only solid rules, so the
scan saw the lower rule alone, the idle composer read `unknown`, and
away-mode delivery to a named Claude primary deferred until return.

A rule carrying one right-aligned title now opens a separator pair. It
never closes one, the pair it opens counts only over an agent-glyph row,
and it is never a valid Pi pair, so Pi's verdict is unchanged.

The away-mode composer deferral now names which refusal it was:
unsubmitted text, or no composer shape recognized.

* no-mistakes(review): Reword composer deferral reason to cover busy harness

* no-mistakes(ci): ci-3 (Greptile, user chose to fix): The rule that must always hold is that Claude's titled opening rule is accepted for any non-empty session name that doesn't start with a space and doesn't contain the rule glyph `─`, including a multiword name. The only place that check lives is the title `case` in `_fm_composer_titled_rule_row` (bin/fm-composer-lib.sh). It now reads `case "$title" in ''|' '*|*─*) return 1 ;; esac`, as the user asked, and the comment above the function mentions multiword titles. I added regression fixtures to `test_matrix_claude_named_session_titled_rule` in tests/fm-composer-lib.test.sh, next to the existing single-word `Andrew` cases. They use the title `Andrew Chen` and check that an idle composer on herdr reads `empty` and a composer with typed text reads `pending`. Something you should know: the old pattern already accepted a title with a space in the middle. It only rejected a title ending in a space. So the new multiword fixtures also pass against the old code, and the bot's failure scenario did not actually happen for "Andrew Chen". What the fix really changes is that it drops the trailing-space rejection, as instructed. Checks run: tests/fm-composer-lib.test.sh and tests/fm-composer-ghost.test.sh both pass (exit 0, no failures), and `shellcheck -x` is clean on both changed files

* no-mistakes(review): Match unnamed-ghost fixture rule width to the partner rule
…process groups (#7666)

* fix(tests): reap Pi test process groups and stop arms whose ground is removed

Orphaned stub-arm pollers from tests/fm-pi-watch-extension.test.sh outlived
a failed case: they waited for release/stop files the failed driver never
wrote, teardown only removed the temp root, and the loops had no other exit.

Run each node driver in its own recorded process group and reap those groups
in teardown before the root is removed; end every blocking stub loop once its
own script is gone. bin/fm-watch-arm.sh now exits with a typed ground-removed
line within one poll when its script, state directory, or home is deleted,
instead of polling through the successor window.

* no-mistakes(document): Document arm exit when its ground is removed
…alidating (#5947)

* fix(bin): defer wedge escalation while an attributed validation run is running or fixing

While a no-mistakes run executes a round, the worker is correctly idle behind
its own blocking drive call, yet the watcher's wedge timer escalated a possible
wedge every FM_STALE_ESCALATE_SECS. The timer now consults the attributed run
step before escalating: a run the current-state reader reports as
validating (running) or validating (fixing) for a named run defers onto the
FM_PAUSE_RESURFACE_SECS recheck cadence, aged from a marker bound to that run
id. Parked, terminal, ci-monitoring, coarse, runless, absent and unreadable
runs keep the unchanged escalation ladder.

* test: count only the validating-run read in the unarmed parked-gate probe

* no-mistakes(document): add .validating-* to watcher-internals marker inventory

* no-mistakes(document): Update fm-watch.sh comments for validating-deferral chain

* no-mistakes(document): Document validating-run deferral in guard and handoff docs

* feat(watch): gate the validating-run wedge deferral behind config/wedge-defer-validating

The deferral changed the default for every home, unlike the comparable
config/wedge-defer-parked-gate and config/wedge-defer-worker-wait waits.
Absent the new presence flag the wedge timer spends no current-state read
for it and keeps the unchanged ladder.
…(#6300)

* fix(session-lock): identify a harness session on Windows/Git Bash

Every session start on Cygwin (Git for Windows) refused the fleet lock and
dropped to read-only with "cannot locate harness process in ancestry", so
spawning, steering, merging, the wake-queue drain, and supervision repair were
skipped on every start. Two independent causes, both on the identity path.

Cygwin's ps has no -o option at all and fails the whole invocation with
"unknown option -- o", so the ancestry walk aborted on its first hop. The walk
now reads comm, args, and ppid through accessors that fall back to Cygwin's
fixed ps columns, leaving the procps/BSD path unchanged.

That alone does not resolve the session: the parent link from a shell the
harness spawns does not cross the Cygwin boundary, and Cygwin reports that
shell's PPID as 1, so no walk can reach a harness that is a native Windows
process. Identity is instead taken from the session pid the harness publishes
and confirmed against the Windows process table before it is used - the pid
must still be live and its executable must independently identify a verified
harness - so an absent, stale, or non-harness value is discarded rather than
bound.

Walking the real Windows parent chain was implemented and then removed as
unsafe. MSYS emulates exec by spawning a fresh Windows process and exiting the
old one, so intermediate shells vanish and a child's recorded parent is
routinely a pid that no longer exists; Windows never reparents an orphan, so
that dangling id stays and can be reissued to an unrelated process. Following
it can bind a home's lock to the wrong process, which is the failure this file
exists to prevent. A harness that publishes nothing stays unresolved, which
leaves the session read-only exactly as before.

Windows pids are tagged rather than stored bare. They are a different namespace:
kill -0 reports a live Windows process as dead, and the number can collide with
an unrelated live Cygwin pid. The tag makes the value non-numeric, so a consumer
that treats it as a local pid - including a future kill - refuses it instead of
acting on the wrong process.

fm-sessionstart-nudge.sh carried a private second copy of the ownership walk and
so stayed wrong after the owner was fixed, nudging a session that already held
the lock. It now asks the owning function.

Verified on Windows 11 (Git Bash, Cygwin ps 3.4.10): the lock is acquired,
reports its holder, is idempotent, and refuses a bogus, dead, or non-harness
published pid. Regressions cover both platform departures behind a fake process
table, so they run on Linux and macOS CI too. The pre-existing e2e failure in
this suite on Windows is unchanged from main; it cannot exec its symlinked
fixture.

Refs #3396

Claude-Session: https://claude.ai/code/session_01F9T29YDqYSkQeDTC2Nfi7h
(cherry picked from commit 8b281b7b5507c342ac7870e8ccbefa56c55d05eb)

* fix(session-lock): keep the nudge's own ancestry question intact

Delegating the nudge to fm_session_lock_owned_by_self changed the question it
asks. The nudge asks whether a process in this ancestry took the lock; the
ownership predicate additionally requires a verified harness in that ancestry,
so a session whose lock was written by a plain shell started being nudged to
run session start again. tests/fm-sessionstart-nudge.test.sh pins the looser
contract deliberately.

The walk stays local, now reading ppid through the portable accessor so it also
survives a ps with no -o option, and defers to the ownership predicate only for
a Windows-tagged holder, which is not in this process table at all.

(cherry picked from commit 0baf64f71ffea275292a0fd88d033caccc041fc9)

* fix(session-lock): accept a tagged identity in every gate that reads the lock

The Windows identity added in this branch introduced a second shape into
state/.lock. Six gates read that field, and each one answered "is this value
usable" with its own inline numeric test, so every one of them read a valid
Windows holder as malformed.

The visible cost was concentrated in startup completion: the record was never
written, and the clear/compact check that consumes it could never match, so
every clear or compact on Windows repeated the full startup sequence. The
deferred network sweeps reported ownership as changed when it had not, and the
Stop auto-arm treated a dead Windows session as an unreadable lock rather than
a recoverable one. fm-lease.sh was the outlier: rather than refusing a value it
could not use, `tr -cd '0-9'` reduced the tag to its digits and produced a
number naming an unrelated process in the local table. It happened to fail
closed downstream, but deriving a wrong-namespace pid is precisely what the tag
exists to prevent, so it now takes the value whole and requires a local pid.

fm_session_pid_valid is now the single owner of that question and every gate
delegates to it, so a third identity shape cannot split them again.

Verified against the shipped bytes of each gate with a tagged lock: startup
completion now records and is recognized (main's gate reruns the full startup
on the same input), both network-ownership gates authorize their sweeps, and a
tagged lock yields no lease holder pid instead of 7204.

(cherry picked from commit 92561828fb9540ab6c77437def67a954e44b0418)

* fix(session-lock): gate the tagged identity on Windows and read it in every lock reader

Accept win:<digits> only where fm_win_boundary_applies, with an all-digit
remainder, so a Linux/macOS reader of a win:N lock stays inert as before.
The sessionstart nudge routes its tagged case through fm_win_untag_pid.
fm_session_lock_foreign_owner_live and fm_session_lock_inspect now validate
through fm_session_pid_valid and resolve a tagged holder through
fm_harness_pid_alive, so a live win:N holder reads as a live foreign owner
and as held; unverifiable tagged holders stay unknown.

* no-mistakes(document): Document Windows tagged session-lock identity in nudge and scripts docs

* fix(session-lock): keep task leases and stale detection working for a tagged holder

A Windows session can now hold the session lock as win:<pid>, but the task
lease still accepted only a local pid: the claim recorded the short-lived
fm-lease.sh process instead, and fm_lease_live rejected the tagged lock, so
the lease was never live and the other supervision actor could clear it and
act on the same task. The lease now records a live tagged lock holder whole
and treats it as live while it is still the lock holder and a verified
harness in the Windows process table. The session-lock library is loaded
only for a win:-shaped value, so POSIX lease verdicts are unchanged.

fm_session_lock_inspect left an exited tagged holder unknown, because
fm_win_command could not tell an absent pid from an unreadable table. It now
returns 1 only when a readable table proves the pid absent and 2 when the
table cannot be read, so inspection matches the local-pid contract: absent
is stale, a live non-harness is unknown with no live harness, and an
unreadable table stays unknown.

* no-mistakes(review): Restrict caller-supplied lease holder pid to local numeric

* no-mistakes(review): Pass tagged session-lock holder whole to task lease

* no-mistakes(review): Make tagged lease-holder regression tests fail without their fixes

* fix(session-lock): take a Windows CLAUDE_PID only with its session id

On Windows the session identity comes from CLAUDE_PID, which every process
started from a Claude pane inherits, so an unrelated process carrying a copy
could take the lock as that session and both would own it. The bridge now
accepts CLAUDE_PID only together with CLAUDE_CODE_SESSION_ID. The trusted
session-id gate matches the tagged win:<pid> form, so that id is recorded
beside the lock, and the anchor stays tagged. fm-lock.sh and the ownership
readers refuse the same tagged pid under a different recorded id as another
live session's. A non-Claude primary hand-started from a Claude pane inherits
both values and still resolves as that session; that remains a known
limitation. POSIX behavior is unchanged: every new branch applies only to a
tagged pid.

* fix(session-lock): let a Windows /clear re-key its own lock

/clear keeps the Claude process, so CLAUDE_PID stays while the session id
changes. Refusing the same tagged pid under a different recorded id locked a
session out of its own lock after /clear, which POSIX handles by re-keying
the sidecar. Drop that refusal: a Windows CLAUDE_PID is still taken only
together with its CLAUDE_CODE_SESSION_ID, and that id is still recorded
beside the lock and re-keyed on /clear as on POSIX.

* no-mistakes(review): Give tagged host test a session id; clarify Windows lock error

* no-mistakes(document): Point the trust-gate comment to the Windows limitation

---------

Co-authored-by: Lloyd <[email protected]>
* feat(bin): add opt-in local Claude usage threshold warner

A usage window is exhausted without warning: work is cut off mid-run
rather than stopping deliberately, and nothing says a window is close to
its cap until it is already gone.

bin/fm-usage-warner.sh is a threshold warner, not a usage viewer.
quota-axi is already the one Claude-quota reader this repo depends on
(bin/fm-quota-axi-lib.sh), so the warner runs that existing read rather
than adding a second reader that could drift from it: one bounded
`quota-axi --provider claude --json --full --no-credential-refresh`, the
snapshot validated with fm_quota_json_valid, and the provider row picked
with the same FM_QUOTA_ROW_JQ join the dispatch consumers use, under
schema 5 and schema 6 alike.

Thresholds are `<window-id>:<percent>` directives in config/usage-warner,
naming quota-axi's own window ids (five_hour, seven_day, model:<name>)
rather than a second vocabulary, and compared against each window's own
percentUsed. Naming the window is the point: the session and weekly
windows exhaust at very different times, so a figure that does not say
which window is close misleads.

One read with two callers and no new schedule: `check` is what a human
runs on demand and what the watcher runs on its ordinary check-shim
cadence once `arm` registers state/usage-warner.check.sh through
bin/fm-check-register.sh. There is no daemon.

Warnings post through macOS Notification Center with the same osascript
call bin/fm-supervise-daemon.sh's wedge alarm makes, without sourcing or
coupling to that daemon's away-mode-specific config and rate limiting.
Delivery is edge-triggered against state/.usage-warner: a crossing warns
once, stays quiet while it holds, and re-arms when the window next reads
back below its threshold, the same standing-report contract
fm-mail-check.sh and fm-tool-update-check.sh already use.

bin/fm-procevent-quota.sh already reads the same snapshot, so docs name
the boundary rather than leaving two similar surfaces unexplained. That
source fires at most once, wakes firstmate with a durable check event,
and compares a provider's aggregate effectivePercentRemaining. This
warner is the standing, human-facing half: per-window, delivered to the
person through Notification Center, and self-re-arming. Neither replaces
the other and arming both is reasonable.

Opt-in is load-bearing and enforced in code. With no valid directive,
`check` returns before any read and `arm` refuses, so an unconfigured
home gains no behaviour change, no new failure mode, and no new hard
dependency at dispatch. Notification Center is macOS-only, so `arm`
refuses on other platforms instead of registering a check that could
never speak.

The warner only warns. It does not stop or pace dispatch, and its
coverage is exactly what quota-axi can see locally, so a plan or
organisation spend cap quota-axi does not report is not covered; the doc
says so rather than implying coverage it does not have.

The new test script carries no measured CI duration hint yet, so the
portable-serial lane balances it on the conservative default until the
hints are next refreshed from a green run, per docs/fm-test-portable-shards.md.

* no-mistakes(review): Key usage-warner de-dupe on window and threshold; fix docs

* no-mistakes(review): Keep absent-window crossings recorded; stub osascript in tests

* no-mistakes(document): Document absent-window de-dupe carry-forward in usage-warner header

* fix: correct Rex secondmate grouping and lifecycle (#7656)

* Fix Rex secondmate session lifecycle

* no-mistakes(review): Retire Rex secondmate sessions under the owning home identity

* no-mistakes(review): Limit Rex FM_ROOT label override to secondmate launches

* no-mistakes(document): Clarify Rex secondmate grouping and lifecycle documentation

* feat(opencode): add OpenCode 2 support with version-gated launch, plugins, and exit (#7336)

* feat(opencode): add OpenCode 2 support with version-gated launch and plugins

OpenCode 2 dropped the v1 server-plugin hook API, so the five fm.primary.*
plugins now export a default definition with an id and a setup function
alongside their legacy OpenCode 1 server export, backed by a new shared
lib/fm-opencode2.js helper; the turn-end guard, watch-arm, cd-check,
pretool-check, and sessionstart-nudge install their behavior from setup(ctx)
on OpenCode 2 and keep the server entrypoint for OpenCode 1.

fm-spawn probes the resolved opencode executable's --version once and branches
the launch, model flag, reasoning config, exit key, and busy-state plugin off
the detected major. A parsed major >= 2 takes the OpenCode 2 shape (no --model,
the model pinned through OPENCODE_CONFIG_CONTENT, a raw Ctrl-C exit, the
session.execution.* busy plugin); OpenCode 1.x and any undetected or
unparseable version fall back to the 1.x shape (--model, 1.x config, /exit)
everywhere. The worker busy-state plugin is always provisioned, but OpenCode 1
keeps the pre-port session.status/session.idle plugin so its busy-state wiring
is unchanged, and only a major >= 2 gets the session.execution plugin. Adapter
and supervision docs, OpenCode 2 live fixtures, and regression tests for the
unknown->1.x launch path and the version-gated busy-plugin shape are included.

* no-mistakes(review): gate OpenCode 2 busy plugin turn-end touch on notifyTurnEnd

* feat(opencode): launch detected OpenCode 2 workers with --standalone

OpenCode 2's default launch attaches to the shared background service, which
hosts plugins with the service's environment and ignores the pane's
OPENCODE_CONFIG_CONTENT. A private server keeps per-worker model, permissions,
FM_HOME, and lock ancestry correct. 1.x and undetected versions are unchanged.

Ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* fix(opencode): resolve the OpenCode 2 project location and treat every terminal turn as a turn end

OpenCode 2.0.x hands plugins the project only as ctx.location.project.directory
and takes ctx.session.prompt({ sessionID, text }), so the V2 setup path never
found its root or delivered a prompt. Interrupted and failed turns now end a
turn like a succeeded one, while a server shutdown does not.

Ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* test(opencode): add a token-free OpenCode 2 native plugin fixture to the live e2e

A private opencode serve plus a loopback provider proves the five primary
plugins load and act on OpenCode 2: startup nudge, cd and watcher-redirection
guards, turn-end guard, watcher arming across succeeded, interrupted, and
failed turns. The fixture declares the complete model capabilities object,
which OpenCode 2.0.11 requires and 2.0.22 accepts. FM_OPENCODE_LIVE_BINS runs
it across several OpenCode 2 executables. The credentialed half now picks its
run flags and session tables by detected major, so it keeps working on 1.x.

Fixture ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* feat(opencode): send one Enter when an OpenCode 2 launch leaves the brief unsent

OpenCode 2.0.11 prefills the --prompt brief without submitting it, while 2.0.22 submits it.
After launch, fm-spawn waits for the worker's busy-state plugin to report the turn start, sends one Enter only if it has not started and the composer is not empty, and fails the spawn if the turn never starts.

* docs(opencode): document the OpenCode 2 launch, delivery gate, and standalone primary homes

Records the 2.0.11 and 2.0.22 live evidence for the native plugin fixture and the post-launch brief delivery gate.

* no-mistakes(review): Trim OpenCode 2 adapter shapes and harden Ctrl-C exit

* no-mistakes(review): Record OpenCode 2 live seatbelt and exit evidence

* no-mistakes(test): Document OpenCode 2.0.22 wide-pane sidebar exit refusal limitation

* no-mistakes(document): Refresh OpenCode 2 exit-key and seatbelt payload docs

* test(opencode): verify OpenCode 1.x live with the dual-export plugins

Pin the live e2e TUI panes to the resolved opencode executable, and record
OpenCode 1.15.7, 1.18.20, and 1.18.31 evidence for plugin loading, the
turn-end guard, watcher continuity, and 1.x worker launch and exit.

* no-mistakes(review): Defer OpenCode 2 Enter on unknown composer; widen turn-end docs

* no-mistakes(document): Document OpenCode 2 delivery gate unknown-composer test outcomes

---------

Co-authored-by: Niranjan <[email protected]>
Co-authored-by: Girik Bajaj <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(bin): add opt-in local Claude usage threshold warner

A usage window is exhausted without warning: work is cut off mid-run
rather than stopping deliberately, and nothing says a window is close to
its cap until it is already gone.

bin/fm-usage-warner.sh is a threshold warner, not a usage viewer.
quota-axi is already the one Claude-quota reader this repo depends on
(bin/fm-quota-axi-lib.sh), so the warner runs that existing read rather
than adding a second reader that could drift from it: one bounded
`quota-axi --provider claude --json --full --no-credential-refresh`, the
snapshot validated with fm_quota_json_valid, and the provider row picked
with the same FM_QUOTA_ROW_JQ join the dispatch consumers use, under
schema 5 and schema 6 alike.

Thresholds are `<window-id>:<percent>` directives in config/usage-warner,
naming quota-axi's own window ids (five_hour, seven_day, model:<name>)
rather than a second vocabulary, and compared against each window's own
percentUsed. Naming the window is the point: the session and weekly
windows exhaust at very different times, so a figure that does not say
which window is close misleads.

One read with two callers and no new schedule: `check` is what a human
runs on demand and what the watcher runs on its ordinary check-shim
cadence once `arm` registers state/usage-warner.check.sh through
bin/fm-check-register.sh. There is no daemon.

Warnings post through macOS Notification Center with the same osascript
call bin/fm-supervise-daemon.sh's wedge alarm makes, without sourcing or
coupling to that daemon's away-mode-specific config and rate limiting.
Delivery is edge-triggered against state/.usage-warner: a crossing warns
once, stays quiet while it holds, and re-arms when the window next reads
back below its threshold, the same standing-report contract
fm-mail-check.sh and fm-tool-update-check.sh already use.

bin/fm-procevent-quota.sh already reads the same snapshot, so docs name
the boundary rather than leaving two similar surfaces unexplained. That
source fires at most once, wakes firstmate with a durable check event,
and compares a provider's aggregate effectivePercentRemaining. This
warner is the standing, human-facing half: per-window, delivered to the
person through Notification Center, and self-re-arming. Neither replaces
the other and arming both is reasonable.

Opt-in is load-bearing and enforced in code. With no valid directive,
`check` returns before any read and `arm` refuses, so an unconfigured
home gains no behaviour change, no new failure mode, and no new hard
dependency at dispatch. Notification Center is macOS-only, so `arm`
refuses on other platforms instead of registering a check that could
never speak.

The warner only warns. It does not stop or pace dispatch, and its
coverage is exactly what quota-axi can see locally, so a plan or
organisation spend cap quota-axi does not report is not covered; the doc
says so rather than implying coverage it does not have.

The new test script carries no measured CI duration hint yet, so the
portable-serial lane balances it on the conservative default until the
hints are next refreshed from a green run, per docs/fm-test-portable-shards.md.

* no-mistakes(review): Key usage-warner de-dupe on window and threshold; fix docs

* no-mistakes(review): Keep absent-window crossings recorded; stub osascript in tests

* no-mistakes(document): Document absent-window de-dupe carry-forward in usage-warner header

* no-mistakes(review): Serialize usage-warner check, dedupe directives, drop vacuous greps

* no-mistakes(document): List usage-warner check lock in state layout

---------

Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Kostadin Pop-Kochev <[email protected]>
Co-authored-by: Niranjan <[email protected]>
Co-authored-by: Girik Bajaj <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
* fix(bin): use clock-stable /proc starttime for remote job worker ownership

Linux remote job ownership compared ps lstart, which drifts on WSL2 while
/proc starttime stays fixed, so ensure treated a healthy worker as dead and
started another supervisor on every call. fm_remote_job_process_start now emits
a proc-starttime token when /proc is readable and falls back to ps lstart
otherwise. The Linux start path hands a live worker of the configured root
whose lock still records a legacy start over to one replacement, checked
against the recorded and live command so no unrelated pid is signaled.

Fixes #2921

* no-mistakes(review): Treat legacy lstart claim starts as indeterminate, not mismatched

* no-mistakes(test): Assert legacy handoff interrupts job once

* no-mistakes(test): Remove scratch debug test; legacy job case git-tracked

* no-mistakes(test): Revert legacy start comparator; simplify legacy handoff test

* fix(bin): drop automatic legacy worker upgrade; document manual one-time restart

* chore: remove stray file

* no-mistakes(document): Drop stale handoff mention from remote worker docs

* fix(bin): verify pre-update remote job workers via legacy lstart

When a recorded start lacks the proc-starttime= prefix, compare it against
ps -o lstart= without LC_ALL=C so a healthy pre-update worker still verifies.
The ordinary code-identity path then replaces it once instead of piling
supervisors. Add regression coverage for the bare-lstart cookie and the
lock upgrade path.

* no-mistakes(document): Clarify legacy remote-job start verification docs

* no-mistakes(review): Preserve C-locale legacy cookie verification, captain

* no-mistakes(document): Clarify legacy process identity cookie compatibility

* no-mistakes(lint): Replace deprecated fgrep with lint-compliant grep -F

---------

Co-authored-by: Pitch Perfekt Collective <[email protected]>
Co-authored-by: mehulbhagwani <[email protected]>
…ude (#6722)

* fix: use managed-compatible worker approval modes

* no-mistakes(document): update codex and claude worker approval mode docs

* no-mistakes(ci): Fixed two test files that weren't updated when the PR changed the default claude permission mode from `--dangerously-skip-permissions` (bypass) to `--permission-mode auto`. Changes: - `tests/fm-claude-trust.test.sh` lines 664 and 696: updated two `assert_grep` assertions from `claude --dangerously-skip-permissions` → `claude --permission-mode auto` - `tests/fm-backend-orca.test.sh` line 568: updated one `assert_contains` assertion from `claude --dangerously-skip-permissions` → `claude --permission-mode auto` Both tests now pass locally (orca: exit=0, backend-dispatch/claude-trust: exit=0)

* fix: remove stray scratch directories from tests/

tests/.tmp-managed-approvals-test.bBuGhY/ and tests/.tmp-managed-approvals2.exz2qr/
were accidentally committed as worktree-local scratch dirs and do not belong in the repo.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* fix: preserve bypass defaults with persistent managed approval failover

* no-mistakes(review): fix approve-for-me fixture and bypass diagnostic messages

* no-mistakes(review): restore absent-Claude-default test and fix pass messages

* fix: recognize managed Codex approval prompts in the C locale

* no-mistakes(review): Fix managed approval failover bounds, authorization, inheritance, and capture

* Simplify managed approval recovery to persistent explicit failover

* no-mistakes(review): Guard failover authorization and unlink staging before recovery

* no-mistakes(document): Correct managed approval documentation and consolidate owner references

* no-mistakes(document): Correct managed-approval references and stale hook guarantees

* fix: require approval and inherit managed modes from primary

* no-mistakes(document): Clarify live hook verification scope

* no-mistakes(review): Remove dead approval_configured key from relaunch metadata

* fix: resurface queued wakes from handling successors (#7466)

* fix(bin): resurface wakes appended while a handling successor is parked

The supervision host parks on the handling successor it starts for a wake
its engine handled, and a handling successor never resurfaced recovery, so
a row another script appended during the park (a captain inbox note from
the Basecamp integration) sat queued until an unrelated close - four hours
in the observed case.

A handling successor now records the newest queued sequence at its start
and closes once with the recovery wake while a newer row is still queued;
a newer row already consumed only advances that mark, so the predecessor's
delivered episode is still never re-announced.

Follow-ups, not built here:
- A row appended in the short window between a handled close and its
  successor's start (about a second) is below the successor's mark; if the
  engine handles that close without claiming the row, the row waits for the
  next close. Closing that window needs the host to treat rows left queued
  after a handled attended turn as main's, which is a separate host change.
- After a machine reboot the primary session does not restart on its own,
  so queued wakes wait until it is resumed by hand. Either auto-resume the
  primary session after boot, or alert the owner when the primary session
  is down while wakes are queued.

* no-mistakes(review): Close handling-successor startup wake race

* no-mistakes(test): Stabilize parked-host inbox wake regression timeout

* no-mistakes(document): Clarify handling-successor wake continuity guarantees

* no-mistakes(ci): Stabilized the flaky remote secondmate lifecycle test by extending the auto-relaunch watcher deadline from ~30 to ~60 seconds. The CI runner exceeded the old deadline by about 3 seconds; the changed production branch was not reachable in this fixture. `bash -n` and `git diff --check` pass. The full test was attempted but exceeded the 600-second local execution limit before reaching this case

* no-mistakes(ci): Fixed flaky concurrent Herdr recovery testing by retrying only documented session-lock contention after both competitors finish. Cleanup now handles fixture-owned read-only hooks. Targeted E2E passed; bash syntax and diff checks passed. Shellcheck reported only existing SC1091 source-following notices

* no-mistakes(test): Preserve successor wake boundaries across handoffs

* no-mistakes(test): Revert successor boundaries and drain teardown fixture wake

* no-mistakes(test): Notify main when downtime handback publication fails

* no-mistakes(test): Revert downtime handback notification changes

* no-mistakes(document): Correct stale supervision wake routing documentation

* fix(bin): stop the supervision host deadlocking and re-announcing handed-back closes

Two defects in this branch's handling-successor changes surfaced as the
"Behavior portable serial 2" shard hanging at its 30-minute limit.

A TERM that lands while the host settles a handled turn's successor handoff
left the host holding the wake-queue and recovery-marker locks; its exit
cleanup then waited forever on the queue lock it still owned. The cleanup now
releases those locks if this process owns them before releasing its grant.

When an accepted close turns main-only at its turn, the host hands it back and
leaves the successor running, but republished the episode as pending
downtime, so that successor re-announced the same close and exited. The
handback now republishes the episode as already announced; a later durable
append still opens a pending episode the successor recovers.

* no-mistakes(test): Park on successor after handling settlement failure

* no-mistakes(test): Use tab-delimited handled-settlement failure logs

---------

Co-authored-by: Caleb LeNoir <[email protected]>

* fix(bin): preserve accents in pending-reply summaries (#7618)

* fix(bin): keep accented letters in pending-reply request summaries

fm_pending_reply_summarize deleted every byte outside printable ASCII, so a Portuguese summary lost its accents: "não faça a correção" was stored as "no faa a correo". It now removes control characters only. The 120-character cap counts UTF-8 characters from lead bytes, so it never splits a letter under any caller locale, including the C locale.

* no-mistakes(document): Documentar preservação de acentos nos resumos

---------

Co-authored-by: Alexandre Custodio <[email protected]>

* feat: add OpenRouter support for typed dispatch resolution (#7149)

* Add explicit OpenRouter Jev dispatch resolution

* no-mistakes(document): Clarify dispatch documentation and remove stale duplicates

* chore: exclude local Stele binding from PR

* no-mistakes(document): Correct dispatch help and never-send documentation

* ci: retrigger CI after a timed-out test shard

* no-mistakes(document): Correct dispatch architecture documentation ownership

* feat(bin): publish lane capacity facts with beat pressure and keyed limits (#6983)

Opt-in: fm-watch.sh publishes state/lane-capacity.json via bin/fm-capacity.sh --publish only while config/lane-capacity exists; adds beat pressure and keyed limits to fm-capacity.sh. Unconfigured fm-capacity output unchanged.

* fix(bin): propagate contribution input assembly failures (#5359)

* fix(bin): transport contribution-input JSON through slurpfile, not argjson

bin/fm-fleet-snapshot.sh --contribution-input passed the full backlog and
task-record JSON to jq through --argjson. A single --argjson argument is
capped by the kernel's MAX_ARG_STRLEN (131072 bytes on Linux), so a large
enough backlog made the kernel refuse to exec jq while the script still
exited 0 with a broken result.

Transport both documents through temporary files and --slurpfile, matching
the pattern the default snapshot path already uses, and propagate a
non-zero exit when that jq invocation fails.

Fixes #5349

* test: narrow contribution-input regression to final assembly failure

The ARG_MAX transport is already fixed on main by #6830, so keep only the regression proving a failing final jq assembly exits non-zero.

* fix: correct Rex secondmate grouping and lifecycle (#7656)

* Fix Rex secondmate session lifecycle

* no-mistakes(review): Retire Rex secondmate sessions under the owning home identity

* no-mistakes(review): Limit Rex FM_ROOT label override to secondmate launches

* no-mistakes(document): Clarify Rex secondmate grouping and lifecycle documentation

* feat(opencode): add OpenCode 2 support with version-gated launch, plugins, and exit (#7336)

* feat(opencode): add OpenCode 2 support with version-gated launch and plugins

OpenCode 2 dropped the v1 server-plugin hook API, so the five fm.primary.*
plugins now export a default definition with an id and a setup function
alongside their legacy OpenCode 1 server export, backed by a new shared
lib/fm-opencode2.js helper; the turn-end guard, watch-arm, cd-check,
pretool-check, and sessionstart-nudge install their behavior from setup(ctx)
on OpenCode 2 and keep the server entrypoint for OpenCode 1.

fm-spawn probes the resolved opencode executable's --version once and branches
the launch, model flag, reasoning config, exit key, and busy-state plugin off
the detected major. A parsed major >= 2 takes the OpenCode 2 shape (no --model,
the model pinned through OPENCODE_CONFIG_CONTENT, a raw Ctrl-C exit, the
session.execution.* busy plugin); OpenCode 1.x and any undetected or
unparseable version fall back to the 1.x shape (--model, 1.x config, /exit)
everywhere. The worker busy-state plugin is always provisioned, but OpenCode 1
keeps the pre-port session.status/session.idle plugin so its busy-state wiring
is unchanged, and only a major >= 2 gets the session.execution plugin. Adapter
and supervision docs, OpenCode 2 live fixtures, and regression tests for the
unknown->1.x launch path and the version-gated busy-plugin shape are included.

* no-mistakes(review): gate OpenCode 2 busy plugin turn-end touch on notifyTurnEnd

* feat(opencode): launch detected OpenCode 2 workers with --standalone

OpenCode 2's default launch attaches to the shared background service, which
hosts plugins with the service's environment and ignores the pane's
OPENCODE_CONFIG_CONTENT. A private server keeps per-worker model, permissions,
FM_HOME, and lock ancestry correct. 1.x and undetected versions are unchanged.

Ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* fix(opencode): resolve the OpenCode 2 project location and treat every terminal turn as a turn end

OpenCode 2.0.x hands plugins the project only as ctx.location.project.directory
and takes ctx.session.prompt({ sessionID, text }), so the V2 setup path never
found its root or delivered a prompt. Interrupted and failed turns now end a
turn like a succeeded one, while a server shutdown does not.

Ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* test(opencode): add a token-free OpenCode 2 native plugin fixture to the live e2e

A private opencode serve plus a loopback provider proves the five primary
plugins load and act on OpenCode 2: startup nudge, cd and watcher-redirection
guards, turn-end guard, watcher arming across succeeded, interrupted, and
failed turns. The fixture declares the complete model capabilities object,
which OpenCode 2.0.11 requires and 2.0.22 accepts. FM_OPENCODE_LIVE_BINS runs
it across several OpenCode 2 executables. The credentialed half now picks its
run flags and session tables by detected major, so it keeps working on 1.x.

Fixture ported from kunchenguid/firstmate#5143.

Co-authored-by: Girik Bajaj <[email protected]>

* feat(opencode): send one Enter when an OpenCode 2 launch leaves the brief unsent

OpenCode 2.0.11 prefills the --prompt brief without submitting it, while 2.0.22 submits it.
After launch, fm-spawn waits for the worker's busy-state plugin to report the turn start, sends one Enter only if it has not started and the composer is not empty, and fails the spawn if the turn never starts.

* docs(opencode): document the OpenCode 2 launch, delivery gate, and standalone primary homes

Records the 2.0.11 and 2.0.22 live evidence for the native plugin fixture and the post-launch brief delivery gate.

* no-mistakes(review): Trim OpenCode 2 adapter shapes and harden Ctrl-C exit

* no-mistakes(review): Record OpenCode 2 live seatbelt and exit evidence

* no-mistakes(test): Document OpenCode 2.0.22 wide-pane sidebar exit refusal limitation

* no-mistakes(document): Refresh OpenCode 2 exit-key and seatbelt payload docs

* test(opencode): verify OpenCode 1.x live with the dual-export plugins

Pin the live e2e TUI panes to the resolved opencode executable, and record
OpenCode 1.15.7, 1.18.20, and 1.18.31 evidence for plugin loading, the
turn-end guard, watcher continuity, and 1.x worker launch and exit.

* no-mistakes(review): Defer OpenCode 2 Enter on unknown composer; widen turn-end docs

* no-mistakes(document): Document OpenCode 2 delivery gate unknown-composer test outcomes

---------

Co-authored-by: Niranjan <[email protected]>
Co-authored-by: Girik Bajaj <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(bin): resolve the tmux container from firstmate's own session, not the most recent group member (#7662)

* fix(bin): resolve the tmux container from the caller's own session, not the most recent group member

* no-mistakes(test): Fall back when the $TMUX session id is stale

* no-mistakes(document): Document tmux container choice under grouped sessions

* fix(bin): read a fully dim Cursor idle placeholder as an empty composer (#7647)

* fix(bin): read a fully dim Cursor placeholder as an empty composer

cursor-agent 2026.10.19 draws the composer glyph and its idle placeholder
as one SGR 2 run with no reverse-video cell, so ghost stripping empties the
row and the empty-content guard returned unknown. Relaunch and exit then
refused on every idle Cursor pane on tmux.

When a styled bare row strips to empty and the plain row is an agent glyph
followed by an anchored idle placeholder, read it empty. Bright typed text,
other dim text, and unstyled rows keep their existing verdicts.

Fixes #7413

* docs(verification): record the fully dim Cursor placeholder verdict and refresh command

* fix(bin): say why away-mode inject deferred and pin named Claude idle composer as empty (#6163)

* fix(bin): recognize a named Claude session's titled composer rule on cursorless backends

`claude -n <name>` right-aligns the session name in the rule above the
composer. Cursorless backends (Herdr) accepted only solid rules, so the
scan saw the lower rule alone, the idle composer read `unknown`, and
away-mode delivery to a named Claude primary deferred until return.

A rule carrying one right-aligned title now opens a separator pair. It
never closes one, the pair it opens counts only over an agent-glyph row,
and it is never a valid Pi pair, so Pi's verdict is unchanged.

The away-mode composer deferral now names which refusal it was:
unsubmitted text, or no composer shape recognized.

* no-mistakes(review): Reword composer deferral reason to cover busy harness

* no-mistakes(ci): ci-3 (Greptile, user chose to fix): The rule that must always hold is that Claude's titled opening rule is accepted for any non-empty session name that doesn't start with a space and doesn't contain the rule glyph `─`, including a multiword name. The only place that check lives is the title `case` in `_fm_composer_titled_rule_row` (bin/fm-composer-lib.sh). It now reads `case "$title" in ''|' '*|*─*) return 1 ;; esac`, as the user asked, and the comment above the function mentions multiword titles. I added regression fixtures to `test_matrix_claude_named_session_titled_rule` in tests/fm-composer-lib.test.sh, next to the existing single-word `Andrew` cases. They use the title `Andrew Chen` and check that an idle composer on herdr reads `empty` and a composer with typed text reads `pending`. Something you should know: the old pattern already accepted a title with a space in the middle. It only rejected a title ending in a space. So the new multiword fixtures also pass against the old code, and the bot's failure scenario did not actually happen for "Andrew Chen". What the fix really changes is that it drops the trailing-space rejection, as instructed. Checks run: tests/fm-composer-lib.test.sh and tests/fm-composer-ghost.test.sh both pass (exit 0, no failures), and `shellcheck -x` is clean on both changed files

* no-mistakes(review): Match unnamed-ghost fixture rule width to the partner rule

* fix: use managed-compatible worker approval modes

* no-mistakes(document): update codex and claude worker approval mode docs

* no-mistakes(ci): Fixed two test files that weren't updated when the PR changed the default claude permission mode from `--dangerously-skip-permissions` (bypass) to `--permission-mode auto`. Changes: - `tests/fm-claude-trust.test.sh` lines 664 and 696: updated two `assert_grep` assertions from `claude --dangerously-skip-permissions` → `claude --permission-mode auto` - `tests/fm-backend-orca.test.sh` line 568: updated one `assert_contains` assertion from `claude --dangerously-skip-permissions` → `claude --permission-mode auto` Both tests now pass locally (orca: exit=0, backend-dispatch/claude-trust: exit=0)

* fix: remove stray scratch directories from tests/

tests/.tmp-managed-approvals-test.bBuGhY/ and tests/.tmp-managed-approvals2.exz2qr/
were accidentally committed as worktree-local scratch dirs and do not belong in the repo.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* fix: preserve bypass defaults with persistent managed approval failover

* no-mistakes(review): fix approve-for-me fixture and bypass diagnostic messages

* no-mistakes(review): restore absent-Claude-default test and fix pass messages

* fix: recognize managed Codex approval prompts in the C locale

* no-mistakes(review): Fix managed approval failover bounds, authorization, inheritance, and capture

* Simplify managed approval recovery to persistent explicit failover

* no-mistakes(review): Guard failover authorization and unlink staging before recovery

* no-mistakes(document): Correct managed approval documentation and consolidate owner references

* no-mistakes(document): Correct managed-approval references and stale hook guarantees

* fix: require approval and inherit managed modes from primary

* no-mistakes(document): Clarify live hook verification scope

* no-mistakes(review): Remove dead approval_configured key from relaunch metadata

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Caleb LeNoir <[email protected]>
Co-authored-by: Caleb LeNoir <[email protected]>
Co-authored-by: Alexandre Custodio <[email protected]>
Co-authored-by: Alexandre Custodio <[email protected]>
Co-authored-by: Pedro Guimarães <[email protected]>
Co-authored-by: Konner Moshier <[email protected]>
Co-authored-by: Oscar Santis Brante <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Kostadin Pop-Kochev <[email protected]>
Co-authored-by: Niranjan <[email protected]>
Co-authored-by: Girik Bajaj <[email protected]>
Co-authored-by: Tomas Perez <[email protected]>
Co-authored-by: Cameron Aragon <[email protected]>
Co-authored-by: Brian <[email protected]>
…ounter loss (#6467)

* fix: notify handling successors about newer inbox wakes

* no-mistakes(document): Document handling-successor inbox regression in watcher coverage list

* no-mistakes(ci): Fixed Greptile P1 (comment 4172295712): a handling successor could miss a new inbox wake when `.wake-queue.seq` was missing or malformed. What must always hold: a row added after the successor took its snapshot must be announced and must never be consumed by an older acknowledgement. Two places were breaking this: 1. `bin/fm-watch.sh`: the successor only recorded the highest inherited sequence number. If the counter was reset, a new row could get a number at or below that and be treated as already covered. This now stays silent forever once the inherited rows are acknowledged and the queue drains. 2. `bin/fm-wake-lib.sh` `fm_wake_append_locked`: a reset counter reused the sequence number of a row still in the queue. The predecessor's pending `--ack-through` consumes rows by sequence number, so it deleted the new row before anyone handled it. This was a gap in the existing allocator, and it is what made the before-ack cases fail even after fix 1. Fixes: - Watcher: the successor now snapshots the inherited rows themselves instead of their highest sequence. On each poll it announces if any queued row is not in that snapshot. It still never consumes rows, and inherited rows alone stay silent. - Allocator: the next sequence is now one more than the larger of the counter and the highest sequence still queued, so a new row can't land inside an outstanding acknowledgement's range. - `docs/watcher-continuity.md`: the paragraph and coverage list are updated to match. Tests: `test_append_wakes_handling_successor` in `tests/fm-watch-arm.test.sh` now inherits two rows and takes a counter state (intact, missing, malformed). The four new cases are after-ack and before-ack with a missing or malformed counter, and they run real watcher, arm and drain processes. In after-ack the queue is fully drained before the new append. Evidence: - Before any production change (on 92c724d), all four new cases failed: "not ok - handling successor stranded the second inbox wake" for after-ack and before-ack. - With only the watcher fix, the after-ack cases passed and the before-ack cases still failed, which shows the allocator fix is needed. - With both fixes, all four pass. Full results: `fm-watch-arm` 36/36 (including the intact after-ack and before-ack cases, so ordinary silence and fresh-beacon delivery still hold), `fm-watch-recovery-loop` 2/2, `fm-inbox` 16/16, `fm-pi-watch-extension` 60/60, `fm-wake-queue` 67/67, and all four `fm-wake-drain-*` suites passed (9, 9, 18, 14). Canonical `bin/fm-lint.sh` with `PATH=/home/nino/.local/bin:$PATH` passed: ShellCheck clean, actionlint 1.7.12, 3 workflows valid. That lint run was in local changed-file mode with ShellCheck source following disabled. In a first run of all nine suites in parallel, `fm-wake-queue` failed on "presentation lock delayed the drain for 10s" and one `fm-pi-watch-extension` timing test failed. Both passed in full when rerun on their own, so I read that as load contention, not this change. Design decision to flag: the allocator change sits in the shared wake library, so it goes beyond the watcher comparison the bot pointed at. It is a one-expression change, and the before-ack tests can't pass without it, because otherwise the predecessor's acknowledgement deletes the new message. Not done, per the phase boundary: nothing committed, pushed or posted, and the live fleet was not touched. Evidence logs are in /tmp/fmci, not in a pipeline logs/evidence directory

* no-mistakes(ci): Fixed both Greptile findings on PR #6467. Nothing was committed, pushed or posted, and the live fleet was not touched. **ci-1 (4172409813): a new wake was mistaken for an inherited one.** - Invariant that must hold: a successor treats a row as covered only if it is an unchanged inherited row in the inherited recovery episode. - Cause: after the predecessor's acknowledgement and a lost counter, a re-append with the same kind, key, payload and epoch was byte-identical to the snapshot row, so the successor stayed silent. - Fix (`bin/fm-watch.sh`): I used the existing recovery generation rather than a new identity scheme. Any append after an acknowledgement mints a new generation. The successor records the generation with its row snapshot, under the queue lock and in arm-check's lock order. Each poll counts the queue as newer if a row is not in the snapshot, or if the queue is non-empty and the generation changed. The existing arm-check then decides whether to announce. No rows are consumed, and inherited rows alone stay silent. - The row snapshot is still needed for before-ack, because an append before the acknowledgement keeps the same generation. **ci-2 (4172409821): large sequence numbers became unusable.** - Invariant that must hold: sequence numbers are always exact digit-only decimals. - Fix (`bin/fm-wake-lib.sh`): the allocator picks the largest of the counter and the queued sequences by comparing decimal text (length, then string order, leading zeros stripped), then adds 1 in bash with `$((10#$seq + 1))`. This restores the 64-bit exactness of the original bash counter. - Same fix at two places in `bin/fm-wake-drain.sh` that print sequences: `presented_max_row` and `ACK_THROUGH` print the matched text instead of `max + 0`. **Tests** - `tests/fm-watch-arm.test.sh`: two new `identical` cases, after-ack with a missing and with a malformed counter. A fake `date` pins the epoch, and the test asserts the row is byte-identical, then checks timely notification, preservation until its own acknowledgement, and no repeat notification. - `tests/fm-wake-queue.test.sh`: new `test_large_sequences_stay_exact_decimal_identifiers` starts from 2147483647, 9007199254740991 and 9223372036854775806, each with an intact, missing and malformed counter. It checks the next sequence is exact and digit-only. For the first two it also checks a real drain shows both rows, names the exact acknowledgement sequence, and acknowledging empties the queue. - `docs/watcher-continuity.md` now describes the generation check. **Evidence** (in `/home/nino/.no-mistakes/evidence/01M40CDTX2000A5TFFRZN27YFR/ci-round3/`) - Before, on 050a5fc: both identical cases failed with "handling successor stranded the second inbox wake (after-ack)". The large-sequence test failed with "advanced to '9223372036854775808', not 9223372036854775807". - After the fix, all three pass (`after-*.log`). - All nine suites passed, each run on its own, all with 0 not ok (`final-results.txt`): `fm-wake-queue` 68/68, `fm-watch-arm` 38/38, `fm-watch-recovery-loop` 2/2, `fm-inbox` 16/16, `fm-pi-watch-extension` 60/60, `fm-wake-drain-open-decisions-cursor` 9/9, `fm-wake-drain-open-decisions` 9/9, `fm-wake-drain-outcome-backstop` 18/18, `fm-wake-drain-unread-status` 14/14. - `bin/fm-lint.sh` with `PATH=/home/nino/.local/bin:$PATH` passes: ShellCheck clean, actionlint 1.7.12, 3 workflows valid (local changed-file mode). **Not run** - The only OpenCode suite is an opt-in live test, so I did not run it. **Limits** - The 2.14748e+09 symptom doesn't reproduce with the awks here (gawk, mawk 1.3.4, busybox). The failure reproduced locally is the precision loss at 64-bit values. - The drain's awk comparisons are only exact up to 2^53. That predates this PR and I left it alone, so the drain test stops at 2^53

* no-mistakes(document): Reattach successor poll-loop sentence to its subject
… directory is removed (#7685)

* fix(tests): bound lock waits on removed dirs and reap fixture-root processes

A lock wait spun every 0.1s forever once its directory was removed, so a
watcher or reconcile scan of a deleted test home never reached its own
home-gone exit. fm_lock_acquire_wait now returns within 0.2s once the
lock's parent directory is gone.

Test teardown now signals every process naming the exact fixture root
(TERM, then KILL) before removing it, in both fm_test_cleanup and the
orphan sweep. The supervision-host fake harness sessions stop once their
home is gone or the suite pid has died, so a hard-killed runner no longer
leaves them polling under init.

Fixes #7672

* fix(tests): bound the session-lock concurrency barrier

Forty workers polled a find pipeline every 0.01s to wait for each other,
so the barrier alone launched thousands of processes a second, and once a
stopped run removed the barrier directory the workers polled forever under
init. Count entries with a builtin glob every 0.05s, and end the wait once
the directory is gone, the suite has died, or the stub block bound passes.

Refs #7672
* fix(bin): admit listed review-bot comments as contribution signals

* no-mistakes(review): Persist review-bot config in contribution check shim

* no-mistakes(review): Classify allowlisted collaborators as review bots

* no-mistakes(document): Document review-bot contribution signals

* no-mistakes(review): Preserve review-bot config and re-raise classification

* no-mistakes(review): Prevent acknowledged bot signals replaying after allowlist changes

* no-mistakes(document): Document configurable review-bot contribution watching

* no-mistakes(document): Clarify review-bot thread documentation

* fix(bin): make review-bot contribution watching opt-in

* docs(bin): state review-bot allowlist has no built-in default

* no-mistakes(document): Document per-home review-bot configuration

---------

Co-authored-by: Caleb LeNoir <[email protected]>
…#7674)

The generated Waiting section told workers to wait on a heavy-test slot that nothing in the repository defines. Remove the phrase and assert that a brief generated with config/wait-no-turns does not name one.
* fix(bin): read the no_ci ci-monitor marker as no-checks instead of validating

Fixes #7644

* no-mistakes(document): Rewrap nm_ci_checks_state no_ci comment
…7683)

* feat: add opt-in restricted permissions for Codex workers

* no-mistakes(review): Document restricted Codex network and git approval limits
… scripts (#7699)

* fix(test): keep serial packing at-budget when a script has no hint

tests/fm-approval-failover.test.sh landed without a serial duration hint,
so the at-budget packing fixture overflowed by 1040ms. Record a measured
5410ms hint and give the fixture its own complete hint table so unmeasured
defaults cannot join the boundary shard.

Co-authored-by: Kun Chen <[email protected]>

* docs: note the local approval-failover packing hint

Record the 5410 ms provisional local sample for the next CI refresh,
and describe the packing-boundary fixture as independent of unhinted
scripts.

Co-authored-by: Kun Chen <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
jesstelford and others added 29 commits November 26, 2026 15:16
… lavish board (#6357)

* fix(bearings): show full Charted Next titles and reasons on the lavish board

Charted Next rows on the board clipped their title and reason with an
ellipsis, and the snapshot shortened gate titles before the board saw them.
Charted Next rows now wrap their full text, and the snapshot's new
--fields gate-text opt-in carries untruncated title_full and reason_full
for the board while the chat digest keeps its compact bounds.

* fix(bearings): keep secondmate Charted Next text whole across the home summary

A secondmate's home summary shortened queued titles to 120 characters and
hold or blocked reasons to 160 before the bearings projection saw them, so
--fields gate-text still handed the lavish board clipped text for secondmate
gates. The summary now keeps up to 500 characters for those fields, which
covers any realistic backlog item while 20 bounded rows stay far inside the
summary byte cap. The stock macOS Bash CI lane's pinned Bearings test count
moves to 61 for the gate-text regression.

* no-mistakes(review): Pass secondmate queued title and reasons untruncated

* test(bearings): expect untruncated queued text in the secondmate home summary
…ancels it (#8779)

* fix(bin): exec the herdr lab server launch so a timed-out provision cancels it

On bash builds that keep a subshell for an async function (macOS /bin/bash
3.2, the Linux CI bash), $! of the backgrounded launch was that subshell, so
fm_herdr_lab_cancel_provision left the herdr server running after a timed-out
provision. The launch now execs herdr through fm_herdr_lab_raw_exec, making
$! the server process on every bash; the cancel is unchanged.

The timed-out provision test now asserts, right after the provision returns,
that the launch process is gone, synchronized on the launch recording its pid
instead of a fixed sleep.

Fixes #8775

* no-mistakes(document): Document lab provision timeout cleanup

---------

Co-authored-by: Kun Chen <[email protected]>
…ist (#8457)

* feat(bin): choose a codex account per ship or scout from a declared list

Add config/codex-accounts, the Codex counterpart of config/claude-accounts:
one Codex home per line (ordinary for the default ~/.codex, or an absolute
CODEX_HOME). While the list exists, every Codex ship or scout spawn names one
declared entry with --account, chosen at intake by the quota-array-dispatch
procedure from bin/fm-codex-account-quota.sh rows. The entry is checked with
codex login status in a stripped environment, launched with CODEX_HOME set
(or unset for ordinary) and CODEX_API_KEY and CODEX_ACCESS_TOKEN unset,
recorded as account=, and reused by relaunch unless --account moves it.
Without the list every Codex launch is unchanged and --account refuses.

bin/fm-worker-account-lib.sh now keys the declared list, its root variable,
and its shed credentials by runner, and the per-account quota read moves into
bin/fm-account-quota-lib.sh shared by the Claude and Codex entry points.

* no-mistakes(ci): I fixed both Greptile findings, and the new tests for each fail before the fix and pass after it. ci-1, Codex secondmates (`bin/fm-worker-account-lib.sh`). The rule: a secondmate without its own account pin file (Codex) must never read `config/codex-accounts`. `fm_worker_account_select` now returns early for such a secondmate, right after it refuses an explicit `--account`, and before the list is parsed. So an empty, malformed or unreadable list no longer blocks the launch or a relaunch. I checked the other place that reads the list, `fm_worker_account_relaunch_request`: it already returns before the read when given a secondmate. Ships, scouts, Claude and Pi follow the same path as before. New test: `test_codex_account_list_leaves_secondmates_alone` in `tests/fm-worker-account.test.sh` now writes a malformed `config/codex-accounts` and checks that a Codex secondmate still launches unchanged (exit 0, no `account=`). Before the fix it was refused with "config/codex-accounts must hold one account per line". ci-2, quota timeout (`bin/fm-account-quota-lib.sh`). The rule: each Claude account read must still honor the old `FM_CLAUDE_ACCOUNT_QUOTA_SECONDS`. `fm_account_quota_report` now picks the per-read limit once: `FM_ACCOUNT_QUOTA_SECONDS` first, then `FM_CLAUDE_ACCOUNT_QUOTA_SECONDS` for Claude only, then 60. The old variable is documented in the lib header. New test: `test_the_claude_read_timeout_is_honored` in `tests/fm-claude-account-quota.test.sh` uses a fake quota-axi that takes 3 seconds. With `FM_CLAUDE_ACCOUNT_QUOTA_SECONDS=1` the account is reported unreadable. Adding `FM_ACCOUNT_QUOTA_SECONDS=10` overrides it and the account is measured. Checks: `tests/fm-worker-account.test.sh`, `tests/fm-claude-account-quota.test.sh` and `tests/fm-codex-account-quota.test.sh` all pass, and `shellcheck -x` is clean on the four changed files. I did not reply to or resolve any PR comment
…n (#8708)

* feat(watch): opt-in absorb of turn-ends after an aborted run

An aborted no-mistakes run keeps current state at failed until a fresh run
starts, so every turn-end of a worker that kept working surfaced.
config/turnend-abort-absorb absorbs it only when the run store records an
abort and an exact busy verdict is newer than the run's end.

Fixes #8675

* no-mistakes(document): Document turnend-abort-absorb flag

* fix(watch): match the exact abort errors no-mistakes records

A gate abort fails the run with 'step <name>: aborted by user[: <reason>]'
and 'axi abort' cancels it with 'cancelled: aborted by user'. Match those
errors exactly and no longer treat a run cancelled by a new push as aborted.

* no-mistakes(review): Fix abort-absorb docs for cancelled runs

* fix(watch): take the abort-absorb busy state from the busy-state verdict

* fix(lint): clear ShellCheck findings the new classify sources expose
Claude Code 2.1.323+ type-checks the Calm mod without
allowImportingTsExtensions and ignores a plugin tsconfig, so
`claude plugin validate --strict` refused the mod (TS5097 on the
.ts import specifiers) and the mod's test fixtures drifted from the
engine's declarations. Keep the .ts specifiers Node needs behind
@ts-ignore TS5097, update the fixtures (Spinner suffix, UserMessage
isExpanded, fs.stat isLink, ui.blit cells variant), and record the
2.1.326 verification. Runtime behavior is unchanged.

Closes #8558
* fix(codex): admit Stop-park releases from 0.163.0

* no-mistakes(document): Remove stale Codex version selection claim

* fix(bin): reach a Codex primary from its SessionStart hook depth

Codex publishes no harness marker, so the session start digest identifies a
Codex primary only through the ancestry walk in bin/fm-harness.sh. That walk
examined eight processes, while the installed Codex runs the tracked
SessionStart wrapper nine parents above the digest's harness probe (eleven
and thirteen for the wake drain and guard probes). The digest therefore
reported harness unknown and rendered the generic supervision block, while
the session lock walker, which examines sixteen processes, still named the
Codex session.

The harness walks now share one sixteen-process reach matching
fm_harness_ancestry_pids, so the digest verdict and the lock owner come from
walks of the same reach. Marker and ancestry precedence is unchanged.

The Pi rebuild cases in the session-open suite set only the Pi marker beneath
the suite's long-lived codex fixture, which the shorter walk never reached;
they now run beneath a pi-named process, as a real Pi session's hooks do.

Adds a portable depth regression, a composed SessionStart regression under a
renamed codex process, and a token-free live SessionStart case for the
installed Codex.

* docs(codex): align version policy and ancestry trial scope

* no-mistakes(document): Clarify Codex SessionStart release coverage

* no-mistakes(document): Correct Stop park script reference

* no-mistakes(document): Clarify Codex Stop park and startup coverage
* fix: read a wrapped typed line in a named Claude composer

In a Claude session started with a name, the session title is drawn into
the composer's top rule. A titled top rule was accepted only when the
prompt glyph row sat directly on the closing rule, so typed text that
wrapped onto a second row read unknown and could not be extracted. A
backend that reads back its typed payload before pressing Enter then
withheld Enter: on a pane narrower than the text, the send failed, or
the text stayed in the composer and blocked every later send.

Accept the wrap rows between the glyph row and the closing rule when
they are contiguous, non-blank, edge-free and within
FM_COMPOSER_PI_MAX_LINES. A glyph followed by a blank row or a longer
region before the next rule still reads unknown.

* no-mistakes(document): Document wrapped named Claude composer reads
* fix(bin): read the PR scan past a review wait on the same PR

A worker may declare its review wait with a paused: line right after its
ready done: line. The scan treated that wait as a later crew line and never
recorded the PR or armed its merge poll. The scan now reads back over paused:
lines whose every PR URL is the ready PR, while a paused: line naming no PR or
another PR, and any working:, blocked: or failed: line, still stop it.

Fixes #8762

* no-mistakes(review): ignore punctuation around a PR URL in a paused line
…ng home's state (#8785)

fm-teardown.sh ran the retiring home's fm-procevent.sh with only FM_HOME and
FM_ROOT_OVERRIDE, so an inherited FM_STATE_OVERRIDE sent preflight, sweep, and
reconcile to the parent's state root. Retirement then refused on the parent's
directory mode, or swept the parent's own registrations and left the child's.

Pass FM_STATE_OVERRIDE="$home/state" on all three calls, match the docs and
recovery command, and replace the fake sweep test with the real fm-procevent.sh
under a parent override at modes 775 and 700, checking the parent's source and
directory mode stay unchanged.
* feat(calm): selectable spaceship working presentation via config/calm-ship

Add an optional spaceship variant for Calm's animated working row on Pi,
selected by the local config/calm-ship file.

- Add .pi/extensions/lib/fm-calm-working-spaceship.ts: a persistent banner
  under its own firstmate-calm-working-spaceship widget key, with an idle
  two-row saucer-over-hull rest pose drifting left to right, a single-row
  `=( * )` warp sprite while a run is thinking, a bounded settle ease back
  into the drift, freeze/resume continuity across hide and show, resize
  clamping, narrow fallbacks, and idle crew markers read from the home's
  state records on a slow tick.
- .pi/extensions/fm-calm.ts resolves config/calm-ship with the same
  effective-home and FM_CONFIG_OVERRIDE rules as config/calm, at extension
  load and again on session_start and /calm. Anything other than
  "spaceship", including an absent file, keeps the boat, which stays the
  default. The boat's own presentation path and its shared widget slot with
  standalone Pi Calm are unchanged; the spaceship is dispatched as a
  separate banner that owns its own slot, and a selection switch tears down
  the replaced variant before installing the new one.
- Document the variant in docs/calm.md and the config/calm-ship schema in
  docs/configuration.md.
- Cover selection, rendering, mode, settle, and freeze/resume in
  tests/fm-calm-pi-extension.test.sh, and add the new module to the
  typecheck fixture in tests/fm-pi-primary-types.test.sh.

Supersedes the earlier attempt in kunchenguid/firstmate#5567, which was
closed unmerged on 2026-10-18 with a branch that had conflicted. This is a
fresh port onto current main, not a revival of that branch.

* no-mistakes(review): Remove crew markers, dead saucer code, fix doc

* no-mistakes(review): Document calm-ship Pi-only scope and trim rule

* no-mistakes(review): Copy spaceship into live e2e; poll drift check

* no-mistakes(review): Tear down spaceship banner on shutdown; map module

* no-mistakes(review): Gate spaceship banner to one agent run

* no-mistakes(review): Share working slot; drop dead spaceship code

* no-mistakes(review): Name both presentation modules in file header

* no-mistakes(document): Align Calm docs with selectable spaceship variant

* feat(pi): keep the spaceship banner for the whole session with idle drift

The selectable spaceship working presentation was scoped to one agent run,
which left Pi's stock working row in place the rest of the session. Make it
ambient: while Calm is active and config/calm-ship selects it, the banner is
installed at session_start and lives until session_shutdown, and the run signal
drives its mode instead of its visibility.

Idle shows the two-row resting pose, a three-cell (|) saucer directly over a
three-cell |^| hull, drifting one column every ~1.5s with a starfield streaming
left past it. A run switches the same banner into the single-row compact
=( * ) warp; the settle relaxes the pose, returns the starfield to the idle
cadence immediately, and eases the pace back into the drift over a bounded
handful of graduated moves.

The boat is unchanged and stays run-scoped. Both presentations still share the
one working-row slot, so a dual Calm install renders one animation and a
presentation another extension installed is left alone.

* no-mistakes(review): Document dual-Calm spaceship exception and tests

* no-mistakes(document): Correct Calm spaceship narrow-fallback wording

* no-mistakes(document): Remove stale spaceship widget-key export

* no-mistakes(document): Align Calm spaceship docs with ambient banner

* test(calm): keep the spaceship harness out of a Bash 3.2 command substitution

Stock macOS Bash 3.2 lexes a heredoc body nested in $(...) as shell text,
so a prose apostrophe inside the JS harness opened shell quoting there and
an unbalanced parenthesis ended the substitution early. The macOS parse
sweep then reported an unrelated later line as an unmatched backtick.

Attach the harness to a group command that redirects to an output file,
the shape every other node harness in this file already uses, and read the
captured output back afterwards. The fixture, the JS harness, and every
assertion are unchanged.

* no-mistakes(review): Narrow dual-install docs; test Calm toggle

* no-mistakes(document): Scope Calm spaceship lifetime claims to calm.md

* no-mistakes(ci): Addressed Greptile finding ci-1 in tests/fm-calm-pi-extension.test.sh. The "absent config/calm-ship" case previously wrote an empty file, so readFileSync still succeeded and the missing-file fallback was never exercised. It now removes the file with `rmSync(..., { force: true })` (imported alongside writeFileSync), and the existing boat assertions are unchanged (no stale widget after session_start, boat hull during the run, clean settle on agent_settled). No product code touched, and no sibling sites write an empty calm-ship file. Verified by running the suite directly with FM_PI_PACKAGE_DIR pointing at the Pi 1.6.1 package-layout shim: all cases pass, including the "working-spaceship modes and selection" case; the four tmux/pi interactive E2E cases skip because tmux is absent, as expected
* fix(bin): refresh watcher beacon at progress checkpoints

* fix(watch): reject zero checkpoint interval

* no-mistakes(document): Align beacon comments with checkpoint behavior

* fix(watch): checkpoint signal triage progress

* no-mistakes(review): Checkpoint turn-end worker classification

* no-mistakes(document): Document watcher beacon checkpoint behavior

---------

Co-authored-by: Pitch Perfekt Collective <[email protected]>
omp joins several queued follow-ups into one prompt or one text part
separated by a blank line. consumeWake only finished a pending wake when
the whole text equalled its content, so merged wakes were never finished
and the same replacement handoff was replayed in every later session.
Each pending wake whose full content the text carries is now consumed,
once per occurrence.
* feat(bin): reclaim a returned Treehouse pool slot's disk at teardown

A returned pool slot keeps every git-ignored build artifact behind
(node_modules, .next, dist, Electron builds), so pools only ever grow
across finished tasks. Teardown now destroys a ship or scout task's own
returned slot by default, relying on treehouse destroy's safe-by-default
behavior so unlanded, dirty, or otherwise disposable-ineligible slots are
only skipped with a warning, never a teardown failure. Opt out home-wide
with config/keep-pool-slots.

* no-mistakes(review): Release slot owner claim before pool slot destroy

* no-mistakes(document): Document keep-pool-slots flag in home layout

* feat(bin): make pool-slot reclaim opt-in (config/reclaim-pool-slots)

Per maintainer review on the PR: invert the flag so destroying a
returned pool slot only happens when a home explicitly opts in, never
by default. An unconfigured teardown behaves exactly as before this
feature existed.

* no-mistakes(review): Fix home-layout skill reclaim flag name
* fix(rex): resolve the launcher session from REX_BLOCK

* no-mistakes(document): Drop stale REX_SESSION from comments

* no-mistakes(lint): Fix ShellCheck warnings in Rex tests
An idle watcher poll starts many short-lived programs whose answers bash
can give itself. Replace them with builtins on the per-poll path, keeping
every result and error word the same:

- sign each status file once per scan and pass that signature to the
  seen check instead of signing it again
- on Darwin, read path state, size and identity with one stat instead of
  four or five, with the same fields and error words
- hex-encode plain-ASCII signature fields with printf -v instead of
  od | tr; any other byte keeps the od encoding
- read the presentation marker, turn-ended markers and the pane capture
  file with $(<file) instead of cat, and strip the pgid without tr
- read kind/backend/harness from a window's meta with one builtin loop
  instead of grep | cut, keeping every value of a repeated key
- skip rm for per-window markers that do not exist (fm_rm_present, same
  exit status as rm -f; a dangling symlink still counts as present)
- skip mkdir of an existing state dir and dirname at library load

Measured with one method: a PATH-shim tracer that logs every program
start (absolute-path calls routed through the shims via BASH_ENV), on
macOS with /bin/bash 3.2, against a synthetic idle home (10
already-reported status files, tmux panes printing a clock, FM_POLL=3).
Each figure is the start count of one steady idle poll (polls after the
first two, between watcher beacon touches) in a 40-second traced run;
every steady poll in a run had the same count. Base is 427056c, the
other side is this commit, both exported from git:

- no task windows: 195 -> 86 starts per poll (-56%)
- four task windows: 291 -> 130 starts per poll (-55%)

An earlier measurement of part of this work reported 102 -> 72 and
170 -> 116 with the same tracer; those pairs differ because they measured
a different baseline - a tree that already had the first half of these
changes - and only the second half on top of it, so they are not quoted
here.

status_observed_signature output is byte-identical before and after on
72 fixture cases (regular, empty, symlinked, dangling, non-ASCII and
invalid-byte targets, directory, unreadable, FIFO, missing; LC_ALL=C and
UTF-8) under bash 3.2 and 5.3.

Not measured: Herdr panes, Linux, wake/drain/ack turns, the periodic
check and home-summary runs, and forks that do not exec.

The inactive-reconcile per-poll fast path and the procevent uname/id
caching are left to #7329 and #7349, which already propose them.

Refs #7330
* feat(watch): wake on an arrived captain-hold --until date (#8444)

Behind the existing opt-in config/open-decision-reminders flag, queue one
check wake per main-home captain hold and --until date when the date arrives.
A durable ledger keeps a watcher restart from refiring a recorded pair.

* no-mistakes(review): Skip Done rows in captain hold wake

* no-mistakes(document): Document captain-hold date wake skips Done rows

* no-mistakes(ci): Throttle failed captain-hold reads and bound them

* docs(watch): list captain hold date wake in the header reason index (#8444)
* test: retry removal of a lock directory the waiter still writes

The waiter creates owner directories inside the state directory while
it waits. One rm -rf can lose that race, leave the directory in place,
and let the waiter return 0.

On origin/main the test matches the copy that failed in CI run
https://github.com/kunchenguid/firstmate/actions/runs/40652730373
(job "Behavior portable serial 3"):
rm: cannot remove '/tmp/fm-wake-tests.ckX5w2/lock-dir-removed/state': Directory not empty
not ok - the lock wait over a removed directory returned 0, not 1

Locally, fm_lock_owner_dir against rm -rf printed "Directory not empty"
3 times in 300 tries. The unfixed test passed 40/40 because the race
did not land. The fixed test passed 20/20. A removal that never
succeeds fails with "the lock directory survived 50 removal retries".

* test(wake-queue): rename the lock directory before the bounded removal retry
* fix(rex): resolve the launcher session on Rex 0.1.0

Rex 0.1.0 rejects a block id as a session.view target, so a Firstmate
running directly in a Rex terminal could not spawn any task and skipped
per-home session cleanup. Resolve the launcher from REX_SESSION when set,
refusing when that session does not hold REX_BLOCK exactly once; otherwise
walk the session list for the single session holding the block, and keep
the block-target call only as a fallback when the list cannot be read.
The refusal now names its reason and the next step.

Fixes #8842

* no-mistakes(review): Make real-Rex smoke no-walk assertion detect flagged ls calls

* no-mistakes(review): Require a matching session_id before confirming the Rex launcher block

* no-mistakes(review): Warn when secondmate placement skips an unresolved Rex launcher

* no-mistakes(review): Stop blaming Rex build in inventory-unreadable refusal

* no-mistakes(review): Restore test coverage for retirement's launcher-session exclusion

* no-mistakes(test): Document Rex launcher behaviour for builds 1758 and 2181

* no-mistakes(document): Clarify Rex per-home session fallback wording

* no-mistakes(ci): I fixed ci-2 (Greptile: unreadable session views were silently skipped). The rule being broken: before placing anything, Firstmate must confirm that REX_BLOCK appears exactly once inside the chosen session, so a session whose view can't be read must never count as "no match". There are three places that read a view, and two already followed this rule. The REX_SESSION path refuses when fm_backend_rex_view_holds_block fails, and the legacy block-target fallback refuses when it can't parse the view. Only the session-list walk in fm_backend_rex_sessions_holding_block treated an exit-0 view it couldn't parse as a non-match and moved on. Fix (bin/backends/rex.sh): in the walk, after a session.view exits 0, the response must be valid JSON whose `.session_id` matches the listed session before the exactly-once check runs. If it isn't, the walk returns 1, and fm_backend_rex_launcher_session refuses with "a live session's view could not be read". I updated the function comment to match. I added no new helpers or branches. Tests: - The fake fixture (tests/rex-fake-fixture.sh) has a new `view-garbled` switch. It holds a session id, and that session's view exits 0 with truncated JSON. - tests/fm-backend-rex.test.sh has a new case where the other session's view is garbled. Resolution must refuse with that reason. Without the fix, the walk would skip the garbled session and resolve to the launcher session. - The existing walked-view-without-session_id case now expects that same unreadable-view refusal, in line with the earlier decision that a view without session_id is unresolved on every path. When I removed the fix temporarily, that assertion failed, and the whole file passed again once I put it back. Results: tests/fm-backend-rex.test.sh passes with exit code 0 (42 tests ok). `/opt/homebrew/bin/shellcheck -x` is clean on all three changed files. I ran no other suites. I replied on the Greptile thread that it is fixed: kunchenguid/firstmate#8855 (comment). The fix is not committed or pushed yet, so the thread will show it only once the pipeline pushes. As you asked, I changed nothing for ci-1 (Full suite waiting on the full-ci label) and did not comment asking for the label
…iours

Merges kunchenguid/firstmate main at fe93901 on top of the restored
1 October sync link (23e5584), resolving the 63 conflicts by the
assessment's rules R1 to R18 so none of this fork's changes is lost.

Fixes found while proving our behaviour after the merge:
- backlog close: a Gerrit or GitLab link and our per-model attribution
  note now share one --note, because tasks-axi takes only one.
- board answers: keyed choices are read under a feedback block again,
  as this fork's list-form fix did, now on upstream's shared parser.
- watcher tests: upstream cases that expect a first-sight alert for a
  declared pause are fitted to this fork's rule that a declared wait
  outranks the pane.
…uses, all in the tests. I changed test files only. The app code is the same. 1. **Temp folder** (parallel 2). The Herdr practice-room test set a fake home folder, then asked for a temp folder. Our temp helper needs a real home folder on Linux. Rule: make the temp folder first, then fake the home. Only this test broke the rule. 2. **Follow-ups** (serial 19). A new test from the original firstmate project runs cleanup. Our cleanup refuses until the worker lists its follow-ups (jobs still to do). Rule: a test must record "no follow-ups" before it expects cleanup to work. I fixed this test, and two more new tests with the same gap that are skipped online. 3. **Pi switch** (serial 9 and 17). Two new tests start Pi (one of the AI worker tools) with `--no-mcp`. Our online setup keeps Pi at version 1.0.0, and it rejects that switch. Rule: tests may only use switches our Pi knows. I removed it from both places and kept our version lock. "Full suite" is only the total light. It failed because the four above failed. **Did it work** Partly proven here. - Temp folder: failed here first. Now passes, 26 of 26, in both setups. - Follow-ups: failed here first. Now passes, 19 of 19. - Pi guard test: showed the same switch error here. It passes after the fix, with this Mac faking Linux and using Pi 0.84.3, not 1.0.0. - Pi pull request test (serial 9): **not run**. This Mac lacks `tmux` (a terminal tool the test needs). I only checked that Pi here accepts the other switches. I infer from the matching error that the same switch caused this failure. - The two extra follow-ups fixes: **not run**. They are skipped here. Their syntax check passes. - The code style checker passes on the changed shell tests. **What do I do now** Nothing yet. The pipeline sends the changes and runs the online checks again. Watch serial 9 and serial 17: only that run proves them on Pi 1.0.0. These two tests have not run on 1.0.0 without the switch, so a second error could show up
@TastyTom13
TastyTom13 merged commit 9e28200 into main Nov 30, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.