Skip to content

feat(bin): merge upstream firstmate main into the fork - #19

Merged
demy00 merged 290 commits into
mainfrom
feature/fm-upstream-sync-n1
Nov 5, 2026
Merged

demy00 merged 290 commits into
mainfrom
feature/fm-upstream-sync-n1

Conversation

@demy00

@demy00 demy00 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Intent

"would it make sense to have a look at upstream? i suspect there must be a bunch of commits. so i would not mind if you could update firstmate if it is worth it."
Upstream is kunchenguid/firstmate. This fork is 284 commits behind and 35 ahead; the last merge from upstream was about 2026-09-30.

What Changed

  • Merges kunchenguid/firstmate main into the fork. This adds the experimental Paseo, Rex, T3 Code, tern, and hc backends, the Kiro, Hermes, Cortex, Command Code, and Polytoken harness integrations, and Antigravity CLI (agy) as a verified primary harness.
  • Brings in upstream's config/firstmate-role self-repository publication gate, forge=external and Forgejo/tea support, and the pr=manual project token. Also adds the opt-in usage warner, PR health monitor, and record export, plus capacity reporting and pipeline spend records, along with upstream's changes to spawn, watcher, teardown, supervision, and remote-secondmate behavior.
  • Reconciles the fork with the merge: the away spend default and spawn refusal now share a still-working count through bin/fm-away-spend-lib.sh, PR identity parsing accepts the keys written by the fork's yolo posture and merge waiver records, and an undeclared surplus Lavish list item is presented but never certified as complete. Also removes the captain-hold and tasks-axi archive helpers the merge superseded, makes tests/fm-procevent.test.sh pass on macOS and under load, and updates the affected docs and CHANGELOG.md.

🤖 Generated with Claude Code

Merge notes

Merges upstream kunchenguid/firstmate main (bb8dd209, 284 commits) into the fork as one merge commit on top of a4963b80.
Upstream has since moved on to 7c6170e2; those newer commits are not in this merge.
No history was rewritten and the fork's 35 commits stay in place.

What upstream brings that matters here

  • Self-repository role gate: config/firstmate-role, bin/fm-role-lib.sh, bin/fm-role.sh and --upstream-consent, which stop a home publishing to this repository on its own authority.
  • Dispatch: more providers (OpenRouter, System One, OpenAI) with a declared credential source, preferred_provider, shared_quota and config/claude-accounts.
  • Worker runtimes and adapters: Rex, tern, t3code, paseo, herdr-core, Hermes, Kiro, Cortex, Polytoken, Command Code, agy as a primary, OpenCode 2.
  • Delivery: --base-branch, pr=manual, forge=external, Forgejo and Gitea, a GitLab no-pipeline waiver, and local-only merges pinned to the reviewed head.
  • Operations: status archive, record export, pipeline spend, capacity, the shorter steering doorbell, and many watcher, lock and away-mode fixes.
  • CI: split test files, TAP plan verification, the full-ci label gate, and fork opt-outs FM_CI_SKIP_PUSH and FM_CI_SKIP_MACOS.

Fork changes dropped as superseded

Fork behaviour kept against upstream

  • PR identity: the fork's yolo= posture write and the merge_waived_red= and merge_waived_missing= waiver records append after pr=, which upstream's identity parser refuses, and upstream fix(bin): keep pr= merge-poll identity last when recording captain-hold completion kunchenguid/firstmate#6732 documents that this stops the merged-PR notification. fm_pr_metadata_identity_parse now allows these keys, which also heals records already written, and the writers are unchanged.
  • feature/ branch names, Jev skill selection, Needs preflight, the clickup-tickets skill, the away-session fixes and the Docker cleanup at teardown.
  • Lavish parser (826e32b, d0ac8f4, 79d101b, cbfb295): upstream's fc8972c skips nested targets and attachments, so a captain's attachment would be lost. It now adopts upstream's accounting, so an unparsed block reports its declared items as malformed and an undeclared surplus list item is presented and never certified complete. Upstream's list-form test was changed to expect the flattened output.
  • Away spend cap: the entry default and the spawn refusal share the fork's still-working count through bin/fm-away-spend-lib.sh, so finished records never raise the cap. Upstream's entry default counts every record. This was a decision on review.

What a running home must do after pulling

  • New publishing tasks on this fork are refused until the operator acts. fm_role_publication_target resolves this repository to github.com/kunchenguid/firstmate, because the upstream remote outranks origin when no remote.*.gh-resolved is set, and no config/firstmate-role exists.
    • Write config/firstmate-role by hand with maintainer github.com/demy00/firstmate, and mark origin as the base with git config remote.origin.gh-resolved base or gh repo set-default demy00/firstmate in the copy used.
    • Or pass --upstream-consent per task.
    • A scope of github.com/kunchenguid/firstmate would wrongly authorize publishing to upstream. Firstmate never grants itself this.
  • Register this repository in data/projects.md: it is not there under its own name, and an unregistered project resolves to no-mistakes with yolo off.
  • Restart after pulling, since AGENTS.md, bin/ and .agents/skills/ load at session start.
  • Tool floors are already met on this machine: no-mistakes 1.60.2, gh-axi 0.1.35, lavish-axi 0.1.81, quota-axi 0.1.55, tasks-axi 0.2.6, treehouse 2.3.0.
  • Herdr 0.7.4 is installed while upstream verifies 0.8.x to 0.9.x. Only the opt-in groups feature warns, but an upgrade is worth considering.

Validation

  • CI on 0435aa44: all 23 checks pass, including every portable lane, the Herdr and herdr-core lanes, both lint partitions and the stock macOS Bash check. The live Herdr doorbell scenario is outside these lanes and remains unrun.
  • All 13 portable CI lanes ran on Linux, one container per lane, with ubuntu 24.04, ruby, a compiler and Chromium.
  • Eight scripts were red in that run, whose containers had no UTF-8 locale. Seven pass when rerun alone with LANG=C.UTF-8, on both this merge and upstream.
  • tests/fm-git-strip-ai-trailers.test.sh fails there on upstream too, because of the image's git 2.43. It passes on macOS with git 2.50.
  • CI's two full lint partitions ran in a 12 GB container and reported no findings. Ten files were killed by that memory limit and one hit the memory fallback, and all eleven are clean under full-dataflow ShellCheck 0.11.0 on the host.
  • The coverage guard, the doc audience check and the stock Bash 3.2 parse sweep pass.
  • Spend-cap regression: with the new test case on the earlier merge, bash tests/fm-afk-contract.test.sh fails with not ok - finished workers counted as still working: 6. It passes with the shared count.
  • PR identity regression: with the new tests and without the parser change, tests/fm-project-yolo-apply.test.sh fails with not ok - the posture change broke the armed PR identity the merge poll authenticates: and tests/fm-pr-merge.test.sh fails with not ok - waived-red-identity: the recorded waiver broke the armed PR identity:. Both pass with it.
  • The base-branch refusal is covered by the line-only case in tests/fm-spawn-pool-base-freshen.test.sh: removing the refusal made that test fail with a line-only base-branch disagreement should refuse the spawn.
  • fm-procevent regression: before the fix it failed on macOS with setsid: command not found and not ok - could not read the draining holder's identity, or earlier at a timing limit. After it, two consecutive full macOS runs pass all 150 cases. A third full run at e1db8234, started on its own because the validation test step reported before reaching this script, also passes all 150 cases. These runs were on macOS only; CI runs it on Linux.
  • The Herdr and herdr-core lanes were not run locally, because this task may not drive Herdr. They pass in CI.
  • On macOS, 31 of the 39 scripts that failed in the full lane run also fail on upstream itself, so they are not caused by this merge, and CI runs these lanes on Linux. The rest failed only on the merge and are fixed here, apart from flakes that passed on rerun.

Also tidied

  • Upstream tests with hardcoded fm/ branches now use feature/, and the away spend-cap fake tmux answers the window inventory.
  • The Pi Calm render test counts the helper's own attempts, which removes a slow-start flake.
  • Numbered the two new shared brief rules 8 and 9, removed a captain-hold comment and two tasks-axi archive helpers left behind by the superseded archive read, and made the away dispatch recipe pass --base-branch and --upstream-consent when a brief records them.
  • tests/fm-procevent.test.sh now passes on macOS: a setsid fixture uses the file's portable perl form, and four time limits that failed on a busy machine are longer.
  • The spend-cap fixture keeps its finished workers' panes live, so the read comes from the status log, and a duplicated comment line from the merge is gone from bin/fm-project-mode.sh.
  • write_forgejo_status_json in tests/fm-pr-merge.test.sh now builds its list in a loop, because stock macOS Bash 3.2 brace-expanded it and wrote a malformed payload. The whole script now passes on macOS.
  • Two bin/fm-afk-contract.sh header comments now name bin/fm-away-spend-lib.sh as the owner of the spend reading.
  • Added four serial timing hints so the coverage guard stays honest, and fixed test fixtures for upstream's unborn-HEAD refusal and pinned local-only merges.

Known limits

  • bin/fm-skill-usage.sh and bin/fm-skill-select.sh resolve only config/claude-account, not upstream's config/claude-accounts. On a home that declares only the list, they read the wrong Claude root with no error, so the usage table undercounts and selection lists candidates from that root. This home uses neither file. Several roots per home is a product decision outside this sync, so it is not changed here.

Noticed

  • fm-skill-select.sh reads the Typesafe key from env or .env only, ignoring the declared credential source and FM_DISPATCH_PROVIDER.
  • The fork's fm_ts_post and upstream's POST path now coexist.
  • The live doorbell scenario needed a long task id to overflow, so the real miss is now rarer. Its fixture was updated but cannot run here.
  • fm-procevent failed once at its first event check (no event was published after the source completed), 13 seconds in, and has not recurred. The cause is unknown and that limit is unchanged.
  • arm can report a listener as not running on a very busy machine, because the product's default confirm window is 3 seconds. The default is unchanged and only the test sets a longer one.

Skills used

firstmate-coding-guidelines, firstmate-self-repo, no-mistakes.

Risk Assessment

⚠️ Medium: The fork's conflict resolutions and follow-up fixes traced correctly with only one opt-in follow-up found, but this 284-commit, 574-file merge changes supervision, merge and spawn behaviour, and this review did not audit every upstream commit or run tests.

Testing

I ran the targeted scripts one at a time: fm-pr-merge, fm-project-yolo-apply, fm-brief, fm-afk-contract, fm-self-repo-role, fm-afk-launch and fm-captain-hold-lifecycle all exited 0, with fm-afk-launch skipping its Rex cases because the rex CLI is missing. fm-procevent was not run, so the step is incomplete. The manual before-and-after check of the identity fix was denied, so the evidence is the script logs and a read-only upstream comparison; there is no UI surface, so no screenshots apply.

Evidence: fm-pr-merge transcript, including the recorded waivers identity case

Source: fm-pr-merge transcript, including the recorded waivers identity case

ok - fm-pr-merge reports exact queue retry flags after a zero-exit false success
ok - fm-pr-merge omits merge-queue retry guidance for a closed GitHub PR
ok - fm-pr-merge aggregates agreeing merge-queue rules
ok - fm-pr-merge reports ambiguity for conflicting merge-queue rules
ok - fm-pr-merge records pr= and pr_head= for a verified GitHub merge
ok - fm-pr-merge records pr= before the forge call can land the merge
ok - fm-pr-merge propagates a real merge failure without silently succeeding
ok - fm-pr-merge refuses a GitHub merge call that leaves the PR open and unqueued
ok - fm-pr-merge retries a bounded number of times when mergeable is UNKNOWN and merges once it resolves
ok - fm-pr-merge reports mergeability still pending after its bounded UNKNOWN retry is spent
ok - fm-pr-merge refuses on the UNKNOWN re-check when a check turned red between reads
ok - fm-pr-merge refuses a genuine mergeable conflict immediately, without retrying
ok - fm-pr-merge keeps PR bookkeeping when it cannot read a successful merge call's outcome
ok - fm-pr-merge refuses with the forge's own output quoted apart from its verdict
ok - fm-pr-merge quotes the forge output when it cannot read the outcome either
ok - fm-pr-merge does not echo back queue flags the caller already used
ok - fm-pr-merge still names retry flags when the caller used a different method
ok - fm-pr-merge names the queue requirement even when its method is unrecognised
ok - fm-pr-merge distinguishes unreadable branch rules from a base with no merge queue
ok - fm-pr-merge reads a plan-gated 403 on branch rules as no merge queue, not unreadable
ok - fm-pr-merge says nothing about a merge queue when the base branch has no queue rule
ok - fm-pr-merge accepts only a proved merge from the gh-axi fallback
ok - fm-pr-merge explains an armed auto-merge that landed nothing on a queue-less base
ok - fm-pr-merge never reports auto-merge as armed when the merge command failed
ok - fm-pr-merge claims no acceptance for a failed merge command carrying queue flags
ok - fm-pr-merge falls back to the gh-axi view when gh's read fails
ok - fm-pr-merge names a landed state hiding behind a failed GitHub merge command
ok - fm-pr-merge refuses a GitHub merge when gh is missing, before recording
ok - fm-pr-merge refuses a GitHub merge when gh is missing rather than merging blind
ok - fm-pr-merge verifies a genuinely merged GitHub pull request
ok - fm-pr-merge refuses to claim a merge when poll recording fails
ok - fm-pr-merge accepts and accurately reports a GitHub merge-queue entry
ok - fm-pr-merge explains how to retry with the required GitHub merge queue method
ok - fm-pr-merge refuses branch deletion unless --attended-override is passed
ok - fm-pr-merge refuses before merging when task meta is missing
ok - fm-pr-merge refuses malformed PR URLs before calling gh-axi
ok - fm-pr-merge --help and -h print the header usage and exit 0
ok - fm-pr-merge refuses unsafe PR URL segments before recording state
ok - fm-pr-merge refuses repo override args before recording state
ok - fm-pr-merge refuses a bundled short-option repo override and refuses -d unless attended
ok - fm-pr-merge does not add default --squash when the caller passes an explicit merge method
ok - fm-pr-merge respects --method=<value> as an explicit merge method
ok - fm-pr-merge parses a GitHub PR URL into gh-axi number and --repo arguments
ok - fm-pr-merge refuses a caller --sha on GitHub because the head comes from the live read
ok - fm-pr-merge merges a GitLab merge request through glab instead of refusing it
ok - fm-pr-merge takes the GitLab instance from the URL rather than assuming one
ok - fm-pr-merge imposes no merge method on GitLab, leaving the project's own one
ok - fm-pr-merge refuses GitLab source-branch deletion unless --attended-override is passed
ok - fm-pr-merge propagates a real glab merge failure without silently succeeding
ok - fm-pr-merge refuses on each GitLab pre-merge condition independently
ok - fm-pr-merge reports every failing GitLab condition, not only the first
ok - fm-pr-merge reports a stale recorded head and verifies the live one
ok - fm-pr-merge refuses an unreadable GitLab merge request state rather than merging blind
ok - fm-pr-merge refuses a GitLab head commit it cannot validate
ok - fm-pr-merge refuses before recording anything when glab or jq is absent
ok - fm-pr-merge merges a Forgejo pull request through tea api instead of refusing it
ok - fm-pr-merge resolves the tea login by matching the PR's host against every registered login
ok - fm-pr-merge refuses when zero or more than one tea login matches the pull request's host
ok - fm-pr-merge refuses on each Forgejo pre-merge condition independently
ok - fm-pr-merge treats an unconfigured Forgejo combined status as none, refusing rather than skipping the check
ok - fm-pr-merge reads every Forgejo combined-status page before merging
ok - fm-pr-merge reports a stale recorded head and binds the merge to the live one instead
ok - fm-pr-merge refuses a Forgejo head commit it cannot validate
ok - fm-pr-merge refuses before recording anything when tea or jq is absent
ok - fm-pr-merge never trusts tea api's exit status alone; a rejected merge is caught by the confirm read
ok - fm-pr-merge retries a failed Forgejo confirmation read and persists the merge authority
ok - fm-pr-merge maps --squash/--rebase to Forgejo's Do field, defaults to the repository's default merge style, and refuses any other extra argument
ok - fm-pr-merge refuses a GitLab head override before recording state
ok - a merge a secondmate home performs itself is reported upward exactly once
ok - a locally routed secondmate home reports the landed PR into its parent's own channel
ok - a landed GitLab merge request is reported upward on the same channel
ok - a queued GitLab merge stays silent and leaves confirmation to the armed poll
ok - a refused or failed merge reports no outcome
ok - a GitLab merge refused before the forge call reports no outcome
ok - a merge a main home performs itself leaves one durable wake naming the PR
ok - a queued GitHub merge stays silent and leaves confirmation to the armed poll
ok - distinct merged PRs for one task retain distinct captain-facing wakes
ok - an uncommitted marker retry preserves at least one durable outcome
ok - a secondmate home that cannot report upward says so instead of merging in silence
ok - fm-pr-merge proceeds when the home carries no backlog at all
ok - fm-pr-merge refuses when the backlog exists but cannot be read
ok - fm-pr-merge refuses when its configured backend cannot be read
ok - fm-pr-merge refuses when its user backend configuration cannot be read
ok - fm-pr-merge refuses when its user backend configuration directory cannot be traversed
ok - fm-pr-merge proceeds once when its user configuration directory and backlog are genuinely absent
ok - fm-pr-merge honors a backend override over an unreadable user configuration
ok - fm-pr-merge refuses red GitHub checks and waives only a named --allow-red check
ok - fm-pr-merge refuses a draft pull request and one with no boolean draft state
ok - fm-pr-merge merges when a failed check run was replaced by a passing re-run
ok - fm-pr-merge never lets a check run supersede a legacy status context
ok - fm-pr-merge still refuses when a check's current run failed after an earlier pass
ok - fm-pr-merge uses start order when the old success finishes last
ok - fm-pr-merge supersedes an old cancellation that finishes last
ok - fm-pr-merge keeps a check red while its re-run is still in flight
ok - fm-pr-merge never lets one check's pass clear another check's failure
ok - fm-pr-merge clears a failure only on a proven later pass of the same check
ok - fm-pr-merge keeps --allow-red scoped to its named check beside a superseded failure
ok - fm-pr-merge rechecks away presence before an attended red merge
ok - fm-pr-merge keeps a quiet-mode home's merges attended, the named red-check waiver included
ok - fm-pr-merge takes each red-check waiver name as a separate argument
ok - fm-pr-merge --allow-red repeats once per exact check name and records every waived name
ok - while the away-posture record exists any green merge lands under away authority, yolo or not, and attended merges stay untagged
ok - under the away-posture record the branch merges a green task, is refused on a red check with or without --allow-red, and is refused at the partition while attended
ok - a branch merge refuses under the lock when the away record is archived during preflight
ok - away posture permits immediate merges but refuses every asynchronous path
ok - away merge proceeds on a plan-gated 403 because that repository cannot have a merge queue
ok - the away record does not bypass red checks, and a recorded pr= must match the URL
ok - an unreadable away-posture record refuses the merge instead of skipping the record
ok - no away-record archive or replacement lands between the authority read and the merge
ok - a record made unreadable before the merge's own authority read refuses the merge
ok - a merge that cannot lock the away record refuses instead of merging unlocked
ok - fm-pr-merge refuses --allow-red on GitLab
ok - fm-pr-merge refuses when a required check from branch protection or a ruleset never reported
ok - fm-pr-merge merges when every required check reported and is green
ok - fm-pr-merge reports a red check and an unreported required check together with every other failure
ok - fm-pr-merge refuses when the required checks cannot be read, and tells a plan without rules apart
ok - fm-pr-merge --allow-missing waives only its named unreported check
ok - fm-pr-merge --allow-missing repeats once per exact name, is attended-only, and is GitHub-only like --allow-red
ok - recorded check waivers keep the task's PR identity readable
ok - fm-pr-merge enforces required producer identity and named waivers
ok - fm-pr-merge matches an app-bound required commit status by name
ok - fm-pr-merge reports known missing checks and all independent read errors
ok - fm-pr-merge refuses --allow-red on Forgejo
ok - fm-pr-merge refuses --allow-missing on Forgejo
ok - fm-pr-merge --allow-no-pipeline waives only a null GitLab head pipeline and keeps every other condition
ok - fm-pr-merge --allow-no-pipeline is attended-only, takes no value, and applies only to GitLab
Evidence: fm-project-yolo-apply transcript, including the armed PR identity case

Source: fm-project-yolo-apply transcript, including the armed PR identity case

ok - a project switched to +yolo hands its live ship tasks the new merge authority, and nothing else
ok - a project switched off +yolo takes merge authority back from its live ship tasks
ok - a posture change keeps an armed task's PR identity readable
ok - a Gerrit project's live tasks never gain merge authority
ok - a registry posture that does not resolve changes no task
ok - named task ids limit the apply to those live ship tasks of the project
ok - a task under a lifecycle action is left untouched and named for a rerun
ok - a project's queued ship items carry its registered posture, and no other item changes
ok - a project switched off +yolo withdraws the posture from its queued ship notes
ok - named task ids limit the apply to those queued items
ok - a backlog that cannot be read leaves the apply incomplete, after the live tasks
ok - usage errors exit 2 and --help prints the usage
Evidence: fm-captain-hold-lifecycle transcript, 75 of 75 cases

Source: fm-captain-hold-lifecycle transcript, 75 of 75 cases

ok - marked hold reasons round-trip through public reads, fleet, startup, and return without changing other fields
ok - new, active, and released holds publish origins after backend success with and without deferral
Terminated: 15
Terminated: 15
Terminated: 15
Terminated: 15
ok - failed and interrupted origin moves cannot inherit active, expired, replayed, or completed calls
ok - historical self-inventories name a workable repair that preserves sibling entries
ok - completion and verification compare backend identities for entries and current or stored origins
ok - complete refuses the origin as its own captain-call inventory
ok - complete refuses an entry held for another origin and flags one with none recorded
ok - report-only unresolved captain call is reproduced and completion refuses before loss
ok - both body-decoding paths work without the allow_nonref default
ok - cleanup preserves every byte of a retained body's non-ASCII characters
ok - the completion gate attests captain-held inventory and transfers open status decisions
ok - answer records the captain's words, closes idempotently, and releases routed work
ok - the completion gate accepts an answered captain call pruned into the archive
ok - the gate still refuses an archived call with no recorded answer and an unknown key
ok - the completion gate unions archived and live inventory and keeps a held call open
ok - the gate reads tasks-axi's default archive in a home that configures none
ok - the gate reads the archive the user's tasks-axi config names
ok - the gate refuses a reused key whose newest archived close recorded no answer
ok - the gate accepts a reused key whose newest archived close is answered
ok - release frees held work with the captain's words recorded and the body preserved
ok - a captain hold is released only in an attended session: away refuses, quiet and no record release
ok - a release waiting on the task lock rechecks the away posture under the lock
ok - captain holds become visible only after their hold-set timestamp is durable
ok - an interrupted answer preserves its hold age until close retry
ok - a deferred captain call leaves the live Captain's Call until its date and stays answerable
ok - an out-of-band close is recordable with the captain's word and nothing else
ok - ended visual review follows the same captain-hold completion owner
ok - resolved findings and decision-like prose do not create captain-held tasks
ok - completion keeps an armed PR identity last in the task record
ok - completion replaces a completion pair recorded after pr= by the previous writer
ok - terminal single-owner stale status decisions do not block empty inventory
ok - main-home and secondmate-home captain calls remain correctly routed
ok - a secondmate home publishes each hold occurrence and its answer on the parent channel
ok - secondmate resolutions publish before retiring durable retry triggers
ok - a bound channel's captured answers close their captain-held tasks at answer time
ok - only a bound captured source creates reconcile requests
ok - normal answers and their replays retire reconcile requests
ok - reconcile closes a moot call with evidence and keeps an active one open with a note
ok - reconcile outcomes apply durable mutations once across partial failures
ok - a channel source with no decision binding closes nothing
ok - legacy identities, metadata, bindings, and the shim keep working
ok - a board answer reaches the keyed-answer intake and wakes firstmate
ok - the chat channel feeds the same keyed-answer intake a captured review does
ok - completion and verification validate origins before constructing paths
ok - a status resolution over a still-open captain-held task is signalled, not closed
ok - a captain call with no routed work, a verified transfer, an open decision, and an answered call all stay silent
ok - cleanup leaves a captain-held work item open with its deliverable, and only an answer closes it
ok - release and scout report retention distinguish deliveries from rejected merge answers
ok - an interrupted cleanup keeps the captain call recoverable and session start retains it
ok - an answer before cleanup replay preserves the retained report
ok - an answer before cleanup replay notes the retained Gerrit change
ok - an unusable pending-close record names its reason instead of a bare refusal
ok - an unsupported relocated report does not wedge the captain's answer
ok - cleanup retains captain calls in the configured backlog
ok - cleanup keeps a captain-held Gerrit task open and records its change URL
ok - merge approval releases before zero-retention cleanup records completion
ok - the PR merge entrypoint refuses a captain-held task before merging
ok - the local merge entrypoint refuses a captain-held task before merging
ok - the PR merge entrypoint separates an unreadable authority record from an absent one
ok - the local merge entrypoint separates an unreadable authority record from an absent one
ok - merge entrypoints reject unsafe identities and absent state before locking
ok - merge entrypoints refuse a replacement incarnation after waiting for cleanup
ok - merge entrypoints own task state before forced cleanup can retire it
ok - a released merge passes the guarded entrypoint and remains recently landed
ok - cleanup refuses a ship row when its captain hold cannot be read
ok - skipped on markdown-only tasks-axi: verify against a beads-migrated hold
ok - skipped on markdown-only tasks-axi: verify against a prefix-migrated hold
ok - skipped on markdown-only tasks-axi: prefer a marker-noted row over a prefix namesake
ok - skipped on markdown-only tasks-axi: complete against a beads-migrated hold
ok - skipped on markdown-only tasks-axi: verify an unresolvable beads legacy id
ok - skipped on markdown-only tasks-axi: verify a derived pre-collapse key
ok - captain-hold mutations address the beads backend without a markdown override
ok - skipped on markdown-only tasks-axi: captain-hold create under due.required without types.custom
ok - an answered captain call archived by Done retention still satisfies the completion gate
ok - an answered captain call archived to a user-configured location still satisfies the completion gate
Evidence: fm-afk-contract transcript

Source: fm-afk-contract transcript

ok - the read-back renders the words verbatim beside the expected return, spend cap, and reach line
ok - words preserve their final newline shape in storage and read-back
ok - one enter call writes a version 2 record, announces hold-for-return only, reads it back without asking for a go, and every read subcommand reflects it
ok - entry without --spend records the workers still working, never below the default floor, and an explicit --spend still wins
ok - the retired propose, confirm, and --proposal inputs are refused by name and write nothing
ok - enter removes a proposal an older version left behind and records only the new words
ok - a same-turn entry records never-set words verbatim, adds no authority field, and restates the never-set
ok - a plain entry records no mandate in one step, and a refresh leaves the standing record untouched
ok - new words archive the old words and keep the session start
ok - a failed replacement keeps the standing posture live
ok - a failed final replacement publication rolls back its superseded archive
ok - validation and archive refuse damaged words blocks
ok - a words line that lost its record prefix fails validate, read, read-back, and archive instead of truncating the mandate
ok - archive keys the record by its entry time, empties the posture, and is idempotent
ok - malformed inputs and foreign record versions are refused rather than guessed
ok - retired clause fields, --grant, and the clause and grant subcommands are refused by name
ok - a version 1 record validates, reads its words and scalars with the clause and grant sections ignored, refreshes untouched, and archives
ok - new words over a live version 1 record archive it and write version 2 with the same session start
ok - enter and archive refuse while the record is locked, and proceed once it clears
ok - a quiet record announces, refreshes, and reads back as a present captain holding nothing, while an away record keeps hold-for-return
ok - an away entry over quiet mode records away, and a quiet entry never masks a standing away record
Evidence: fm-self-repo-role transcript

Source: fm-self-repo-role transcript

ok - fm-role.sh report: default, user, and maintainer directives resolve
ok - fm-role.sh report: malformed, unknown, and unsafe input fails closed
ok - fm-role.sh check: the default user/operator home cannot publish to firstmate upstream
ok - fm-role.sh check: a task on an ordinary project is untouched by the boundary
ok - fm-role.sh check: a matching maintainer scope authorizes the self-repository publication
ok - fm-role.sh check: scope mismatch and mere upstream remote presence never authorize
ok - fm-role.sh check: equivalent remote spellings resolve to one publication target
ok - fm-role.sh check: repository lineage, not remotes, identifies firstmate across forks
ok - fm-role.sh check: gh-resolved base selects the exact fork target, otherwise legacy precedence holds
ok - fm-role.sh check: undeterminable lineage or publication target refuses
ok - fm-role.sh check: recorded one-task consent authorizes its named repository only
ok - secondmate home: a role file without an inheritance receipt grants nothing
ok - secondmate home: inherited grants need a matching receipt; receipt-less and revoked grants are dead
ok - secondmate home: a primary role its own resolver rejects propagates as revocation
ok - fm_dod_block: upstream consent renders on publishing contracts and is refused on local-only
ok - fm-brief.sh: --upstream-consent validates, scopes to ship tasks, and renders normalized
ok - fm-brief.sh: --project applies the self-repository gate at scaffold time
ok - fm-spawn.sh: the launch gate refuses a user/operator home and passes a matching maintainer
ok - fm-spawn.sh: consent must agree between flag and brief, and is refused on local-only
ok - fm-promote.sh: the self-repository gate governs promotion identically to spawn
ok - fm-spawn.sh: --upstream-consent is refused on secondmate charters
# all fm-self-repo-role tests passed
Evidence: fm-afk-launch transcript

Source: fm-afk-launch transcript

ok - clear-stale: removes escalations buffer, sidecar, wedge marker, and unknown-wake acknowledgements
ok - clear-stale: leaves the durable wake-queue intact (no pending work dropped)
ok - enter: one call writes the record with the words, expected return, and spend cap, reads it back without asking for a go, and launches no daemon
ok - enter: the retired --grant flag is refused by name and leaves the standing record alone
ok - enter: refuses while the prior return catch-up is pending
ok - propose: the retired wait-for-go step is refused by name, writes nothing, and releases the launcher lock
ok - confirm: the retired wait-for-go step is refused by name, writes nothing, and releases the launcher lock
ok - pi: start refuses to launch the daemon and writes no state
ok - pi: start-native refuses to prepare a daemon
ok - pi-signed: start refuses to launch the daemon and writes no state
ok - pi-signed: start-native refuses to prepare a daemon
ok - FM_TEST_HARNESS seam is inert without the test marker
ok - pi enter stop: reports that no daemon terminal was running
ok - daemon entry: no daemon lifecycle starts without the away-posture record
ok - daemon entry: enter then start-native run back to back with no confirmation between them
ok - failed start: preserves the posture record enter wrote
ok - stop: clears the away flag and archives the posture record under its entry time
ok - launcher paths: relative home and state ignore CDPATH before daemon command construction
ok - launcher paths: absolute symlink spellings are preserved
ok - launcher paths: unresolved relative FM_HOME fails loudly
ok - launcher paths: unresolved relative FM_STATE_OVERRIDE fails loudly
ok - refresh: daemon already alive - stale artifacts preserved (current session's buffer kept)
ok - mode: a fresh entry with FM_AFK_MODE=quiet writes quiet
ok - mode: a fresh entry with FM_AFK_MODE unset defaults to away
ok - mode: a bare refresh (FM_AFK_MODE unset) of an already-running quiet daemon preserves quiet, never resets to away
ok - start: an unset-mode quiet refresh preserves the quiet record and flag
ok - start: /afk over a running quiet daemon refreshes the flag to away
ok - start-native: an unset-mode quiet refresh preserves the quiet record and flag
ok - start-native: /afk over a running quiet daemon refreshes the flag to away
ok - mode: an empty (legacy pre-mode) flag reads as away
ok - mode: a bare-epoch-timestamp (legacy pre-mode) flag reads as away
ok - mode: unrecognized content falls back to away
ok - mode: a missing flag reads as away
ok - stop-ordering: daemon SIGTERM'd while .afk still present (flush is not a no-op)
ok - stop-ordering: .afk cleared last
ok - stop-ordering: daemon-terminal record removed
ok - stop identity: stale lock cannot signal an unrelated live process
ok - failed start: away flag and delivery artifacts roll back
ok - concurrent start: one serialized daemon terminal remains tracked
ok - launcher lock: incomplete publication receives initialization grace
ok - launcher signal: TERM exits and releases the lifecycle lock
fm-afk-launch: daemon launched in non-visible herdr workspace ws-partial (pane lab:pane-exact), supervising lab:captain
ok - herdr create: malformed response recovers durable exact ownership
fm-afk-launch: herdr create failed after returning exact ids; closing lab:pane-exact
fm-afk-launch: recorded terminal teardown is unconfirmed; preserving exact id
ok - herdr create error: unconfirmed exact id is persisted for reconciliation
fm-afk-launch: failed to run daemon in herdr pane lab:pane-exact; closing it
fm-afk-launch: recorded terminal teardown is unconfirmed; preserving exact id
ok - herdr run failure: unconfirmed exact id remains reconcilable
ok - herdr daemon terminal: runs with the captain's primary harness
ok - tmux daemon terminal: runs with the captain's primary harness
fm-afk-launch: failed to persist daemon terminal record; closing tmux:exact-session
ok - record failure: newly created terminal is closed by exact id
fm-afk-launch: daemon did not become ready; closing tmux:exact-session
ok - readiness failure: exact terminal and durable record roll back
fm-afk-launch: daemon did not become ready; closing tmux:exact-session
fm-afk-launch: recorded terminal teardown is unconfirmed; preserving exact id
ok - readiness failure: unconfirmed terminal retains its reconciliation id
ok - tmux absence: clean missing differs from transport probe failure
ok - native lifecycle: launcher owns state with no terminal
ok - native lifecycle: uniform stop clears state without closing a terminal
ok - supervision host: away start-native on a claude home (config file: -) refuses the daemon and keeps the record
ok - supervision host: away start-native on a claude home (config file: empty) refuses the daemon and keeps the record
ok - supervision host: quiet start-native and a plain refresh of the quiet daemon still prepare the daemon
ok - supervision host: config/supervision-host-off keeps the away daemon on a claude home
ok - supervision host: away mode on an opted-in cursor, opencode, omp, grok, codex, or agy home launches no daemon
ok - supervision host: enter names a missing engine on an opted-in home and says nothing otherwise
ok - quiet entry: the daemon-backed quiet record announces a present captain with nothing held for a return
ok - quiet entry: a later /afk entry turns the quiet record into the away posture, which holds for the return
ok - supervision host: /quiet is a statement where the attended host runs, and a quiet enter writes nothing there
ok - supervision host: quiet-check says the supervision session is paused while its latch holds, and starts nothing
ok - supervision host: quiet-check names what the attended host lacks
ok - supervision host: an unready host's quiet entry records its mode, which carries the daemon start
ok - supervision host: /quiet under a live away record refuses and names it until the return
ok - supervision host: /quiet under a live away record over a fallback quiet daemon refuses until the return
ok - supervision host: a failed quiet start archives its quiet record so the present captain is not parked
ok - supervision host: a failed away start keeps its away record
ok - native entry: launcher-prepared lifecycle state is not rewritten
fm-afk-launch: reconciling leaked daemon terminal tmux:exact-session
fm-afk-launch: recorded terminal teardown is unconfirmed; preserving exact id
ok - teardown failure: exact terminal record is preserved
ok - record publication: failed atomic rename preserves the complete prior record
fm-afk-launch: daemon terminal record is malformed; refusing to act on it
ok - record read: malformed record fails closed without acting on a partial id
fm-afk-launch: daemon terminal record is malformed; refusing to act on it
fm-afk-launch: malformed daemon terminal record; refusing to stop away mode
ok - stop: malformed terminal record preserves away state and fails closed
fm-afk-launch: failed to create detached tmux daemon session 'fm-afk-daemon-1055137862-52355-16634-1793886467'
ok - tmux launch: planned exact target is recorded before creation and removed on failure
fm-afk-launch: failed to create detached tmux daemon session 'fm-afk-daemon-2612752575-52510-21969-1793886467'
ok - tmux launch: unique names eliminate collision teardown
ok - stop validation: malformed record causes no daemon or state side effects
ok - launcher lock: incomplete metadata fails acquisition and releases lock
fm-afk-launch: failed to clear away-mode flag
fm-afk-launch: away mode stopped; terminal teardown or the record archive remains recorded for retry
ok - stop state: away-flag removal failure is surfaced
fm-afk-launch: away-mode daemon did not exit after SIGTERM; preserving lifecycle state
ok - stop liveness: captured live daemon preserves lifecycle state after lock release
fm-afk-launch: an away-posture record is required; run enter before starting the daemon
fm-afk-launch: an away-posture record is required; run enter before starting the daemon
ok - refresh record: malformed terminal identity fails closed
fm-afk-launch: an away-posture record is required; run enter before starting the daemon
ok - clear failure: native entry aborts and restores prior state
fm-afk-launch: reconciling leaked daemon terminal tmux:exact-session
fm-afk-launch: terminal close command failed, but exact absence was confirmed
ok - confirmed absence: cleanup succeeds and removes the stale record
fm-afk-launch: rollback restoration incomplete; backup retained at /var/folders/y9/b8qt1d396lv9cfh42ft2gt7r0000gn/T//fm-afk-restore-fail.LGUlKy/state/.afk-launch-backup.pjUKFk
ok - rollback restore: incomplete restoration retains its recovery backup
fm-afk-launch: an away-posture record is required; run enter before starting the daemon
ok - flag failure: lifecycle aborts without active state
ok - herdr e2e: captain tab pane count unchanged after start (no split)
ok - herdr e2e: daemon launched in a separate non-visible workspace
ok - herdr e2e: daemon pane is NOT in the captain's tab
ok - herdr e2e: daemon terminal scoped to the lab session
ok - herdr e2e: captain tab pane count restored after stop
ok - herdr e2e: daemon workspace removed by exact id on stop
ok - herdr e2e: record + .afk cleared on stop
ok - tmux e2e: captain window pane count unchanged after start (no split-window)
ok - tmux e2e: daemon launched in a separate detached session
ok - tmux e2e: captain window pane count unchanged after stop
ok - tmux e2e: daemon session killed by exact id on stop
ok - tmux e2e: record + .afk cleared on stop
skip: rex CLI not found at $REX_BIN_DIR, on PATH, or at the server bundle path
skip: Rex CLI or jq unavailable (rex e2e)
  • Evidence: fm-brief transcript
  • Outcome: ⚠️ 3 issues (1 warning, 2 infos) across 1 run (27m47s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 issues (1 warning, 1 info)
  • ⚠️ bin/fm-skill-usage.sh:69 - The fork's skill tools resolve only config/claude-account, so they read the wrong Claude root on a home that uses upstream's new config/claude-accounts list. Example: a home declares only that list, and workers launch under --account /accounts/a. fm_worker_account_resolve looks only at the singular file and returns nothing, so fm-skill-usage.sh falls back to CLAUDE_CONFIG_DIR or ~/.claude. Transcripts under /accounts/a/projects are never read, so the weekly table undercounts or reports no tasks, with no error. bin/fm-skill-select.sh:198 has the same gap: it lists candidates from that fallback root, not the root the worker launches under. This only affects homes that opt in to the list. The merge commit mentions it under Noticed but does not fix it. The remedy needs a product decision, because one home now has several roots: aggregate them for usage, and pick by the task's --account for selection, which runs before spawn. Traced from source; not reproduced live.
  • ℹ️ bin/fm-role-lib.sh - Once merged, a home using this fork resolves its publication target to upstream. fm_role_publication_target tries upstream before origin when no remote.*.gh-resolved=base is set, so the target becomes github.com/kunchenguid/firstmate. The merge commit says new publishing tasks on this repository are then refused until the operator acts. config/ is gitignored, so config/firstmate-role cannot ship with this change. The operator must write maintainer github.com/demy00/firstmate, set the base remote in the copy used, or pass --upstream-consent per task. This is upstream's intended gate and the commit documents the steps, so no code change is needed. I traced the target resolution; the refusal itself comes from the commit message. Relay this as a post-merge step.
⚠️ **Test** - 3 issues (1 warning, 2 infos)
  • ⚠️ tests/fm-procevent.test.sh - fm-procevent has no result in this run because it was never started, and it is one of the five scripts the captain said not to leave to CI. It was waiting on the slow fm-captain-hold-lifecycle run, and the phase then had to report. The fm-procevent changes, including the macOS and load fixes in 483680b and the Lavish list handling in 2d30fc4, therefore have no finished evidence here. Run this script on its own with a background timeout longer than 10 minutes, because the foreground limit is 600s.
  • ℹ️ bin/fm-pr-lib.sh:489 - My before-and-after check of the PR identity fix was denied by the permission prompt, and I did not retry it another way. It would have run the real posture writer against the parent commit's parser and this commit's parser. The new tests pass with the fix, but I did not see them fail without it. That claim comes from the commit message, and the parser's old refusal comes from the diff.
  • ℹ️ tests/fm-spawn-pool-base-freshen.test.sh:1121 - The refusal of a brief with a Base branch: line and no --base-branch already has a test, so I added none: the line-only case of test_base_branch_must_agree_with_the_brief runs the real bin/fm-spawn.sh and asserts a non-zero exit, a message naming the Base branch line, and no task metadata. I confirmed this by reading the test and did not run that script in this run. Its assertion on the message text is loose, because it matches only the words 'Base branch'.
  • bash tests/fm-pr-merge.test.sh - passed (587s), including test_recorded_waivers_keep_the_pr_identity_readable, which runs real --allow-red and --allow-missing merges
  • bash tests/fm-project-yolo-apply.test.sh - passed, including test_posture_change_keeps_an_armed_pr_identity_readable
  • bash tests/fm-brief.test.sh - passed
  • bash tests/fm-afk-contract.test.sh - passed (19s)
  • bash tests/fm-self-repo-role.test.sh - passed (11s)
  • bash tests/fm-afk-launch.test.sh - exit 0 (64s); Rex cases skipped because the rex CLI is not installed
  • bash tests/fm-captain-hold-lifecycle.test.sh - passed (882s), 75 of 75 cases; it passed the 600s foreground limit and finished in the background
  • bash tests/fm-procevent.test.sh - NOT RUN
  • Read tests/fm-spawn-pool-base-freshen.test.sh to check coverage of the Base branch refusal - the line-only case covers it; script not run in this run
  • gh api repos/kunchenguid/firstmate/compare/... (read-only) - the fork was 284 behind and 35 ahead at the base commit; upstream main is 8 commits past the merged bb8dd209 with 0 behind
  • Before-and-after run of the real posture writer against both parsers - denied by the permission prompt, not performed
⚠️ **Document** - 1 info
  • ℹ️ CHANGELOG.md:10 - The changelog entry cites (#19), but that number does not exist yet: the GitHub API returns 404 for demy00/firstmate issue 19, and the latest PR I saw is ci: pin Linux jobs to ubuntu-24.04 #18. It is probably the next number, so I left it. If the PR gets a different number, correct this reference.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

cloud-practitioner and others added 30 commits October 7, 2026 03:52
* feat(spawn): add per-home worker tool exclusions

Add an optional per-home config/crew-exclude-tools file listing tool names to hide from workers, one per line, with blank lines and # comments allowed.
It applies to every ship and scout launch and relaunch in that home, is never inherited by another home, and does not affect secondmate agents.
Pi and pi-signed apply it through --exclude-tools, which also covers MCP tool names.
Any other runtime, and a raw launch command, refuses the launch when the list is non-empty rather than ignoring it.
Malformed entries are refused before provisioning, and before a relaunch stops a running worker.
Exclusions that match no tool in the worker's loaded registry are reported as unverified warnings in its status record instead of refusing the worker.

Closes kunchenguid#6744

* no-mistakes(review): Preserve UTF-8 exclusion paths and verify Pi lifecycle behavior

* no-mistakes(document): Clarify worker tool exclusion documentation

* no-mistakes(ci): Fixed ci-1 in bin/fm-exclude-tools-lib.sh: a failed read now returns an error before printing names, so all shared launch and relaunch callers refuse rather than silently dropping exclusions. Added deterministic regression coverage for a file disappearing after readability checks across Pi/pi-signed ship and scout launches. Reproduced the original failure; verified 83 spawn checks, 77 relaunch checks, direct parser/runtime failure cases, full targeted lint, Bash syntax, and git diff --check. Relaunch tests passed with existing fixture-cleanup permission warnings. ci-2 remains unchanged per the user's decision; the outer executor owns the fresh CI run
kunchenguid#5343)

* refactor(bin): share the local Firstmate home walk from the wake library

Teardown's walk over the root home and its registered local secondmate homes
moves into bin/fm-wake-lib.sh as fm_local_firstmate_state_dirs, next to
fm_firstmate_root_home, so a second consumer can count task records across
this machine's homes without a copy. Teardown keeps its exact refusal wording
through a thin wrapper.

* feat(bin): defer spawns beyond a project's declared machine capacity

A project whose machine-local resource only serves a few workers at once had
no way to tell Firstmate so: every queued item was launched, and the surplus
workers spent full-context turns retrying the resource.

config/project-capacity in the root home now declares how many workers each
named project admits at once on this machine. bin/fm-spawn.sh counts the ship
and scout records on the same project origin across the root and its local
secondmate homes, skipping ones whose ready PR is recorded, while holding the
shared project lock through publication. A spawn with every place held exits 75
before any brief render, endpoint, worktree, record, or backlog move, so the
item stays queued; batches report it as deferred. Undeclared projects keep
today's uncapped dispatch, and an unreadable declaration refuses rather than
guessing the limit.

Refs kunchenguid#4237

* no-mistakes(review): Document that capacity matches the clone directory name

* no-mistakes(document): Rewrap stale fm-wake-lib root-home doc comment

* no-mistakes(review): Dedupe local state dirs by identity to avoid double-counting

* no-mistakes(document): Rewrap fm_local_firstmate_state_dirs error doc comment

* no-mistakes(ci): I fixed all four Greptile findings. All 14 tests in tests/fm-project-capacity.test.sh pass, and shellcheck at warning level is clean on the changed files. Each new test failed against the old code and passes now. - **ci-1 (spaced names):** a declaration line must give a name its capacity whenever the name is a valid clone directory name. `fm_project_capacity_lookup` now trims each line, skips blank lines and lines whose first non-blank character is `#`, and takes the last field as the capacity. Everything before that field is the name, so it may contain spaces. The old error cases still refuse: a single field is rejected, and trailing text leaves a last field that is not an integer. The library header and docs/configuration.md now say a name starting with `#` cannot be declared. New test `test_spaced_project_name_is_declared` declares `my heavy project 1` next to an indented comment line and gets a deferral. - **ci-2 (unreadable records):** the holder count must never silently leave out a holder. `fm_project_capacity_occupants` now refuses when a local home's state directory exists but cannot be read or listed, or when a `.meta` file cannot be read. The error names the path, and `fm-spawn.sh` shows it in its existing refusal message. New test `test_unreadable_holders_refuse_admission` covers an unreadable record in the root home and an unreadable state directory in a registered local secondmate home, then checks that the spawn is admitted once both are readable. The test is skipped when run as root. - **ci-3 (Orca lock):** any spawn that can become a holder for a capped project must take that project's lock. The lookup now also reports whether the declaration caps any project at all, and an Orca spawn takes the per-origin lock whenever it does. This covers every capped same-origin clone. It also covers some cases where no same-origin clone is capped, because a spawn cannot find clones under other directory names without searching for them. With no declaration file, Orca still skips the lock. The comments in the library and in the `fm-spawn.sh` header are updated. The Orca test now clones the origin as `project-2`, which has no declaration, and checks that its Orca spawn refuses while the lock is held and publishes no record. - **ci-4 (worktrees):** `assert_nothing_created` now also compares the project's `git worktree list` from before and after a deferred spawn. Both tests that call it take that snapshot first. Files changed: bin/fm-project-capacity-lib.sh, bin/fm-spawn.sh, docs/configuration.md, tests/fm-project-capacity.test.sh

* fix(bin): declare capacity for a project name that begins with #

A clone directory whose name begins with # was skipped as a comment, so that project stayed uncapped. A line is a declaration when the # is written against the rest of the name and the line ends with a capacity; a # followed by whitespace stays a comment.

* no-mistakes(document): Rewrap project-capacity library header comment

* no-mistakes(ci): Lint 2 fails because this PR's code pushes ShellCheck past its memory cap. ShellCheck ran out of memory analyzing bin/fm-teardown.sh in CI (reason=memory, rc=251, peak about 8.39 GB). On current main the same file passes at about 7.29 GB. **Cause:** the new `fm_local_firstmate_state_dirs` function in bin/fm-wake-lib.sh had a conditional `. fm-secondmate-registry-lib.sh` with a `# shellcheck source=` directive inside the function. ShellCheck followed that source again, inside a function scope, wherever fm-wake-lib.sh is sourced, and bin/fm-teardown.sh is the heaviest root that sources it. Measured locally with `shellcheck --norc --external-sources bin/fm-teardown.sh`: - current main (fd325b1): 7.29 GB - main merged with this PR: 7.86 GB - the same merge without the in-function source: 7.27 GB **Rule this restores:** this change must not make any lint root heavier than it is on main. That function holds the only new nested source in the change. **Fix:** I removed the in-function source, which no caller needs. Both callers already load the registry library at top level before calling the function: - bin/fm-teardown.sh sources it directly. - bin/fm-spawn.sh, the only user of bin/fm-project-capacity-lib.sh, gets it through bin/fm-ff-lib.sh. I also documented the requirement in the function's comment and in the "Requires" note in bin/fm-project-capacity-lib.sh. No behaviour changes. **Verification:** - ShellCheck on head: bin/fm-teardown.sh peaks at 7.12 GB and bin/fm-spawn.sh at 6.68 GB, both with rc=0. bin/fm-wake-lib.sh and bin/fm-project-capacity-lib.sh lint clean. - tests/fm-project-capacity.test.sh, tests/fm-teardown.test.sh (102 ok) and tests/fm-teardown-endpoint-safety.test.sh all pass. Files changed: bin/fm-wake-lib.sh, bin/fm-project-capacity-lib.sh

* fix(bin): release the Herdr session lock when reclaim finishes

A concurrent resume in another home waits five seconds for that lock.
Reclaim is the last presentation change on the recovery path, so holding
the lock through the launch tail made the waiter time out. The contributions
arm check also freezes its one-second clock, the same way the budget tests
do, because an unfrozen clock can tick past before the first forge read.

* no-mistakes(review): Keep Herdr session lock through launch handoff after reclaim

* no-mistakes(review): Skip the spawning task's own record in capacity count

* no-mistakes(review): Restore release test comment above its test

* docs: scope PR-ready re-evaluation to a declared project capacity

A ready pull request frees a place only when that project declares capacity, so the always-loaded backlog contract should re-evaluate on that handoff only in that case.
… section (kunchenguid#6785)

fm-procevent-lavish.sh read labels tag=message rows SESSION-ENDING MESSAGE
only when session_ended is true and CAPTAIN MESSAGE otherwise, but the
count line always said session_ending_message_count. Several composer
messages on a still-open board were therefore counted as session-ending.

The count line now follows the same session_ended switch:
session_ending_message_count once the session ended, captain_message_count
otherwise. Message rows stay out of the annotation count, per triage.

Fixes kunchenguid#6743
…henguid#6780)

The Herdr presentation lock namespace was the fixed machine-global
/tmp/firstmate-herdr-presentation, so on a host where two OS users run
Firstmate on Herdr the first account to create it owned it and every
teardown from the other account was refused with no way to clear it.

Suffix the namespace with the account uid. The owner-uid and mode-700
checks are unchanged, so a foreign-owned or wrong-mode name at this
account's path is still refused and never adopted, chowned, or removed.

Fixes kunchenguid#4716.
…te (kunchenguid#6809)

The OpenCode session plugin's shouldArm kept its own copy of the need
test that only looked for in-flight task records, while the turn-end
guard decides with fm_supervision_needed in bin/fm-supervision-lib.sh,
which also counts registered process-event sources and trusted custom
checks. With an empty fleet but any registered source or check, the
guard blocked every turn end while the plugin declined to arm - a loop
the guard's own repair line could not resolve because it names the
plugin as the fix.

The plugin now delegates the decision to the shared predicate through
bash, keeping the local away-record decline and the x-mode.env arm
override. OpenCode plugin test fixtures now carry the real predicate
their arming path sources, and the arm suite gains six cases asserting
the plugin's decision against the shared verdict over the same
synthetic state directories.

Co-authored-by: Mia Sun <mia@Bigs-Mac-mini.localdomain>
kunchenguid#6792)

* fix(bin): resolve a pending reply only from its own task's status line

Remote reply ingestion handed every corr= token in a mate's payload to
fm_pending_reply_try_resolve together with that mate's own status log,
so one mate echoing another mate's token resolved the other request.
Honor a status-file override only when it is the record's own
parent_status, and match the corr= token as a whole word.

Fixes kunchenguid#6538

* no-mistakes(document): docs: scope remote reply settlement to the asked mate
…nguid#6784)

agent-skill-trigger-index claims to be the complete agent-only trigger
index but omitted operational-home-layout, session-start-recovery,
validation-supervision, ship-landing, scout-completion, and
away-quiet-supervision. Add each with its own description's trigger,
placed beside the related entries.

The decision-hold-lifecycle redirect stub stays out, per triage.

Fixes kunchenguid#6503
…nchenguid#6814)

* test: share a rename-safe agent stand-in across liveness suites

On Ubuntu 26.04, `sleep` is the uutils multicall binary, which refuses to
run when invoked through a symlink named after another utility. The Herdr
descendant process-walk tests built their agent-named process as a `pi`
symlink to the host `sleep`, so the process exited at once, its parent shell
was gone before the walk ran, and both cases read `unknown unreadable` and
failed on that host. The suite stops at its first failure, so every later
case went unrun. The Herdr control smoke test's `claude` symlink has the
same construction.

The tmux liveness suite already solved this with a host-compiled spinner and
a survival-checked `sleep` fallback. That builder moves into tests/lib.sh as
fm_agent_standin, and the tmux suite, both Herdr descendant cases, and the
Herdr control smoke test now use it. When no stand-in can survive a foreign
name, a case skips with the reason instead of failing.

tests/fm-test-fixtures.test.sh gains a portable regression with a fake
multicall `sleep`, so it bites on hosts whose own `sleep` is single-purpose.

* no-mistakes(document): Correct Herdr verification fixture reference

* ci: retrigger cancelled shard
…he Stop hook's group is torn down (kunchenguid#6787)

* fix(bin): keep the supervision host's pass-through successor out of the hook's process group

The successor a main-only pass-through leaves for main shared the Stop hook's
process group, so the harness tearing that group down after the exit-2 rewake
stopped it. The stop published downtime and the next park's first cycle
announced an empty check: rearm-resurface, which woke main again in a loop.
Start that successor in a process group of its own, as the hook's own
handling successor already is.

* no-mistakes(review): Give the at-turn successor left for main its own group

* no-mistakes(document): Document own-group successor for turn-start hand-back too

* no-mistakes(ci): I made the change you asked for: both new teardown tests in tests/fm-supervision-host.test.sh now call the existing `stop_home_processes "$home"` just before `pass`. The tests are `test_successor_left_at_the_turn_survives_the_hook_process_group_teardown` and `test_pass_through_successor_survives_the_hook_process_group_teardown`. No production code and no other tests changed. The rule broken was that a test must not leave a home's watcher or arm processes running after it passes. These two were the only cases in the changed area that broke it. The other host+hook tests already stop their home, and `test_successor_close_during_main_turn_is_delivered_at_the_next_turn_end` leaves its watcher behind too, but it is an older test you said not to touch. The only reason anything was left over is that the successor's arm now sits in its own process group, outside the hook's teardown. `stop_home_processes` kills the watcher by the pid in its lock file, which stops it no matter which group it is in. **Checks run:** - I ran just these two tests from a scratch copy of the suite (since deleted). Both pass in about 13 seconds. - After each test, a process listing filtered to that test's home directory came back empty once the processes had about a second to exit after TERM. - `bash -n` on the test file passes. - `shellcheck` is not installed here, so I did not lint the file. - I did not run the full serial-2 suite locally. Whether it now finishes under its 30-minute limit will only show on the next CI run
…ters (kunchenguid#6823)

* test: use idle composer readiness for Claude tmux guards

* no-mistakes(test): Fix attended supervision test expectations and isolate worker state

* no-mistakes(document): Correct live guard coverage and readiness documentation

* no-mistakes(ci): Captain, fixed SC2100 by quoting the cursor-agent assignment in tests/fm-host-mirror-live-e2e.test.sh. Reproduced the failure before editing; pinned ShellCheck lint on both PR test files, bash syntax checks, and git diff --check now pass

* test: preserve attended successor close assertions

* no-mistakes(test): Fix attended live test watcher takeover expectations

* no-mistakes(document): Correct stale attended guard documentation

* Revert "no-mistakes(document): Correct stale attended guard documentation"

This reverts commit 8e59d89.

* Revert "no-mistakes(test): Fix attended live test watcher takeover expectations"

This reverts commit c0b8510.
* test: order stale watcher-lock fixture races explicitly

* no-mistakes(review): Removed duplicate stale-steal reap call
…ting server (kunchenguid#6920)

* fix(bin): keep herdr composer probes observable-only without autostarting server

- Refuse bare pane identifiers lacking session prefix in fm_backend_herdr_parse_target
- Add fm_backend_herdr_target_observable to passively verify server liveness without autostarting
- Route visible viewport captures through fm_backend_herdr_target_observable
- Detach stdin with </dev/null on background server launch in fm_backend_herdr_server_ensure
- Add unit and regression tests in tests/fm-backend-herdr.test.sh

* fix(bin): drop parse_target colon restriction to preserve existing fixtures

Revert the fm_backend_herdr_parse_target colon check so that single-colon
session targets like sess:p1 in secondmate liveness and other fixtures parse
properly. The probe path remains observable-only via fm_backend_herdr_target_observable.
…kunchenguid#6956)

* test: clear inherited Git repository location in fixture helper

An absolute GIT_DIR inherited from the caller (a linked-worktree hook
exports one) overrides the discovery that git -C implies, so fixture
setup moved the caller's branches and registered fixture worktrees in
it. tests/git-config-helpers.sh now unsets GIT_DIR, GIT_WORK_TREE,
GIT_INDEX_FILE and GIT_COMMON_DIR alongside the config isolation.

Fixes kunchenguid#6953

* no-mistakes(document): Document fixture Git location isolation in CONTRIBUTING
…nchenguid#6830)

* fix(bin): stage contribution-input JSON via temp files

The contribution-input branch passed the whole canonical backlog document to
jq as a single --argjson argv argument. A large fleet's backlog JSON exceeds
Linux MAX_ARG_STRLEN (128 KiB), so jq fails with E2BIG (Argument list too
long) and the contribution-input snapshot emits empty output, breaking the
bearings contribution path.

Write both the backlog and task documents to a temp directory and hand them
to jq with --slurpfile, matching how the full snapshot path already stages
the same pair. Output is unchanged for any backlog that fits in argv.

* no-mistakes(document): Correct contribution cleanup trap comment
)

* fix(bin): arm the busy contract on secondmate launches

A tmux-backed secondmate's active-turn gate can only see a busy verdict from the parent home's record, and those launches never armed it.

* no-mistakes(review): Reopen secondmate busy on blocked Claude Stop; drop muse guard

* no-mistakes(review): Make Claude secondmate Stop guard the sole Stop-state writer

* no-mistakes(review): Record live rewake UserPromptSubmit evidence and add regression

* docs: record Claude secondmate Stop guard as busy writer

* no-mistakes(review): Keep Stop idle hook for older secondmate guards

* no-mistakes(document): Correct stale omp secondmate -e rationale in supervision verification

* no-mistakes(document): Fix skill-relative turnend-guard link in Claude harness reference

* no-mistakes(ci): Root cause: in shard 9, the pure-contract-unit family ran two scripts, tests/fm-rovo-harness.test.sh (14712 ms) and tests/fm-omp-harness.test.sh (10335 ms). Those two durations add up exactly to the failing family's 25047 ms. The failing one was tests/fm-omp-harness.test.sh. Its test_secondmate_launch_relies_on_discovery still asserted the old contract: that an omp secondmate launch names no -e and gets no state/<id>.omp-ext.ts. This PR (issue kunchenguid#4268) deliberately changed that. bin/fm-spawn.sh now arms the busy contract for omp secondmates, so their launch names `-e state/<id>.omp-ext.ts` and writes that extension. The primary extensions are still left to auto-discovery. The harness reference docs were updated to match, but the test was not. The fix is test-only and touches just tests/fm-omp-harness.test.sh. The test now asserts that the secondmate launch names exactly one -e and that it points at the parent-home state/sm.omp-ext.ts. Because only one -e is allowed, the tracked .omp/extensions files are not named a second time, which would load them twice. The test also asserts that the extension file exists, and the header comment for contract 3 was updated. The posture overlay, --cwd, marker, and supervision-model assertions are unchanged. Verification: the host's load average was about 140 on 8 cores, and the full script timed out locally after 590 s having finished only its first 2 tests. So I ran the one affected test function on its own through the real fm-spawn path, and it passed (`ok - fm-spawn: a real omp secondmate launch loads only the busy -e and auto-discovers its primary extensions`). The remaining omp tests were not re-run locally. shellcheck on the file reports only existing info-level notices. The change is left uncommitted for the outer executor

* test: keep the secondmate busy stall gate visible after main's liveness probe

The merged watcher treats a window-name inventory miss as a missing endpoint and exits a later checkpoint on the previous quiet run's recovery wake. The fake pane now answers both list-windows formats, and each observation starts without a leftover downtime marker, so a busy mate still defers the stall and an idle mate still surfaces it.

* no-mistakes(review): Align fm-spawn secondmate comments with omp -e and devin refusal

* no-mistakes(document): Document secondmate busy extensions in configuration reference

* no-mistakes(test): Make live busy-contract guard clean up read-only lab dirs

* fix(bin): pass Claude secondmate busy hooks through --settings

Rewriting a persistent mate home's settings.local.json drops the captain's saved permissions. The hooks now live in a parent-state file Claude Code loads for that session only.

* no-mistakes(review): skip busy arm for raw secondmate launch commands

* no-mistakes(review): retire earlier busy arm on raw secondmate respawn

* no-mistakes(review): retire Stop pointer on relaunch, load --settings in live guard

* no-mistakes(document): Document secondmate Claude settings file and raw-launch exception

* no-mistakes(ci): The check "Behavior portable serial 9" failed because of this PR, and I fixed it with a test-only change; `tests/fm-spawn-dispatch-profile.test.sh` now passes locally in full. Cause: the one failing test was "claude secondmate launch settings JSON does not disable Claude attribution" in `tests/fm-spawn-dispatch-profile.test.sh`. This PR makes a claude secondmate launch pass `--settings` as a file path (`state/<id>.claude-settings.json`) instead of inline JSON. The test helper `claude_settings_json_arg` handed that path string to jq as if it were JSON, so jq reported a parse error. The product behavior is correct: the file does carry `feedbackDrafts` and the attribution-off policy. Invariant: a test that checks the Claude launch settings must read the settings Claude would load, whichever form `--settings` takes (inline JSON or a file path). The only place this must hold is `claude_settings_json_arg`, the single reader of the `--settings` value in the tests. Its two callers, `assert_attribution_policy` and `assert_attribution_policy_absent`, both go through it. Fix: `claude_settings_json_arg` now prints the value when it starts with `{` and prints the file contents otherwise. No product code changed. Verification: I ran `bash tests/fm-spawn-dispatch-profile.test.sh` in the worktree. It ended with "all fm-spawn-dispatch-profile tests passed", including the previously failing secondmate case and the crewmate and keep-ai-trailers cases that use the inline form. I did not run the other tests of shard 9; they passed in the CI run and this change touches only this test file. The change is uncommitted in the worktree (one file modified)
…ailures (kunchenguid#7036)

The large-backlog regression already proved the json and secondmate
home-summary modes stay within exec limits. It now also runs the
contribution-input mode on the same 1200-record backlog, which is the
path kunchenguid#6830 moved off argv. With that fix reverted the test fails with
the field error jq Argument list too long at the contribution-input call.
…urn (kunchenguid#5843)

* fix(teardown): scrub nested repos before return

Treehouse return uses git clean -fd, which leaves a nested git
repository in the pool slot. Scout and forced teardown run
git clean -ffdq first. A return that stays dirty names the
lost slot instead of reporting a clean return.

* no-mistakes(review): Report lost pool slots early and scrub forced child copies

* no-mistakes(review): Drop misleading no-rerun clause from lost-slot message

* no-mistakes(document): Note failed status read in teardown dirty-return header

* no-mistakes(ci): I fixed ci-1 and ci-2 in bin/fm-teardown.sh, and I added tests in tests/fm-teardown.test.sh. Invariant (ci-1): a lost-slot finding must only warn. It must never change the teardown exit status. Two places must obey this: the final status block, and the remote success path that a forced remote retirement uses. - The final block no longer runs `exit 1`. When a slot is lost, teardown writes a lost-slot line to stderr instead of the clean "teardown X complete" line. Then backlog_refresh_reminder runs and teardown exits with its normal status. - Before this change, remote_secondmate_teardown discarded the remote output when the remote run succeeded. Now it sends that output to stderr. Without this, the remote lost-slot warning would not reach the operator once the remote side exits 0. - I updated the header comment to match. Invariant (ci-2): after a return that succeeds, teardown must verify every returned copy, or it must warn that it could not. This invariant is enforced inside teardown_note_dirty_return, which both return sites call (the main WT return and the forced-secondmate child return). Before, a copy that was missing or not a readable git worktree caused a silent `return 0`. Now it sets the lost flag and gives the same warning, with the text "cannot verify: the copy is missing or not a readable git worktree after return". Both call sites run only for a copy that existed before the return. The exit status does not change. Tests: - The dirty-return test now expects exit 0 and the warning. - New test (z3d): a forced secondmate teardown whose child return leaves residue. This is the same command that `retire --force` runs on the remote host. The test expects exit 0 and the warning, and it checks that the task record and the home are removed. - New test (z3e): a return that removes the copy's .git. The test expects exit 0, the "cannot verify" warning that names the copy, and no clean completion line. Verification: - I ran the new and updated tests against the old script. Three failed as expected (exit 1, or no warning). With the fix, all of them pass. - The full tests/fm-teardown.test.sh suite passes: 117 ok, 0 not ok. - shellcheck shows no new warnings. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh is still running. It covers the remote success path that now relays output. Up to now it has no failures, but it has not finished, so I cannot report a final result for it

* no-mistakes(ci): I fixed ci-1 and ci-2 as one exit contract, as the user asked. The changes are in bin/fm-teardown.sh, tests/fm-teardown.test.sh, and tests/fm-remote-secondmate-lifecycle-e2e.test.sh. Invariant (ci-1): when a returned slot is dirty or cannot be verified, teardown must finish every cleanup step and then exit with exit code 4. Exit 4 is used for nothing else. It must hold in two places: the final status of a local teardown, and the remote secondmate retirement caller. - Local: the existing lost-slot flag now leads to `exit 4` (TEARDOWN_LOST_SLOT_EXIT). This exit comes after the task record is removed, the warning is printed, and backlog_refresh_reminder runs. A clean return still exits 0. Refusals and errors exit 1, and an invalid request exits 2. The header documents all of these codes. Exit 3 is only an internal "not remote" return. The ssh transport uses 255. - Remote caller: remote_secondmate_teardown treats a remote exit 4 as "retired with a lost-slot warning". It does the full local retirement (route, registry line, reply source, records, summary refresh), prints the normal completion line on stdout, and then returns 4. The remote control script runs fm-teardown.sh as its last command, and fm-on.sh execs ssh, so the remote 4 reaches the local side unchanged. Invariant (ci-2): remote output goes to local stderr only when it is a lost-slot warning. - After a clean remote retirement (exit 0), the caller no longer prints the captured remote output. - After exit 4, the caller forwards only the lost-slot warning header and the remaining-path lines. To make those lines easy to find, teardown_note_dirty_return now indents each remaining path by two spaces. Tests: - The dirty-return (z3), forced-secondmate dirty-child (z3d), and copy-removed (z3e) tests now expect exit 4 after cleanup. The clean scout return (z1) still expects 0. - The final remote retirement in the e2e test now uses a fake-ssh mode, retire-lost-slot. In this mode the real remote retire runs, and then the fake reports a lost child slot with exit 4. The test checks the following: exit 4; the remote home, parent metadata, and route are removed; stdout has "teardown ios complete (remote"; stderr has the warning and the remaining path; and stderr does not contain the remote completion text. The remote side producing exit 4 is covered by z3d. Verification: - tests/fm-teardown.test.sh: 117 ok, 0 not ok. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh: ALL TESTS PASSED. - shellcheck shows the same warning count as before on all three files. - Against the previous script, both suites fail as expected. In the local suite, dirty-return expected 4 but got 0. In the e2e test, the stdout local-completion check fails

* no-mistakes(ci): Both CI failures came from the lost-slot check that this PR added. Shard 3: tests/fm-secondmate-safety.test.sh "force teardown failed to discard child work". Shard 7: tests/fm-teardown-endpoint-safety.test.sh exited 4. The check ran after the return of every copy. Treehouse return removes a copy that is not a pool slot, so the check reported "cannot verify" and teardown exited 4. Before the fix, both failures happened on my machine. Invariant: only a Treehouse pool slot can be lost by the pool, so the check runs only for a copy that was a pool slot before the return. Fix in bin/fm-teardown.sh: both return sites (the main WT return and the forced-secondmate child return) now run fm_treehouse_pool_slot before the return. They call teardown_note_dirty_return only when the copy was a pool slot. teardown_note_dirty_return lost its pool-slot branch and its unused proj argument; the slot label still comes from the path of the copy. Test fix: in tests/fm-teardown.test.sh, the z3d child copy was not a pool slot. It is now a real pool slot (pool/6/repo plus treehouse-state.json), and the test still expects exit 4 and the warning. Verification: endpoint-safety 27 ok, exit 0. secondmate-safety 79 ok, exit 0. fm-teardown 117 ok, 0 not ok. remote-secondmate-lifecycle-e2e ALL TESTS PASSED. shellcheck count is unchanged (17)

---------

Co-authored-by: Nova Agent B <novaagentb@gmail.com>
…nguid#7047)

* fix(tests): keep backlog suites hermetic against a local .tasks.toml

Fixture homes now write the tracked markdown defaults through a
fm_test_tasks_toml helper instead of copying the checkout's .tasks.toml,
which an operator may override with a beads backend at a live backlog.

The backlog handoff and receive moves pin --backend markdown, because they
already name their markdown files and otherwise resolve the backend from the
caller's working directory. The atomicity suite runs from its scratch root so
its direct tasks-axi fixture calls cannot read the checkout config.

* no-mistakes(review): Add decoy-cwd .tasks.toml regressions for handoff and receive

* no-mistakes(lint): Reuse sha256_file helper to fix SC2015 in remote handoff test
…nchenguid#7076)

* fix(bin): parse whole project name in home seed registry queries

Parse the full project name after the dash in fm-home-seed.sh registry lookups.

This matches the round-3 bootstrap mirror check parser so spaced names resolve.

Cover both the project-less seed refusal guard and registry line lookups in tests.

* no-mistakes(review): Match registry rows by name prefix plus separator

* no-mistakes(document): Note shared registry row-match rule in fm-home-seed
…d#4490)

* fix(codex): preserve announced recovery across checkpoints

* no-mistakes(review): Make announced-recovery checkpoint test reproduce the regression

* no-mistakes(review): Separate 2026-10-07 checkpoint fixture verification from original run

* no-mistakes(test): Defer TERM exit to clean up quiet checkpoint watcher locks

* no-mistakes(document): Update checkpoint recovery and signal documentation

* no-mistakes(ci): Updated both lock-acquire retry loops to honor the watcher’s TERM stop status, so held-marker cleanup exits while retaining stale lock evidence. Set the --stop test’s watcher poll to 1 second to fit its 5-second stop bound. Syntax checks and the full watch-arm suite passed; the targeted held-marker test passed during the triage suite, which timed out after 600 seconds before completing. Did not change or attempt to fix fm-supervision-host.test.sh

* no-mistakes(ci): Removed the cleanup-bound test that incorrectly expected a TERM-stopped watcher to retry a contended lock acquisition. TERM cleanup intentionally stops after the failed attempt; the remaining held-lock test verifies it exits and retains stale lock evidence. The two relevant TERM tests passed, as did shell syntax and diff checks

* Revert "no-mistakes(ci): Updated both lock-acquire retry loops to honor the watcher’s TERM stop status, so held-marker cleanup exits while retaining stale lock evidence. Set the --stop test’s watcher poll to 1 second to fit its 5-second stop bound. Syntax checks and the full watch-arm suite passed; the targeted held-marker test passed during the triage suite, which timed out after 600 seconds before completing. Did not change or attempt to fix fm-supervision-host.test.sh"

This reverts commit 44ce29bfbfa95149a7785efc200f6a00b5bf3a41.

* Revert "no-mistakes(ci): Removed the cleanup-bound test that incorrectly expected a TERM-stopped watcher to retry a contended lock acquisition. TERM cleanup intentionally stops after the failed attempt; the remaining held-lock test verifies it exits and retains stale lock evidence. The two relevant TERM tests passed, as did shell syntax and diff checks"

This reverts commit e1e37067a9369f0c38d7bd1c7a0913b1c54fc28a.

* Revert "no-mistakes(test): Defer TERM exit to clean up quiet checkpoint watcher locks"

This reverts commit 9877bf92134e77414e25cd8e6f122ff4d089473a.

* fix: let checkpoint watcher clean up before timeout

* no-mistakes(review): Scope checkpoint timeout escalation and restore signal docs

* no-mistakes(review): Fix Perl checkpoint timeout escalation

* no-mistakes(document): Clarify checkpoint recovery documentation

* no-mistakes(document): Document isolated checkpoint regression command

* no-mistakes(ci): Tied direct-checkpoint SIGKILL escalation to the effective cleanup bound, preserving the five-second minimum and leaving the supervision-host path unchanged. The targeted checkpoint suite, shell syntax checks, ShellCheck, and diff checks pass. CI was not manually rerun

---------

Co-authored-by: jopo <jopo@JP-M2mini.local>
…uid#4395)

* feat(bin): add Forgejo (tea) as a third forge alongside GitHub and GitLab

Extends the existing provider-tagged PR/MR dispatch in fm-pr-lib.sh,
fm-pr-poll.sh, fm-pr-check.sh, and fm-pr-merge.sh with a forgejo arm,
following the same pattern already established for GitLab. tea addresses a
repository by owner/repo slug only and resolves the host through a named
"tea login" rather than a URL, so the login is matched against the PR's host
fresh at arm and merge time. tea's own merge subcommand exposes no
head-binding flag, so the merge itself calls Forgejo/Gitea's REST API
directly via "tea api" with head_commit_id, verified against a real
disposable instance to behave like --match-head-commit/--sha; that same
verification found that "tea api" reports an HTTP-level failure with exit
status 0, so a merge is confirmed only by reading the pull request back
afterward, never by trusting the command's own exit code.

Adds forgejo as a value of the registry's existing forge= binding (the
closed set becomes none|gerrit|forgejo, with its refusals unchanged), so a
generated brief and its direct-PR Definition of done name tea before any PR
exists and bin/fm-spawn.sh's forge agreement and bin/fm-promote.sh carry it
like gerrit. Documents the new value in docs/configuration.md,
docs/architecture.md, and a new maintainer-verification doc mirroring
docs/gitlab-merge-watch.md.

* no-mistakes(review): Redact private Forgejo host/IP from evidence doc

* no-mistakes(review): Fix doc's tea-login JSON shape; dedupe host validators

* no-mistakes(document): Add Forgejo to README doc index and scripts.md forge list

* no-mistakes(lint): {"summary": "fix(bin): drop unused FORGEJO_LOGIN capture in fm-pr-check.sh"}

* fix(bin): refuse --allow-red on Forgejo instead of dropping it silently

The attended --allow-red waiver landed on main while the Forgejo arm was
being written, so its applicability guard only ever classified GitHub and
GitLab. On a Forgejo pull request the flag parsed, and then nothing read
it: forgejo_verify_mergeable requires the head's combined commit status to
be exactly "success", with no per-check name to match a waiver against.

The merge still refused, so no red Forgejo merge was ever possible, but it
refused without saying the waiver had been ignored. Extend the existing
GitLab guard to cover Forgejo for the same reason GitLab has it: both
collapse their checks into a single head verdict, so the green requirement
is absolute and a named waiver cannot apply.

* fix(bin): poll a Forgejo pull request by number through tea api

The merge watch listed the 50 most recent pull requests and filtered to the
watched index, so in a repository with more newer pull requests a merged
watch never fired. Read the one pull request through tea api instead and wake
only on a boolean merged field of true, since tea api exits 0 on HTTP errors.

Share the tea login match as fm_pr_forgejo_login for every sourcing script and
add fm_pr_forgejo_read_record for the state, merged flag, and head. Arming now
also requires jq, which the poll needs to read the record.

* fix(bin): gate a Forgejo merge on every status page and on draft state

The combined-status endpoint computes its state from one page of contexts, so
a failing context past the first page could leave the head reading green. Read
every page until an empty one and require each to be success. Also refuse a
pull request the API reports as a draft.

* fix(bin): prove a Forgejo task landed from its merged pull request at teardown

pr_is_merged read the recorded pr= only through gh, so a Forgejo task always
fell back to the content check and refused landed work whenever that check was
inconclusive, such as when later default-branch commits conflict with the
merged tree. Read a recorded Forgejo URL through fm_pr_forgejo_read_record and
apply the same containment check against its head.

* feat(bin): read Forgejo pull requests in crew-state and review-diff

fm-crew-state reports a terminal passed run's Forgejo pull request as open,
closed, merged, or unknown through fm_pr_forgejo_read_record, and
fm-review-diff resolves a /pulls/<n> URL to the refs/pull/<n>/head ref
Forgejo serves. Document the by-number read, the paged status gate, and the
draft gate, and mark what the evidence instance did not exercise.

* fix(bin): parse tea logins as JSON and close the remaining Forgejo gaps

The tea login match split each line of `tea login list --output json` on
quotes and read field 4, which only works while tea pretty-prints one field
per line. A login printed as one compact object put the login name where the
url belonged, so arming, merging, and polling refused every Forgejo host.
fm_pr_forgejo_login and the static poll's own copy now parse the list with
jq, matching each login's url host with scheme, userinfo, port, and path
stripped, and still refuse zero or several matches.

--allow-missing is now refused on a Forgejo pull request the way --allow-red
already is, instead of being parsed and ignored: the merge already requires
the head's combined commit status to have succeeded.

The forge=forgejo Definition of done read the draft state back with
gh-axi pr view and cleared it with gh-axi pr ready although the PR is opened
with tea; both publishing modes now read the draft state through tea api and
clear Forgejo's work-in-progress title prefix with tea pulls edit.

* no-mistakes(review): Retry Forgejo merge confirmation read before failing

* no-mistakes(document): Document Forgejo draft gate and merge confirmation retry

* fix(bin): merge Forgejo pull requests with the repository's default style

When the caller named no merge method, a Forgejo merge always sent Do=merge,
so a repository that allows only squash or rebase merges refused every
default call. The style now comes from the repository's own
default_merge_style, read live through the same tea login, and a merge is
refused when that value cannot be read or is not a known style rather than
replaced by one chosen here. A method the caller names still wins.

---------

Co-authored-by: dna <dna@local>
* fix: serialize secondmate liveness relaunches across task set

* no-mistakes(review): Remove relaunch wait override and test bounded contention

* no-mistakes(document): Clarify secondmate relaunch locking and timeout documentation

* chore: keep local Stele binding out of shared template

* no-mistakes(document): Correct stale secondmate recovery timing comment

* chore: exclude local Stele binding from relaunch fix

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

* no-mistakes(document): Correct secondmate recovery ordering documentation
…unchenguid#7172)

* feat(bin): gate firstmate-upstream publication behind a declared home role

Users who clone firstmate and run it as-is got a surprise: when their
agent hit a firstmate bug, it could drive a pull request at upstream
because nothing distinguished the maintainer's home from an ordinary
user's. Every home now resolves to user/operator unless the gitignored
config/firstmate-role grants a maintainer scope, or a single task
carries the captain's recorded --upstream-consent on the brief, spawn,
and promotion. fm-brief, fm-spawn, and fm-promote apply one fail-closed
gate in bin/fm-role-lib.sh; the role is never inferred from gh identity,
remotes, permissions, or CI, and secondmates honor only receipt-proven
inherited grants so a child cannot grant itself. Session start reports
the resolved role with no network call. Ordinary project delivery and
the clone-and-run setup flow are unchanged.

* no-mistakes(review): Harden firstmate role parsing, normalization, and inheritance

* no-mistakes(review): Detect firstmate by lineage; drop consent fallback; fix claims

* no-mistakes(document): Correct and consolidate Firstmate role documentation
…henguid#7248)

* fix: narrow Pi before-agent prompt events

* no-mistakes(review): Restore processing-run abort detection and type Pi test events
…guid#6608)

* docs: let a home declare authoritative external memory tiers

AGENTS.md section 6 routed durable knowledge only to firstmate-local files,
so a home whose captain keeps reasoning and facts in external stores had no
tracked rule keeping those stores authoritative over the per-machine data/
cache. Add a generic home-declared Memory layering contract (schema in
docs/configuration.md), make firstmate the capture path for workers whose
harness cannot reach a declared tier, and teach the stow skill to route to
declared tiers first and never prune a tier-owned entry without capturing it.

* no-mistakes(review): Report missing memory-layering declaration and index tier docs

* no-mistakes(document): Narrow memory-tier re-seed step to captain re-declaration

* no-mistakes(ci): Environment: 2026-10-05, host wildrobot, Linux 7.0.0-34. Finding ci-1 (Greptile): a tier-owned fact could be lost when its declared tier was unreachable from the session. - The invariant that was broken: until the declared tier holds a tier-owned fact, that fact must stay in a memory file loaded at startup. - Where it could be broken: the declared-tier guard, which said to archive the entry to the never-loaded cold tier; the routing step for new findings, which only mentioned the receipt; and the budget-eviction and offload eligibility rules. Fix, made only in .agents/skills/stow/SKILL.md: - **New marker.** Added `<!--t:NAME-->` to the existing compact marker list, so its meaning lives in one place. It marks a tier-owned entry that tier NAME does not hold yet. Stow never prunes, ages out, evicts, offloads, consolidates away, or archives an entry carrying it, whatever its tier clock says. A later pass that can reach NAME captures the entry there and removes the marker. - **Declared-tier guard.** "still archive rather than delete" now says to leave the entry in place with its pending-capture marker, and the receipt still names it. - **Routing step 2.** When the tier is unreachable, a new finding is written to the startup-loaded local file its class would otherwise use, or kept where it already lives, with the marker. It is still reported as an exception in the receipt. - **Budget eviction and offload eligibility.** Both now exclude entries pending capture, so the convergence pool is counted correctly. - **Receipt bullet.** Changed "finding or pruned entry" to entries left carrying the pending-capture marker, because those entries are no longer pruned. docs/configuration.md ("protects tier-owned entries from pruning") and AGENTS.md section 6 are still accurate, so I left them unchanged. No new file, queue, script, or digest section. One sentence per line, plain dashes. Verification: tests/fm-stow-cascade.test.sh, tests/fm-documentation-audiences.test.sh, and tests/fm-lint.test.sh all pass

* docs: keep undeclared memory-tier path silent and close stuck tier markers

Drop the stow receipt line reporting a missing Memory layering declaration
(AGENTS.md section 6, the stow skill, docs/configuration.md) so a home with
no declaration behaves exactly as before. Name pending-capture entries in the
exempt floor wording, and say how stow retargets or clears a pending-capture
marker whose tier was renamed or retired.
* fix: keep unsupported contributions unmeasured during polling

* no-mistakes(document): Clarify unsupported contribution polling documentation

* no-mistakes(review): Match literal GitHub hostname and cover unsupported lookalikes

* no-mistakes(review): Separate durable ownership compatibility from GitHub observation eligibility

* no-mistakes(document): Clarify unsupported contribution coverage and ownership compatibility
…er-strip hooks path (kunchenguid#6341)

* fix(bin): keep inherited Git credential helpers when installing the trailer hooks path

Problem:
Every fleet launch prefixed the worker command with `export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0=...`.
That replaced any `GIT_CONFIG_*` entries the pane already carried, so a scoped HTTPS credential setup such as `credential.helper=` followed by `credential.helper=!gh auth git-credential` was silently dropped.
Git then fell back to the system or global helper (for example `osxkeychain` from the system gitconfig on macOS), so a worker meant to use a scoped token pushed with the user's personal credentials.

Reproduction on main:
GIT_CONFIG_COUNT=2 GIT_CONFIG_KEY_0=credential.helper GIT_CONFIG_VALUE_0= GIT_CONFIG_KEY_1=credential.helper GIT_CONFIG_VALUE_1='!gh auth git-credential' sh -c "<emitted launch>; git config --get-all credential.helper" prints none of the inherited entries, only the system helper (`osxkeychain` from Homebrew's system gitconfig on the reporting machine).

Fix:
The launch prefix now appends `core.hooksPath` at index `GIT_CONFIG_COUNT` and increments the count, resolved in the destination shell after any `config/launch-env-allowlist` filtering.
The inherited count is validated as decimal before shell arithmetic, leading zeros are normalized (Git accepts `02`), and a count that cannot be extended within Git's signed int refuses.
A refusal uses `return 1 2>/dev/null || exit 1`, so when the pane sources the launch file the error stays visible and the interactive shell survives instead of the pane dying with the message.

Tests:
`tests/fm-spawn-dispatch-profile.test.sh` gains a behavior test that runs the real emitted launch under sh, bash, and zsh with inherited credential-helper entries and counts `2` and `02`, then asks Git for `credential.helper` and `core.hooksPath`.
The same test checks that an invalid or overflowing count refuses, and that sourcing the launch file from an interactive shell keeps that shell alive with the error visible.
The exact-launch assertions in the dispatch-profile and Kimi suites now extract the emitted prefix through one `fm_test_launch_git_prefix` helper in `tests/lib.sh` instead of two hand-copied strings, whose content the behavior test covers.

Risk:
Top-level `return` outside a sourced file is unspecified by POSIX; verified on macOS sh (bash 3.2 in POSIX mode), bash, and zsh, and every path still ends nonzero before the worker command runs.
The hook wrapper still unsets only `GIT_CONFIG_COUNT` and index 0, which is sufficient because Git ignores indexed entries once the count is unset.
A launch that forwards `GIT_CONFIG_COUNT` without all of its indexed keys now fails in Git instead of being masked by the overwrite.

* no-mistakes(review): Keep inherited Git config in hooks and fish-safe launch

* no-mistakes(document): docs: describe appended hooksPath keeping inherited Git config

* test: run the fish pane launch cases in CI

Install fish in the portable serial lane and run the credential-append
and invalid-count refusal cases under fish. Under CI the spawn test
fails instead of falling back to the static syntax check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: strip the Git config launch prefix before reading the Claude doorbell

The trust suite evaluated the whole launch command to find the final prompt
argument, so it now also sourced the per-spawn git-config env file that the
fake pane never writes. Drop that prefix the same way the dispatch suite does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: share the launch command parser across the spawn suites

The trust suite failed in CI because its copy of the launch parser missed
the Git configuration prefix the dispatch suite's copies already stripped.
Move the prefix and export stripping into tests/lib.sh next to
fm_test_launch_git_prefix so the three parsers cannot drift again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(bin): canonicalize env-file hooks path and tighten launch-config tests

env-file now writes the canonical (pwd -P) spelling of the hooks directory, matching what install records, so a symlinked path no longer makes the hook wrapper miss its own entry and silently skip the repository's hook.
A new strip test passes a symlinked hooks path through env-file and fails without this change.

The launch-env-allowlist test now also asserts the appended core.hooksPath, so a regression that drops the strip-hook entry only on the env -i path is caught.

Without fish installed locally, the launch test now prints an explicit fish skip line and limits its pass message to sh, bash and zsh, instead of claiming every pane shell after only a static token check.

* no-mistakes(review): Drop CI fish install and CI-only fish refusal

* no-mistakes(document): Document GIT_CONFIG_COUNT overflow refusal in configuration docs

* test: prove a refused Git config count never starts the worker

The invalid-count refusal checks only asserted a nonzero status and the helper's own error text.
If the launch line kept going after the refusal, the worker probe's final `git config` also failed under the bad count, so the checks still passed.
The probe now prints a marker on stderr, and every refusal case in sh, bash, zsh and fish asserts the marker never appears.
Dropping the `|| return 1 2>/dev/null || exit 1` guard from the launch line now fails the test.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…available (kunchenguid#6810)

* fix(bin): name the failing read when a contribution observation is unavailable

An unavailable contribution observation recorded one constant error and
discarded the failing read's exit status and error output on cleanup, so a
network failure, a forge refusal and a structural check failure all looked
the same and left nothing to diagnose once the next good read cleared it.

The record's error and the unavailable line now name the first failing step:
the read's label, exit status, budget seconds left and the first line of its
error output, or the structural check that refused the observation. Budget
refusal stays silent and unmeasured as before.

* no-mistakes(review): Label closing head read's structural failure as its own cause

* no-mistakes(document): Note structural refusals record contribution errors too
…unchenguid#6365)

* fix(spawn): give Orca workers an opt-in scoped environment source

Fixes kunchenguid#6339

On the Orca backend, `config/launch-env-allowlist` expands each allowlisted name in the destination pane, and that pane is an Orca terminal whose environment comes from the Orca app and the user's shell startup files.
Allowlisted credentials therefore resolve to the user's personal values or to nothing, with no warning, while the same allowlist scopes tmux workers correctly.

Add an opt-in `config/launch-env-tmux-session` naming one tmux session.
On a fresh Orca spawn, before the worktree or terminal is allocated, fm-spawn reads each allowlisted name from that session's local environment with `tmux -u show-environment -t =<session> <name>`.
The worker launches with the existing `env -i` boundary and operational floor, the snapshotted values in place of destination expansion, and `GIT_CONFIG_NOSYSTEM=1` so a system credential helper cannot answer for the worker.
The source requires an allowlist, so tmux's automatic update-environment names such as `SSH_AUTH_SOCK` are never forwarded unless listed.
A listed name missing from the session, an unreadable session, or a malformed selector refuses before allocation; an explicit `-NAME` record stays a deliberate unset.
Values are shell-quoted only in the existing owner-only staged launch file, never terminal input, and the pane deletes that file as sourcing starts; a deletion failure refuses the worker launch and keeps the interactive shell.
`-u` is required because tmux's non-UTF-8 client output replaces newlines and non-ASCII bytes in values with underscores.

The source is opt-in and nothing changes for homes that do not create the file.
When `config/backend` is orca, the allowlist is nonempty, and no source is configured, fm-spawn now prints a stderr warning that allowlisted names resolve from the Orca terminal, so the mismatch is no longer silent.
It warns rather than refuses because refusing would stop every existing Orca home that uses an allowlist, which the triage asked not to assume.
Other backends, relaunch (already refused on Orca), and secondmate inheritance are unchanged; the selector is not in the inherited configuration list.

The scoped Git credential helper case also needs kunchenguid#6341, which stops fm-spawn's `core.hooksPath` entry from overwriting inherited `GIT_CONFIG_*` entries; this change does not depend on it.

Tests in `tests/fm-spawn-orca-worktree.test.sh`:

- A real-tmux regression on a private socket checks exact multiline UTF-8 values under absent and C locales through sh, Bash, and zsh, refusal of names that exist only server-globally or only inside another value, and exclusion of the automatic `SSH_AUTH_SOCK`.
- Fake-Orca spawns execute the real staged launch file under synthetic personal credentials and cover the configured source, an empty allowlist, refusal before allocation for each invalid setting, file privacy and deletion before the worker runs, and the deletion-failure path.
- The warning appears for a nonempty allowlist without a source and not for an empty allowlist or a configured source.

Risk: the source keeps tmux and the named session as dependencies of Orca spawns, and secret values sit in a 0600 file under a 0700 directory until the pane sources it.
It is not a filesystem sandbox; a worker can still read the user's credential files unless the harness restricts that.
The hardened path was verified with the regressions above, not with a live Orca spawn.

* no-mistakes(review): Harden Orca launch-file cleanup, floor unsets, and stat portability

* no-mistakes(review): Scope Orca abort cleanup to the staged launch file

* docs: scope Orca source to fresh spawns and qualify pane values

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: state that Orca relaunch is refused

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* no-mistakes: apply CI fixes

* no-mistakes(review): Keep Orca launch file while delivered terminal stays open

* no-mistakes(document): Qualify fm-spawn help's destination-pane expansion claim for Orca

* fix(spawn): keep launch-send failures fatal and compare tmux bytes per version

The Orca launch-file cleanup wrapped both launch sends in a condition, which runs outside errexit.
A failed send on tmux and every other non-Orca backend then continued as success, so a post-publication relaunch failure no longer failed closed.
Each send failure now exits again, and Orca source mode removes its staged file first.

The real-tmux regression asserted that invalid UTF-8 bytes survive tmux itself, which holds on tmux 3.6a but not on the CI runner's tmux.
It now asserts that the snapshot reproduces exactly the bytes the installed tmux reports for that name.

* fix(spawn): reclaim an Orca launch file the pane never runs

In Orca source mode the pane unlinks the credential-bearing launch file as it starts sourcing it.
A pane that accepted the source command but never ran it left the file on disk until teardown, because the abort cleanup keeps the file for a delivered, still-open terminal.
After delivery, fm-spawn now waits up to 30 seconds for the pane to consume the file; if it has not, fm-spawn removes it and fails the spawn with a status line naming the unrun command.

The snapshot already reads and writes tmux output as latin1, so bytes that are not valid UTF-8 reach the launch file unchanged.
A deterministic fake-tmux regression now pins that, independent of how the installed tmux stores such values.

The live-terminal test now drives a slow pane and fails unless the spawn waits for it, and the controlled-source test reads the file the fake pane consumed.

* no-mistakes(review): Keep Orca terminal open when launch file is unconsumed

* no-mistakes(review): Refuse Orca worker when launch file already reclaimed

* no-mistakes(review): Make Orca spawn's deadline launch-file reclaim exclusive

* no-mistakes(document): Document Orca launch-file reclaim keeping the terminal open

* fix(spawn): reclaim an interrupted Orca launch file and keep errexit panes open

An HUP, INT or TERM after the source command reached the Orca terminal left
the credential-bearing launch file on disk: bash ran the EXIT trap with status
0 and abort cleanup kept a delivered file for the pane. Source mode now traps
those signals until the pane consumes the file, and abort cleanup reclaims it
with the same non-forced unlink arbitration as the consume deadline, refusing
the worker when the spawn wins and leaving the terminal open.

The delivered source line now keeps a pane shell with errexit set open when
the launch is refused, including when the file was already reclaimed.

* no-mistakes(review): Trap signals as soon as Orca launch file is published

* no-mistakes(document): Record pre-send interrupt coverage in Orca verification notes

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
babbarc and others added 28 commits November 2, 2026 15:13
…henguid#8017)

* test: give anchored absence assertions a regex that can match

assert_grep and assert_no_grep are fixed-string greps. An anchored pattern
handed to them searches for a literal caret, which no line can contain, so
every anchored assert_no_grep passed no matter what the file held.

Eighteen call sites across six suites asserted their absence that way, so
they were silently checking nothing: the merge-local readiness snapshot,
the public-followup request and platform links, the secondmate backend and
harness records, the restart literal-stop path, the delivery mode and yolo
fields, and the remote-doctor launchctl calls.

Add assert_regex and assert_no_regex for patterns that describe a line
rather than a literal, and convert those sites. The remote-doctor
alternation becomes a real ERE group instead of a fixed string containing
backslash-pipes.

The three suites that run on this host pass unchanged: merge-local 8,
task-delivery 34, public-followup 90. The other three fail identically on
unmodified main here because their fixtures pin a PATH without tr, sed, or
head; that is environmental and unrelated.

* no-mistakes(review): Fix regex absence errors and interactive label guard

* test(assertions): name lib.sh for ShellCheck source following

* no-mistakes(test): Fix vacuous anchored absence guard in fm-pr-merge help test

* no-mistakes(review): Restore pre-existing help assertion exactly

* no-mistakes(document): Document new assertion suite coverage in its header comment
…r there (kunchenguid#8052)

* fix(spawn): lease the Herdr task copy so a restart restores the worker there

* test(spawn): align Herdr abort fixture with lease failure

* no-mistakes(review): Return Herdr lease when projected abort closes task pane

* no-mistakes(document): Note Herdr spawns no longer leave nested treehouse shell

* no-mistakes(ci): ci-2 (Greptile, bin/backends/herdr.sh): the invariant is that the projected abort cleanup must report a closed endpoint exactly when the task pane is confirmed gone. fm_backend_herdr_projection_close_pane_focus_preserving can confirm the close and then return 2 only because focus restoration failed. It can also return 2 or 1 after a close that did not happen. The only place where this result becomes SPAWN_ENDPOINT_CLOSED is fm_backend_herdr_projection_cleanup_exact; its single caller is bin/fm-spawn.sh:1691. I fixed it at that shared boundary. When the close call fails, the function now checks the exact pane with the existing fm_backend_herdr_pane_presence_state, and it reports success only when the result is `dead` (pane_not_found). It does not treat a return value of 2 as closed, so a present or unknown pane keeps the lease. I also updated the comment above the function. Tests (tests/fm-backend-herdr.test.sh, test_projection_cleanup_exact_succeeds_only_when_the_task_pane_closed): I added two behavioural cases that run the real cleanup and the real presence classifier against a stubbed herdr CLI response. (1) The close returns 2 and the pane get returns pane_not_found: the result is rc=0, so the endpoint is closed. (2) The close returns 2 and the pane get still shows the pane: the result is rc=1. I also stubbed the CLI in the existing refused-close case so that it cannot reach a real herdr. Before the fix, the confirmed-close-then-failed-restore case failed ("got 'CLOSED w1:p1;rc=1'"). After the fix, the full tests/fm-backend-herdr.test.sh and tests/fm-spawn-herdr-lease.test.sh pass. shellcheck -S warning is clean on both changed files. ci-1 (Full suite): this is not a code defect. The job stopped at the label gate with FM_CI_FULL=false and FM_CI_LANES_FAILED=false, so no lane failed. I did not change code for it. I did not re-run the workflow: this phase must not control CI, and a re-run cannot pass until a maintainer adds the full-ci label to PR kunchenguid#8052, because the gate reads that label. This is still an external label requirement. Note: a temporary copy of the fixed herdr.sh remains at /tmp/herdr.fixed, because my clean-up command was denied by permissions

* no-mistakes(review): Release or name Herdr lease after post-launch rollback

* no-mistakes(review): Return Herdr lease only when the pane is confirmed gone

* no-mistakes(review): Keep dirty Herdr slots leased after failed spawns

* no-mistakes(test): Count Herdr pane-death removal in concurrent abort ordering check

* no-mistakes(document): Clarify Herdr aborted-spawn lease return condition

* test(herdr): allow explicit lab session for presentation e2e

* fix(teardown): close Herdr pane before returning its lease

* no-mistakes(review): Remove inherited HERDR_LAB_SESSION override from presentation e2e

* no-mistakes(document): Document Herdr teardown closing pane before returning lease

* fix(teardown): retain leased copy when Herdr close is refused
… agent is live (kunchenguid#8085)

* fix(inactive-reconcile): withhold terminal outcome while the agent is alive

Fixes kunchenguid#6553

* no-mistakes(review): Bound liveness read; withhold only busy or relaunched agents

* no-mistakes(review): Judge incarnation by spawn epoch; use remaining budget

* no-mistakes(document): Document live-agent withholding in architecture scan rule

* no-mistakes(lint): Fix ShellCheck SC2143 and SC2016 findings

* no-mistakes(ci): ci-2 and ci-3 are fixed in tests/fm-inactive-reconcile.test.sh. ci-1 (Full suite) needs no code change, as the captain decided. I ran only the new test in isolation, plus a mutation check; the full test file did not pass in this environment (details at the end). - **ci-2 (macOS sed):** `arm_claude_busy` no longer uses `sed -i`. It writes the edited meta to `<id>.meta.new` and moves it over the original, so it works with both GNU and macOS sed. - **ci-3 (liveness-read timeout):** I added `test_stalled_liveness_read_is_bounded_and_scan_progresses`. - The fake `fm-crew-state.sh` sleeps 1s, then returns `failed` for child `a`. - The fake `tmux` then stalls for 30s, which stalls the liveness read. - With a 2s scan budget, the scan must finish within 4s. - After the stall is cleared, the next scan must still reach child `b`. - **Mutation check:** I removed `fm_run_timed "$timeout"` from the liveness read at `bin/fm-inactive-reconcile.sh:517`. The new test then failed, so it catches a lost timeout. I restored the file afterwards. - **Full test file:** it did not pass in this environment, because the existing `test_stalled_state_read_is_bounded_and_scan_progresses` failed on timing. In one run it exceeded its 3s elapsed bound (4s); in another, its next scan did not reach child `b`. I never ran it against `HEAD` alone; this PR changed that file only by adding the new test and the sed fix. - **Not checked:** I did not investigate why that existing test fails here
…biguous (kunchenguid#7568)

* fix(herdr): name a stale launcher pane id as gone instead of ambiguous

The launcher pane id a shell inherits outlives the pane itself.
When herdr no longer knows that id, `pane get` answers with whatever
pane it still has, the exact-id filter in
fm_backend_herdr_launcher_identity keeps nothing, and the guard
refused with "returned an ambiguous tab or workspace identity".
There is no ambiguity to report: the pane does not exist any more, so
the id is stale.

The refusal now names the stale pane id, says the pane no longer
exists in the session, and names HERDR_PANE_ID, HERDR_TAB_ID and
HERDR_WORKSPACE_ID as the values to refresh.
The return codes, the refusal behavior, the identity-matching logic
and the spawn behavior are unchanged, and no other error path changed.

tests/fm-backend-herdr.test.sh covers both shapes of this path: a pane
id herdr answers with a different pane, and a pane record that names
no tab.

* fix(herdr): stale launcher pane message covers the no-tab shape too

The empty-tab shape is a pane record that still answers but names no tab,
so 'no longer exists' was not literally true for it. The refusal now says
the pane is stale: it no longer exists or names no tab or workspace in the
session. Return codes, refusal and identity matching are unchanged.

* no-mistakes(review): Reword unreadable launcher pane error as stale

* no-mistakes(document): Document stale launcher pane refusal in herdr backend docs

* fix(herdr): keep the could-not-be-read wording when the launcher pane get fails

* no-mistakes(test): docs(herdr): describe destroyed panes as unreadable, not stale
…uid#8084)

* feat(bin): add verified Hermes TUI worker adapter

* no-mistakes(document): Document Hermes owner in tmux composer identity comment

* no-mistakes(ci): Fixed ci-4: a Hermes worker that stalls at setup or misses the readiness deadline is now stopped before its task record is removed. Rule that must hold: once the Hermes launch command has been sent, any failure exit from the Hermes readiness gate closes the launched endpoint first. Only after that may the abort trap (spawn_abort_cleanup) roll back a fresh spawn's record and retire its busy generation. Two exits in the gate broke this rule, and both are now fixed in bin/fm-spawn.sh: 1. **Readiness timeout:** after the existing error message, the gate now calls `rovo_endpoint_cleanup`. This is the same close step the rovo launch-then-confirm gate already uses: it calls the backend's kill (just the exact terminal on orca) and sets SPAWN_ENDPOINT_CLOSED. It runs before `exit 1`, so the window is closed while the record still exists. 2. **Failed Enter on the first-run decline:** this used to `exit 1` straight away. It now `break`s out of the poll loop, so it reaches the same close-then-exit path. The ordinary path is unchanged. A ready screen or a hook record sets HERMES_READY=1 and skips the cleanup. Regression test in tests/fm-hermes-harness.test.sh: a fake tmux shows a stalled provider-setup screen, and the test uses tiny poll settings (FM_HERMES_READY_POLLS=2, interval 0). The fake `kill-window` writes down whether the task's .meta file still exists at the moment it is called. The test asserts that the spawn fails with the Hermes diagnostic, that `kill-window` ran while the record was present, and that the fresh record was removed afterwards. I confirmed it fails without the fix ("missing: 'kill-window record=present'") and passes with it. It uses only throwaway fixtures and a generic `example` profile. Checks run: tests/fm-hermes-harness.test.sh and tests/fm-rovo-harness.test.sh both pass with 0 failures, shellcheck on both changed files is clean, and `bash -n` passes. Changes are left uncommitted so the pipeline can record them as their own fix commit, with no squash. ci-1, ci-2 and ci-3 were not touched, as instructed

* no-mistakes(ci): I fixed ci-3. If the stalled Hermes worker can't be closed, a failed spawn now keeps its task record, so supervision and teardown can still reach the worker. **What must always hold:** once the Hermes launch command has been sent, the spawn rollback may remove a fresh task record and its busy generation only after the launched endpoint has actually closed. The last round's ci-4 fix tried to close the pane first, but it ignored whether that close worked. The cleanup at exit (`spawn_abort_cleanup`) still saw `SPAWN_FRESH_COMMIT_PENDING=1` and removed the record anyway, leaving a possibly live Hermes worker with nothing pointing at it. **Fix** (`bin/fm-spawn.sh`, the Hermes readiness gate's failure exit): after `rovo_endpoint_cleanup`, if `SPAWN_ENDPOINT_CLOSED` is not 1, the gate clears `SPAWN_FRESH_COMMIT_PENDING`. It also prints a warning that the record is kept and the worker should be inspected and torn down. This uses the existing flag the abort cleanup already relies on, the same way other kept-record paths skip rollback. The readiness timeout and the failed-Enter exit from the first-run decline both reach this single exit, so the fix covers both. Nothing else changes: - When the close succeeds, the record is rolled back exactly as before (the earlier stalled-launch test still passes). - When Hermes becomes ready, this branch is skipped. - On a relaunch, `SPAWN_FRESH_COMMIT_PENDING` is already 0, so nothing changes there. I left the other harnesses' gates alone. Changing how they roll back would go beyond this finding. **New test** in `tests/fm-hermes-harness.test.sh`: a fake tmux shows a stalled provider-setup screen, and its `kill-window` can be made to fail (`FM_FAKE_HERMES_KILL_FAIL`). The test checks four things: - the spawn fails with the Hermes error; - a close was attempted while the record existed; - the kept-record warning is printed; - the `.meta` record survives and still has `hermes_profile=example`. It uses only throwaway fixtures and a generic `example` profile. Without the fix the test fails ("missing: 'task record is kept'"); with it, it passes. **Checks run:** - `tests/fm-hermes-harness.test.sh`: all cases pass, 0 failures. - `tests/fm-rovo-harness.test.sh`: passes. - `shellcheck` on both changed files: only the usual SC1091 info notes about sourced files not being followed (it was run without `-x`), no warnings. As instructed, I didn't touch ci-1 (the full-suite label gate maintainers apply) or ci-2 (stale). The changes are uncommitted so the pipeline can record them as their own fix commit, with no squash

* test: include Hermes process helper in partial-bin fixtures

* no-mistakes(review): Add Hermes process helper to remaining fm-harness fixtures
* fix: recheck landed work after teardown process reap

* no-mistakes(review): Delay backlog close markers until post-reap safety proof

* no-mistakes(document): Correct stale pending-close publication references

* no-mistakes(document): Clarify initial teardown safety check ordering

* no-mistakes(document): Correct teardown ordering comments and stale retention documentation

---------

Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
…unchenguid#8099)

* fix(timeout): keep redirected stdin on backgrounded runners

Non-interactive bash assigns /dev/null to an async command, so the external
timeout and bash runners dropped a piped payload before it reached the
command. Restore that stdin with an explicit redirection, leave a terminal
or closed stdin on the old assignment, and cover every mechanism the host
can select.

* no-mistakes(test): Give terminal stdin /dev/null in timed background runs

* no-mistakes(ci): No new code change is needed. The fix for ci-1 is already in commit db61d47a, which is HEAD, and the working tree is clean. Greptile pointed out that the old fd 3 check could never fail: fm_run_timed ran inside a pipeline subshell while `echo still >&3` ran in the parent shell. The committed test now calls the runner directly, with stdin redirected from a file, in the same shell that then writes to fd 3. It covers the external-timeout mechanism when one is installed and always covers the bash override. It checks the exit status, that the fd 3 write landed, and that the payload came through. Following the driver's instructions, I kept that commit and did not rework it. I re-ran `bash tests/fm-timeout-lib.test.sh` and it exited 0 with every case passing. The Greptile check is still failing only because the earlier push to the PR hit a GitHub Internal Server Error and never landed. The test code is not the cause. Re-publishing the existing commit through the pipeline will resolve it, and that step belongs to the outer executor
* Bind interrupted auto-arm notices to their producing session

* no-mistakes(document): Document session-bound auto-arm interruption recovery

* no-mistakes(ci): Fixed all three lint-inventory expectations to exclude hidden scripts, matching the documented shell globs. Tier 2 test correction; production behavior was correct. fm-lint.test.sh passes, with four platform capability skips. Targeted ShellCheck and git diff --check pass

* no-mistakes(ci): Repair blocked: the command guard rejected test authoring as “Indirect command execution not allowed.” Stopped dependent work without switching tools. Independently untracked exactly the six authorized files with git rm --cached; verified every physical file remains and every ignore pattern still matches. ci-1, ci-2, and ci-3 remain unresolved. Neither reproduction nor verification ran. No commit, push, or new scratch files were created

* Preserve interrupted auto-arm episodes by session identity

* no-mistakes(document): Clarify session-bound auto-arm failure documentation

* test: keep the exhausted-interruption fixture on one session

The integrated Stop driver starts a new fake-claude pid per Stop. Bind those
Stops to one recorded session id so a session-scoped interrupted episode can
still exhaust its budget and commit the attended alarm.

Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>
…list (kunchenguid#8121)

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

Add an opt-in config/claude-accounts list of Claude config directories.
When it is present, every Claude ship or scout spawn names one declared
entry with --account; that entry passes the same root, raw-command, and
stripped-environment `claude auth status` refusals as config/claude-account,
and is recorded as account= on the spawn line and in the task record.
A relaunch or recovery keeps the recorded account, and only an explicit
`fm-control.sh <id> relaunch --account <entry>` moves a task to another
declared account. Without the list nothing changes and --account refuses.

bin/fm-claude-account-quota.sh measures each declared account in isolation
with `quota-axi --provider claude --profile-only` and shows the highest
known spendPriority, escalating on a tie or when nothing is rankable, so
the existing quota-array-dispatch procedure can rank accounts.

Refs kunchenguid#7638

* fix(bin): keep quota-axi's reason when an account read is rate-limited

quota-axi exits nonzero when it cannot measure a provider, such as when the
Claude quota endpoint rate-limits a burst of reads, but still prints a valid
snapshot naming that state. fm-claude-account-quota.sh now keeps that
snapshot, so the account is reported unmeasured with the vendor's reason
instead of as an unreadable root.

* no-mistakes(review): Make Claude account quota helper data-only; skill chooses account

* fix(bin): close account-list review gaps on --account, runway, and secondmates

- Refuse an --account value holding a control character, and match it
  against each whole declared entry, so a newline can no longer pass
  membership on one line or split the account= record.
- Print each scope's usableRunwaySeconds and the runway's
  projectionConfidence in fm-claude-account-quota.sh rows, so the
  runway floor has the time it needs; confidence was previously always
  dropped because the snapshot carries it under runway.
- Refuse --account on every secondmate spawn before the remote route,
  which previously accepted and ignored it.

---------

Co-authored-by: Omkar Bhale <omkarbhale001@gmail.com>
…on branch prompt (kunchenguid#8118)

* feat(branch-prompt): append an optional home include to the supervision branch prompt

The headless supervision engine runs in safe mode and loads none of the
home's hooks, CLAUDE.md, skills or plugins, so a home had no way to give the
branch a home-specific rule. fm-branch-prompt.sh now appends the optional
local config/branch-prompt-include.md verbatim as its last section, the same
way config/brief-include.md extends worker briefs: absent or blank leaves the
prompt byte-identical, and an unusable path stops the generator before it
emits anything.

* no-mistakes(review): Pin byte-stability re-run to a temp home

---------

Co-authored-by: c-c6aw <225476801+c-c6aw@users.noreply.github.com>
…not kill the default server (kunchenguid#6422)

* fix(bin): bind live-lab tmux calls to explicit sockets so cleanup cannot kill the default server

tmux honours TMUX_TMPDIR only while that directory exists; once it is gone,
tmux silently resolves the default socket under /tmp/tmux-<uid>. The live
lab and its tests addressed their private server through TMUX_TMPDIR alone,
so a cleanup aimed at a removed lab directory ran kill-server against the
user's own default server and ended every session on it.

Every tmux call in bin/fm-live-lab.sh and its tests now names the lab socket
with tmux -S, and every kill-server runs only while that socket exists. The
lab's stub spawns, the fm-gate-refuse lab-socket test, and the lab cleanup
guidance in fm-brief.sh and fm-lab-home.sh follow the same rule.

tests/lib.sh gains fm_tmux_isolation_gate: a suite that starts or kills tmux
servers runs only when no live server answers in the default socket
directory (a private /tmp, or a disposable CI runner), skips with the
isolation it needs otherwise, and fails instead of skipping under CI. The
live-lab suites open with it. tests/fm-live-lab-isolation.test.sh covers the
gate both ways and proves that pane, say, check and down aimed at a missing
lab directory leave a decoy server on the default socket alive.

* no-mistakes(review): Run live-lab decoy only in private /tmp; drop gate bypasses

* no-mistakes(review): Drop inherited temp dirs inside the isolation namespace

* no-mistakes(document): Clarify live-lab down contract for socket-guarded server kill

* test(live-lab): bound the isolation decoy cleanup and report a decoy it cannot stop

* no-mistakes(review): Run bounded decoy cleanup tests on host; bound kill-server

* no-mistakes(document): Reflow stop_decoy doc comment in isolation test

* fix(tests): treat an exited unreaped decoy as gone in isolation cleanup

* no-mistakes(review): Make pid_running fail closed when ps errors

* no-mistakes(document): Document pid_running fail-closed ps behavior

* no-mistakes(review): add isolation suite serial hint; lane saturated, guard still fails

* no-mistakes(review): shorten isolation cleanup polls; hint 3482ms, guard passes

* test(tests): bound the tmux isolation gate's server probe

fm_tmux_isolation_gate asked each socket's server for its sessions with no
deadline, so a stopped or stuck user tmux server held the gate, and with no
per-script deadline in the runner, the whole run, before it could skip.
Each probe now runs under fm_run_timed for FM_TMUX_ISOLATION_PROBE_SECONDS
(default 5), and a server that does not answer in time counts as live: the
gate skips and names the silent socket and the deadline.

* test(tests): skip the live-lab decoy cases for a checkout under /tmp

The isolation suite re-runs itself under unshare -Urm after mounting a fresh
tmpfs on /tmp, so a checkout under /tmp lost the script to that mount: the
namespace check passed and the re-run failed on a missing file instead of
running its decoy cases. The suite now resolves its own physical path, skips
the decoy cases with a reason before mounting when that path is under /tmp,
and re-runs the physical path otherwise. A copy of the suite under /tmp pins
the skip.

* test(tests): run only the decoy preflight in the /tmp copy of the isolation suite

The copy that pins the /tmp skip re-ran every host case, doubling the
suite's runtime and its exposure to their timing bounds. It now goes straight
to the decoy preflight it exists to exercise.

* test(bin): refresh the live-lab isolation suite serial hint

The probe-deadline and /tmp-checkout cases lengthen the suite from about 3.5 s
to 4.3-6.5 s in a private /tmp; the provisional hint now carries the slowest
of six new samples.
…d#8119)

* Fix retriable bounded lock deadline races

Preserve retry-later status after an unpublished or exited lock holder at the deadline. Keep malformed lock records as hard failures and cover each classification with deterministic lock fixtures.

Closes kunchenguid#8105

* no-mistakes(review): Return 124 when bounded lock is released
…ed work (kunchenguid#7820)

* fix(teardown): refuse open-PR ships and ignore the no-mistakes mirror in the landed test

Teardown deletes the record that merge recording depends on, so an ordinary ship whose recorded pr= is still open is refused (--force bypasses). The unpushed-commit checks also exclude the local no-mistakes mirror remote, which is not a forge, so work that only reached the mirror is no longer counted as landed.

* no-mistakes(review): Exclude no-mistakes mirror from teardown unpushed checks

* test: assert the mirror-only teardown refusal retains the task state
* fix: keep Codex Stop responses free of login-shell output

* no-mistakes(document): Consolidate Codex Stop documentation under authoritative owners

* no-mistakes(ci): Fixed both Pi before_agent_start handlers to narrow prompt-bearing events before accessing event.prompt, addressing the two TS2339 CI errors. Custom events now bypass user-prompt handling; ordinary prompt events and existing message_start paths remain unchanged. Local verification is blocked: tsc is not on PATH. No tools were installed and no other pipeline phases were executed

* fix: keep Codex Stop responses free of login-shell output

* no-mistakes(document): Consolidate Codex Stop documentation under authoritative owners

* no-mistakes(document): Correct Codex verification prerequisites and guard coverage
…nchenguid#7253)

* fix(calm): leave one blank row above the Claude Code working boat

Refs kunchenguid#7160

* no-mistakes(review): Assert spinner Box padding by walking tree
…kunchenguid#8127)

* fix(spawn): refuse to relaunch a worker into a primary home or checkout

A relaunch trusted the recorded worktree and started the worker there. After a machine restart the restored record could point at the primary home or a repository's primary checkout, so a worker was relaunched inside it. Relaunch now refuses with a named error when the recorded worktree is the home, the code root, or a repository's primary checkout (git dir equals git common dir).

* no-mistakes(document): Document relaunch refusal of primary home or checkout worktrees

* no-mistakes(ci): Fixed ci-2 (the Greptile P1 finding). ci-1, the Full suite failure, is the expected maintainer-label gate; the user chose to leave it alone, so nothing was changed for it. Invariant: the relaunch refusal must judge whether the recorded worktree is a primary checkout from the directory's own layout on disk. Inherited Git location variables must not be able to change the answer. In this change, the only place that probes Git for that decision is the git-dir and common-dir check in the `--relaunch` refusal in `bin/fm-spawn.sh`. The home and code-root comparison doesn't use git, so it can't be affected. Fix in `bin/fm-spawn.sh`: both probes now run in a single subshell. That subshell first unsets the same Git variables that `bin/fm-claude-trust.sh` clears (`GIT_DIR`, `GIT_WORK_TREE`, `GIT_COMMON_DIR`, `GIT_OBJECT_DIRECTORY`, `GIT_INDEX_FILE`, `GIT_ALTERNATE_OBJECT_DIRECTORIES`, `GIT_CEILING_DIRECTORIES`, `GIT_NAMESPACE`, `GIT_DISCOVERY_ACROSS_FILESYSTEM`, `GIT_CONFIG*`). It then runs one `git rev-parse --path-format=absolute --git-dir --git-common-dir` and splits the two output lines. The unset is scoped to the subshell, so the environment the rest of the script and the launched worker see is unchanged. When git fails, the result is empty and the code falls through exactly as before. Regression test in `tests/fm-control-relaunch.test.sh`: `test_relaunch_refuses_the_primary_checkout_under_inherited_git_overrides`. It records `worktree` as the project's primary checkout, then runs `fm-spawn --relaunch` with `GIT_DIR` set to the linked worktree's git directory and `GIT_WORK_TREE` set to the primary checkout. It asserts exit code 1, the "primary home or checkout" error, and that nothing was launched. The test is registered in the suite's run list. Verification: - `bash tests/fm-control-relaunch.test.sh` with the fix: rc=0, all tests pass, including the new one. - With the `fm-spawn.sh` change temporarily reverted: rc=1, and the new test fails with `missing: 'primary home or checkout'`. So it reproduces the reported bypass. - `shellcheck` on both files reports no warnings or errors

---------

Co-authored-by: Trillium Smith <5898009+trillium@users.noreply.github.com>
…chenguid#7609)

* fix(session-lock): read process identity without the ps binary

An EDR-style policy can deny the ps binary's exec itself - observed on
a hardened macOS host where /bin/ps was refused even for 'ps -V', while
kill, head, sysctl, pgrep and lsof all ran. The session lock proved
identity by walking harness ancestry through ps, so the walk died at
its first call: every session in that home became a permanent
lock-refused read-only one, and a live lock owner looked reclaimable,
so a fresh process could take over a lock whose owner was still
running.

All identity reads now go through one fm_proc_info reader. ps stays
primary and is used verbatim wherever it executes, so a host where ps
works is byte-identical to before. Only a ps that cannot execute at
all - bash exit 126 for a refused exec, 127 for a missing binary,
while a pid merely being gone exits ps 1 - routes one read to an OS
provider: /proc on Linux, bin/fm-procinfo.py on macOS, which reads the
ppid through a self-verified KERN_PROC_PID chain and the identity
through the KERN_PROCARGS2 argv region.

That last point is a correctness requirement, not a preference. macOS
'ps -o comm=' reports argv[0] and 'ps -o args=' reports the full argv,
so the ps-free route keys both fields on the same argv region. A
helper that reported the resolved exec path instead disagreed with ps
for renamed, symlinked, or argv[0]-wrapped harnesses, and that
disagreement turns a lock refusal into a wrong take-ownership decision.

Every read fails closed and is verified against the requested pid: no
route guessing, foreign chains still refused, dead pids still stop the
walk. A record that is not exactly one line of three fields with a
numeric ppid is refused rather than loosely sliced.

Two defects found by diffing the change against the unchanged base on
a live host are fixed here as well:

1. A pid ps can see but cannot name - a live process whose comm was
   emptied - was reported as stale, which means reclaimable. The base
   reports unknown for that case, and reporting it stale let a fresh
   process take over a lock whose owner was still running. The ps route
   now reports the pid as present, and the provider route accepts a
   record whose comm field is legitimately empty so both routes agree.

2. The provider record parser rejected a record with an empty field,
   but the field COUNT is what it must pin: a TAB is IFS whitespace, so
   a record with a MISSING field parsed exactly like a record whose
   field was empty. The parser now rebuilds the record from the parsed
   fields and compares it to the original, which proves the count
   without rejecting a legitimate empty field.

Verified against the unchanged base: 120 identity reads and 200 lock
inspections across live pids show zero divergence, and the empty-comm
case reads unknown on both.

* no-mistakes(review): Refuse reclaiming session locks with unreadable owner identity

* no-mistakes(review): Reject partial process identity reads; reclaim non-pid locks

* no-mistakes(review): Preserve platform process identity byte rendering across routes

* no-mistakes(review): Normalize trailing empty argv elements across identity providers

* no-mistakes(document): Document session-lock recovery requirements

* no-mistakes(lint): Fix ShellCheck arithmetic array index style

* fix(session-lock): decide the owner verdict from liveness first, not identity

The review rounds that closed the "a live owner can be taken over" hole
inverted the order of the two facts the verdict is built from: the
provider read decided whether the recorded owner was alive, and liveness
was only consulted afterwards. That order breaks two cases the base
already handled.

A pid this session cannot signal is not a live owner it may reclaim
over, whatever a process table still says about it. A recorded owner
that is gone therefore has to read as gone, or the stale lock can never
be reclaimed and the session stays lock-refused read-only for good -
the exact wedge this change exists to remove. The repository's own
suites pin that: tests/fm-session-lock-ancestry.test.sh asserts that a
recorded pid whose kill -0 fails is left for the ordinary reclaim, and
tests/fm-session-lock-ancestry.test.sh's sibling case asserts that a
recorded pid of 1 - which this session may not signal - is still
reclaimable.

The verdict now asks liveness first and identity second:

  kill -0 succeeds, the provider reads   -> readable
  kill -0 succeeds, the provider fails   -> unreadable: alive, identity
                                            not readable, so the lock
                                            must not be reclaimed
  kill -0 fails, the provider reads      -> unknown: the process exists
                                            but this session may not
                                            signal it, so it is not a
                                            harness this session can
                                            prove - the base's "no live
                                            harness owner"
  kill -0 fails, the provider fails      -> dead

That keeps the protection the review rounds were after - a live owner
whose identity cannot be read is never reclaimable - while restoring the
base's reclaim behaviour for the cases the base handled. The new case
"kill -0 succeeds, the provider fails" is the one that closes the
reported takeover path, and it is unchanged.

Verified on this host: tests/fm-session-lock-ancestry.test.sh exits 0
again (it exits 1 on the previous head, where the recorded-dead-pid case
failed), tests/fm-session-lock-ps-denied.test.sh exits 0, and
tests/fm-gotmp.test.sh exits 0. tests/fm-secondmate-harness.test.sh and
tests/fm-session-start.test.sh still exit 1 with exactly the failures
they have on the unchanged base: this host's restricted PATH lacks
dirname, cat and awk.

* no-mistakes(review): Preserve successful status for unreadable owner verdicts

* fix(session-lock): keep the ppid a walk input, not an identity field

The review round that made a partial identity read refuse the reclaim
extended the rule from the arguments to the parent pid as well: a read
that could not answer ps -o ppid= was treated as an unreadable
identity, so the whole read failed.

The parent pid is not an identity field. The identity the matcher reads
is comm and args, and both of those are still fail-closed: a live
harness whose arguments cannot be read is not reduced to a bare
interpreter name, and its lock is still not reclaimable. The parent pid
is a walk input, and a parent pid that cannot be read only ends the
ancestry walk one hop early - the walk finds no harness and the
session refuses the lock rather than taking one it cannot prove, which
is the conservative direction.

The base read the parent pid exactly this tolerant way, and the
repository's own suites pin it: tests/fm-grok-harness.test.sh and
tests/fm-kimi-harness.test.sh stub ps so that it answers comm= and
args= and refuses every other question, and both expect the lock to be
recognised as held by a live harness. Under the stricter rule both
suites failed with "fm-lock did not recognize grok as a live holder"
and "fm-lock did not acquire from Kimi ancestry".

The provider route is unchanged and stays all-or-nothing: on Linux the
parent pid comes from the same /proc read as the command name, and on
macOS from the same KERN_PROC_PID chain, so a provider read is either
complete or unreadable. The case that proves it - a /proc entry with no
readable cmdline - still refuses the reclaim.

The new test case is corrected rather than dropped: the failed-args
case still has to refuse the reclaim, and the failed-ppid case now
pins the tolerant contract - the verdict stays readable and the parent
pid is empty.

The same commit restores the shellcheck directives on the assignments
inside fm_session_lock_inspect's verdict switch. The globals are read
by bin/fm-lock.sh and bin/fm-inbox.sh, but the assignments inside the
switch had lost their disable comments, so 'Lint 1' failed with SC2034
on FM_LOCK_INSPECT_STATE and FM_LOCK_INSPECT_LIVE_HARNESS.

Verified on this host: tests/fm-session-lock-ps-denied.test.sh exits 0,
tests/fm-session-lock-ancestry.test.sh exits 0,
tests/fm-grok-harness.test.sh exits 0 (it exits 1 before this commit),
tests/fm-kimi-harness.test.sh exits 0 (it exits 1 before this commit),
tests/fm-gotmp.test.sh exits 0, and bin/fm-lint.sh exits 0.

* no-mistakes(document): Clarify session-lock recovery ownership

* no-mistakes(lint): Fix single-iteration ShellCheck loop

* test(session-lock): drop the unused loop variable from the partial-identity case

The failed-args case no longer runs through a loop, so the local that
held the field name is never read, and the lint partition reports it as
an unused variable (SC2034). The declaration loses it; nothing else
about the case changes.

* no-mistakes(review): Protect tagged lock owners; preserve Cygwin identity reads

* no-mistakes(review): Fix zero-form locks; focused tests fail pty-host, ShellCheck warnings

* fix(session-lock): read a classified live harness holder as held

fm_session_lock_inspect lost its identity check on the readable verdict,
so every live holder was classified unknown instead of held: grok and
kimi holders failed the live-holder assertions, and a claude-named
holder made fm-inbox report unknown for a lock that was held.

Decide held from the single fm_harness_process_matches call on the
readable branch. The Windows-tagged pre-block that made the same
decision a second time is removed: fm_session_lock_pid_verdict already
resolves the tagged pid through the Windows table and leaves the same
FM_PROC_COMM/FM_PROC_ARGS, so re-reading it could only let the two
answers diverge, and its winpid/win_rc were the unused bindings
ShellCheck flagged as SC2034.

* no-mistakes(document): Align session-lock docs with the shared reclaim verdict

* fix(session-lock): emit the denied-ps diagnostic once per run

`FM_OS_PROC_DIAG_SHOWN` was set by the diagnostic inside
`triple=$(fm_os_proc_triple "$pid")`, so it died with that
command-substitution subshell and every later ancestor read reprinted the
same cause during one lock acquisition.

`fm_proc_info` now spends the once-per-run guard in the shell that owns
the walk. A cause line exists only on the provider's failure routes, so a
failed read is exactly where that budget is used up; a readable read
leaves it unspent for a later failure.

The new case drives three failing reads in one shell and asserts one
stderr line, then repeats with a readable first pid to prove a successful
read does not spend the budget.

* no-mistakes(document): Correct the denied-ps diagnostic scope to per shell

* no-mistakes(review): Preserve UTF-8 process identity in Linux fallback

* no-mistakes(document): Record the ps-free identity byte rule and helper inventory

* test(session-lock): compare control-byte argv by shape, not by ps bytes

The control-byte route-equivalence case compared the provider record and
the ps record byte for byte. That pins one procps build's choice of byte
for a control byte: 4.0.x writes a space where an argument's newline was
and '?' for other controls, while other builds write '?' for the newline
too, so the same two routes agree on one build and differ on the other
even when both make the same identity decision.

Fold each route's separator byte onto the placeholder the /proc route
writes before comparing, keep the ppid and comm fields a raw comparison,
and assert the fixture's words still straddle the control bytes on both
routes so the case cannot pass by matching a loss. Pin the fold against
both Linux renderings of this fixture's newline and assert those
renderings really differ, so a return to raw bytes fails here instead of
only on the other procps build.

* no-mistakes(document): Align session-lock reclaim docs with the shared verdict

* test(session-lock): keep the base PATH when no python3 shim is added

The e2e blocked-ps case built the child PATH from fakebin alone on a host
without python3, dropping the inherited base path with it. On Linux that
left the /proc provider without the cat and tr it reads through, so the
walk failed for a reason unrelated to the denied ps and the case failed
spuriously on exactly the host it is meant to cover.

Set the base path unconditionally and let the python3 branch only insert
the shim ahead of it.

* no-mistakes(document): Correct session-lock verdict comments and library ownership header

* no-mistakes(document): Correct stale issue pointer in session-lock scope comment

* no-mistakes(document): Correct malformed-lock reclaim wording and ps-denied nudge limit

* fix(session-lock): parse /proc stat fields as stat_fields so rex.sh lints clean

ShellCheck follows source directives: bin/backends/rex.sh sources
bin/fm-agent-process-lib.sh, which sources bin/fm-session-lock-lib.sh, so the
new array local named `fields` made rex.sh's string use of its own `fields`
read as an array/string clash (SC2178/SC2128) and failed CI lane Lint 2 on
6e26ecb, while main's same lane passes.

Rename the array to stat_fields, the name the repo's other /proc stat readers
(bin/fm-remote-job-lib.sh, bin/fm-teardown.sh) already use. Verified with
`shellcheck --norc --external-sources bin/backends/rex.sh` (was rc=1, now
rc=0) and `bin/fm-lint.sh --partition 2of2` locally (rc=0, rex.sh reason=ok).

* no-mistakes(document): Sync session-lock docs and stat-parser comment

* test(run): hint fm-session-lock-ps-denied so the coverage guard stays under its unmeasured share

The new session-lock denial script left 43 of 284 portable serial scripts
without a measured duration hint on CI (main: 42), one past the guard's 15%
bound. Record the 3012ms this run measured, in sorted order beside its
ancestry sibling.
…ledgement (kunchenguid#8031)

* fix(watch): print multi-line check output as one wake line

A custom check that printed several lines queued one row with the lines
joined, but the watcher printed the raw lines, and wake consumers that keep
only prefixed lines (such as the Claude Stop-hook banner) dropped every line
after the first. Flatten the wake line the same way the queued row is
flattened, so both carry every line.

* fix(wake): present every distinct check payload before acknowledgement

The drain kept only the newest row per kind and key, and its acknowledgement
then consumed the hidden rows too. Two different wakes queued by one check
before a drain therefore lost the earlier payload unread. Collapse check
rows only when their payload is identical; signal, stale and heartbeat rows
keep their existing newest-wins collapse.
…ses (kunchenguid#3841)

* feat: check published releases for watched tools

* no-mistakes(review): Restore whole-registry validation while retaining published-release checks

* no-mistakes(document): Clarify successful installed-version probe requirement

* fix: retain completed tool sweeps at the budget boundary

* no-mistakes(review): Restore unconditional sweep recording and cadence; focused tests pass

* no-mistakes(review): Correct incomplete sweep recording and cadence documentation

* no-mistakes(document): Drop stale conditional sweep-recording wording from configuration docs

* no-mistakes(review): Require successful probes only for published-release comparison

* test: expect a newer announced version beside the published source

Upstream now reports an announcement naming an installed version only as
update not in effect, so the composition test announces 0.8.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* no-mistakes(review): Compare published releases with the newest installed copy

* no-mistakes(review): Reject watched tools setting both published and version_url

* no-mistakes(document): Scope curl hardening note to published release reads

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…id#6695)

* fix(bin): read a typed slash command above Claude 2.1.291's marked popup row

Claude Code 2.1.291 draws the selected row of its slash-command popup with the
same `❯` marker as its composer, so that row below the composer's closing rule
became the bottom-most bare composer candidate and the whole popup list was
read as the typed command. The Herdr Claude payload proof then judged the
payload unsent, cleared it, and reported send-failed, so `fm-control exit` and
every slash command sent through `fm-send` failed on Herdr.

Demote that row to the proven envelope above it, but only when the envelope's
own glyph row holds typed `/` text (the fallback read can never be empty) and
the row has the popup shape: a leading `/` or a truncated `…` name, then a gap
of two or more spaces before its description. Numbered-choice dialog rows,
one-word drafts, empty composers, and typed prose keep their old reading, and
the head-truncation and placeholder-remainder refusals are unchanged.

Regression tests run against real captures of the 2.1.291 screens. The live
guard gains a /context scenario, and the dated verification record is updated.

* no-mistakes(review): Ghost-strip popup demotion guard; relocate 2.1.291 docs

* no-mistakes(review): Match popup guard to fallback's plain glyph row

* no-mistakes(review): Narrow box popup test; note box follow-up in docs

* no-mistakes(document): Point same-glyph footer rule at 2.1.291 popup exception

* no-mistakes(ci): Both selected Greptile findings are fixed. Only the live test and the verification doc changed; product code and box handling are untouched. The changes are left uncommitted for the outer executor. **ci-2** (tests/fm-herdr-submit-confirm-live-e2e.test.sh) - Invariant: a live delivery check must show that the command actually ran, through its rendered output. An empty composer and a registered agent are not enough. - Fix: after the `/context` verdict, the test now polls the pane the same way the earlier reply check does, until `/context`'s `Context Usage` heading renders. Any other result fails. - I confirmed that heading with a probe in an isolated `fm-lab-` session. The popup's description says "context usage" in lowercase, so the case-sensitive match cannot hit the popup. - The read window is 1000 lines (`--source recent --lines 1000`). The report runs to hundreds of rows here with its heading at the top, so the 200-line window the reply check uses would lose it. - The existing agent-registered and composer-empty checks are kept. The header comment, block comment and pass message were updated to match. **ci-3** (docs/verification/runtime-backends.md) - Invariant: only tests that fail against the previous classifier may be called before-and-after regressions. - I ran each of the five tests on its own against base 5838f10's `bin/fm-composer-lib.sh`: - These 3 fail there and are now labelled before-and-after regressions: `marked_row_is_not_a_second_composer`, `composer_content_..._not_the_composer`, and `send_text_submit_..._proven_and_submitted` (the last one returned 'unknown'). - These 2 pass there and are now labelled guards: `demotion_only_ever_refuses` and `popup_still_refuses_a_partial_payload`. - I corrected one more claim in the same paragraph. It said the live guard fails against the old classifier "at the `/exit` scenario". A live run against the old classifier (session `fm-lab-herdr-submit-con-1106578-15406`) actually fails earlier, at `/context`, with `send-failed`. The doc now says that. - The doc's recorded live output was replaced with the real output of the new run. **Verification** - Live guard on HEAD: `FM_HERDR_SUBMIT_CONFIRM_LIVE=1 ANTHROPIC_MODEL=claude-haiku-4-5-20251001` passed all 4 checks, including "...proves and submits a typed /context behind its command popup and renders its report". It ran in its own session, `fm-lab-herdr-submit-con-1098793-23839`. - Every live run used only its own `fm-lab-` session. Afterwards `herdr session list` shows only `default`, which was never touched. - `tests/fm-composer-lib.test.sh` returned 0 with 47 ok, and `tests/fm-backend-herdr.test.sh` returned 0 with 233 ok. - With the opt-in off, the live test skips with rc 0. - `bin/fm-lint.sh` returned 0 (ShellCheck 0.11.0, actionlint 1.7.12). - Temporary directories were removed. **Gap:** the new check's failure path was never triggered in a live run, because the old classifier fails earlier, at the verdict. That the check can tell a run from no run rests on the probe: the heading is not on screen before submission, and the popup text is lowercase

* no-mistakes(document): Include Tern in popup classifier inheritance documentation
…#8139)

* fix(spawn): tolerate slow Herdr worktree entry

Restore shell startup tolerance after out-of-pane leasing, resend the worktree cd once, and diagnose a pane that never moves. Cover delayed and dropped entry portably and ordinary/delayed projected spawns in an isolated real-Herdr lab.

Fixes kunchenguid#8138

* no-mistakes(document): Document Herdr worktree cd resend in agent-control

* no-mistakes(ci): I fixed Greptile ci-1. On supported Herdr releases below the presentation floor (0.8.0, including pinned 0.7.4), the live test `tests/fm-herdr-projected-cd-live-e2e.test.sh` reported a correct flat spawn as a failure. Now it skips clearly on those releases. **Invariant:** the test may expect a projected spawn only when the same floor classifier `fm-spawn` uses says projection is the default. **Where it must hold:** the one decision point before the case loop. Both cases (delay 0 and delay 1) assert the `.herdr-presentation` marker, and both sit after that check. **Change (test file only):** after the lab is provisioned, the test calls the existing `fm_backend_herdr_presentation_release_supported` from `bin/backends/herdr.sh`. It goes through the test's fake `herdr`, which routes every call to the named lab session, so the check covers the same client and server `fm-spawn` sees. The result is handled three ways: - **At or above the floor:** the projected and delayed cases run as before. - **Below the floor:** the test prints `skip: Herdr <release> is below the 0.8.0 presentation floor, so spawns stay flat` and exits 0. The cleanup trap still tears down the lab. - **Can't be classified:** the test fails. No production code changed, and the overall Herdr support floor is unchanged. **Verification** (Herdr was only run through `bin/fm-herdr-lab.sh` on its own `fm-lab-` session): - **Above the floor:** on the installed Herdr 0.9.5, both cases pass: "Herdr 0.9.5 projected spawn enters its recorded copy" for delayed=0 and delayed=1. - **Below the floor:** I pointed `HERDR_LAB_HELPER` at a temporary wrapper around the real lab helper. It changes only the `status --json` reply so the client and server report 0.7.4, protocol 17. The test printed "skip: Herdr server version 0.7.4 (protocol 17) is below the 0.8.0 presentation floor, so spawns stay flat" and exited 0. This is simulated, not a real 0.7.4 install. - Afterwards no lab sessions were left over. - `tests/fm-spawn-herdr-lease.test.sh` passed through `bin/fm-test-run.sh`. - `bash -n` is clean. shellcheck shows only the existing SC1091 info note about the sourced `tests/fixtures.sh`. I did not edit the PR body, so its links to issue kunchenguid#8138 are untouched

* no-mistakes(document): Document live projected-cd test's below-floor skip
Merges upstream kunchenguid/firstmate main (`bb8dd209`, 284 commits) into the fork as one merge commit on top of `a4963b80`.
No history was rewritten and the fork's 35 commits stay in place.

## What upstream brings that matters here

- Self-repository role gate: `config/firstmate-role`, `bin/fm-role-lib.sh`, `bin/fm-role.sh` and `--upstream-consent`, which stop a home publishing to this repository on its own authority.
- Dispatch: more providers (OpenRouter, System One, OpenAI) with a declared credential source, `preferred_provider`, `shared_quota` and `config/claude-accounts`.
- Worker runtimes and adapters: Rex, tern, t3code, paseo, herdr-core, Hermes, Kiro, Cortex, Polytoken, Command Code, agy as a primary, OpenCode 2.
- Delivery: `--base-branch`, `pr=manual`, `forge=external`, Forgejo and Gitea, a GitLab no-pipeline waiver, and local-only merges pinned to the reviewed head.
- Operations: status archive, record export, pipeline spend, capacity, the shorter steering doorbell, and many watcher, lock and away-mode fixes.
- CI: split test files, TAP plan verification, the `full-ci` label gate, and fork opt-outs `FM_CI_SKIP_PUSH` and `FM_CI_SKIP_MACOS`.

## Fork changes dropped as superseded

- Pi 1.2 custom-message handling and the Pi Calm and branch test stabilizations (bc3f178, 1757302): upstream kunchenguid#7216, kunchenguid#6530 and kunchenguid#6338 do the same. The fork's exporter-lookup non-vacuity asserts went with them.
- Captain-hold Done-archive read (999f9d8): upstream kunchenguid#6094 reads the archive directly, so `archive_row_show`, `task_show_durable`, `resolve_attested_entry` and `archive_file` are gone.
- Bash 3.2 BASHPID watchdog (9e8b923) and its test: upstream kunchenguid#6028 fixes the same hang.
- ubuntu-24.04 runner pin (04e25db): upstream kunchenguid#7798 pins it too. The fork's comment explaining the pin stays.
- Remote-reply flake part of bc3f178: upstream kunchenguid#6639 and later fix the cause.
- Bearings hand count in CI: the TAP plan from upstream kunchenguid#7775 replaces it.

## Fork behaviour kept against upstream

- `feature/` branch names, Jev skill selection, Needs preflight, the clickup-tickets skill, the away-session fixes and the Docker cleanup at teardown.
- Lavish parser (826e32b, d0ac8f4, 79d101b, cbfb295): upstream's fc8972c skips nested targets and attachments, so a captain's attachment would be lost. It now adopts upstream's accounting, so an unparsed block reports its declared items as malformed. Upstream's list-form test was changed to expect the flattened output.
- Away spend cap refusal counts workers still working, while the entry default stays upstream's record count.

## What a running home must do after pulling

- **New publishing tasks on this fork are refused until the operator acts.** `fm_role_publication_target` resolves this repository to `github.com/kunchenguid/firstmate`, because the `upstream` remote outranks `origin` when no `remote.*.gh-resolved` is set, and no `config/firstmate-role` exists.
  - Write `config/firstmate-role` by hand with `maintainer github.com/demy00/firstmate`, and mark origin as the base with `git config remote.origin.gh-resolved base` or `gh repo set-default demy00/firstmate` in the copy used.
  - Or pass `--upstream-consent` per task.
  - A scope of `github.com/kunchenguid/firstmate` would wrongly authorize publishing to upstream. Firstmate never grants itself this.
- Register this repository in `data/projects.md`: it is not there under its own name, and an unregistered project resolves to no-mistakes with yolo off.
- Restart after pulling, since `AGENTS.md`, `bin/` and `.agents/skills/` load at session start.
- Tool floors are already met on this machine: no-mistakes 1.60.2, gh-axi 0.1.35, lavish-axi 0.1.81, quota-axi 0.1.55, tasks-axi 0.2.6, treehouse 2.3.0.
- Herdr 0.7.4 is installed while upstream verifies 0.8.x to 0.9.x. Only the opt-in groups feature warns, but an upgrade is worth considering.

## Validation

- All 13 portable CI lanes ran on Linux, one container per lane, with ubuntu 24.04, ruby, a compiler and Chromium.
- Eight scripts were red in that run, whose containers had no UTF-8 locale. Seven pass when rerun alone with `LANG=C.UTF-8`, on both this merge and upstream.
- `tests/fm-git-strip-ai-trailers.test.sh` fails there on upstream too, because of the image's git 2.43. It passes on macOS with git 2.50.
- CI's two full lint partitions ran in a 12 GB container and reported no findings. Ten files were killed by that memory limit and one hit the memory fallback, and all eleven are clean under full-dataflow ShellCheck 0.11.0 on the host.
- The coverage guard, the doc audience check and the stock Bash 3.2 parse sweep pass.
- The Herdr and herdr-core lanes were not run locally, because this task may not drive Herdr. CI owns them.
- On macOS, 31 of the 39 scripts that failed in the full lane run also fail on upstream itself, so they are not caused by this merge, and CI runs these lanes on Linux. The rest failed only on the merge and are fixed here, apart from flakes that passed on rerun.

## Also tidied

- Upstream tests with hardcoded `fm/` branches now use `feature/`, and the away spend-cap fake tmux answers the window inventory.
- The Pi Calm render test counts the helper's own attempts, which removes a slow-start flake.
- Added four serial timing hints so the coverage guard stays honest, and fixed test fixtures for upstream's unborn-HEAD refusal and pinned local-only merges.

## Noticed

- `fm-skill-select.sh` reads the Typesafe key from env or `.env` only, ignoring the declared credential source and `FM_DISPATCH_PROVIDER`.
- Skill selection and usage resolve only `config/claude-account`, not `config/claude-accounts`.
- The fork's `fm_ts_post` and upstream's POST path now coexist.
- The live doorbell scenario needed a long task id to overflow, so the real miss is now rarer. Its fixture was updated but cannot run here.

## Better idea

- The spend-cap entry default counts records while the refusal counts still-working workers, so finished records inflate the default cap. Sharing one count would be simpler, but it changes entry behaviour, so it stays out of this merge.

## Skills used

`firstmate-coding-guidelines`, `firstmate-self-repo`, `no-mistakes`.
- Share the fork's still-working count between the away entry default and
  the spawn refusal through bin/fm-away-spend-lib.sh, so finished records
  never raise the spend cap.
- Present an undeclared surplus Lavish list item and never certify it as
  complete, as upstream does.
- Pass --base-branch and --upstream-consent in the away dispatch recipe when
  a brief records them.
- Number the shared brief rules 8 and 9.
- Remove the captain-hold comment and tasks-axi archive helpers left behind
  by the superseded archive read.
fm-procevent could not pass on macOS: one fixture called setsid, which macOS
does not have. It now uses the same perl form as the two other session fixtures
in the file. Short time limits also failed on a busy machine, so the listener
start waits, the pre-reboot stamp deadline, the retry case's owner lease and the
script's default confirm window are longer. No case proves less.

Also recover the work the failed validation run's test agents left uncommitted:
the spend cap fixture now keeps its finished workers' panes live, so the read
comes from the status log, the entry default is asserted over the same live
panes as the refusal, and a duplicated comment line from the merge is gone.
The fork's yolo posture write and the merge waiver records append after a task's
pr= line, and fm_pr_metadata_identity_parse refuses unknown keys there. Upstream
documents that this stops the merged-PR notification from arriving. The parser
now allows these keys, which also heals records already written. New tests run
each real writer and fail without the change.

Also correct two away record header comments that named the old owner of the
spend reading, and build the Forgejo status fixture in a loop, because stock
macOS Bash 3.2 brace-expanded it and wrote a malformed payload.
@demy00
demy00 merged commit d8235d1 into main Nov 5, 2026
24 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.