Repository navigation
Sync upstream through 15ad1bd6 and take upstream PRs 7349 and 6812 (Defender load reduction, step 1) - #92
Merged
Conversation
…reeze on SIGTTIN fm_run_timed and fm_exec_timed run the command in its own process group, so a command that read the inherited terminal was stopped by SIGTTIN and froze the whole call in T state while its caller kept holding locks (the STAT T .task-set.lock hold of the treehouse leak incident). Reproduced on a real pty: fm_run_external_timeout never completed with 24 frozen process observations, fm_run_bash_timeout lost the command to SIGTTIN (status 149), and fm_exec_timed never completed. No caller feeds stdin through either runner; the probes that already hit this forced the redirect at their own call sites. The redirect now lives in bin/fm-timeout-lib.sh for every bounded runner, and the regression tests assert both halves: the command reads EOF instead of the caller's stdin, and each runner finishes a terminal-reading command under a job-control shell instead of freezing it.
A watcher armed from a stale treehouse pool slot outlives the copy, keeps a home's lock and state from a path that is about to be deleted, and forks from there - the fork-storm half of the treehouse leak. The arm already refused disposable no-mistakes validation checkouts; it now refuses a pool-slot copy too, unless that copy IS a firstmate home (bin/fm-home-seed.sh's durable lease shape): the copy must host the operational home layout and the state root it writes must resolve inside that same copy. Without that exception every secondmate home living in a pool slot would lose its supervision cycle. Regression proof: without the guard the treehouse fixture arms a real watcher from the disposable copy (watcher: started); with it the arm refuses before touching state, and the home-in-slot fixture still arms and closes its cycle.
…t blocking event_wait_or_sleep read a return of 1 as 'the reader already blocked the budget'. An event stream that comes back empty or closed ends at once instead, so the cycle fell through with zero delay and forked a reader per pass: the 5000-8000 forks/sec half of the treehouse leak. Both layers now honor the budget. The herdr wait sleeps the remainder before its documented 'the caller has effectively already slept' return, and the watcher sleeps whatever the backend left of POLL, always at least one second, so a no-hit cycle can never spin whatever the backend did. Regression: a fake reader exiting at once now spans its 3s budget instead of returning in 0s, and the supervision cycle runs 4 passes in 4s at POLL=1 instead of tight-looping.
An lsof scan that failed or timed out under load aborted the whole teardown with REFUSED, so a stale pool slot could never be cleaned: the worktree, its metadata, and its processes stayed behind forever - the orphaned-worker half of the treehouse leak. The reap now takes the same backend process-group fallback a missing lsof already took (reap_task_backend_process_group), and the teardown proceeds. Only leaked processes that survive every reap attempt still refuse. Regression: with lsof erroring and a real leaked process in its own process group, teardown reaps that group, returns the worktree, and exits 0; before the fix it refused with exit 1 and left everything in place. A git lock that cannot be proven stale is still never cleared.
…ll floor; symlink-safe arm guard
…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>
…re, including absolute paths (kunchenguid#7307) * fix(composer): treat OpenCode >= 1.18 right-aligned cwd:branch as furniture OpenCode 1.18.31 draws the worker pane's working directory and branch right-aligned inside the left-bar composer rows above the Build footer, wrapped over up to three rail-width fragments whose final fragment continues onto the footer row's right end. The fragments are RGB 128 grey with luminance exactly on the ghost-luma ceiling, so they survive ghost stripping, and the left-bar classifier read them as unsent typed text: every idle 1.18.31 pane answered pending, which skipped the steering doorbell, the watcher's re-ring ladder, and /exit typing. _fm_composer_leftbar_cwd_start recognises the run structurally and position-gated: contiguous single-token rows immediately above the footer row whose gap after the bar exceeds half the row, whose fragments plus the footer row's gap-separated right-hand tail concatenate to a path, optionally followed by :<branch>. A path-shaped string typed at the composer's left edge is still typed text, so a wrong call can only defer, never inject. Extraction shares the same rule so extracted composer content stays user-scoped. * no-mistakes(review): drop dead footer-tail concat, add live short-cwd fixture * no-mistakes(review): accept only ~/ cwd rail; lone slash stays pending * no-mistakes(review): require footer row for leftbar cwd furniture walk * no-mistakes(review): Require topmost cwd fragment to carry ~/ prefix * no-mistakes(document): Correct cwd furniture recognition doc to topmost-fragment check * fix(composer): gate cwd rail on region width; correct version story Review round on the independent PR review: the position gate now measures the gap against the region's width (the widest trimmed plain row across first..last), so a short space-prefixed home path typed into an otherwise empty composer no longer reads empty; the right-half lone-token residual is pinned explicitly. The cwd:branch furniture is documented as present since OpenCode 1.18.0 (upstream anomalyco/opencode#36457, merged 2026-07-11), not a 1.18.31 layout change. The 1.18.30 capture comment notes it omits the directory footer, and a cropped-composer extraction assertion scopes user content to the typed row above the rail. * no-mistakes(document): correct OpenCode cwd-furniture version framing and doc typos * fix(composer): accept an absolute cwd rail outside $HOME as OpenCode furniture Refs kunchenguid#4632, builds on kunchenguid#5030. * no-mistakes(review): Harden live abs-cwd check waits and qualify rail comment * no-mistakes(review): Fix composer-lib relative path in OpenCode harness doc * no-mistakes(test): Relax live check's DONE wait for wide OpenCode panes * no-mistakes(document): Separate absolute-cwd verification output block from following prose --------- Co-authored-by: Konrad Heimel <konrad.heimel@corp.ovh.com>
…mpt (kunchenguid#6682) * fix: name the Claude exit picker on existing stale wakes A pane parked on that picker still read as healthy quiet after Enter was refused. The existing stale and wedge reports now carry the dialog name, including through away-mode escalation. Refs kunchenguid#4754 * no-mistakes(review): fix: report exit picker on terminal-status away stales * no-mistakes(document): docs: describe exit-picker reporting in stale supervision * no-mistakes(review): fix: drop away stale marker when second-mate picker closes * fix: keep the exit-picker name off paths main does not already run A second mate stays exempt from stale capture, and a finished worker in away mode no longer ages into a wedge. The name remains on the stale and wedge wakes a worker already raises. * no-mistakes(review): name the exit picker on wedge deferral reasons * no-mistakes(review): limit exit-picker name to plain stale and wedge escalation
…uid#7308) * feat(afk): Spend-Obergrenze beim Eintritt aus der lebenden Worker-Zahl Ohne ausdrückliches --spend nimmt der Eintritt in den Away-Modus die Zahl der gerade im Home stehenden gewöhnlichen Worker als Obergrenze, damit der Modus laufende Parallelität nicht einengt. Der bisherige Default bleibt Untergrenze, 0 bleibt ausgeschlossen, und ein ausdrückliches --spend gewinnt weiterhin. Die Zählung bekommt mit `live-workers` genau eine Implementierung in bin/fm-afk-contract.sh. bin/fm-spawn.sh liest sie dort statt mit einer eigenen Schleife, sodass Eintritt und spätere Sperre nicht auseinanderlaufen können. * no-mistakes(document): Remove misplaced afk spend-cap plan --------- Co-authored-by: ladwein <ladwein@firstmate.bost8.thelad.loc>
…ion paths (kunchenguid#6965) * fix(bin): guide supervision through completed-scout cleanup * no-mistakes(document): Document completed-scout cleanup ownership and regression coverage * no-mistakes(test): Allow confined lab overrides and verify live scout cleanup * no-mistakes(test): Clarify per-task cleanup reporting and verify live outcomes
…o the job's timeout (kunchenguid#7240) * fix: recheck a worker paused on its own background job A worker that declares `paused:` on its own background job and then misses the job's completion stays idle until the long declared-wait recheck, because the first-sight alert spends the declaration's throttle and nothing else names when the job must have ended. The worker pause instructions now say that `until` for such a job is its start plus its timeout, and the watcher already rechecks once when that time passes. The recovery playbook now tells the supervisor to verify the condition a declared wait names before reporting the wait as healthy. Fixes kunchenguid#7239 * test: give the background-job until test headroom over its quiet round The first absorb round of the until test may take four poll cycles of up to 30 s each on a loaded runner. With `until` only 15 s ahead, that time could pass during the round and fail the test although the watcher behaves correctly. Set `until` 120 s ahead so the window covers those four cycles, as CONTRIBUTING asks of fixture windows. * chore: retrigger CI * chore: retrigger CI * no-mistakes(review): Rebuild bg-job until test with passed until, no sleep * no-mistakes(review): Restore bg-job absorb checks and assert due recheck marker --------- Co-authored-by: pedromuller-del <254459182+pedromuller-del@users.noreply.github.com>
…dapter (kunchenguid#6679) * feat: add Command Code crewmate and scout adapter Add `commandcode` as a verified worker runtime for crewmate and scout work only, so Firstmate can dispatch workers on Command Code models such as deepseek/deepseek-v4.1-flash. - Detection: the anchored `command-code` process title identifies the adapter in fm-harness.sh and the shared liveness classifier. - Launch: fm-spawn passes --yolo, --trust, --skip-onboarding, the model, an effort only where the model's accepted set is verified, and the typed launch brief after --; taste-learning state is kept out of git. - Busy state: a tracked mod, bin/fm-commandcode-mod.ts, is loaded per process with --mod and --mod-option, writing run_start/run_end/session end through fm-busy-event.sh; no user or project settings are edited (Command Code's --config persists globally, so it is never used). - Control: one Escape interrupts; the idle double-Escape Rewind picker is a recognized hazard that exit refuses and interrupt dismisses; /quit exits. - Composer: the bright truecolor placeholder is read with an identity-scoped ghost ceiling, and the tmux adapter supplies the identity for a cursor parked below the footer; Herdr reports it natively as `cmd`. - Attribution: the fleet commit-msg strip removes the CommandCodeBot trailer. - Docs, harness reference, verification record, portable regressions, and the FM_COMMANDCODE_SIGNALS_LIVE live guard. * no-mistakes(review): Drop flash-fast effort pairs; correct identity-probe cost comments * no-mistakes(ci): I fixed both Greptile findings the way you asked. Both new regression tests fail on the old code and pass now. The changes are not committed. **ci-1: Command Code on zellij, cmux and orca.** The rule that must hold is that a Command Code worker only runs on a backend that tells Firstmate the pane is Command Code. Without that, its idle placeholder never reads as an empty composer, so steering stalls. `bin/fm-spawn.sh` now refuses `--harness commandcode` unless the backend is tmux or herdr. The error reads: `commandcode is verified on the tmux and herdr backends only; backend=<b> cannot prove its composer empty. Select backend tmux or herdr.` - The check runs after both the harness and the backend are known, so it covers fresh spawns and `--relaunch`. - It runs before any pane, worktree, task record or busy state is created. - New test in `tests/fm-commandcode-harness.test.sh`: tries a scout spawn on each of zellij, cmux and orca (with a fake `orca` that reports ready). It checks for the refusal and that nothing was launched, no task record was written and busy state was not armed. It needs no real backend installed. - Documented in `docs/configuration.md`, the Command Code adapter reference and the `fm-spawn.sh` header. **ci-2: an old process signalling its replacement.** The rule is that the `turn-ended` notification may only be raised under the same generation check as the idle write. The mod used to touch the file itself after the writer returned, which left a gap for a relaunch to slip in. - `bin/fm-busy-event.sh apply` takes a new `--turn-ended` flag. It touches `state/<id>.turn-ended` while still holding the writer lock, after the generation check passes. A stale generation is refused with no touch, and the flag is rejected on any subcommand other than `apply`. - `bin/fm-commandcode-mod.ts` no longer touches files itself. On `run_end` it passes `--turn-ended` unless the turn was interrupted. - New test in `tests/fm-commandcode-harness.test.sh`: a fake writer accepts the idle write and then arms a replacement before the mod continues. It asserts no notification appears. - New test in `tests/fm-busy-state.test.sh`: the notification is raised for the current generation, not for a stale one, and not outside `apply`. **Checks run:** - Passing: `fm-commandcode-harness`, `fm-busy-state`, `fm-busy-adapter-wiring`, `fm-backend`, `fm-documentation-audiences`, and `bash -n` on the changed shell files. - `fm-bootstrap.test.sh` fails one case ("backend=herdr must fail closed on its own missing session CLI"). It fails the same way on an untouched copy of the branch, because herdr is installed at `/usr/bin/herdr` on this machine. - `bin/fm-lint.sh` could not run because ShellCheck 0.11.0 is not on PATH, so the changed shell files have not been linted. **Not changed:** Devin's hook does the same thing outside this PR: it runs `apply ... && touch` in `bin/fm-devin-config.sh`. That predates this PR and is not in the changed area, so I left it alone * no-mistakes(ci): I fixed ci-sc2016. ShellCheck is not installed on this machine, so I could not confirm that the lint warning is gone. **The rule that was broken:** the repo lints with ShellCheck at its default severity, which also fails on info-level notes. Any single-quoted `$` that is meant to stay literal needs a scoped disable comment that says why. Only one place in the changed area needed this: the racing-writer `printf` in `tests/fm-commandcode-harness.test.sh`. Its format string writes `"$2" "$3"` on purpose, so the generated fake writer reads its own arguments when it runs. **The fix:** I added one line just above that `printf`: `# shellcheck disable=SC2016 # positional params expand in the generated writer.` The repo already does this the same way, for example in `tests/fm-afk-launch.test.sh` and `tests/fm-ask-user-authority.test.sh`. Nothing else changed, so the test behaves exactly as before. **Checks run:** - `bash -n tests/fm-commandcode-harness.test.sh` passes. - `bash tests/fm-commandcode-harness.test.sh` passes all six cases, including the busy-mod case with the racing writer. **Not run:** `bin/fm-lint.sh` stops with "ShellCheck not found" because ShellCheck 0.11.0 is not on PATH and there is no copy in the repo. I did not install it, since installs outside the worktree are off limits here. The upstream lint run will be the first ShellCheck pass on this change. The change is not committed * no-mistakes(review): Hard-code Command Code ghost luma ceiling at 160 * no-mistakes(review): Test commandcode relaunch refusal off tmux/herdr before stop * no-mistakes(document): Note Command Code fixed ghost luma ceiling in config docs
Reuse the wake library's OS cache and Bash's effective UID while retaining all live PID, directory identity, ownership, mode, and lease reads. The real owner watchdog's five complete half-ticks drop from 85 to 70 successful execve calls and from 165 to 150 forks/clones under strace. Observed 62-second windows normalize to 159.7 versus 145.2 forks/minute. Refs kunchenguid#7330
Claude spills a hook output over 10,000 characters and shows only the first 2,000 plus a saved-file path. The re-emit prints captain.md and learnings.md last, so they never reached the session. Print a short cue first that names the saved file and the memory files, and document the cap. Refs kunchenguid#6303
…kunchenguid#7302) * fix: retry transient contribution reads once * fix: classify contribution read errors safely Address review findings for kunchenguid#7262 by parsing only gh status forms, recognizing real DNS errors, refusing GraphQL not-found retries, clearing per-URL diagnostics, and restoring exit-137 handling. * fix: recognize bare gh HTTP errors Complete kunchenguid#7262 review fixes by accepting bodyless gh status lines and keeping all GraphQL errors out of transient network classification. * no-mistakes(review): Classify gh network errors by Go error tokens * no-mistakes(document): Note why contribution 404 reads are never retried * no-mistakes(review): Retry message-less GraphQL HTTP 5xx on closing read * fix: retry transient contribution reads once * fix: classify contribution read errors safely Address review findings for kunchenguid#7262 by parsing only gh status forms, recognizing real DNS errors, refusing GraphQL not-found retries, clearing per-URL diagnostics, and restoring exit-137 handling. * fix: recognize bare gh HTTP errors Complete kunchenguid#7262 review fixes by accepting bodyless gh status lines and keeping all GraphQL errors out of transient network classification. * no-mistakes(review): Classify gh network errors by Go error tokens * no-mistakes(document): Note why contribution 404 reads are never retried * no-mistakes(review): Retry message-less GraphQL HTTP 5xx on closing read
…tion (kunchenguid#7338) * fix(bin): let a backlog captain hold bound the watcher's wedge escalation A stuck worker whose task was held for the captain through bin/fm-captain-hold.sh kept wedge-escalating every STALE_ESCALATE_SECS, because wedge_wait_evidence only read the status line. It now also reads the open backlog captain call (task_captain_call_open) and defers to the existing captain-facing long recheck, silent while the away record exists. * no-mistakes(review): Publish no wait age for backlog captain holds * no-mistakes(review): Let an elapsed paused-until line fall through to backlog hold * no-mistakes(document): Document backlog captain hold in wedge wait-evidence contract
…guid#5404) * fix(bin): parse Lavish list-form results and refuse unparsed blocks Lavish emits its queued prompts in TOON list form instead of table form as soon as the items stop being uniform, for example when some annotations carry a nested target object or a message carries an attachments table. The adapter only recognized the table header, so read reported a complete, empty result and answers closed nothing. Move the result parsing into one shared reader used by read, answers, and reconciles that accepts both forms, keeps only column-zero headers, skips nested structures only beneath the field that opened them, and counts anything it cannot account for as malformed. An unrecognized header naming the block is now malformed rather than an empty result, answers and reconciles exit nonzero when the result is not fully accounted for, and the queued-content check treats a list header as content. Refs kunchenguid#4726 * no-mistakes(document): Document Lavish capture formats and incomplete-result handling * test: expect captain_message_count for the open-board list-form capture
…uid#5835) * fix(pi): let the supervision branch claim Orca stale wakes The watcher keys Orca endpoints by terminal=, but the branch dispatcher only indexed window=, so every Orca stale row vetoed the wake scan and went to main. Index both endpoint fields. Local hotfix ahead of upstream; refs kunchenguid#5623. * test(pi): cover terminal-keyed Orca stale rows in branch dispatch Pins the terminal= endpoint lookup: a terminal-keyed stale row queued with another eligible row must resolve to its task in both routine and heartbeat scans, instead of vetoing the wake to main. * no-mistakes(document): Update supervision dispatch doc for Orca terminal-keyed stale rows * fix(pi): reject conflicting wake endpoint ownership Index task keys and window/terminal aliases through one ownership check. Ambiguous records must leave the wake on MAIN instead of selecting the last task and possibly bypassing another owner's open decision. Cover duplicate terminals and collisions with window and task keys in both record orders while preserving unique terminal routing. * no-mistakes(document): Document conflicting alias ownership as scope corruption * fix(pi): retain ownership claims from incomplete task records Check endpoint and task alias ownership before project eligibility so a projectless record cannot lose its open decision to another terminal owner. Require project context before decision filtering can grant routing scope. Cover missing and empty project fields in both record orders, and preserve refusal for a uniquely mapped terminal without project context. * no-mistakes(review): Fix canonical routing ownership and custom SDK event handling * no-mistakes(review): Preserve dedicated custom processing run ownership * no-mistakes(document): Clarify Pi event handling and fail-closed routing documentation
…anches (kunchenguid#7368) * feat(bin): add a forge=external review rail that never pushes task branches A project whose review tool uploads its own snapshot of the worker's local commits can now be registered [direct-PR forge=external]. Workers on such a project never need to push a branch to publish, and must never push a task branch to the shared origin. - fm-project-mode.sh: external joins the closed forge set; never detected, refused on local-only, and +yolo reports yolo=off with a refusal. - fm-dod-lib.sh: external ships direct-PR only; its first rule forbids origin and task-prefixed pushes, its Definition of done renders the home's config/external-review.md adapter verbatim, and the ready-report gate accepts `done: review <url> uploaded for review` on the URL alone or, with a recorded backup remote, once HEAD is on the backup namespace. - fm-git-push-guard.sh (new): per-task pre-push guard refusing pushes to origin or a URL matching origin's, task-branch and task-prefixed refs on any remote, and refs outside the backup prefix on the backup remote. - fm-git-strip-ai-trailers.sh: install gains --push-guard and --no-strip. - fm-spawn.sh: refuses yolo, a missing adapter, and an unusable backup remote before launch; installs the guard even under keep-ai-trailers; and records forge=external, backup_remote=, and backup_prefix=. - fm-review-check.sh (new): records review= and review_head= with no merge watch, and publishes the child's ready line in a secondmate home. - fm-promote.sh refuses promotion onto forge=external, because a scout launches without the guard. - Docs: docs/external-review-forge.md (design), configuration.md's new "External review tool" section, scripts.md, and the ship-landing and project-management skills. * no-mistakes(review): Drop string-grep hook assertion from external-review spawn test * no-mistakes(document): Note forge=external contract token and direct-PR-only composition
…uid#7387) Ein Lauf, den sendCustomMessage startet, traegt eine Custom-Nachricht und keinen prompt. Das Lesen des prompt an dieser Stelle warf, womit jeder solche Lauf mit einem Fehler auftauchte statt zu starten. Die Verengung dagegen steht seit 8c9c67d im Zweig, ein Test, der sie benennt, fehlte: die einzige Abdeckung lag beilaeufig in einem Abbruch-Fall der Abwesenheits-Haltung und verschwindet mit ihm. Der neue Fall erweitert den bestehenden Mirror-Test und prueft, dass ein solcher Lauf weder wirft noch als Dialog gespiegelt wird. Gegenprobe: ohne die Verengung wirft genau dieser Fall mit "Cannot read properties of undefined (reading 'trim')". Co-authored-by: thelad-dev <ladwein@firstmate.bost8.thelad.loc>
…nchenguid#7409) * fix(tmux): verify exact endpoint membership * fix(tmux): preserve exact target forms * test(tmux): align endpoint fixture lifecycles * test(tmux): guard isolated cleanup and shell reader * no-mistakes(review): Limit tmux .pane target split to window indexes
… plain row (kunchenguid#7395) * fix(bin): stop misreading opencode's own footer as pending composer text An idle OpenCode composer classified as `pending`, and that verdict gates every typed-plane action firstmate owns: fm-send skips the doorbell, and fm-control refuses both relaunch and exit. A firstmate operator lost a full session to it and had to type into worker panes by hand three times. Root cause: opencode 1.19 draws the mode/model footer's identifying cells de-emphasised (mode word RGB 67;133;190, middle-dot separators 111;110;105, luminances ~119.8 and ~109.7, both under fm_composer_strip_ghost's 128 threshold). That helper exists to answer "what did the human type?", so it deleted exactly the cells that identify the footer. The `^(Build|Plan)` anchor then became unreachable on every styled backend - tmux, Herdr, and Zellij - not just one pane, because the unstyled row keeps its styling bytes everywhere. The fix proves the footer from both forms of that row: the ghost-stripped content and the ANSI-stripped plain row. Proving it on the form ghost stripping cannot reach is the whole repair. What makes that safe, and why the previous argument was not: the earlier draft argued safety by noting that on a plain capture the two forms collapse to one string, so the verdict is unchanged. That is true and carries no weight, because styled=0 is the only configuration where the new proof does nothing. The exemption is safe because a row reaches the plain form only when the ghost-stripped row still fails the pattern, which means the stripped content is non-empty while its own leading Build/Plan cell was deleted as ghost. Nothing opencode draws de-emphasises a typed row's leading cells - only its furniture is drawn dimmed - so the only rows the plain form admits beyond the stripped one are de-emphasised furniture, and the mode footer is the only furniture opencode draws that opens with a mode word. That is self-confirming rather than asserted, and it is the argument to recheck when a new opencode release moves a colour. A review also caught a second change riding along in the same diff: the footer pattern had been widened from `[[:space:]]+` to `[[:space:]]*`, admitting `Build ·x` and a bare `Build ·`. Both read as more typeable than the footer, so they moved the verdict in exactly the direction this rule exists to prevent. No recorded opencode footer ends at the dot, so the original `+` matches every real capture and the widening is reverted. Verification: - fm-lint.sh exit 0 on pinned shellcheck 0.11.0 and actionlint 1.7.12. - fm-doc-audience-check.sh ok across 119 surfaces and 757 local links. - tests/fm-composer-lib.test.sh green via bin/fm-test-run.sh. - The new regression case fails on exactly one assertion when this change is reverted: "opencode 1.19.0 de-emphasised footer row: expected empty, got 'pending'", which is the reported symptom. - Confirmed end to end against live panes rather than only fixtures: a real idle opencode 1.19.0 worker classified empty after the change and pending before, and firstmate reached the worker over the steer channel afterwards. * no-mistakes(review): fix(bin): apply leftbar footer rule in content extractor; correct cursorless claim * no-mistakes(document): document opencode 1.19 footer furniture and extractor coverage * no-mistakes(document): document ghost-luma knob coupling to opencode footer furniture * no-mistakes(document): document opencode de-emphasised footer recognition invariant * no-mistakes(review): fix(docs,bin): correct ghost-luma knob direction, gate plain-row extraction * no-mistakes(review): fix(docs,bin,tests): correct ghost-luma knob wording, share plain-content helper, cover Herdr/Zellij idle * no-mistakes(document): narrow overstated backend coverage claim in runtime-backends.md * no-mistakes(document): document leftbar footer override and opencode 1.19 pointer
…7406) Der Kopf des Tests sagt, jedes Programm werde so gestartet, wie bin/fm-spawn.sh es startet. Im codex-Zweig von launch_cmd fehlte dabei --disable hooks, das fm-spawn im crewmate- und scout-Pfad setzt. Ohne den Schalter parkt codex auf dem Hook-Vertrauensdialog ("N hooks are new or changed"), dessen Auswahl auf "Review hooks" aufsetzt und der mit der Tastenebene dieses Werkzeugs nicht beantwortbar ist. Der Lauf meldet dann die Tuerklingel als nicht befolgt, obwohl er ueber die Tuerklingel gar nichts ausgesagt hat - und das auf jedem Checkout, weil schon die projekteigene .codex/hooks.json den Dialog aufzieht. Dazu eine knappe Zusicherung am Startrezept, damit der Schalter beim naechsten Umbau nicht wieder still ausfaellt. Co-authored-by: ladwein <ladwein@firstmate.bost8.thelad.loc>
…kunchenguid#7096) * fix(bin): store only classified review fields in contribution records A pull observation stored GitHub's raw reviews payload, so a PR with a few hundred reviews wrote a record past the 1 MiB read cap and every pending, verdict and ack read then refused the whole home. Project each stored review to id, state, submitted_at, commit_id and user.login, the only fields the classifier reads, and add a many-review regression. * no-mistakes(document): clarify contribution record read cap in script header
…7216) * fix(pi): retain custom-event handling and processing cancellation * fix(pi): identify custom triggers before legacy prompt narrowing * no-mistakes(test): Correct branch fixture retirement and verify real notification ownership * no-mistakes(document): Clarify Pi event boundaries and verification scope * fix(pi): retain custom-event handling and processing cancellation * fix(pi): identify custom triggers before legacy prompt narrowing * no-mistakes(test): Correct branch fixture retirement and verify real notification ownership * no-mistakes(document): Clarify Pi event boundaries and verification scope * no-mistakes(review): Fix SDK1.1 prompt staging and verify branch context * no-mistakes(document): Clarify SDK prompt compatibility and branch-context verification * no-mistakes(test): Require dual-SDK compiler checks; execution remains pending * no-mistakes(document): Correct SDK typecheck documentation and stale dependency claims * no-mistakes(document): Correct stale Pi typecheck documentation and ownership pointers * no-mistakes(ci): Fixed SC2329 in tests/fm-pi-primary-types.test.sh by inlining EXIT cleanup. Also fixed a reproduced macOS npm-prefix/lockfile path failure without changing dependency pins or assertions. Canonical targeted lint, strict TypeScript 5.9.3 checks against Pi 1.1.0 and 1.2.0, and success/failure cleanup checks pass. Both behavior-shard failures were upstream npm ETARGET errors in workflow steps unchanged from base; no workflow/runtime changes warranted. Hosted CI remains for the outer executor * fix(test): reconcile queued processing probes after rebase * no-mistakes(document): Correct Pi compiler-phase documentation and stale CI comments
…guid#6380) * fix(cursor): verify cursor-agent by running it, not by name Cursor's installer writes its `cursor` IDE shim through the ~/.local/bin/cursor -> cursor-agent symlink, which can replace a versioned cursor-agent with a script that only prints "No Cursor IDE installation found" and exits non-zero. That file keeps Cursor's own name and install-tree path, so the name shortcut (and the structural check alone) accepted it and every Cursor spawn launched the broken file instead of the working agent alias. A launch candidate now has to print Cursor's CLI identity under the bounded probe, or carry the structural evidence and run --help successfully. Hosts without a bounded runner keep the structural verdict, as before. * no-mistakes(document): Align cursor launch-verify docs with runtime * no-mistakes: apply CI fixes * test: restore fm-watch-triage ack_stopped_cycle assertion The CI fix round loosened ack_stopped_cycle so a drain that prints no acknowledgement command and exits zero counts as success. That test is unrelated to the Cursor executable verification this branch changes, so restore its original assertion rather than mask a watcher failure here. * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * fix(bin): restore fm-afk-contract clock sampling A CI fix round changed how fm_afk_contract_cmd_enter samples its epoch. That away-mode behavior is unrelated to the Cursor executable verification this branch changes, so restore it here and leave any fix to its own change. * fix(cursor): load the timeout library only when a probe runs Sourcing bin/fm-timeout-lib.sh at load time made every consumer of fm-cursor-lib.sh, including the session-lock and turn-end hook paths that never probe, depend on that file being next to it. Load it lazily from the probe instead. * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * test: restore herdr focus-flash e2e test A CI fix round edited this Herdr end-to-end test, which is unrelated to the Cursor executable verification this branch changes. Restore it here and leave any fix to its own change. --------- Co-authored-by: ladwein <ladwein@firstmate.bost8.thelad.loc>
…#7422) * fix(dod): require a PR reference in CI-ready notes * no-mistakes(review): Recognize Forgejo plural pull request URLs
# Conflicts: # .agents/skills/ship-landing/SKILL.md # .github/workflows/ci.yml # .no-mistakes.yaml # .pi/extensions/fm-primary-pi-watch.ts # bin/backends/tmux.sh # bin/fm-brief.sh # bin/fm-dod-lib.sh # bin/fm-promote.sh # bin/fm-spawn.sh # bin/fm-test-run.sh # bin/fm-watch.sh # docs/architecture.md # docs/configuration.md # docs/documentation-audiences.json # docs/verification/runtime-backends.md # tests/fixtures.sh # tests/fm-ci-workflow.test.sh # tests/fm-crew-state.test.sh # tests/fm-pi-branch-extension.test.sh # tests/fm-pi-watch-extension.test.sh # tests/fm-spawn-dispatch-profile.test.sh # tests/fm-watch-triage.test.sh
…mpty-wait poll budget) into the fork
…s) into the upstream sync
… ownership proof and pre-return guard
…to the upstream sync One conflicting file: bin/fm-timeout-lib.sh, where PR 91's stdin passthrough meets upstream 6812's stdin redirect. Both sides are real fixes with opposite effects on the same line, and both intents are kept: - PR 91 passes the caller's stdin to the bounded command, because callers do feed it - bin/fm-nm-run-lib.sh hands its probe program to fm_nm_bounded on stdin. Upstream's redirect rested on the premise that no caller feeds stdin through fm_run_timed, which is false on this fork. - Upstream 6812 stops a bounded command reading the caller's TERMINAL from its own process group, where the read raises SIGTTIN and freezes the call in T state while the caller holds its locks. The resolution passes a non-terminal stdin through and swaps only a tty for /dev/null, inside the child, on every mechanism: fm_run_bash_timeout, the fm_run_external_timeout wrapper script, fm_run_timed's perl arm, and once in fm_exec_timed ahead of its three arms, so no arm can drift from the contract. PR 91's lazy-fetch and group-kill behaviour is untouched. tests/fm-timeout-lib.test.sh's upstream stdin case asserted the premise rather than the incident, so it now pins the contract this fork keeps; its pty-driven freeze case is unchanged and still passes, which is the half that proves the terminal protection survives. Validation: tests/fm-timeout-lib.test.sh 19 ok / 0 not ok, and tests/fm-nm-run-lib.test.sh 4 ok / 0 not ok, so both sides' own suites hold.
…ft unreachable The sync hoisted the custom-message case to isCustomBeforeAgentStart at the top of the handler, a type guard written so a prompt-only SDK cannot narrow it to never. The older inline copy survived below it, where both earlier guards have already returned: it was dead code, and because event is narrowed to the prompt-bearing member there, reading event.message failed the strict typecheck against Pi 1.1.0 and 1.2.0 (TS2339 on type never) - the one real CI failure on this branch. Removing it changes no behaviour, since the hoisted guard answers that case first. tests/fm-pi-primary-types.test.sh passes against both SDKs and tests/fm-pi-branch-extension.test.sh is 51 ok / 0 not ok.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Step 1 of the Defender load reduction: bring the fork up to date with upstream and take the two upstream performance/safety PRs that stand on their own, so step 2 (the loop rewrite) can be measured against a current base. No loop rewrite here.
This PR must land as a merge commit, not a squash. It carries three real upstream merges, and squashing them would discard the merge-base the next sync resolves against.
What was taken
ksrc/mainsync, 27 commits since merge-base7df545bf15ad1bd678e41849uname/euidinfm-procevent-lib.shd27f23a2b0eade2b.treehouseslots; sleep out the empty-wait poll budgetc8eed75544c15d1fmainat the time of the sync (PR #85)36ef08d5b666dd4dEach was merged, not cherry-picked, so the heads above are true ancestors of this branch.
The 27 upstream commits in (a)
15ad1bd6fix: require actual PR references in CI-ready ship notes (fix: require actual PR references in CI-ready ship notes kunchenguid/firstmate#7422)7efe9d04fix(bin): verify cursor launch binaries with a bounded probe (fix(bin): verify cursor launch binaries with a bounded probe kunchenguid/firstmate#6380)7099556dfix: handle Pi 1.1 and 1.2 supervision events correctly (fix: handle Pi 1.1 and 1.2 supervision events correctly kunchenguid/firstmate#7216)67abd40afix(bin): store only classified review fields in contribution records (fix(bin): store only classified review fields in contribution records kunchenguid/firstmate#7096)4de02c06test(send): codex im Tuerklingel-Test hook-frei starten (test(send): launch codex doorbell e2e with --disable hooks kunchenguid/firstmate#7406)e906f2e0fix(composer): prove opencode 1.19 de-emphasised mode footer from the plain row (fix(composer): prove opencode 1.19 de-emphasised mode footer from the plain row kunchenguid/firstmate#7395)aa9ab042fix(bin): stop tmux target checks reporting gone windows as alive (fix(bin): stop tmux target checks reporting gone windows as alive kunchenguid/firstmate#7409)5f2b81bctest(pi): Lauf ohne prompt in before_agent_start festnageln (test(pi): pin before_agent_start run without prompt kunchenguid/firstmate#7387)1a6714f2feat(bin): add a forge=external review rail that never pushes task branches (feat(bin): add a forge=external review rail that never pushes task branches kunchenguid/firstmate#7368)230db821fix: correct Pi wake ownership and processing-turn handling (fix: correct Pi wake ownership and processing-turn handling kunchenguid/firstmate#5835)fc8972cdfix: parse list-form Lavish results without dropping answers (fix: parse list-form Lavish results without dropping answers kunchenguid/firstmate#5404)9b1ada04fix(bin): let a backlog captain hold bound the watcher's wedge escalation (fix(bin): let a backlog captain hold bound the watcher's wedge escalation kunchenguid/firstmate#7338)4f77bb37fix(bin): retry transient contribution forge reads once before waking (fix(bin): retry transient contribution forge reads once before waking kunchenguid/firstmate#7302)0aa7facdfix: put a read cue at the head of a context re-emit (fix(bin): put a read cue first in context re-emit output kunchenguid/firstmate#7298)a24f4cb8feat(bin): add a verified Command Code (commandcode) crewmate/scout adapter (feat(bin): add a verified Command Code (commandcode) crewmate/scout adapter kunchenguid/firstmate#6679)0fd0e82afix(bin): have workers paused on their own background job set until to the job's timeout (fix(bin): have workers paused on their own background job set until to the job's timeout kunchenguid/firstmate#7240)33503ab3ci: let a fork skip the push run and the macOS job by repository variable (ci: let a fork skip the push run and the macOS job by repository variable kunchenguid/firstmate#7260)819f1a49fix(bin): guide completed-scout cleanup and permit stock lab supervision paths (fix(bin): guide completed-scout cleanup and permit stock lab supervision paths kunchenguid/firstmate#6965)9cd4a3befeat: set afk spend cap from live ordinary workers at entry (feat: set afk spend cap from live ordinary workers at entry kunchenguid/firstmate#7308)138cf11afix(bin): report a worker parked on the exit picker as blocked-on-prompt (fix(bin): report a worker parked on the exit picker as blocked-on-prompt kunchenguid/firstmate#6682)08f0a069fix(bin): treat OpenCode's right-aligned cwd rail as composer furniture, including absolute paths (fix(bin): treat OpenCode's right-aligned cwd rail as composer furniture, including absolute paths kunchenguid/firstmate#7307)24f3a6b8fix(spawn): scope Orca worker launch env to an opt-in tmux session (fix(spawn): scope Orca worker launch env to an opt-in tmux session kunchenguid/firstmate#6365)723f43c7fix(bin): name the failing step when a contribution observation is unavailable (fix(bin): name the failing step when a contribution observation is unavailable kunchenguid/firstmate#6810)0397cb2bfix(bin): keep inherited Git config entries when installing the trailer-strip hooks path (fix(bin): keep inherited Git config entries when installing the trailer-strip hooks path kunchenguid/firstmate#6341)89028578fix: keep unsupported contribution URLs unmeasured (fix: keep unsupported contribution URLs unmeasured kunchenguid/firstmate#7233)2911a3bbfeat: let a home declare authoritative external memory tiers (feat: let a home declare authoritative external memory tiers kunchenguid/firstmate#6608)8c9c67defix(pi): narrow before_agent_start events before reading prompt (fix(pi): narrow before_agent_start events before reading prompt kunchenguid/firstmate#7248)Not taken, on purpose
Conflict resolutions
The sync merge resolved 22 conflicting paths. In every case the fork's behaviour was kept and the upstream change folded into it. No fork behaviour was dropped and no fork file disappeared:
git ls-treeoverorigin/mainagainst this branch reports no missing path.The 22 conflicted paths
.agents/skills/ship-landing/SKILL.md.github/workflows/ci.yml.no-mistakes.yaml.pi/extensions/fm-primary-pi-watch.tsbin/backends/tmux.shbin/fm-brief.shbin/fm-dod-lib.shbin/fm-promote.shbin/fm-spawn.shbin/fm-test-run.shbin/fm-watch.shdocs/architecture.mddocs/configuration.mddocs/documentation-audiences.jsondocs/verification/runtime-backends.mdtests/fixtures.shtests/fm-ci-workflow.test.shtests/fm-crew-state.test.shtests/fm-pi-branch-extension.test.shtests/fm-pi-watch-extension.test.shtests/fm-spawn-dispatch-profile.test.shtests/fm-watch-triage.test.shFork behaviours preserved and re-checked after the merge: ClickUp ticket dispatch, Claude and Codex seats with guarded renewal, the seat-aware pipeline and quota cache, Jev dispatch and the production monitor, the per-home ticket-sync hook, the supervision host, the lead-restart Remote Control carry-over, and per-task delivery timings. Nothing was dropped as "upstream already does this" - upstream has no equivalent for any of them.
Settling the two cautions in 6812
1. The arm refusal must not lock a real home out of its own watcher
6812 refuses to arm a watcher from a
.treehousepath. On this machine the second mate homes are.treehousepaths, so a blanket refusal would have stopped them supervising.The merged guard in
bin/fm-watch-arm.shadmits a.treehousepath when it is a real home - its state directory sits under the copy root anddata/,state/,config/andprojects/are all present - and refuses otherwise. It sits inside the sameFM_GATE_REFUSE_BYPASS != 1wrapper as the fork's existing.no-mistakes/worktreesguard, which is unchanged. Neither guard is weakened: the bypass still works, and the lab-permitted path still requires state in the lab.Proved against the merged code, read-only, with no supervision cycle started:
2. The teardown force-kill-and-recheck must not remove a worktree with live processes on herdr
6812 replaces teardown's lsof-failure refusal with force-kill-and-recheck, and its own risk note says that on non-tmux backends it can remove a worktree while identified processes still run. This fleet runs herdr.
Resolution: the proceed half is tmux-only.
reap_task_pids_scan_fallbackforce-kills what an earlier successful scan already proved to be this task's own, takes the backend process-group fallback, and then, on any backend that is not tmux, keeps the refusal and preserves the worktree.reap_task_backend_process_groupis a no-op off tmux, so on herdr a failed scan leaves no account of what is still rooted under the directories about to be deleted - and removing them on that evidence is the one outcome teardown must not produce. The landed-work test is untouched.New test
test_lsof_error_on_a_non_tmux_backend_refusescovers exactly that: the same herdr fixture completes with a working lsof and refuses with a broken one, keeping the copy, the durable record, and the pool slot.One behavioural divergence worth knowing
6812's stated goal is to stop an lsof failure stranding a pool slot forever. On this fork it does not fully achieve that, and no part of 6812 was dropped to make that so.
The fork has a second guard upstream does not:
refuse_unowned_worktree_processeswill not hand a worktree totreehouse return --forcewhile anything it could not prove is this task's own still stands there, because the return terminates those processes. That guard needs lsof too. So when lsof fails, the reap-side fallback lands exactly as 6812 wrote it - the force-kill and the tmux process-group cleanup both run - and teardown then stops one step later at the pre-return scan instead of returning the slot.That is the safer of the two outcomes and the fork's deliberate behaviour (fork PR #79, which also added the ownership proof upstream lacks), so it was kept. Four upstream test expectations were reconciled rather than inverted:
test_lsof_error_falls_back_to_the_process_group_reap- still asserts the fallback and the reap; now also asserts the slot is kept, with the reason.test_lsof_error_after_identification_force_kills_the_tracked_process- its leaked process is now a child of a real endpoint leader, in its own process group, so the fork can prove it is the task's and the fallback's force-kill is genuinely exercised. Without that fixture change the fork preserves the process and the new code is never reached at all.test_lsof_error_with_a_surviving_tracked_process_refuses- same fixture change, so the survivor is tracked and the "survived a force-kill" refusal is reached.test_lsof_error_never_clears_index_lock- the sync replaced the fork's assertion with upstream's; it now names the fork's refusal. The invariant it owns is unchanged: an lsof error never removes the index lock.Closing that gap properly means teaching the pre-return scan to work without lsof. That is new design and out of scope here.
Keeping current with main
origin/mainmoved twice while this was open, and both are merged in rather than rebased.bin/fm-timeout-lib.sh, on the same line twice.That conflict is two real fixes with opposite effects, and both intents are kept:
bin/fm-nm-run-lib.shhands its probe program tofm_nm_boundedon stdin. Upstream 6812's redirect rested on the premise that no caller feeds stdin throughfm_run_timed, which is false on this fork.The resolution passes a non-terminal stdin through and swaps only a tty for
/dev/null, inside the child, on every mechanism:fm_run_bash_timeout, thefm_run_external_timeoutwrapper script,fm_run_timed's perl arm, and once infm_exec_timedahead of its three arms so no arm can drift. PR #91's lazy-fetch and group-kill behaviour is untouched.tests/fm-timeout-lib.test.sh's upstream stdin case asserted that premise rather than the incident, so it now pins the contract this fork keeps. Its pty-driven freeze case is unchanged and still passes, which is the half proving the terminal protection survives. Both sides' suites hold:fm-timeout-lib19 ok / 0 not ok,fm-nm-run-lib4 ok / 0 not ok.The one CI failure, fixed
The first CI run was red on
tests/fm-pi-primary-types.test.sh: TS2339,Property 'message' does not exist on type 'never', against Pi 1.1.0 and 1.2.0.It was a sync artifact. The custom-message case in
before_agent_startwas hoisted toisCustomBeforeAgentStart, a type guard written precisely so a prompt-only SDK cannot narrow it tonever; the older inline copy survived below it, where both earlier guards have already returned. It was unreachable, and readingevent.messagethere failed the strict typecheck. Removing it changes no behaviour.tests/fm-pi-primary-types.test.shnow passes against both SDKs, andtests/fm-pi-branch-extension.test.shis 51 ok / 0 not ok.Versions
No newer minimum no-mistakes, herdr or treehouse version is needed. The repository declares no minimum for any of the three, and the upstream diff
7df545bf..15ad1bd6introduces none.Testing
Targeted suites for the scripts this change touches. The full serial suite is left to CI.
tests/fm-watch-arm.test.shtests/fm-timeout-lib.test.shtests/fm-supervision-events.test.shtests/fm-procevent.test.shtests/fm-teardown.test.shThe watch-arm suite was run from a
.treehousepool slot and is green there, which is the environment 6812's new refusal governs.The teardown suite is the long one, so this PR was raised while it was still running in order to start CI earlier; it has since returned green in full. Its seven lsof and scan-failure cases - the ones this reconciliation changes - were run first, and the new herdr case passes with them.
The one procevent failure is
could not read the draining holder's identity, caused bysetsid: command not found.setsidis not present on macOS, the same line exists unchanged onmain, and the suite's other 141 cases pass - a pre-existing environment gap, not a regression from this sync. Linux CI hassetsid.