Repository navigation
feat: sync upstream firstmate main into fork - #4
Merged
Merged
Conversation
…henguid#7451) * fix(tests): tolerate slow orphan-storm source launches * no-mistakes(document): docs: pin orphan-storm row to pacing, not lease expiry
* fix: respect gh-resolved base in publication target selection * no-mistakes(document): Document gh-resolved publication target selection
…4728) * feat(bin): add Paseo as an experimental session backend Modeled on the cmux adapter, with Herdr's one-workspace-per-task UX: terminal NAME is the routing authority, workspace title is decoration only. tmux stays the default; Paseo is opt-in via config/backend, FM_BACKEND=paseo, or PASEO_AGENT_ID/bundle-id auto-detection. * no-mistakes(document): docs(paseo): register Paseo across backend inventories and lists * no-mistakes(document): docs(paseo): list paseo in AGENTS.md config/backend entry * fix(bin): give Paseo one shared workspace per project with a tab per task Paseo's sidebar is project > workspace > terminal tab. The adapter used to create one workspace per task, so a fleet showed up as a pile of sidebar entries. It now mirrors Herdr's container shape: one shared `firstmate` (or `2ndmate-<id>`) workspace per project, adopted by cwd and title or created once, with each task as a terminal tab inside it. Kill closes only the task's tab; the shared workspace is never archived and the adapter never runs a `paseo project` command, so Paseo reuses the project registered for the path instead of multiplying projects. Live findings folded in: the CLI prints an Electron warning on stderr when firstmate itself runs inside a Paseo agent, so parsed `--json` calls no longer merge stderr into stdout; `workspace ls` reports the cwd normalized but not symlink-resolved, so adoption matches the raw, logical, and physical path; a bare Escape stays pending in zsh's emacs keymap and fuses with the next key, so the smoke test verifies labels with Enter and sends Escape last. The smoke test now owns a throwaway project directory and deletes the project it registered, so a captain's real sidebar is never touched. Both paseo suites get a portable-serial duration hint and a `paseo` family so the coverage guard stays under its unhinted cap. * test(bin): teach the backend-list suites about paseo CI serial shard 5 failed because tests/fm-bootstrap.test.sh still expected the known-backend list to end at cmux. Add paseo to that expectation and to the sibling lists in the control, trace-context, and teardown-safety suites (with a valid paseo endpoint record), and scrub PASEO_AGENT_ID and __CFBundleIdentifier in the bootstrap suite's hermetic unset so running the tests from inside a Paseo agent cannot flip a default-backend case onto paseo the way $TMUX or HERDR_ENV would. * no-mistakes(review): Fix paseo control keys, secondmate fallback, docs, and tests * no-mistakes(review): Send paseo C-u as raw byte, refuse untokenized keys * no-mistakes(document): Sync Paseo docs for key tokens, secondmate fallback * no-mistakes(lint): Use prefix-form PATH in paseo autodetect tests * fix(bin): make paseo explicit-only and adopt the tab's own workspace Paseo stamps its markers into every descendant process: an agent exports PASEO_AGENT_ID, a terminal tab exports PASEO_TERMINAL_ID and PASEO_WORKSPACE_ID, and both carry __CFBundleIdentifier=sh.paseo.desktop. A tmux server started from a Paseo tab inherits all of them, so their presence never proves the captain chose Paseo (the same finding recorded on kunchenguid#4484 and kunchenguid#3884). fm_backend_detect now ignores every Paseo marker; paseo is reachable only through config/backend, FM_BACKEND=paseo, or --backend paseo, exactly like zellij and orca. That also retires the auto-detected-paseo secondmate fallback to tmux, which only existed because of auto-detection: an explicit paseo still refuses --secondmate, and an unconfigured home inside Paseo stays on tmux silently. Once Paseo has been selected explicitly, PASEO_WORKSPACE_ID is still useful: a firstmate running inside a Paseo tab adopts that tab's own workspace as the project's shared workspace when its cwd is the project, before falling back to the firstmate-title lookup (herdr's launcher-identity rule). Verified live that CLI-created tabs export PASEO_WORKSPACE_ID and no PASEO_AGENT_ID. Docs also note that `paseo run --cwd` is ignored when PASEO_AGENT_ID is set; the adapter never uses `paseo run`. * no-mistakes(test): Drop stale Paseo auto-detect mention from fm-spawn help * no-mistakes(document): Document Paseo own-workspace adoption order * no-mistakes(ci): Fixed ci-3 with a test-only change. The unconfigured-spawn case in test_secondmate_spawn_refuses_explicit_paseo_only failed on CI with "error: no launch template for harness unknown". CI runners have no agent process above the test, so harness detection returned unknown before the spawn reached the home check. The fix pins the harness with `printf claude > "$dir/config/secondmate-harness"` just before that spawn call, with a two-line comment explaining why (tests/fm-backend-paseo.test.sh). I verified locally that tests/fm-backend-paseo.test.sh passes, including the secondmate test, and that shellcheck is clean on the file. I did not rerun it detached from the agent process chain; your earlier report of it failing without the pin and passing with it is the evidence for that part. As you instructed, I made no change for ci-1 or ci-2 (the fork approval gate) or for the Lint 2 runner shutdown, which was infrastructure * fix(bin): let the adapter precheck load paseo Main now checks that a backend's adapter and its sibling libraries are readable before sourcing it, and refuses any backend it has no sibling list for. Paseo had no entry, so every paseo call failed to load the adapter and fell back to 'unknown'. Paseo sources the same siblings as cmux, so it shares that entry and sources through the checked path. * no-mistakes(document): Make fm_backend_source adapter-count comment count-free * test(bin): prove the Pi branch claims paseo stale wakes The watcher keys a non-Orca stale wake by the task's window= value, and the Pi supervision branch resolves a stale row to its task only through window= (Orca's terminal= key is not indexed, which is how Orca stale wakes ended up waking main). Paseo records window=<terminal-uuid>:<workspace-uuid>, so pin that a stale row keyed by that value is claimed by the branch for the right task. * no-mistakes(document): Note Paseo adapter in composer capture-window config doc * fix(bin): refuse a paseo spawn when its inventory is unreadable Paseo allows duplicate workspaces and terminal names, so the adapter looks up the project's shared workspace and checks the task's terminal name before creating either. Both lookups treated a failed or unreadable listing as empty, so a transient daemon error during spawn created a second workspace for the project or a duplicate task terminal. The spawn now refuses instead, and creates nothing, when either inventory cannot be read. * docs(paseo): note why capture reads the whole scrollback Paseo caps terminal scrollback at 1024 lines, so reading all of it and trimming locally stays bounded however long a task runs. A bounded `--start -<n>` read is not a drop-in replacement: it counts the blank screen rows below the prompt as the tail, so a quiet terminal captures as empty. * no-mistakes(document): Document Paseo spawn refusal on unreadable inventory * no-mistakes(lint): Rewrite paseo workspace inventory check as explicit if-block * feat(bin): keep paseo tasks from cluttering the sidebar Every project a firstmate worked in got its own "firstmate" workspace in Paseo, and those workspaces and their projects stayed in the sidebar after the work was done. When firstmate itself runs inside Paseo, task tabs now go into its own workspace, whatever the project. A terminal tab names that workspace through PASEO_WORKSPACE_ID; an agent session only has PASEO_AGENT_ID, so its workspace is the one live workspace whose folder is the firstmate home. Otherwise the per-project shared workspace is still used, and closing its last task tab archives it and deletes its project when the folder is one of the home's own clones. Archiving a workspace also archives its agents and leaves the project listed, so cleanup skips firstmate's own workspace, workspaces titled by someone else, workspaces with an agent in their folder, and projects outside the home, and does nothing when an inventory cannot be read. * no-mistakes(review): Retire paseo workspace when tab already gone; rename spawn vars * no-mistakes(document): Align Paseo doc workspace wording with own-workspace placement * fix(bin): serialize paseo spawns with workspace cleanup Cleanup checked that a per-project workspace had no tabs, made more Paseo calls, and then archived it. A spawn could open a tab in that workspace in between, and the archive would then take a live task's tab with it. Spawning (choosing or creating the workspace and opening the tab) and cleanup now share one home-wide lock, the stale-owner lock from fm-wake-lib.sh that herdr already uses. A spawn that cannot get it refuses and cleanup skips. Cleanup now only archives a workspace for one of the home's own clones, which only this home spawns into, so a per-home lock covers every spawn that could use it. * no-mistakes(document): Scope Paseo workspace retirement to home clones in architecture * test(paseo): fix shellcheck SC2031 lint warning in fm-backend-paseo test The workspace-lock holder helper read $! after backgrounding the holder, which ShellCheck's dataflow analysis flags as SC2031 because the helper only runs inside command substitution. The holder now records its own PID ($$, the same process $! named) before signalling readiness, and the helper returns that. No behavior change. * test(paseo): keep the smoke test from archiving a workspace it did not create Run from a Paseo tab or agent, PASEO_WORKSPACE_ID/PASEO_AGENT_ID steered create_task into the caller's own workspace, which cleanup then archived. The smoke test now unsets both before sourcing the adapter, archives the workspace create_task returned only while its cwd is the test's own temp dir, and runs cleanup once. Test-only; assertions are unchanged. * no-mistakes(document): List paseo in FM_BACKEND and README backend lists * no-mistakes(document): Add paseo to backend dependency docs and lists * no-mistakes(document): docs: list paseo among Command Code refused backends * no-mistakes(document): Note Paseo as unstyled in opencode footer record
…g budget (kunchenguid#7545) (kunchenguid#7558) Claude Code lists skill descriptions within a budget of 1% of the context window and drops the least-invoked skills' descriptions first, which are the rarely-loaded recovery skills whose descriptions AGENTS.md section 13 uses as the trigger index. - Remove the decision-hold-lifecycle redirect stub; nothing on main points briefs at it any more (captain-hold-lifecycle owns the policy and docs/captain-hold-lifecycle.md still documents the fm-decision-hold.sh shim). - Tighten the longest skill descriptions to their load triggers, keeping every trigger. Total description size drops from 11312 to 6142 characters across the listing. - Document /doctor, /skill-doctor, skillListingBudgetFraction, and skillOverrides "name-only" in the Claude harness adapter notes as opt-in, home-local vendor settings. No session-start budget warning or other default-on surface is added.
…enguid#7563) * fix(extension): launch lifecycle helpers through verified Bash The extension host spawned bin/fm-procevent.sh directly with shell:false, which native Windows Node rejects with spawn EFTYPE because it cannot run a script through its shebang. Resolve an absolute Bash from $BASH or PATH, verify it with a short probe (on Windows it must report an MSYS or Cygwin OSTYPE, so WSL bash.exe is skipped), and pass the script as its first argument. The child keeps shell:false, the sanitized environment, literal argv, and the existing failure mapping. Fixes kunchenguid#7559 * no-mistakes(review): Harden lifecycle Bash interpreter verification * no-mistakes(document): Document lifecycle Bash verification contract * fix(extension): try exported BASH only on Windows for lifecycle helpers
…nchenguid#7348) Sites that run one no-mistakes daemon per isolated workspace keep each task's runs in a per-workspace NM_HOME that cannot be derived from the shared gate remote, so crew state, pipeline spend, and teardown read the wrong home. When NM_HOME is unset and config/nm-home-resolver names a site-provided executable, fm-nm-run-lib.sh now calls it with the task copy path and exports the printed home for that one call. Only host reads (axi status, the axi overview, axi logs, runs, daemon status, the state database) and axi abort --run use it. An explicit NM_HOME always wins, and with no file behaviour is unchanged. Fixes kunchenguid#7309
…ds-decision line (kunchenguid#7361) * feat(bin): let a worker's own open blocked: or needs-decision: line defer wedge escalation behind config/wedge-defer-worker-wait Opt-in only: absent the flag the wedge ladder is unchanged. Counts only the worker's own newest line (reserved keys excluded via status_own_open_decisions), defers onto the existing bounded recheck with a verb-specific clearing action and no escalation-count increase, and ends on any newer status line or a newer acknowledged inbox record. The away daemon honors the same evidence before escalating an enriched wedge. Refs kunchenguid#6899 * no-mistakes(document): Document worker-wait deferral in wait-evidence lists
* feat(bin): pin per-mate secondmate runtime overrides in config/secondmate-harness A single default pin line gives every secondmate one runtime, so raising the default pin silently migrates a mate the captain ruled onto its own runtime. config/secondmate-harness now accepts optional "mate <secondmate-id>: <harness> [<model>] [<effort>]" override lines, and fm-harness.sh secondmate, secondmate-model, and secondmate-effort take the secondmate id as an optional second argument that selects that line. Spawn, the control-plane relaunch, and the secondmate restart each pass the mate id they already know, so all three resolve one decision. A malformed pin file is refused with its line number and prints no token instead of resolving around it to the default runtime. * no-mistakes(review): Bypass unused pins during explicit secondmate relaunch * no-mistakes(document): Correct and consolidate per-mate runtime pin documentation * fix: preserve legacy secondmate pin parsing without overrides * fix(bin): keep legacy secondmate pin files opt-in config/secondmate-harness is documented as "the first non-empty, non-comment line is parsed". The per-mate override grammar made the whole file strict, so a second default line or a fourth token started refusing every secondmate spawn, relaunch, and restart - even in a home that never wrote a mate line. That changed how an existing, already-valid file is read, so the feature was not opt-in. Scope the strict whole-file parse to files that declare at least one "mate <secondmate-id>:" line. A file with no mate line parses exactly as before: first non-empty, non-comment line, the rest ignored, a fourth token ignored, nothing refused. A file that does declare a mate line keeps the strict parsing, so a duplicate override, a malformed entry, or an extra token still refuses loudly with its line number. Coverage: a legacy file with a second default line and a fourth token now spawns, relaunches, and restarts a mate onto its first line; a declaring file that is malformed refuses each of those paths with the offending line; and an explicit --harness/--model/--effort relaunch succeeds whatever the pin file holds, because the config read stays behind the explicit-harness guard. * no-mistakes(document): Document per-mate secondmate runtime pins * no-mistakes(ci): Fixed `tests/fm-backend-herdr-presentation-e2e.test.sh` teardown to restore write permission on fixture directories before removal. This addresses the read-only git-hook cleanup errors in the failed Herdr check. The real-Herdr presentation E2E test passed locally (exit 0)
…unchenguid#6973) Adds bin/fm-capacity.sh, a read-only, network-free report of open ship/scout lanes against an optional config/lane-capacity target plus host load, memory and disk headroom. Without config/lane-capacity it reports counts only and gives no dispatch-hold advice. Docs, operational-home-layout skill entry, a gated AGENTS.md pointer, and tests/fm-capacity.test.sh.
… panes (kunchenguid#7437) * fix: bound unknown-live watcher alarms * no-mistakes(review): Gate unknown-alive stale bound on progress; fix arm CONFIG * no-mistakes(review): Keep watch.env loading only in the watcher arm * no-mistakes(review): Seed worktree progress before first unknown-alive alarm in test * no-mistakes(document): List config/watch.env in operational home layout * no-mistakes(review): Narrow watch.env docs to arm-launched watchers --------- Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
* fix(bin): honour the no-run verdict from axi status in crew-state * no-mistakes(review): Honor authoritative no-run verdict across fallbacks * no-mistakes(lint): Quote no-run sentinel to satisfy ShellCheck * no-mistakes(document): document authoritative no-run verdict in crew-state attribution
* fix(composer): accept Grok 1.0.44 approval-titled bottom border as empty composer * no-mistakes(document): Document Grok’s aligned approval title * no-mistakes(ci): Captain, removed the unused test variable that failed Lint 1. ShellCheck, the composer suite, and the remote provisioning test pass locally. Behavior portable serial 9 failed during fixture cloning in an unchanged test, before composer behavior was exercised; no further code change is warranted for that failure * no-mistakes(review): drop dead approval guard, make Grok fixtures locale-independent widths * fix(bin): stop shellcheck re-expanding fm-wake-lib in teardown Lint 1 dies when ShellCheck expands bin/fm-wake-lib.sh twice from bin/fm-teardown.sh. The top-level source already names that file. Point the second directive at /dev/null and leave the runtime source unchanged. * docs: record Grok 1.0.44's approval-titled composer border The verification record scoped its titled-bottom-border note to the Grok 1.0.5 three-column overhang but never recorded the newer shape this branch accepts, so a maintainer could not tell the two cases apart or know what a Grok upgrade re-verifies. Add a dated record of the 1.0.44 shape - the typed model/effort title plus its ` · always-approve` suffix, drawn inside a rounded bottom border at the aligned width - with the live verdicts that prove it, the portable test that owns it, and the fail-safe verdict every neighbouring title keeps. * no-mistakes(review): Narrow Grok composer coverage claims to verified matrix * no-mistakes(document): Correct stale Grok verification notes * docs: trigger CI re-run for flaky shard 4 Behavior portable serial 4 failed on the previous head with one assertion only, `not ok - the NUL-bearing line was not captured`, in the unchanged remote-reply and relay path; its fixture hardcodes /bin/sleep, direct NUL ingestion passes, and the other 19 checks were green. GitHub refused a job re-run for this fork PR, so this empty commit is the re-trigger. No content change. * no-mistakes(document): Clarify Grok live guard verification scope * fix(composer): restrict Grok approval titles to rounded borders Reject light, heavy, double, and ASCII approval-title boxes at the shared classifier boundary. Only the rounded family has recorded live evidence, and an empty verdict grants permission to type into the pane. Cover denied families through tmux and cursorless backend profiles while preserving rounded idle, draft, malformed-title, and legacy behavior. * no-mistakes(document): Refresh Grok composer verification evidence * no-mistakes(ci): Fixed the stale local link in `docs/verification/runtime-backends.md`; the section heading’s anchor had changed. `tests/fm-documentation-audiences.test.sh` passes
…henguid#7155) * fix(omp): point non-checkout homes at fm <project> relaunch and name why the extension is not loaded * no-mistakes(review): Remove unset-FM_HOME omp watch cause line
…cap (kunchenguid#7552) * feat(fm-watch): bound consecutive wedge escalations per worker window An unattended watcher escalation loop once burned ~359M tokens in a day: the watcher keeps re-escalating a pane it believes is wedged, and nothing bounded how many times it did that for one worker window. Add an opt-in ceiling on consecutive wedge escalations for a single window. At FM_WEDGE_MAX_ESCALATIONS the watcher publishes one terminal PERMANENTLY-WEDGED wake and writes both cap markers, after which the wedge path short-circuits for that window until FM_CAP_HORIZON_SECS elapses or an operator removes both markers. A pane hash change alone does not re-engage while the window-scoped marker stands, so a pane that re-renders on every poll cannot rebuild the counter and re-fire every bound. A failed marker write rolls the cap state back rather than amplifying one write failure into a wake-queue flood, and a rollback that itself fails leaves a transient sentinel that holds the wedge path quiet for FM_ROLLBACK_SENTINEL_TTL_SECS. FM_WEDGE_MAX_ESCALATIONS defaults to 0, so the unconfigured path keeps today's behavior exactly. Each setting is validated the way the rest of the file validates its environment settings and falls back to its default on a non-numeric value; a zero horizon or sentinel TTL falls back too rather than degrading into a re-fire loop. Tests drive the watcher as a real process through its public environment surface, and a separate opt-in live guard exercises a real tmux pane holding a wedged process in a disposable lab home built by bin/fm-lab-home.sh, covering both halves of the contract: the cap engaging, and the cap releasing itself on the horizon with no operator action. * no-mistakes(review): fix(fm-watch): bound the wedge cap honestly * test(fm-watch): make the wedge-cap live guard a falsifiable comparison The live guard demonstrated the ceiling but could not falsify it, and it advertised evidence that did not survive its own run. Register both new suites in bin/fm-test-run.sh. Unregistered they fell into the unclassified catch-all, which put the live guard outside the repo-wide live-gate sweep at tests/fm-live-gate.test.sh - the sweep that proves every live guard refuses together on FM_LIVE=0. The wedge-cap suite joins watcher-wake-lock and the live guard joins live-harness-optin; the serial lane passes no live-capability --fail-on-gate-skip token, so CI gating is unchanged. Run the unceiled baseline and the ceiled arm back to back on the same workload, one differing setting, in one transcript. The baseline at the shipped default of 0 shows the train of five consecutive wakes the cap exists to bound; the ceiled arm at 3 shows one terminal PERMANENTLY-WEDGED wake and then silence. State plainly in the transcript that the motivating incident happened at the default, so it motivates the ceiling and is not itself evidence the ceiling engaged. Correct the post-horizon assertion. It required the terminal marker on the very first cycle after the horizon, which the reset escalation counter makes false: the first post-horizon wake is an ordinary escalation and the bound is reached one cycle later. Assert the lane is audible, not which marker it carries. Reprint the transcript to stdout before cleanup, so the run ends in one self-contained evidence block instead of a pointer to the temp file this script is about to delete. Source tests/wake-helpers.sh for hash_text, and define PANE_TEXT in this script's own scope, so no unbound-variable or command-not-found line can appear inside the evidence a reviewer reads. Document in docs/configuration.md what the cap covers and does not: it bounds the wedge timer where a busy pane crosses FM_BUSY_TURN_MAX_SECS, it does not cover the non-terminal first-sight stale surface, only a pane leaving the stale path clears the markers, and a cap fire resets the consecutive-deferral budget of a wedge-evidence guard because that guard is not consulted while the cap is silencing the window. * no-mistakes(review): fix(fm-watch): release wedge cap markers on every episode-ending reset * no-mistakes(review): derive the live guard's window key the way the watcher does * no-mistakes(review): fix(fm-watch): probe dead endpoints under the wedge cap, scope terminal rows per episode * no-mistakes(review): fix(fm-watch): cap the dead-endpoint probe, real degraded fallback * fix(fm-watch): release the wedge cap through one episode-ending choke point The cap's release invariant - every reset that ends a wedge episode drops the cap markers with it - was wired at two inline sites and two more were missed. One of the misses is surface_nonterminal_stale, the hot path that ends the episode marker on every non-terminal stale poll, so the cap's episode tracking was broken in the common case rather than the rare one and a genuine new wedge after a pause-and-resume stayed silent for the full horizon. Enumeration had already failed once, so wiring the two missing sites would look finished and be incomplete again. Make the invariant structural instead: one choke point, wedge_episode_end, now performs every removal of the .stale-since-<key> episode marker and clears the cap markers with it, and a new assertion in the test fails on any direct rm of that marker outside it. keep-counter=1 marks a route that only restarts the escalation count while the wedge timer keeps aging. That is the same episode, not a new one, so the cap markers are deliberately not cleared there; an existing triage test pins that behaviour and it is unchanged. Both proofs are falsification-tested. The completeness assertion and the behavioural case each fail against the pre-fix watcher, and the behavioural case additionally fails when only the surface_nonterminal_stale wiring is reverted while the choke point still exists, so it pins the hot path specifically rather than passing because some other route happened to release the markers. The cap stays window-scoped with no per-hash marker, still defaults to off, and still releases on the horizon. The episode-scoped terminal row stays one per episode under the append lock, the documented first-sight containment stays, and the dead-endpoint-before-silencing work is untouched. * no-mistakes(review): fix(wm-watch): release wedge cap on every episode-end route * no-mistakes(review): fix(fm-watch): gate cap markers, probe under sentinel, release churn * no-mistakes(review): fix(fm-watch): release wedge cap on the away first sight * no-mistakes(review): fail safe the wedge escalation-count write under a configured cap * no-mistakes(test): fix wedge-cap live guard leaking its temp root * no-mistakes(review): fix(fm-watch): keep the wedge ladder reachable under a fired cap * no-mistakes(review): fix(fm-watch): pace the sentinel dead-record probe by threshold * no-mistakes(test): fix(test): give the wedge-cap suite its serial-lane weight hint so its CI shard fits the 30-minute job cap * no-mistakes(document): align wedge-cap docs with implemented release boundary * fix(docs): correct the cap markers' lifetimes in the layout reference The state/ listing claimed .wedge-permanent-<key> "only sits on disk until a later cap fire overwrites it". That is false: bin/fm-watch.sh:1214-1219 _wedge_cap_markers_clear removes .wedge-permanent-<key>, .wedge-terminal-queued-<key> and .wedge-rollback-failed-<key> outright, and it runs on every cap release, so a release takes the marker off disk rather than leaving it for a later cap fire to overwrite. The same clause also left the other two markers' lifetimes and delete semantics unstated. Each now carries its own lifetime, and the sentence records that a cap release drops all three while only the two silencing markers re-engage a window when deleted by hand. Verified against bin/fm-watch.sh: FM_CAP_HORIZON_SECS bounds the cap marker via _wedge_cap_marker_stands, FM_ROLLBACK_SENTINEL_TTL_SECS bounds the rollback-failure sentinel, and the terminal-row marker records the episode that queued the row and is dropped with the rest of the cap state. * no-mistakes(document): state the watcher's cap release boundary in its header comment * fix(fm-watch): make the wedge escalation-counter reset opt-in The upstream maintainer reviewed the wedge-cap pull request, accepted the live validation, and asked for the escalation-counter reset to become opt-in: it should only kick in when the cap is configured, so a home that has not set anything keeps today's behaviour and still gets the deep-inspection prompt for a stuck pane. The choke point wedge_episode_end gained a third state. The call sites whose pre-cap shape kept the escalation counter - the first-sight stale surfaces, where upstream dropped the wedge timer and left the count standing - now pass keep-count, so the counter survives them exactly as upstream's did while the cap is unconfigured. With a configured cap the count still restarts with the released episode, which is what lets a re-wedged window escalate from 1 again past a released marker. The other episode-ending routes are unchanged: the pre-cap watcher reset the count there too, so those keep resetting it in both postures. The new parity suite proves the property rather than asserting it: it drives one stuck-pane scenario against upstream main's own bin/ tree and against this branch, and requires the same observable outcome for the unconfigured case - the same ladder, the same demand-deep-inspection prompt, no cap marker. A configured cap in the same harness fires PERMANENTLY-WEDGED at its threshold, which is what shows the setting really reaches the watcher, so the unconfigured cases cannot pass vacuously. * no-mistakes(review): fix(fm-watch): bound the wedge cap settings to a comparable range The review step's fix agent produced this change but its own turn hit the 30-minute invocation budget, so the gate failed the step with the work uncommitted. The work is preserved in the gate's recovery ref and in the task's saved round patch; this commit carries it forward unchanged. bash's test cannot compare a decimal integer outside its own range: the comparison ERRORS rather than evaluating false, and every later comparison of such a value therefore reads as false. A value such as 99999999999999999999 passed the digit check unchanged, so the cap never engaged - the unbounded escalation train the feature exists to bound - and the \"is it zero\" test errored false as well, so the keep-count sites reset the escalation counter on a home that had configured nothing, which is the behaviour the maintainer's request forbids. The same hole let an unusable horizon make the cap marker expire at once and an unusable sentinel TTL drop the sentinel on the next poll, putting the failed-write route back on every poll. The fix bounds the accepted range at the ONE normalization choke point, where each value is read, rather than hardening every comparison site: a value bash cannot compare never reaches a comparison, because an arithmetic error is read as false at every site, which is the opposite of what each of those tests means. Values are accepted below 10^18, which always fits bash's 64-bit signed arithmetic, and the empty, non-digit, zero and negative handling keeps its documented fallbacks: 0 for the cap, 86400 for the horizon, 3600 for the sentinel. Regression cases cover a value beyond bash's integer range for each of the three settings, and the parity suite proves the unconfigured home is still observably identical to upstream main. * no-mistakes(document): docs: correct wedge-cap ranges, release routes, reset contract * no-mistakes(ci): fix the wedge-cap lint finding and pack the lane on CI measurements Upstream CI on the rework head went red on two checks, both ours. "Lint 1" failed on the new parity suite: two `return 1` statements behind `fail` were unreachable, and behind them was a real bug. `fail` lives in tests/lib.sh and exits, so inside the command substitution that reads the baseline it ended only the SUBSHELL - the outer script continued with an EMPTY baseline and reported a divergence with an empty trace instead of failing. The test's own header says it is the proof and a silent skip would be no proof at all, so the baseline now reports the specific reason and returns non-zero, and the caller's guard aborts the whole test. A baseline that cannot be materialised aborts the test rather than continuing. "Behavior portable parallel 2" failed the packing-boundary check: the wedge-cap suites were packed on provisional LOCAL measurements that overstated their CI cost, which left the serial lane without the headroom the boundary check needs to place one script exactly at the budget. The same CI run measured them for real - 374225 ms for the wedge-cap suite, 27763 ms for the parity suite, 74 ms for the live-guard skip - and those Ubuntu measurements replace the local ones in bin/fm-test-run.sh. * no-mistakes(document): docs: fix wedge-cap measurement attribution, document cap-off release
…lag (kunchenguid#7407) * feat: archive retired task status history behind an opt-in flag * fix(bin): recognize an already-retired remote home before it is recreated Sourcing fm-wake-lib.sh through the control script's libraries creates "$FM_HOME/state", so retiring a remote home that was already removed fabricated an unseeded directory before validate_home ran. The already-retired branch was unreachable, and that retirement and every retry refused with "remote home is not a seeded secondmate home". Check for the absent home before loading any library, accepting exactly the retire dispatcher's arguments so an invalid option still fails with usage, and drop the allow-absent branch that could no longer be reached. * no-mistakes(review): Removed configurable status archive retention override * no-mistakes(review): Remove published archives after failed status retirement
…y age (kunchenguid#7364) * fix(bin): raise unanswered review threads again after acknowledgement Acknowledging a maintainer signal removed the only record of the thread, so a comment nobody answered was never raised again, including while its task sat on a hold. Poll now tracks each unanswered maintainer comment, review and inline review comment on an open pull request until the contribution author replies in it or it is resolved, and raises it again once it is a day old (FM_CONTRIBUTIONS_REPLY_AGE) and daily after that. The wake names the comment URL and its age. * no-mistakes(review): Track only inline and changes-requested threads, bound notified * no-mistakes(review): Let reviewer verdicts answer reviews, skip empty-body change requests * no-mistakes(ci): Fixed "Behavior portable serial 6" with a test-only change. The serial 4 failure is a timing flake that this change did not cause. Serial 6 (tests/fm-pr-check-security.test.sh, "retired poll left task-a.check.sh"): this PR adds one more forge read to the contribution observer, a paginated `gh api graphql` query for reviewThreads. The test's fake `gh` answered every `api graphql` call with merge-state key=value lines. The observer rejected that output and raised the wake "contributions: observation unavailable ... review thread pages returned an unexpected shape". That wake ended the watcher cycle before the merged task-a poll retired. Invariant: the fake forge must answer every read the contribution observer makes, in that read's real shape. The other contribution reads (comments, reviews, inline comments, checks, statuses, repo) were already faked. The new reviewThreads query was the only read missing. Fix: tests/fm-pr-check-security.test.sh now answers any `api graphql` call containing reviewThreads with one empty reviewThreads page. The merge-state graphql answer is unchanged. Verified: I reproduced the failure locally before the fix. The test also passes on base fc8972c with that commit's bin/. After the fix, `bash tests/fm-pr-check-security.test.sh` exits 0 with all 47 cases ok. The only other test whose fake `gh` handles `api graphql` and runs the contribution path is tests/fm-pr-merge.test.sh. It prints no "unexpected shape" text. It fails locally with "github-zero-exit-queue-required: refusal did not name the concrete observed state", and it fails the same way on base fc8972c. So that failure predates this change, and it is not among the failing CI checks. Serial 4 (tests/fm-remote-reply.test.sh, "the NUL-bearing line was not captured"): this is a 40-second wait (800 polls of 0.05 seconds) for a procevent result in the remote-reply stream, and it timed out on CI. The test does not use fm-contributions or any file this PR changes. It passed locally twice (42 ok, exit 0), so this is CI load flakiness outside this change. I made no code change for it * fix(bin): make unanswered review re-raise opt-in The re-raise wake and the reviewThreads read now run only when FM_CONTRIBUTIONS_REPLY_AGE is set to a positive number of seconds. An unconfigured install polls exactly as before: no review-thread read, no threads[] entry and no unanswered signal. arm copies a set value into the generated check so the watcher honors it. * fix(bin): refuse a zero-padded zero reply age FM_CONTRIBUTIONS_REPLY_AGE=00 and 000 passed validation as positive ages. They now fail like 0 does. * no-mistakes(review): remove dead reviewThreads branch from security test fake gh * no-mistakes(review): use portable sed -i.bak in contributions test helper * no-mistakes(docs): name the thread URL in the unanswered-wake header text
… opt-in flag (kunchenguid#7631) * Refuse unguarded Herdr lifecycle briefs at spawn * no-mistakes(review): name matched Herdr command, document opt-in guard, test scaffold * no-mistakes(lint): quote matched-command assertion so ShellCheck SC2016 passes
…an opt-in flag (kunchenguid#7630) * fix(bin): publish a child's PR-ready line only after checks green behind an opt-in flag bin/fm-pr-check.sh publishes the child's PR-ready line to the parent channel when it registers the PR, before the child has reported its checks green. With config/ready-after-green present, a no-mistakes registration records the PR and arms the merge poll but publishes the line only when the last done line in the child's status is 'done: PR <url> checks green' for that PR. Without the flag the behaviour is unchanged. * no-mistakes(review): accept checks-green note with surrounding text for ready line * no-mistakes(ci): Lint 2 was caused by this PR and is fixed. Behavior tests (Herdr) is a pre-existing flake unrelated to this PR, so no code change was made for it. Lint 2 (fixed): ShellCheck SC2034 at tests/fm-teardown.test.sh:2711 because `run` was declared with `local` but is a function defined inside the test, never a variable. Invariant: a `local` declaration names only variables the function uses. The same wrong declaration also existed in the sibling opt-in test at line 2662 (both added by this PR), so `run` was removed from both `local` lines. Verified locally: `shellcheck -x tests/fm-teardown.test.sh` returns 0 (it reproduced the SC2034 warning before the edit), `bin/fm-lint.sh tests/fm-teardown.test.sh` returns 0, and `bash tests/fm-teardown.test.sh` exits 0 with 141 passing tests, including both "fm-pr-check withholds the PR-ready line ..." and "fm-pr-check releases the PR-ready line on a checks-green report that carries surrounding text". Behavior tests (Herdr) (not caused by this PR): the single failure is tests/fm-backend-herdr-presentation-e2e.test.sh "concurrent secondmate recovery failed ... error: herdr presentation recovery could not acquire its session lock; refusing a concurrent resume". That test exercises bin/fm-spawn.sh's Herdr session-lock recovery path; this PR touches only bin/fm-pr-check.sh, docs, a SKILL.md row, and tests/fm-teardown.test.sh, and the presentation test references none of them. The identical failure appeared on the unrelated branch fm/t3-5596-successor-v3 in run 39709923982 (job 119598556006), and the flake is already tracked in open issues kunchenguid#6454 and kunchenguid#7277. Rerunning the Herdr job should be enough; fixing the lock budget belongs to those issues, not this PR
* feat(bin): add Rex as an auto-detected session backend Add bin/backends/rex.sh, a session-provider adapter for the Rex terminal multiplexer, and wire it through the dispatcher, spawn, control plane, crew state, busy evidence, and away-mode supervision. - Auto-detect Rex from TERM_PROGRAM=rex with REX_BLOCK, after tmux and Herdr and before cmux; explicit --backend, FM_BACKEND, and config/backend still win, and a nested tmux or Herdr is never read as Rex. - One focus-safe tab per task: in Firstmate's own Rex session when it runs directly inside Rex (confirmed against the server), otherwise in one session per home; new blocks are resized to 200x50; every call names its session and block by immutable id. - Recovery-grade agent state from Rex's process view, OSC 7501 program status as positive busy evidence only while its owner is in the foreground chain, and a viewport derived from the last size.rows rows of the styled capture. - Absence proof from a structured not-found on the recorded server (rex_server), so fm-control exit and relaunch work on Rex and a gone block is reclaimed into a fresh tab in its recorded session. - Away mode for a Rex-hosted primary runs its daemon in a dedicated Rex session killed by exact id. - Docs: docs/rex-backend.md, configuration and control-plane tables, and a dated live verification record; tests: a stateful fake-CLI suite, a real-server smoke test guarded to its own fm-test- session, and a Rex away-launcher e2e. * no-mistakes(review): Recover Rex reclaim after server stops; document deferred asks * no-mistakes(document): Correct Rex documentation and consolidate stale backend guidance
…ollback (kunchenguid#7625) * no-mistakes(review): wedge cap: guard the cap-fire counter reset with rollback * no-mistakes(document): docs: repair shard-pack wording and wedge-cap marker shorthand * no-mistakes(review): docs: correct away-release terminal-row bound claim * no-mistakes(document): docs: cover third guarded cap-state write in watcher comment * no-mistakes(ci): Reweighted the packing hint for tests/fm-supervision-host.test.sh from the local 789123 ms to 1192918 ms, the one completed successful CI sample (run 39642852135, job 119276758966), and let the LPT packer rebalance. The guard was not weakened (PORTABLE_SERIAL_MAX_WEIGHT_MS=1200000, PORTABLE_SERIAL_SHARDS=9, coverage guard and packing-boundary check untouched) and nothing was hand-placed. New packed hint sums of the 9 serial shards (ms): 1=1192918 (1 script), 2=1139923 (18), 3=1139903 (30), 4=1139922 (30), 5=1139917 (30), 6=1139886 (29), 7=1139891 (30), 8=1139880 (29), 9=1139911 (31). Total 228 scripts = the serial lane exactly; max 1192918 < 1200000, so it fits. Packing guard: bin/fm-test-run.sh --check-coverage -> FM_TEST_COVERAGE ok total=268 parallel=24 parallel_max_ms=665545 parallel_imbalance_ms=2 parallel_unhinted=0 serial=228 serial_shards=9 serial_unhinted=15 serial_max_ms=1192918 serial_budget_ms=1200000 herdr=16, exit 0. tests/fm-test-run.test.sh passes both packing contracts: 'coverage guard bounds the unmeasured share and serial packing within twenty minutes' and 'serial packing accepts the exact budget and refuses one millisecond above it'. bin/fm-doc-audience-check.sh ok (surfaces=124 local_links=851). docs/fm-test-portable-shards.md now states the same 1192918 ms for that script, citing run 39642852135 (documented duration == packed weight), and adds the required honesty note in the same paragraph style: run 39765114423 cancelled this script alone in a shard at the 30-minute job cap and upstream run 39618934309 hangs identically, so the weight is a fit to the 20-minute packing target, not a cure, and the underlying slowness is an upstream defect this branch does not own. No other file, weight, test or doc line touched. Unrelated pre-existing failure, verified by git stash at base commit 5af4072: tests/fm-session-lock-ancestry.test.sh asserts 'the pty-host was not reparented to init after the daemon ended' and fails identically on the unmodified tree (sandbox pty behaviour); the --jobs family-admission assertion in the same suite fails only because of it. Not caused by this change
…nguid#6588) * fix(bin): restore inherited handling before main-only hand-back * Restored downtime so an earlier engine turn could not suppress a later main-owned close while leaving a healthy successor behind * Routed restoration failures through the existing Stop-hook alarm instead of silently discarding the hand-back * Added host-and-hook regressions plus attended and away idle-return controls to separate missing monitoring from status classification * no-mistakes(test): Assert ordered stale event in returned-driver controls * no-mistakes(document): Document main-only hand-back downtime restoration and failure * no-mistakes(document): Correct host header on main-only downtime republish
…unchenguid#7639) * feat(rex): push blocked edges from Rex program status through a bounded Lua reader Rex joins Herdr as a push-capable backend: a bounded rex do reader streams program_status_changed, child_exited, and block_closed for the watched task blocks, and a trusted blocked edge wakes the supervisor with Rex's blocked kind and message in the reason. The per-pane dedupe moves into the shared transition lib, the record gains a detail field, and gone edges end the wait for an immediate poll. The real-Rex test isolation is shared by both smokes. * fix(rex): anchor the composer read on Rex's cursor position Rex's format method reports the cursor alongside the styled grid, so the composer verdict now uses the same cursor-anchored read as tmux and falls back to the cursorless read only where that is unknown. OpenCode 1.19 draws a status line below its composer, which made every cursorless read of an idle OpenCode worker on Rex unknown and refused steers, exit, and relaunch. * test(rex): add a live composer guard for every installed harness on Rex * docs(rex): record push-event and per-tool live evidence on Rex * no-mistakes(document): Clarify Rex documentation and shared transition ownership * no-mistakes(ci): Fixed flaky public-followup fixture teardown: killing only the remote worker child allowed its supervisor to restart and race directory removal. Cleanup now uses the existing whole-worker-tree stop helper. Verified the full public-followup suite, remote-job orphan-reap suite, shell syntax, and git diff checks all pass
…nd an opt-in flag (kunchenguid#7634) * refactor(bin): share the branch-to-PR lookup through fm-pr-lib * feat(bin): notify owned PR health changes behind an opt-in flag * no-mistakes(review): drop status-line ownership, key checks per name, remove PR wait rule * no-mistakes(review): rediscover the branch PR once the cached one is final * no-mistakes(review): refuse retired re-enrollment, require marked checks, verify owned records * no-mistakes(document): note shared branch-to-PR lookup in scripts table * fix(bin): notify reported failures when no checks are required * no-mistakes(document): inventory PR health flag and state, note new pr-forge member
* Isolate real Rex tests with private servers * no-mistakes(review): Trap Rex cleanup early and prove passive-read autostart guard * no-mistakes(document): Consolidate Rex test isolation documentation
* fix(bin): report an outdated bootstrap tool instead of a missing one detect_local_tools printed "MISSING:" for a treehouse without --lease, a no-mistakes below 1.46.0, a gh-axi below its floor, and an incompatible tasks-axi or quota-axi, so a supervisor read an installed tool as absent and took the first-install remediation again. Report those as "OUTDATED:" with the installed version, the requirement and the tool's own upgrade command: treehouse update, no-mistakes update, gh-axi update and quota-axi update. tasks-axi ships no self-updater, so it keeps its install command. "MISSING:" stays for absent tools only, and lavish-axi keeps PRESENTATION_UNAVAILABLE with its text fallback. Update the bootstrap-diagnostics handler, the AGENTS.md section 13 trigger list and the operator diagnostics in docs/configuration.md, and cover absent, below-floor and at-floor for every floored tool in tests/fm-bootstrap.test.sh. * no-mistakes(document): Documented distinct bootstrap tool diagnostics * fix(bin): reuse the tasks-axi check's own probe results Rendering the tasks-axi OUTDATED requirement text ran the two `--help` capability probes again after the compatibility check had already run them, including when session start handed bootstrap an incompatible verdict. The check now records the reason behind its verdict - the version floor, or the capability probes the build fails - and reuses it, both within the process and across the existing one-hop handoff, so naming a missing capability costs no second probe pass. A build below the floor is answered by its version alone and never pays for capability probes it cannot use. The bootstrap tests that simulate a tool as absent removed it from the fake bin directory while bootstrap kept searching the fallback base PATH, so a real host install could satisfy the lookup instead of the expected MISSING line. Those cases now hide the tool from the base path as well, and a new case pins the contrast between a bare and a curated fallback. Verified: the touched bootstrap suite passes, and its probe-count and capability assertions fail against the pre-fix scripts. Run with a fallback base PATH carrying real installs of the absent tools, the pre-fix suite fails on "absent treehouse reports a missing tool" while the fixed suite passes every case. * no-mistakes(document): Documented missing versus outdated tool diagnostics * no-mistakes(document): Refresh outdated-tool documentation * no-mistakes(review): Reuse shared version parser for outdated diagnostics * no-mistakes(document): Correct outdated-tool diagnostics documentation * no-mistakes(document): Align toolchain upgrade documentation * fix(skills): keep main's bootstrap-diagnostics description and only add OUTDATED
…e verbatim match (kunchenguid#7530) * Clarify ahoy legacy startup exclusion * Fix quoted payload code span
…unchenguid#7637) * fix(timeout): bypass shell builtins when invoking external runners * no-mistakes(review): Remove redundant slashless runner resolution from external timeout
…urable (kunchenguid#6094) * fix: count answered captain holds in the Done archive at the completion gate Done retention moves closed markdown rows into the configured Done archive, which tasks-axi show never reads, so verify, complete, and scout teardown refused an answered captain hold once retention archived it. The completion gate now reads the newest archived block for an attested entry, under its exact or legacy identity, and accepts it only through a recorded resolution. Unanswered archived closes and holds found nowhere still refuse. * no-mistakes(document): document Done-archive durability in captain-hold verification record * no-mistakes(ci): Fixed the selected Greptile findings in bin/fm-captain-hold.sh (all in the Done-archive read path added by this PR). code_change_needed=true. ci-3 (Archived reads can hang): task_show_archived() now bounds the replayed archive `tasks-axi show` with the same read bound the live backlog read uses (FM_BACKLOG_ROW_TIMEOUT_SECS via fm_run_timed, sanitising a non-positive/padded value to 10s, mirroring fm_backlog_row_show). A bound hit is treated as 124, not absence: task_show_archived returns 124 and prints a loud reason; archived_entry() propagates 124; verify_entry_durable() exits 124 on the archived-read bound (alongside its existing resolve 124 handling); verify_hold_durable() exits 124 rather than reading the row as absent. So verify can no longer hang and complete can no longer stay blocked while holding the origin metadata lock. ci-4 (User-level archive setting ignored): added captain_markdown_archive_setting(), which resolves the [markdown] archive key with tasks-axi's own source precedence — the backlog root's .tasks.toml first, then $HOME/.tasks-axi/config.toml — before the existing default of done-archive.md beside the backlog; a relative value still resolves against the backlog root, which I verified empirically matches tasks-axi (root config wins over home config; a relative home-config value resolves against the backlog root; default stays data/done-archive.md). tasks-axi exposes no command for the archive path, so re-parsing with matched precedence is the available approach. Added test_archived_answer_in_a_user_configured_archive_satisfies_the_gate, which sets the archive only in a fixture $HOME/.tasks-axi/config.toml and drives the whole hold→answer→retention→verify/complete/teardown flow with that HOME, asserting the answered call archived to the relocated location still satisfies the gate. ci-5 (repeated archive scans, P2): left unchanged per the instruction's opt-out. A clean reuse of the row archived_entry already found is not small: archived_entry runs inside a command substitution, so its TASK_SHOW_OUTPUT dies with the subshell and cannot be handed to verify_hold_durable without restructuring both to pass the loaded row through the current shell. The growth is bounded (O(archive size) per attested entry) and P2, so hardening it would add more machinery than the fix warrants. Unanswered archived closes and holds found nowhere still refuse (existing test coverage retained). Verification: `bash -n` clean; pinned ShellCheck 0.11.0 (`shellcheck -x bin/fm-captain-hold.sh`) reports 0 findings; tasks-axi archive-precedence behaviour confirmed by direct experiment. The full fm-captain-hold-lifecycle.test.sh suite (which exercises both the pre-existing archived-gate test and the new user-config test) is slow due to beads spawns and was still running at report time; recommend confirming it green before merge. ci-1/ci-2 need no code change (action_required fork workflow runs awaiting maintainer approval), per the recorded user decision * no-mistakes(document): Document Done-archive reads under backlog row timeout * docs: say only the archive row replay is bounded, not the archive scan * no-mistakes(document): Move Done-archive rule to the complete section
… scripts (kunchenguid#7699) * fix(test): keep serial packing at-budget when a script has no hint tests/fm-approval-failover.test.sh landed without a serial duration hint, so the at-budget packing fixture overflowed by 1040ms. Record a measured 5410ms hint and give the fixture its own complete hint table so unmeasured defaults cannot join the boundary shard. Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> * docs: note the local approval-failover packing hint Record the 5410 ms provisional local sample for the next CI refresh, and describe the packing-boundary fixture as independent of unhinted scripts. Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>
* fix: terminate steering inbox records with newline * no-mistakes(ci): Fixed Greptile P2 by updating the shared generated `INBOX_SECTION` in `bin/fm-brief.sh`, which is the single guidance source consumed by ship, scout, and secondmate scaffolds. The guidance now tells workers to prefer `fm_task_inbox_body`, explains that `body-terminator=1` marks exactly one synthetic record-termination newline that is not logical body content, and says to remove only that marked terminator while preserving intentional trailing newlines and legacy EOF bodies. Added generated-brief behavioral coverage for all three scaffold paths in `tests/fm-brief.test.sh`. Verified with `./tests/fm-brief.test.sh && bash ./tests/fm-task-inbox.test.sh`
* fix(bin): make fm-send.sh --help print usage before FM_HOME resolution
* fix: parse list-form Lavish results without dropping answers (#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 #4726
* no-mistakes(document): Document Lavish capture formats and incomplete-result handling
* test: expect captain_message_count for the open-board list-form capture
* fix: correct Pi wake ownership and processing-turn handling (#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/firstmate#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
* feat(bin): add a forge=external review rail that never pushes task branches (#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
* test(pi): Lauf ohne prompt in before_agent_start festnageln (#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 8c9c67de 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>
* fix(bin): stop tmux target checks reporting gone windows as alive (#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
* fix(composer): prove opencode 1.19 de-emphasised mode footer from the plain row (#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
* test(send): codex im Tuerklingel-Test hook-frei starten (#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>
* fix(bin): store only classified review fields in contribution records (#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
* fix: handle Pi 1.1 and 1.2 supervision events correctly (#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
* fix(bin): verify cursor launch binaries with a bounded probe (#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>
* fix: require actual PR references in CI-ready ship notes (#7422)
* fix(dod): require a PR reference in CI-ready notes
* no-mistakes(review): Recognize Forgejo plural pull request URLs
* feat(herdr): opt-in project groups with status tags and a sorted agents view (#7434)
* feat(herdr): opt-in project groups with status tags and a sorted agents view
Add config/herdr-project-groups (absent or off: unchanged behavior). When on,
Firstmate tags each Herdr task pane, and its own projected workspace, with
display-only fm_group/fm_state/fm_task/fm_sort tokens, sets a Herdr agents
view sorted by group then status (needs-captain, problem, running, done), and
places a new projected task at the end of its own group inside the parent
block with the same single verified move as before.
The watcher reconciles tags once per poll and a spawn tags its task at once;
bin/fm-herdr-groups.sh also previews (plan), clears, and prints or appends
suggested sidebar rows with a backup. The agents view helper needs python3.
The only test-runner change is the serial weight hint for the new suite.
* docs(herdr): record the live lab check of project groups
The four hand checks for tags, the sorted agents view, placement at the
end of the group, and clear passed against a real Herdr 0.9.5 server
(protocol 22) in a guarded lab session.
* docs(herdr): align project group verification notes with the live check
* fix(bin): pin LC_ALL=C for remote job process identity reads (#7410)
ps -o lstart= renders in the caller's locale, so a lock or claim owner
recorded under one locale (de_DE renders "Di Okt 13 ...") failed identity
verification under another, was declared dead, and a second worker split
the queue: two serve loops reclaimed and reaped each other's live jobs,
which vanished mid-claim and failed staged jobs with exit 125 and no
output. Pin LC_ALL=C in fm_remote_job_process_start and pin the
cross-locale invariant with a regression test.
Co-authored-by: researchworldwide2026 <researchworldwide2026@gmail.com>
* fix(opencode): ignore child stdin EPIPE in guard and encoder (#7447)
* fix(bin): ignore crew state overrides for other tasks (#5881)
* Guard fm-crew-state overrides by task-name basename
bin/fm-crew-state.sh honours FM_CREW_STATE_META_OVERRIDE and FM_CREW_STATE_STATUS_OVERRIDE only when the override's basename is the requested task's own .meta or .status file name.
An override naming a different task, for example one inherited through a server started inside another task's snapshot child, falls through to the task's own records under the state directory.
A snapshot's own override, which names the task it was captured for, is still honoured.
This is complementary to #5622, which keeps the overrides out of the Herdr server launch: whatever path leaks an override, the reader never trusts one that names a different task.
Regression tests cover a mismatched override being ignored and a matching one being honoured.
* no-mistakes(review): Make metadata override tests behaviorally distinct
* fix(bin): re-anchor a Claude session's lock so /clear keeps ownership (#7415)
* fix(bin): re-anchor a Claude session's lock so /clear keeps ownership
A same-session confirmation over a live lock line 1 outside the current
harness ancestry now rewrites line 1 to the session's CLAUDE_PID anchor
under the claim lock, so a later /clear re-key in the same process is
still proven by ancestry instead of being refused as a foreign owner.
Fixes #6820
* fix(bin): move task leases with a session-lock re-anchor
A same-session re-anchor rewrote lock line 1 off a live pid while task
leases still named that pid, so a lease held by main or the supervision
branch read as stale and the other actor could claim the task. The
re-anchor now takes the lease-command lock after the claim lock and,
in the same critical section as the line-1 write, rewrites leases
recorded against the old pid to the new anchor (fm_lease_rekey_holder).
If the lease-command lock stays busy past a short bound, the
confirmation keeps line 1 as before and a later acquisition re-anchors.
The foreign-owner reproduction now asserts the re-anchor contract: the
same trusted id from a live process outside the owner's ancestry moves
line 1 onto that process's CLAUDE_PID, and a different id is refused
against it afterwards. The ancestry membership loop is shared through
one session-lock lib helper.
The earlier commit dropped the ancestry suite's dead-front-end reclaim
phase; that coverage lives in the existing reclaim tests
(test_verified_reclaim_keeps_new_sidecar and the Stop auto-arm's
test_reclaims_stale_session_lock_before_arming).
* fix(bin): record the lock holder for a lease pinned before a re-anchor
The supervision host pins FM_LEASE_HOLDER_PID to lock line 1 at the
start of each engine turn. A same-session re-anchor inside that turn
moved line 1 to a new pid while the pinned holder stayed alive, so a
later claim or same-actor refresh in the turn recorded the old pid and
the lease read stale, letting main claim the branch's task.
A claim now records the live line 1 when the pinned holder is alive but
is no longer line 1. Another session takes the lock only from a dead
owner, so that state comes from a re-anchor; a dead pin is still
recorded as before and its lease stays stale.
* no-mistakes(review): Move auto-arm rewake session pid with lock re-anchor
* no-mistakes(review): Align startup-network downgrade test and lock-rewrite comment
* no-mistakes(review): Correct lock takeover and re-anchor signal-window comments
* no-mistakes(review): Record re-anchor rewake and pinned-claim verification evidence
* no-mistakes(document): Update network-checks diagnostic for re-anchored lock holder
* feat: support version URLs for watched tool updates (#7449)
* feat(bin): watch a tool's published version through version_url
A watched tool whose CLI never announces its own updates can name a version_url; the document is fetched read-only inside the probe bound, its first dotted number is the published version, and an update is reported when that is newer than the version PATH resolves. Claude Code is the shipped example entry.
* no-mistakes(review): Compare published versions against newest installed tool copy
* no-mistakes(document): Clarify watched-tool version URL documentation
* fix(pi): keep a live session's extension markers when a nested Pi command loads them (#7287)
* fix(pi): keep a live session's extension markers when a nested Pi command loads them
A short-lived Pi command started from inside a live session, such as the
`pi --help` capability probe, auto-loads the two primary extensions. Both
treated the session lock as owned because an ancestor holds it, so the child
rewrote `.pi-watch-extension-loaded` and `.pi-turnend-extension-loaded` with
its own pid and exited. Session start then rejected the markers and printed a
false `PI_WATCH_EXTENSION: not loaded` alarm.
Before writing, each extension now reads the marker's pid and leaves the
marker untouched when that pid is a live strict ancestor of the current
process. A missing marker, a dead pid, the current pid, or a live pid outside
the ancestry still writes as before, so a fresh start and a relaunch over a
dead session bind unchanged. Lock ownership and the reader are untouched.
Fixes #5202.
* fix(tests): drop apostrophes from the nested-load marker heredocs so stock Bash 3.2 parses them
* fix: reclaim orphaned Claude auto-arm claims (#5939)
* fix(bin): supersede an orphaned Claude auto-arm claim after a session restart
An auto-arm claim is open only while its owner still descends from the session-lock pid.
A hook whose session exited mid-cycle stays alive with no parent to receive its exit 2, so deferring to its claim left the home unsupervised until the next session turn.
The replacement session's first Stop now takes the next generation, attaches to the running watcher, and delivers the wake itself, while the orphan goes silent.
A claim with no readable numeric session lock is never open.
* no-mistakes(review): accept pid-1 ancestor and session-id-matched autoarm claims
* no-mistakes(review): pin autoarm session-id claim signal to lock holder pid
* no-mistakes(review): exercise real lock recovery in orphan supersession tests
* no-mistakes(review): record lock-holder pid-identity instead of bare pid
* no-mistakes(document): complete autoarm claim-open coverage list
* no-mistakes(ci): Greptile finding ci-1 (hidden session-lock dependency in bin/fm-wake-lib.sh) fixed. Invariant: every function fm-wake-lib.sh calls must either be defined in that file or explicitly loaded by it before the call, so a caller sourcing only the wake library cannot silently degrade. Violating sites in the changed area: fm_autoarm_claim_open's fm_session_lock_recorded_session_id call, and the sibling writer fm_autoarm_claim_next's fm_session_lock_trusted_session_id call (which would otherwise silently omit the two new ledger fields). Both fixed at one shared boundary: a new lazy loader _fm_wake_require_session_lock (bin/fm-wake-lib.sh:38), matching the file's existing _fm_wake_require_classify/_fm_wake_require_timeout idiom, invoked immediately before each call. Lazy rather than top-level source so the ~40 scripts sourcing the wake library pay no harness-identity machinery cost; no circularity (fm-session-lock-lib.sh sources only fm-cursor-lib.sh). No new behaviour, state, or fallback. Verification: sourcing only fm-wake-lib.sh, a claim with broken ancestry plus matching sidecar id and matching recorded lock-holder identity now reads OPEN and the session-lock library is loaded on demand; ordinary descent path unaffected. Suites tests/fm-claude-stop-autoarm.test.sh, tests/fm-turnend-guard.test.sh, tests/fm-wake-queue.test.sh all pass; shellcheck -S warning reports only the pre-existing SC2034 present on HEAD. tests/fm-session-lock-ancestry.test.sh fails its final case ("the pty-host was not reparented to init after the daemon ended") identically with the change reverted, so that failure is a pre-existing WSL environment behaviour, not caused by this fix
* no-mistakes(document): Clarify auto-arm claim documentation
* feat(bin): add Polytoken crewmate/scout worker adapter (#7321)
* wip: polytoken worker adapter (detection, launch, wiring, control, composer; tests mid-iteration)
* feat: verify the polytoken worker adapter (crewmate + scout)
Add polytoken 0.8.19 as a verified crewmate/scout adapter on the
captain-approved TUI-pane-plus-REST hybrid: the pane keeps inspection
and backend parity while the control verbs ride the session daemon's
typed REST API.
Detection is ancestry alone on the anchored polytoken comm (a tool
subprocess's parent is the session daemon, verified live), with the
launch boundary clearing every foreign ORCA_/FM_ marker plus the fixed
harness-identity set. The launch generates the per-task worker config
dir (mirrored operator config with the unattended permission posture
enforced, because a project config.yaml fully replaces the global
config), the worker role-contract facet (no model pin, delegation and
facet switching denied at the tool registry), and the worktree hook
layer binding the verified busy pair - pre_user_prompt and
pre_model_turn open, stop closes - to a no-argv generated writer. The
readiness gate binds the session id, port, and credential into task
metadata through sessions --format json and fails loudly on any
first-start dialog, because the license terms are a blocker by captain
decision and --accept-license-terms is never passed.
Interrupt is POST /turn/cancel with its typed settle (the TUI has no
interrupt chord, so no key is ever improvised), exit is /quit, and a
cancelled turn's busy close is written by the control plane because no
stop hook fires. The composer is the verified separated shape with
polytoken as its second owner, and Enter mid-turn queues, so the
busy-queued conversion applies. Crewmate and scout only: a secondmate
launch is refused, and a project's own .polytoken/hooks.json is refused
rather than clobbered.
* no-mistakes(review): Fix polytoken launch flag order, token argv, live guard
* no-mistakes(document): Correct polytoken REST doc comment and token-on-stdin invariant
* no-mistakes(lint): Silence intentional SC2016 in polytoken live guard treehouse shim
* no-mistakes(review): Retire polytoken pool wiring, drop FIFO config, test env clearing
* no-mistakes(review): Scope polytoken teardown wiring removal to untracked polytoken files
* no-mistakes(review): Refuse existing polytoken hook layer before writing any wiring
* no-mistakes(document): Note teardown as consumer of harness wiring-path table
* no-mistakes(review): Retire only firstmate-generated polytoken worktree wiring
* no-mistakes(review): Guard polytoken hook layer before relaunch cleanup arms
* no-mistakes(document): Note relaunch also skips git-tracked wiring paths
* test: stub polytoken in the refused-relaunch fixture
The refused relaunch onto polytoken resolves the polytoken binary before
its hook-layer refusal, so the case failed on CI hosts without the real
CLI installed. A no-op stub on the fixture PATH stands in; it is never
launched.
* no-mistakes(review): Guard polytoken interrupt close; refuse whitespace hook paths
* no-mistakes(review): Snapshot busy record after cancel settles before idle close
* no-mistakes(review): Guard interrupt close with pre-cancel snapshot and sync recheck
* no-mistakes(test): Clear inherited AGENT at the polytoken launch boundary
* no-mistakes(document): Document guarded polytoken interrupt close and whitespace refusal
* test: preserve Polytoken hook refusal coverage with explicit pins
* no-mistakes(review): Refuse invalid Polytoken relaunch profiles before stopping the worker
* no-mistakes(document): Document Polytoken relaunch refusals before stopping the worker
* fix: scope worker wiring cleanup to Polytoken
* fix(bin): point Polytoken workers away from tool_flow for the task directory
Polytoken 0.9.0 offers no launch-time path grant: tool_flow's file_read
refuses the Firstmate task directory while the direct file tools reach it
under the generated bypass matcher. The worker facet now says so, and the
verification record carries the live evidence.
* fix(bin): leave the pool as found when a fresh spawn fails
A fresh spawn that fails and leaves no task record now closes the endpoint
it opened before its launch was delivered, so the shell whose treehouse get
leases the slot ends and the pool gets the slot back. It also removes the
harness wiring, task temp root, and staged launch file it wrote, and drops
its slot claim under a retaken project lock after metadata publication.
* no-mistakes(review): Stop pre-launch refusals pointing at windows abort cleanup closes
* fix(bin): scope failed-spawn cleanup and the Running-for busy row to Polytoken
The failed-spawn pool cleanup and the Running-for busy row now apply only to
Polytoken, so every other harness keeps main's abort behavior, header text,
operator messages, and harness-less busy union. Tests prove the Polytoken
path cleans up and a non-Polytoken refused launch behaves as on main.
* no-mistakes(review): Scope submit-core busy reads to Polytoken pane identity
* no-mistakes(review): Stop polytoken treehouse isolation refusal pointing at closed window
* test: track the spawned window in the Polytoken harness tmux stand-in
Main now requires exact tmux window membership before sending keys
(aa9ab042), and the Polytoken harness stand-in listed no windows, so the
merged spawn could never deliver Enter. Record the created window, list
it, and forget it on kill, as tests/fixtures.sh does.
* no-mistakes(document): Scope fresh-endpoint abort comment to Polytoken spawns
* no-mistakes(ci): Lint 1 (ci-3) was caused by this PR, and I fixed it. Commit d18014e1 added the in_polytoken_submit_pane() subshell helper to tests/fm-polytoken-harness.test.sh. That helper sources bin/fm-tmux-lib.sh without the `# shellcheck source=/dev/null` line that every other source in the file carries (lines 55-63 and 200). With --external-sources, ShellCheck followed the library into the subshell and flagged `local pid=$!` at line 690 as SC2031. The fix is that one missing line, added above the source at line 318. After the fix, `shellcheck -x` reports nothing on the file, `bin/fm-lint.sh tests/fm-polytoken-harness.test.sh` passes with full extended analysis, and the Polytoken harness test passes. Behavior portable serial 2 (ci-1) and serial 5 (ci-2) failed in timing-sensitive tests this PR does not touch, so I made no code change for them. I reran both test files in full on this branch on macOS, and both passed (rc=0, no failures). tests/fm-supervision-host.test.sh passed, including the 'host-only transition veto changed Pi's existing offer rule' check that failed in CI. tests/fm-remote-secondmate-lifecycle-e2e.test.sh passed, including 'watch liveness: a dead remote secondmate is auto-relaunched on its own host with one wake'. Main's own recent CI runs (38950070853, 38719784765) also failed on different timing assertions in these serial shards. Together that points to runner flakes rather than a defect in this change
* no-mistakes(review): Retake per-id spawn lock before Polytoken abort deletions
* no-mistakes(document): Document per-id lock guard on Polytoken abort cleanup
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Fix away branch relaunch admission (#7444)
* fix(bin): show reported checks when a pull request's base requires none (#7450)
Port the reported-check fallback and regressions from df605386963686dff138f89bea84541c0ade6c96. Preserve required-only reporting when required checks exist and refuse failed fallback reads.
* fix: support durable per-secondmate account pins (#7452)
* fix(tests): clean read-only relaunch fixtures
Use the shared fixture cleanup so generated read-only Git hook directories do not leave permission errors and temporary trees behind.
* fix(accounts): support durable per-secondmate account pins
Resolve optional primary-home secondmate account files through the worker pin parser and checks. Preserve existing defaults when no override exists and re-read the selected pin on spawn, relaunch, and recovery.
* no-mistakes(review): Name the rejected pin file in account refusals
* no-mistakes(document): Document per-secondmate account pins in relaunch and layout docs
* feat(bin): consult operator evidence guards before wedge escalation (#6958)
* feat(watch): consult opt-in operator guards before a wedge escalation
Add config/wedge-evidence-guards, an opt-in list of operator-owned guard
executables that the watcher's at-threshold wedge branch consults after the
wait evidence, worktree-write probe and dead-endpoint probe. A CRITICAL
answer defers one window at a time, capped by FM_WEDGE_GUARD_DEFER_MAX
consecutive deferrals recorded beside the other wedge-window records, and
the escalation that ends a capped run names the guard and its reason.
Timeouts, failures, malformed output, UNKNOWN and WARNING fail open, and an
untrusted config or guard is never run. With the config absent the ladder is
unchanged.
Refs #6919
* no-mistakes(document): Document wedge-evidence-guards in home layout index
* no-mistakes(document): Align jev-guards CRITICAL verdict with bounded deferral
* fix(bin): make inbox listing succeed when the inbox is empty (#7460)
* fix(bin): make the brief's inbox listing succeed on an empty inbox
The worker brief told crewmates to list the inbox with a bare *.msg glob.
On an empty inbox that glob fails: bash ls exits 2 and zsh aborts with
'no matches found'. Use find piped to sort -V so the listing is silent on an
empty or absent inbox and keeps numeric order past 999.
Refs #7244
* no-mistakes(review): Make relaunch note inbox listing safe when empty
* fix: bound remote secondmate convergence and preserve owed re-reads (#7394)
* fix(bin): fit remote second-mate convergence inside the startup network bound
The deferred startup network stage (120s) timed out once four second mates
were remote: the mates already converge concurrently, but each mate's
inheritance push sent its fifteen allowlisted items one SSH round trip after
another, so a single mate's convergence took 64-76s after a ~16s liveness
pass.
- fm-remote-inherit-push.sh validates and snapshots every item locally first,
so a local refusal now sends nothing, then sends the items up to
FM_REMOTE_INHERIT_PUSH_JOBS (default 4) at a time and replays their output in
allowlist order. A failed item still fails the push with its own error, and
no further item is started after it. The receiver is unchanged: each item is
its own file and generation record, and the host's job worker still runs one
home's commands one at a time.
- fm-bootstrap.sh gives each remote mate's convergence its own budget,
FM_SECONDMATE_CONVERGENCE_TIMEOUT (default 75s). A mate whose sync or push
hits it is reported as that mate's SECONDMATE_SYNC skip and keeps its retry
marker, instead of holding the whole stage past its bound.
* fix(bin): nudge a remote second mate to re-read only when something changed
Each remote convergence attempt records its retry marker before it starts,
so a sweep cut off by the startup network bound or failing before any change
left a marker that made the next session start nudge every remote mate even
though its instructions and inherited files were unchanged. The marker now
records whether a re-read is owed, set only once an attempt actually changed
the home, and a tracked-file sync that moved nothing under AGENTS.md, bin/,
or .agents/skills/ no longer counts as a change.
* fix(bin): keep a remote mate's re-read owed when its convergence is cut short
A convergence step stopped by the per-mate budget loses its output, so a
push that had already applied an item reported nothing and left the retry
marker with no re-read owed; the next start then saw every item unchanged
and never told the mate to re-read. A step cut off by the budget now marks
the re-read owed, and so does a failed push whose output shows items it had
already pushed or removed.
The lifecycle e2e suite runs every remote leg through the real entrypoint
and job worker on the test machine, so it now gives convergence ample time;
the budget's own behavior is pinned in fm-bootstrap-network-parallel, whose
budget and failure cases are also made independent of machine load.
* no-mistakes(review): Keep re-read owed on partial or unknown completion
* no-mistakes(review): Persist owed re-read when killed mid-mutation
* no-mistakes(document): Fix stale remote re-read owed docs
* test: send inherited items one at a time in the remote lifecycle e2e fixture
Behavior portable serial 5 failed on the watcher auto-relaunch leg of
tests/fm-remote-secondmate-lifecycle-e2e.test.sh after the inheritance push
started overlapping its sends. Across 14 recent main CI runs that suite's
remote-spawn leg took 30.8-35.6s and the watcher leg 27.3-34.5s, already close
to its 30s wait; on the PR run remote spawn took 42.1s, well outside that range,
while legs that push nothing were only 5-10% slower. The watcher relaunch is a
remote spawn, and the only changed code on that path is the inheritance push.
This fixture's transport has no network latency and its job worker runs one
home's commands one at a time, so overlapping sends cannot hide any round trip
there and only add submission overhead to every remote spawn. The suite now
sends one item at a time, as it did before; the overlapped scheduler stays
covered by tests/fm-bootstrap-network-parallel.test.sh, and the production
default of four is unchanged. The watcher leg's failure now also prints the
watcher's output.
* no-mistakes(document): Clarify remote re-read obligations and consolidate documentation
* fix(bin): record a remote mate's re-read as owed before convergence can change its home
A live run against a real remote second-mate home showed the owed re-read
still lost when the startup network bound stopped the stage. That bound
stops it the way `timeout -k 1` does: TERM to the stage's process group, then
KILL one second later. Bash defers a TERM trap while the convergence worker
waits in a command substitution, and the remote call runs in its own timed
process group, so the KILL landed before the trap could record the re-read.
The remote home had already applied the change, the next start saw every item
unchanged, sent nothing, and deleted the marker, so the mate was never told
to re-read.
Bootstrap convergence and config-push now write the record owed before any
remote step can change the home, and write it back only after the attempt has
reported: removed after confirmed unchanged convergence or a successful send,
and back to owed=0 when a failed attempt's outcome proves nothing changed. A
kill at any point therefore leaves the re-read owed. The TERM/INT traps are
gone. The kill regression now sends TERM and then KILL one second later, as
the startup bound does; it fails on the previous head and passes here.
* no-mistakes(document): Clarify convergence timeout scope and consolidate reread documentation
* fix: require positive daemon running status in crew-state (#7317)
* fix(tests): stabilize supervision host drain and offer fixtures (#7467)
* fix(bin): refuse spawn into a project with an unborn HEAD (#6987)
* fix(bin): refuse spawn into a project with an unborn HEAD
Spawn into a repository with no commit waited 60s for treehouse and then reported that the worktree was the spawning project itself, never naming the cause. Refuse before the wait and name the unborn HEAD and the remedy. The project-management skill now states that a new local repository needs a first commit.
* docs(skills): tell the captain a new project needs a first commit
The Create a project step no longer reads as firstmate committing into the project. It states that spawn refuses an unborn HEAD and that the captain is told the project needs a first commit.
* test: give spawn fixtures a first commit for the unborn-HEAD refusal
* no-mistakes(review): Commit foreign consent fixture so spawn guard passes
* feat(bin): add GitLab --allow-no-pipeline merge waiver and close backlog items for GitLab MRs (#7462)
* feat(bin): add an attended GitLab --allow-no-pipeline merge waiver
A GitLab repository that deliberately runs no merge request pipeline could
never be merged through fm-pr-merge.sh: the guard requires a successful head
pipeline at the current head, and GitLab has no per-check waiver.
--allow-no-pipeline waives only the pipeline condition, and only when GitLab
reports head_pipeline as present and null. A failed, running, canceled, or
stale pipeline still refuses, every other condition (open, mergeable
detailed_merge_status, no conflicts, discussions resolved) still holds, and
the verified head is still passed to glab as --sha. The flag is attended-only
(refused while the away-posture record exists), GitLab-only, and takes no
value; without it the default refusal is unchanged.
* fix(bin): close a GitLab merge request task's backlog item with a note
tasks-axi accepts a --pr link only as a GitHub or Forgejo pull request, so
after a GitLab merge request landed, teardown could never complete the
backlog Done transition and left the close pending forever.
Extend the existing Gerrit carve-out in fm_backlog_done and
fm_backlog_retain, and the captain-hold answer replay that shares it, to
record a GitLab merge request URL as a "GitLab merge request <url>" note,
until tasks-axi accepts GitLab merge request URLs. GitHub and Forgejo pull
requests are still recorded as pr links.
* no-mistakes(document): Note GitLab --allow-no-pipeline waiver in merge-watch record
* test(tests): stop orphan-storm fixture failing on slow launches (#7451)
* fix(tests): tolerate slow orphan-storm source launches
* no-mistakes(document): docs: pin orphan-storm row to pacing, not lease expiry
* fix: honor gh-resolved publication targets (#7540)
* fix: respect gh-resolved base in publication target selection
* no-mistakes(document): Document gh-resolved publication target selection
* feat(bin): add Paseo as an experimental session backend (#4728)
* feat(bin): add Paseo as an experimental session backend
Modeled on the cmux adapter, with Herdr's one-workspace-per-task UX:
terminal NAME is the routing authority, workspace title is decoration
only. tmux stays the default; Paseo is opt-in via config/backend,
FM_BACKEND=paseo, or PASEO_AGENT_ID/bundle-id auto-detection.
* no-mistakes(document): docs(paseo): register Paseo across backend inventories and lists
* no-mistakes(document): docs(paseo): list paseo in AGENTS.md config/backend entry
* fix(bin): give Paseo one shared workspace per project with a tab per task
Paseo's sidebar is project > workspace > terminal tab. The adapter used
to create one workspace per task, so a fleet showed up as a pile of
sidebar entries. It now mirrors Herdr's container shape: one shared
`firstmate` (or `2ndmate-<id>`) workspace per project, adopted by cwd
and title or created once, with each task as a terminal tab inside it.
Kill closes only the task's tab; the shared workspace is never archived
and the adapter never runs a `paseo project` command, so Paseo reuses
the project registered for the path instead of multiplying projects.
Live findings folded in: the CLI prints an Electron warning on stderr
when firstmate itself runs inside a Paseo agent, so parsed `--json`
calls no longer merge stderr into stdout; `workspace ls` reports the
cwd normalized but not symlink-resolved, so adoption matches the raw,
logical, and physical path; a bare Escape stays pending in zsh's emacs
keymap and fuses with the next key, so the smoke test verifies labels
with Enter and sends Escape last.
The smoke test now owns a throwaway project directory and deletes the
project it registered, so a captain's real sidebar is never touched.
Both paseo suites get a portable-serial duration hint and a `paseo`
family so the coverage guard stays under its unhinted cap.
* test(bin): teach the backend-list suites about paseo
CI serial shard 5 failed because tests/fm-bootstrap.test.sh still
expected the known-backend list to end at cmux. Add paseo to that
expectation and to the sibling lists in the control, trace-context, and
teardown-safety suites (with a valid paseo endpoint record), and scrub
PASEO_AGENT_ID and __CFBundleIdentifier in the bootstrap suite's hermetic
unset so running the tests from inside a Paseo agent cannot flip a
default-backend case onto paseo the way $TMUX or HERDR_ENV would.
* no-mistakes(review): Fix paseo control keys, secondmate fallback, docs, and tests
* no-mistakes(review): Send paseo C-u as raw byte, refuse untokenized keys
* no-mistakes(document): Sync Paseo docs for key tokens, secondmate fallback
* no-mistakes(lint): Use prefix-form PATH in paseo autodetect tests
* fix(bin): make paseo explicit-only and adopt the tab's own workspace
Paseo stamps its markers into every descendant process: an agent exports
PASEO_AGENT_ID, a terminal tab exports PASEO_TERMINAL_ID and
PASEO_WORKSPACE_ID, and both carry __CFBundleIdentifier=sh.paseo.desktop.
A tmux server started from a Paseo tab inherits all of them, so their
presence never proves the captain chose Paseo (the same finding recorded
on #4484 and #3884). fm_backend_detect now ignores every Paseo marker;
paseo is reachable only through config/backend, FM_BACKEND=paseo, or
--backend paseo, exactly like zellij and orca. That also retires the
auto-detected-paseo secondmate fallback to tmux, which only existed
because of auto-detection: an explicit paseo still refuses --secondmate,
and an unconfigured home inside Paseo stays on tmux silently.
Once Paseo has been selected explicitly, PASEO_WORKSPACE_ID is still
useful: a firstmate running inside a Paseo tab adopts that tab's own
workspace as the project's shared workspace when its cwd is the project,
before falling back to the firstmate-title lookup (herdr's
launcher-identity rule). Verified live that CLI-created tabs export
PASEO_WORKSPACE_ID and no PASEO_AGENT_ID.
Docs also note that `paseo run --cwd` is ignored when PASEO_AGENT_ID is
set; the adapter never uses `paseo run`.
* no-mistakes(test): Drop stale Paseo auto-detect mention from fm-spawn help
* no-mistakes(document): Document Paseo own-workspace adoption order
* no-mistakes(ci): Fixed ci-3 with a test-only change. The unconfigured-spawn case in test_secondmate_spawn_refuses_explicit_paseo_only failed on CI with "error: no launch template for harness unknown". CI runners have no agent process above the test, so harness detection returned unknown before the spawn reached the home check. The fix pins the harness with `printf claude > "$dir/config/secondmate-harness"` just before that spawn call, with a two-line comment explaining why (tests/fm-backend-paseo.test.sh). I verified locally that tests/fm-backend-paseo.test.sh passes, including the secondmate test, and that shellcheck is clean on the file. I did not rerun it detached from the agent process chain; your earlier report of it failing without the pin and passing with it is the evidence for that part. As you instructed, I made no change for ci-1 or ci-2 (the fork approval gate) or for the Lint 2 runner shutdown, which was infrastructure
* fix(bin): let the adapter precheck load paseo
Main now checks that a backend's adapter and its sibling libraries are
readable before sourcing it, and refuses any backend it has no sibling
list for. Paseo had no entry, so every paseo call failed to load the
adapter and fell back to 'unknown'. Paseo sources the same siblings as
cmux, so it shares that entry and sources through the checked path.
* no-mistakes(document): Make fm_backend_source adapter-count comment count-free
* test(bin): prove the Pi branch claims paseo stale wakes
The watcher keys a non-Orca stale wake by the task's window= value, and
the Pi supervision branch resolves a stale row to its task only through
window= (Orca's terminal= key is not indexed, which is how Orca stale
wakes ended up waking main). Paseo records
window=<terminal-uuid>:<workspace-uuid>, so pin that a stale row keyed
by that value is claimed by the branch for the right task.
* no-mistakes(document): Note Paseo adapter in composer capture-window config doc
* fix(bin): refuse a paseo spawn when its inventory is unreadable
Paseo allows duplicate workspaces and terminal names, so the adapter
looks up the project's shared workspace and checks the task's terminal
name before creating either. Both lookups treated a failed or unreadable
listing as empty, so a transient daemon error during spawn created a
second workspace for the project or a duplicate task terminal. The spawn
now refuses instead, and creates nothing, when either inventory cannot be
read.
* docs(paseo): note why capture reads the whole scrollback
Paseo caps terminal scrollback at 1024 lines, so reading all of it and
trimming locally stays bounded however long a task runs. A bounded
`--start -<n>` read is not a drop-in replacement: it counts the blank
screen rows below the prompt as the tail, so a quiet terminal captures
as empty.
* no-mistakes(document): Document Paseo spawn refusal on unreadable inventory
* no-mistakes(lint): Rewrite paseo workspace inventory check as explicit if-block
* feat(bin): keep paseo tasks from cluttering the sidebar
Every project a firstmate worked in got its own "firstmate" workspace in
Paseo, and those workspaces and their projects stayed in the sidebar
after the work was done.
When firstmate itself runs inside Paseo, task tabs now go into its own
workspace, whatever the project. A terminal tab names that workspace
through PASEO_WORKSPACE_ID; an agent session only has PASEO_AGENT_ID, so
its workspace is the one live workspace whose folder is the firstmate
home.
Otherwise the per-project shared workspace is still used, and closing
its last task tab archives it and deletes its project when the folder is
one of the home's own clones. Archiving a workspace also archives its
agents and leaves the project listed, so cleanup skips firstmate's own
workspace, workspaces titled by someone else, workspaces with an agent
in their folder, and projects outside the home, and does nothing when an
inventory cannot be read.
* no-mistakes(review): Retire paseo workspace when tab already gone; rename spawn vars
* no-mistakes(document): Align Paseo doc workspace wording with own-workspace placement
* fix(bin): serialize paseo spawns with workspace cleanup
Cleanup checked that a per-project workspace had no tabs, made more
Paseo calls, and then archived it. A spawn could open a tab in that
workspace in between, and the archive would then take a live task's tab
with it.
Spawning (choosing or creating the workspace and opening the tab) and
cleanup now share one home-wide lock, the stale-owner lock from
fm-wake-lib.sh that herdr already uses. A spawn that cannot get it
refuses and cleanup skips. Cleanup now only archives a workspace for one
of the home's own clones, which only this home spawns into, so a
per-home lock covers every spawn that could use it.
* no-mistakes(document): Scope Paseo workspace retirement to home clones in architecture
* test(paseo): fix shellcheck SC2031 lint warning in fm-backend-paseo test
The workspace-lock holder helper read $! after backgrounding the holder,
which ShellCheck's dataflow analysis flags as SC2031 because the helper
only runs inside command substitution. The holder now records its own
PID ($$, the same process $! named) before signalling readiness, and the
helper returns that. No behavior change.
* test(paseo): keep the smoke test from archiving a workspace it did not create
Run from a Paseo tab or agent, PASEO_WORKSPACE_ID/PASEO_AGENT_ID steered
create_task into the caller's own workspace, which cleanup then archived.
The smoke test now unsets both before sourcing the adapter, archives the
workspace create_task returned only while its cwd is the test's own temp
dir, and runs cleanup once. Test-only; assertions are unchanged.
* no-mistakes(document): List paseo in FM_BACKEND and README backend lists
* no-mistakes(document): Add paseo to backend dependency docs and lists
* no-mistakes(document): docs: list paseo among Command Code refused backends
* no-mistakes(document): Note Paseo as unstyled in opencode footer record
* fix(skills): keep recovery-skill triggers inside Claude Code's listing budget (#7545) (#7558)
Claude Code lists skill descriptions within a budget of 1% of the context
window and drops the least-invoked skills' descriptions first, which are
the rarely-loaded recovery skills whose descriptions AGENTS.md section 13
uses as the trigger index.
- Remove the decision-hold-lifecycle redirect stub; nothing on main
points briefs at it any more (captain-hold-lifecycle owns the policy and
docs/captain-hold-lifecycle.md still documents the fm-decision-hold.sh
shim).
- Tighten the longest skill descriptions to their load triggers, keeping
every trigger. Total description size drops from 11312 to 6142
characters across the listing.
- Document /doctor, /skill-doctor, skillListingBudgetFraction, and
skillOverrides "name-only" in the Claude harness adapter notes as
opt-in, home-local vendor settings.
No session-start budget warning or other default-on surface is added.
* fix(extension): launch lifecycle helpers through verified Bash (#7563)
* fix(extension): launch lifecycle helpers through verified Bash
The extension host spawned bin/fm-procevent.sh directly with
shell:false, which native Windows Node rejects with spawn EFTYPE because
it cannot run a script through its shebang. Resolve an absolute Bash
from $BASH or PATH, verify it with a short probe (on Windows it must
report an MSYS or Cygwin OSTYPE, so WSL bash.exe is skipped), and pass
the script as its first argument. The child keeps shell:false, the
sanitized environment, literal argv, and the existing failure mapping.
Fixes #7559
* no-mistakes(review): Harden lifecycle Bash interpreter verification
* no-mistakes(document): Document lifecycle Bash verification contract
* fix(extension): try exported BASH only on Windows for lifecycle helpers
* feat(bin): add an opt-in no-mistakes home resolver for host reads (#7348)
Sites that run one no-mistakes daemon per isolated workspace keep each
task's runs in a per-workspace NM_HOME that cannot be derived from the
shared gate remote, so crew state, pipeline spend, and teardown read the
wrong home.
When NM_HOME is unset and config/nm-home-resolver names a site-provided
executable, fm-nm-run-lib.sh now calls it with the task copy path and
exports the printed home for that one call. Only host reads (axi status,
the axi overview, axi logs, runs, daemon status, the state database) and
axi abort --run use it. An explicit NM_HOME always wins, and with no file
behaviour is unchanged.
Fixes #7309
* feat(bin): defer wedge escalation for a worker's own open blocked/needs-decision line (#7361)
* feat(bin): let a worker's own open blocked: or needs-decision: line defer wedge escalation behind config/wedge-defer-worker-wait
Opt-in only: absent the flag the wedge ladder is unchanged. Counts only the worker's own newest line (reserved keys excluded via status_own_open_decisions), defers onto the existing bounded recheck with a verb-specific clearing action and no escalation-count increase, and ends on any newer status line or a newer acknowledged inbox record. The away daemon honors the same evidence before escalating an enriched wedge.
Refs #6899
* no-mistakes(document): Document worker-wait deferral in wait-evidence lists
* feat(brief): forbid leading cd in generated scout and ship briefs (#7481)
* feat: support per-mate secondmate runtime pins (#6917)
* feat(bin): pin per-mate secondmate runtime overrides in config/secondmate-harness
A single default pin line gives every secondmate one runtime, so raising the
default pin silently migrates a mate the captain ruled onto its own runtime.
config/secondmate-harness now accepts optional
"mate <secondmate-id>: <harness> [<model>] [<effort>]" override lines, and
fm-harness.sh secondmate, secondmate-model, and secondmate-effort take the
secondmate id as an optional second argument that selects that line.
Spawn, the control-plane relaunch, and the secondmate restart each pass the
mate id they already know, so all three resolve one decision. A malformed pin
file is refused with its line number and prints no token instead of resolving
around it to the default runtime.
* no-mistakes(review): Bypass unused pins during explicit secondmate relaunch
* no-mistakes(document): Correct and consolidate per-mate runtime pin documentation
* fix: preserve legacy secondmate pin parsing without overrides
* fix(bin): keep legacy secondmate pin files opt-in
config/secondmate-harness is documented as "the first non-empty, non-comment
line is parsed". The per-mate override grammar made the whole file strict, so
a second default line or a fourth token started refusing every secondmate
spawn, relaunch, and restart - even in a home that never wrote a mate line.
That changed how an existing, already-valid file is read, so the feature was
not opt-in.
Scope the strict whole-file parse to files that declare at least one
"mate <secondmate-id>:" line. A file with no mate line parses exactly as
before: first non-empty, non-comment line, the rest ignored, a fourth token
ignored, nothing refused. A file that does declare a mate line keeps the
strict parsing, so a duplicate override, a malformed entry, or an extra token
still refuses loudly with its line number.
Coverage: a legacy file with a second default line and a fourth token now
spawns, relaunches, and restarts a mate onto its first line; a declaring file
that is malformed refuses each of those paths with the offending line; and an
explicit --harness/--model/--effort relaunch succeeds whatever the pin file
holds, because the config read stays behind the explicit-harness guard.
* no-mistakes(document): Document per-mate secondmate runtime pins
* no-mistakes(ci): Fixed `tests/fm-backend-herdr-presentation-e2e.test.sh` teardown to restore write permission on fixture directories before removal. This addresses the read-only git-hook cleanup errors in the failed Herdr check. The real-Herdr presentation E2E test passed locally (exit 0)
* feat(bin): add fm-capacity.sh to report open lanes and host headroom (#6973)
Adds bin/fm-capacity.sh, a read-only, network-free report of open ship/scout lanes against an optional config/lane-capacity target plus host load, memory and disk headroom. Without config/lane-capacity it reports counts only and gives no dispatch-hold advice. Docs, operational-home-layout skill entry, a gated AGENTS.md pointer, and tests/fm-capacity.test.sh.
* fix(bin): bound repeat stale alarms for unknown-but-alive progressing panes (#7437)
* fix: bound unknown-live watcher alarms
* no-mistakes(review): Gate unknown-alive stale bound on progress; fix arm CONFIG
* no-mistakes(review): Keep watch.env loading only in the watcher arm
* no-mistakes(review): Seed worktree progress before first unknown-alive alarm in test
* no-mistakes(document): List config/watch.env in operational home layout
* no-mistakes(review): Narrow watch.env docs to arm-launched watchers
---------
Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
* fix(bin): honor explicit no-run verdict in crew-state (#5888)
* fix(bin): honour the no-run verdict from axi status in crew-state
* no-mistakes(review): Honor authoritative no-run verdict across fallbacks
* no-mistakes(lint): Quote no-run sentinel to satisfy ShellCheck
* no-mistakes(document): document authoritative no-run verdict in crew-state attribution
* fix(composer): recognize Grok approval-titled borders (#6132)
* fix(composer): accept Grok 1.0.44 approval-titled bottom border as empty composer
* no-mistakes(document): Document Grok’s aligned approval title
* no-mistakes(ci): Captain, removed the unused test variable that failed Lint 1. ShellCheck, the composer suite, and the remote provisioning test pass locally. Behavior portable serial 9 failed during fixture cloning in an unchanged test, before composer behavior was exercised; no further code change is warranted for that failure
* no-mistakes(review): drop dead approval guard, make Grok fixtures locale-independent widths
* fix(bin): stop shellcheck re-expanding fm-wake-lib in teardown
Lint 1 dies when ShellCheck expands bin/fm-wake-lib.sh twice from
bin/fm-teardown.sh. The top-level source already names that file. Point
the second directive at /dev/null and leave the runtime source unchanged.
* docs: record Grok 1.0.44's approval-titled composer border
The verification record scoped its titled-bottom-border note to the Grok
1.0.5 three-column overhang but never recorded the newer shape this branch
accepts, so a maintainer could not tell the two cases apart or know what a
Grok upgrade re-verifies.
Add a dated record of the 1.0.44 shape - the typed model/effort title plus
its ` · always-approve` suffix, drawn inside a rounded bottom border at the
aligned width - with the live verdicts that prove it, the portable test that
owns it, and the fail-safe verdict every neighbouring title keeps.
* no-mistakes(review): Narrow Grok composer coverage claims to verified matrix
* no-mistakes(document): Correct stale Grok verification notes
* docs: trigger CI re-run for flaky shard 4
Behavior portable serial 4 failed on the previous head with one assertion
only, `not ok - the NUL-bearing line was not captured`, in the unchanged
remote-reply and relay path; its fixture hardcodes /bin/sleep, direct NUL
ingestion passes, and the other 19 checks were green. GitHub refused a job
re-run for this fork PR, so this empty commit is the re-trigger. No content
change.
* no-mistakes(document): Clarify Grok live guard verification scope
* fix(composer): restrict Grok approval titles to rounded borders
Reject light, heavy, double, and ASCII approval-title boxes at the shared
classifier boundary. Only the rounded family has recorded live evidence,
and an empty verdict grants permission to type into the pane.
Cover denied families through tmux and cursorless backend profiles while
preserving rounded idle, draft, malformed-title, and legacy behavior.
* no-mistakes(document): Refresh Grok composer verification evidence
* no-mistakes(ci): Fixed the stale local link in `docs/verification/runtime-backends.md`; the section heading’s anchor had changed. `tests/fm-documentation-audiences.test.sh` passes
* fix(bin): point non-checkout omp homes at fm <project> relaunch (#7155)
* fix(omp): point non-checkout homes at fm <project> relaunch and name why the extension is not loaded
* no-mistakes(review): Remove unset-FM_HOME omp watch cause line
* feat(fm-watch): bound consecutive wedge escalations behind an opt-in cap (#7552)
* feat(fm-watch): bound consecutive wedge escalations per worker window
An unattended watcher escalation loop once burned ~359M tokens in a day: the
watcher keeps re-escalating a pane it believes is wedged, and nothing bounded
how many times it did that for one worker window.
Add an opt-in ceiling on consecutive wedge escalations for a single window.
At FM_WEDGE_MAX_ESCALATIONS the watcher publishes one terminal
PERMANENTLY-WEDGED wake and writes both cap markers, after which the wedge
path short-circuits for that window until FM_CAP_HORIZON_SECS elapses or an
o…
…nces project MCP servers (kunchenguid#7693) * fix(bin): answer Kimi 2.3.0's folder prompt and refuse one that announces project MCP servers Kimi Code CLI 2.3.0 reworded its folder prompt: the options now read "Trust and continue" and "Exit", so the complete-dialog test in bin/fm-spawn.sh never passed and every Kimi launch stopped at the prompt with no key sent. The same release reads a root .mcp.json at the git worktree root as a project MCP declaration (its documentation names only .kimi-code/mcp.json) and announces declared servers on the prompt as "Start N MCP server(s) automatically" over "Config: <file>"; pressing Enter there starts those servers before any login. Move the prompt predicates into bin/fm-kimi-trust-lib.sh, recognize both recorded wordings, and refuse, before any key, a prompt that announces project servers or that pages its disclosure (a short pane keeps the complete dialog on screen and can hide the announcement on another page). The launch fails naming the reason; a prompt with no announcement is answered as before, and kimi -p is untouched. Replay the prompts recorded from the real 2.3.0 CLI through the Kimi suite's fake pane, one case per wording. * test(bin): add a default-on live guard for Kimi's folder prompt Launch the installed Kimi bare in a private tmux server with a disposable home and its updater off, and check every recorded prompt wording against the predicates bin/fm-spawn.sh answers with: the plain prompt is complete and Enter clears it, each declaring directory is announced and never answered with its command never run, and short panes collapse or page the prompt. No prompt text is submitted, so it spends no tokens and needs no login. Record the dated 2.3.0 and 2.3.1 result in the verification record. * docs: record the Kimi 2.3.0 folder prompt and its refusals Name both recorded option pairs, the project-server announcement, the paged and collapsed renderings, and the root .mcp.json read in the Kimi adapter reference, and point the configuration guide's harness restrictions at it. * no-mistakes(review): map changed captures to their readers; drop unrecorded 2.1.1 * no-mistakes(document): name the capture-directory arm in the changed-file map
…int (kunchenguid#7703) With config/rex-status-marks set to `on`, the captain sees from Rex itself which worker needs them: bin/fm-rex-marks.sh mirrors each Rex task's latest status into one Firstmate-owned OSC 7501 record (app=firstmate, id=fm) on the worker's pane, titled with the task's tab label, plus one OSC 777 desktop notification when a new attention state appears. Absent the file, nothing changes: the watcher skips the sync and teardown runs nothing new. - Status mapping: needs-decision or a captain hold -> blocked question, blocked -> blocked permission (auth when the note names a credential), failed -> error, done -> done (PR ready with a URL), else removed. - Validation progress: while marks are on and a no-mistakes ship validates with no mark, a working id=fm/validate record shows the share of steps done and the active step (fm_nm_run_progress in bin/fm-nm-run-lib.sh). - config/rex-tint opts in separately to an OSC 11 background tint on waiting and failed workers, reset with OSC 111. - A `rex` wedge-alarm channel, used only when config/wedge-alarm names it, raises an id=fm-wedge record and notification on Firstmate's own pane and removes it after the next delivered digest; `auto` never adds it. - Rex attributes a record written to a pane's terminal to the foreground process, so fm_backend_rex_trusted_record, the push stream consumer, and rex-eventwait.lua now ignore app=firstmate records: a mark can never read as the worker's busy state or blocked edge. - Tests: fake-CLI cases for the sequences, read-back, trust exclusion, default-off, producer convergence, clear, and progress parsing; real-Rex cases in the event-wait smoke; daemon cases for the rex wedge channel.
…7518) * feat(backends): add the T3 Code runtime backend T3 Code owns the agent session while Treehouse keeps owning the task worktree. The adapter drives the T3 server over its HTTP orchestration API with a CLI-issued bearer and reads native thread changes over the WebSocket shell stream; nothing is typed into a terminal. A spawn leases a Treehouse slot durably, registers the project by real path, creates the thread on the slot, and starts the launch turn with the encoded brief. T3 sets environment per provider instance, never per thread, so the facts a pane would export (GOTMPDIR, FM_TASK_ID, TRACEPARENT, a secondmate's launch prefix) travel as per-directory harness config: an env block in .claude/settings.local.json, or a [shell_environment_policy] table in .codex/config.toml. A tracked Codex config is overlaid under skip-worktree with a journal and restored byte for byte at teardown. Teardown stops and archives the thread before the slot returns, because a live thread whose worktree path disappears re-creates it on its next turn. The backend is experimental, runs only the claude and codex harnesses, and is selected explicitly or by a configuration-gated auto-detection rule: a home whose T3 shell snapshot shows exactly one live worktree-less thread. * feat(watch): supervise T3 Code tasks from the server's session status The T3 server reports its own session status for claude and codex alike, and no shell sits in front of the agent, so both its native busy and idle verdicts are trusted ahead of harness records (source t3code-native). The watcher subscribes to the shell stream for this home's worker threads, normalizes pending approvals to blocked through the shared transition policy, and keeps polling as the fallback. A thread's capture stays byte-identical through a long tool call, so the wedge ladder gains one T3 consult that resets the idle timer only while the server still reports the session running; stopped and failed sessions read dead and are reported once by the shared dead-record probe. * feat(control): native exit, relaunch refusal, and away-mode threads on T3 Code A T3 thread has no composer, so exit is the server's own session stop, proven by the same recovery-grade agent-state wait every other backend uses. A thread is bound to the driver that first ran it and a turn on a stopped thread continues the same agent, so relaunch is refused before anything is stopped, by the control plane and by the launch owner. A T3 missing is the server's own answer, so the absence proof re-reads the thread. The away daemon can supervise a captain that runs inside a T3 thread: T3 puts nothing into the agent's environment, so after the explicit overrides and the tmux and Herdr markers it asks the server for the one live worktree-less thread on this home's project. start refuses because T3 hosts no terminal to create; start-native remains the path. * test(t3code): cover the adapter against a fake server and a real socket A node HTTP fake answering from a per-case world covers the token and version gates, project matching, the command payloads, the status table, the stop-then-archive kill, worker and secondmate spawns, the per-directory environment files, tracked Codex config preservation, teardown ordering, the control plane's native exit and relaunch refusal, and the wedge consult. A second suite frames real WebSocket messages for the event reader and the watcher's fallback. A token-free live guard skips cleanly without T3. Cases that parse TOML report themselves skipped without a Python 3.11+ interpreter instead of passing vacuously. * docs: document the T3 Code backend and record its verification The backend guide owns setup, token minting, task shape, lifecycle, restart behavior, push events, away-mode support, and active limits. The runtime backend verification record keeps the dated live evidence. The shared configuration, architecture, control-plane, trace-context, and away-mode owners gain one-line cross-references instead of restatements. * no-mistakes(review): Harden t3code launch settings, abort lease, and secondmate bearer * no-mistakes(document): Refresh T3 backend documentation * fix(t3code): harden stable V1 thread lifecycle * fix(t3code): require explicit backend selection * docs(t3code): record stable source pin and trim shared churn * fix(t3code): reject V2 teardown before local cleanup * docs(t3code): align explicit selection guidance and tests * no-mistakes(review): Unify T3 thread status, gate, and V2 recovery handling * no-mistakes(review): Complete T3 V2 recovery steps and trim probe shell reads * no-mistakes(review): Apply T3 background liveness to stopped and errored sessions * no-mistakes(review): Classify T3 background liveness by T3's own session rules * no-mistakes(document): Align T3 backend documentation with current behavior * no-mistakes(ci): Fixed the T3 probe to preserve ready, idle, and interrupted detail verdicts when the shell request fails or times out. Added behavioral coverage that failed before the fix and now passes. The fake-server adapter suite, focused lint, and diff checks pass; the live Codex guard was disabled * no-mistakes(ci): Fixed ci-5: shell-snapshot failures now preserve thread liveness with unknown busy state. T3 busy guards defer, and classifiers preserve uncertainty. Added behavioral regression coverage. T3 adapter, daemon, busy-state, and pending-reply suites, focused lint, and documentation checks pass * no-mistakes(ci): Fixed unknown T3 verdicts clearing stale markers and errored-thread rechecks. Unknown still defers delivery. Both regressions failed before their fixes and now pass. All four focused suites, syntax checks, diff checks, and fast local lint pass. Full extended lint was stopped after nine minutes of heavy memory use * fix(t3code): bound stale alerts and restore portable CI checks * no-mistakes(review): Keep T3 stale markers when thread reads fail transiently * no-mistakes(document): Correct T3 backend documentation and supervision guidance * fix: preserve T3 integration changes during rebase * no-mistakes(ci): Captain, fixed discarded T3 stale warnings to re-arm exactly once, preserving delivered-warning suppression and startup rollback. Regression failed before the fix and passes afterward. All 59 portable T3 tests, targeted lint, syntax checks, and diff checks passed * no-mistakes(document): Clarify T3 warning lifecycle and account guidance * no-mistakes(review): Set launch-sent flag before send to preserve Git hooks * no-mistakes(document): Correct T3 backend documentation and ownership * fix(t3code): bound native-uncertainty inbox deferral by the busy budget Upstream's steering-inbox busy-deferral budget now also covers T3 Code native uncertainty, so a doorbell held for an unreadable thread escalates as stuck-busy instead of waiting forever. Document it and extend the probe test. * no-mistakes(document): Correct T3 runtime documentation and owner references * no-mistakes(document): Correct stale T3 backend documentation * fix(t3code): bound the running-session wedge deferral by turn age A T3 thread that stayed running reset the wedge timer on every consult, so a hung turn past FM_BUSY_TURN_MAX_SECS never reached the possible-wedge alert. Defer only while the latest turn boundary T3 records is younger than that bound, and never defer on a missing turn timestamp. * no-mistakes(document): Correct T3 backend documentation scope * fix(watch): keep the task-record busy verdict for non-T3 inbox delivery inbox_steer_check consulted fm_busy_is_busy with the window target for every backend. Restore window_is_busy, which classifies through the recorded task, for every backend except T3 Code, which alone also treats native uncertainty as busy before ringing. * no-mistakes(document): Correct T3 lifecycle and supervision documentation * no-mistakes(document): Correct T3 cleanup and stall documentation * fix(t3code): load the composer library for the shared submit dialog check Upstream's submit dispatcher now prepares and reads the composer dialog sink around every adapter, so a T3 Code submit failed with 'the dialog check could not be recorded' because this adapter never loaded bin/fm-composer-lib.sh. * no-mistakes(document): Correct stale T3 backend documentation * feat(t3code): move the backend onto T3 Orchestrator V2's /mcp transport T3's Orchestrator V2 removed POST /api/orchestration/dispatch, and an OAuth mcp-client session is accepted only on /mcp. Add bin/fm-t3-mcp.mjs, a dependency-free MCP client with the captain-run PKCE sign-in, a tools/list capability gate pinned to the signed-in environment id, and the thread verbs the adapter needs, and port bin/backends/t3code.sh onto it: launch, send, read, interrupt, archive with a proven close, and the away-mode thread lookup. The transport forces three changes: fm-control exit refuses on t3code (V2 has no session stop), the WebSocket push path is removed (an mcp-client is refused on it, so T3 windows poll), and a launch whose reply is lost keeps its lease instead of retrying (t3_thread_launch has no idempotency key). Fixes kunchenguid#6904 * fix(t3code): verify the V2 wiring live on Linux and fix what it found A live run of the /mcp backend against t3 0.0.46-nightly.20261010.2935 on Linux found four defects the fake server could not: - capture read the oldest activity items: t3_thread_read pages forward from afterPosition, so the helper now starts from the thread's visible item count and widens backwards when that undercounts. - fm-control interrupt on t3code always reported cancel=unconfirmed because the key path discarded T3's own run-wait verdict; it now reports T3's confirmed, not-running, or unconfirmed. - the telemetry probe never read "off" on Linux, where /proc/<pid>/environ is NUL-separated and the value match ran into the next variable. - the credential-mode test ran BSD stat first, which GNU stat answers with filesystem output before failing. The fake server now pages like T3, the capture and interrupt tests fail without their fixes, and the runtime-backends record carries the live run. * no-mistakes(review): Archive unproven T3 launches as uncertain; gate t3_thread_list * no-mistakes(review): Restore identity-tool gate test coverage * no-mistakes(document): Align T3 backend documentation with Orchestrator V2 * fix(t3code): address the Orchestrator V2 backend review - Interrupt confirmation waits on exactly the run T3 interrupted (wait --run). - A send reply lost after T3 committed it reads unconfirmed (exit 7 from the helper, verdict unconfirmed, fm-send exit 3), and one request id per logical delivery makes the resend idempotent. - Secondmate recovery never replaces an endpoint whose close is unproved, and resumes a failed T3 run in its own thread instead of launching a second one. - Secondmate retirement reaps provider processes T3 detaches after the archive before a pooled or standalone home is returned or removed. - Pending runtime requests read blocked, escalate once per request set through the watcher's push splice, and are answered with bin/fm-t3-answer.sh; permission approvals are surfaced, never answered. - Supervisor discovery reads every thread page and counts forks, not subagents. - Model selection resolves against orchestrator_capabilities, keeps unrelated default options under an effort override, and launch reads back the full t3_thread_configuration; the stale driver-binding claim is corrected. - The watcher's push splice waits on exact active runs through t3_thread_wait, bounded by the poll interval, with polling as the backstop. - The Claude pull-request-tool clause applies only before the T3 build verified safe, with an opt-in live guard and a dated verification record. - The fake server models paging, exact-run waits, asynchronous interrupt and archive, commit-then-disconnect sends, and pending requests; read limits cap at T3's 100. * no-mistakes(review): Retain T3 send outcomes, freeze digests, keep Herdr push * no-mistakes(review): Keep T3 request ids across outages and failed retries * no-mistakes(document): Correct T3 retry, recovery, and cleanup documentation * fix(t3code): limit the secondmate close refusal to T3 threads Non-T3 secondmate recovery keeps its existing best-effort close, so homes without backend=t3code run the same liveness code as main. A T3 secondmate whose thread reads missing now re-proves the close through the idempotent archive before a replacement thread launches, and an unproved close spawns nothing. * no-mistakes(review): Report lost T3 launch-brief replies as unconfirmed, keep task record * no-mistakes(document): Correct T3 backend documentation and recovery guidance * fix(t3code): drop the unused local that failed CI lint ShellCheck SC2034 flagged the unused `between` local in the T3 secondmate close-proof test, failing the Lint 1 job on the original pull request. * fix(t3code): cover T3 0.1.0's full-access scopes in the sign-in pairing code T3 0.1.0 grants a full-access mcp-client orchestration:read, orchestration:operate, settings:write, and source-control:write, and its OAuth decision refuses a pairing code that does not cover all four. The sign-in minted its code with only the read and operate scopes the 0.0.46 nightlies required, so login failed on the stable release with insufficient_scope. Request all four; the 0.0.46 nightly CLI accepts both added scope names, and the issued credential is still the server's own full-access scope set. * no-mistakes(review): Document remote code-root update requirement for new inherited items * no-mistakes(review): Route T3 secondmates to the re-read nudge, not restart * no-mistakes(review): Tolerate older receivers' absent-item refusal; refuse T3 raw launch * no-mistakes(review): Harden T3 abort, launch, watch paths; drop default-path forks * no-mistakes(review): Fix T3 daemon restamp, project race, Git config, settings merge * no-mistakes(review): Write only Firstmate's hook entry to T3 env files * no-mistakes(review): Fix T3 symlink guard, cleanup leaks, blocked-supervisor digests * no-mistakes(review): Scope T3 codex pre-check; tighten tests; correct T3 docs * no-mistakes(review): Key T3 codex pre-check on tracked config; fix forge doc * no-mistakes(review): Treat empty T3 replies and held local failures as unconfirmed * no-mistakes(test): Keep pre-existing CLAUDE.local.md on refused t3code spawn * no-mistakes(document): Correct T3 away-mode injection and stale-marker docs * no-mistakes(ci): The failing check is the auto-relaunch leg of tests/fm-remote-secondmate-lifecycle-e2e.test.sh ("the watcher did not exit on its auto-relaunch wake within the bound"). The flake predates this branch, but the branch makes it more likely, so I fixed the test. The whole test file now passes locally. Does the branch touch the path? Partly. - For a herdr remote mate, the branch leaves the liveness probe, the relaunch, the watcher tick and fm-spawn.sh's remote-secondmate path unchanged. Every T3 branch there is gated on backend=t3code. - But the branch adds `t3code-instances` to FM_INHERITABLE_CONFIG, ahead of captain-shared.md. Every remote spawn, including the watcher's relaunch, now pushes one more remote `absent` record. - CI per-leg timings, branch vs two main runs: legs that push inheritance are about 5-12% slower (37.3 vs 35.5s, 54.3 vs 48.0-49.7s, 55.5 vs 49.9-52.1s, 30.6 vs 26.3-27.9s). Seeding-only legs are identical. Evidence the flake predates this PR: - On main this leg already takes 30.1-32.9s. - The test waits 1500 iterations of `sleep 0.02`, about 30-35s. - The watcher's own relaunch bound, FM_SECONDMATE_LIVENESS_TIMEOUT, defaults to 120s. - The identical failure appears in 7 other recent failed CI runs on unrelated branches (fm-upstream-six-local-fixes, fm-stooddown-worker-false-wedge-alarms, fm-resolve-quota-attention, fm-session-stall-2026-10-16, fm-7426-pr, fm-polytoken-worker-adapter-v2, fm-remote-convergence-upstream). None of them contain bin/backends/t3code.sh. Violated invariant: the test must never fail a relaunch the watcher still accepts inside its own relaunch bound. The fix is test-only. It is the uncommitted change to tests/fm-remote-secondmate-lifecycle-e2e.test.sh that the timed-out earlier agent left; I reviewed it and kept it. - The watcher leg pins FM_SECONDMATE_LIVENESS_TIMEOUT=120, the same value as the default. - The iteration-count loop becomes a wall-clock deadline: that bound plus 30s for startup and probe. - Either spawn outcome, success or timeout (124/137), still wakes and exits the watcher, so the ordinary path ends as soon as the relaunch completes. - The `t3code-instances` inheritance item is a feature this PR needs, so I left the product code unchanged. The file's other ~30s waits each wait for a point partway through a spawn, not for a product-owned bound. They are the spawn and the config push reaching a blocked inheritance write, and a respawn reaching a blocked launch. All three passed locally, and the first two also passed in this branch's CI run, so I left them alone. Verification: - `bash -n` and `shellcheck -x` pass. - I ran only this one test file through bin/fm-test-run.sh, as instructed. Result: exit=0, total=1 failed=0, duration 1246656ms. This Mac runs about 2.5× slower than CI. - "watch liveness: a dead remote secondmate is auto-relaunched on its own host with one wake" passed after 89s (02:42:43 → 02:44:12). The old ~30s wait would have failed it; the new deadline is 150s * no-mistakes(review): Document t3code-instances absent-push cost for remote inheritance * no-mistakes(ci): The failing check is a timing flake in tests/fm-watcher-lock.test.sh, not a defect in this branch's code. I fixed it with a test-only change. What failed: in "Behavior portable serial 7", test_lock_recovers_dead_nested_steal_chain failed with "not ok - dead link-lock owner did not publish its pid" (tests/fm-watcher-lock.test.sh:394). That message comes from the helper leave_dead_link_locks. The helper starts a bash child that sources bin/fm-wake-lib.sh and creates one or more link locks, then waits for the child to write its pid. The wait was 50 rounds of `sleep 0.02`, about 1s on Linux CI. The other child-startup waits in this file allow about 5s (lines 536, 635, 808). Locally the child publishes in about 60ms, so the 1s bound only fails when the runner stalls. Did the branch cause it? The branch does not touch the test, bin/fm-wake-lib.sh, bin/fm-path-lib.sh or tests/lib.sh. Its only change to bin/fm-test-run.sh puts the new T3 tests into test families, which can change which tests share a serial shard. I searched the failed CI logs of the last 60 runs on other branches and found no instance of this failure, so I can't show it predates the PR. Violated invariant: a wait the test owns must not fail a child that a loaded runner merely slows down. Sibling sites: the helper is the one shared place where all four of its callers wait (reclaims_dead_steal_owner, recovers_dead_nested_steal_chain, steal_reap_cannot_remove_successor, resumes_own_interrupted_steal_reap), so the one edit covers all of them. The other short wait in the file (line 132) reads output from a watcher that has already exited, not a child still starting up. Fix: one edit to the helper. The loop runs up to 250 rounds instead of 50, about 5s, the same as the file's other startup waits, with a two-line comment. It still returns as soon as the pid appears, so the normal path is unchanged. No product code changed. Verification: - `bash -n` and `shellcheck -x` pass. - I ran the four helper callers from a temporary copy of the file, with only the child's startup delayed by 10s. - Old helper: fails with the exact CI message "dead link-lock owner did not publish its pid" (rc=1). - New helper: all four pass (rc=0). - With no delay, all four pass in about 2s. - I could not run the full file locally. An unrelated earlier test, test_lock_stale_steal_single_winner_under_concurrency, hangs on this Mac's bash 3.2: the read from its FIFO fails with "Interrupted system call". That test passed in this CI run and is outside this fix, so I left it alone and stopped the run. - The temporary driver files were removed. The unselected ci-2 (Behavior portable serial 2, cancelled with no verdict) was not addressed * no-mistakes(document): Fix T3 path inventory and thread wording * no-mistakes(review): Fix T3 lease abort, approval identity, waits, and selection * no-mistakes(review): Pin T3 approval identity to verified v0.1.0 waiting items * no-mistakes(review): Remove stray Paseo fragment from fm-backend.sh header * no-mistakes(document): Correct T3 lease, send-verdict, and teardown docs * no-mistakes(review): Prove T3 launch archives, clean aborted homes, reap nested homes * no-mistakes(review): Keep T3 slot lease only on dirty-slot refusal * no-mistakes(review): Treat T3 orchestration_error as unconfirmed; fix backend docs * no-mistakes(review): State unproven T3 outcome cause in operator text * no-mistakes(review): Refuse T3 secondmate teardown without lsof; name env cleanup * no-mistakes(review): Restore main's reassigned-slot test; add separate T3 overlay test * no-mistakes(test): Document Codex trust prerequisite for T3 Codex env * no-mistakes(document): Correct T3 uncertain-launch lease and coverage docs * no-mistakes(review): Warn on unconfirmed T3 Codex trust; harden launch-archive proof and tests * no-mistakes(document): List T3 Codex trust warning in coverage inventory * no-mistakes(ci): The rebase onto 25bb43b completed cleanly. I also fixed a CI test-coverage failure that the combined tree caused, by adding a tenth portable serial CI shard. Every verification run passes. The shard fix is in the working tree and not committed. **Rebase:** all 82 commits are replayed with no merge commits, and the new head is f1bb58ae. Each commit keeps its original author, date and subject, including Bryce Eppler's. - One commit conflicted: fff8ce69, in tests/fm-remote-secondmate-lifecycle-e2e.test.sh. Main (ac8a767) raised a watcher wait loop from 1500 to 3000 iterations of `sleep 0.02`, about 60s. The branch replaces that loop with a 150s wall-clock deadline: the watcher's 120s relaunch bound plus 30s. I kept the branch side, which already gives the longer wait main wanted. - The branch's patch on the new base matches the original apart from line numbers. Main's patch also matches, except for that one hunk. - Main also edited fm-watch.sh, fm-pending-reply-lib.sh, fm-fleet-snapshot.sh, fm-test-run.sh and some docs. Its edits there sit in different hunks from the branch's. **Coverage-guard break:** each side passes alone, but together they do not. CI's "Test coverage guard" job runs `bin/fm-test-run.sh --check-coverage`, which failed with "largest portable serial shard packs 1200805ms above the 1200000ms target". | tree | serial lane total | largest shard | |---|---|---| | main | 10582151ms | 1192918ms (ok) | | branch before rebase | 10762151ms | 1195805ms (ok) | | rebased | 10807151ms | 1200805ms (over by 805) | - **Cause:** the five tests the branch adds have no timing hint, so each is packed at the 45000ms default. Main added one more unhinted test. Nine shards hold at most 10800000ms. - **Why hints alone don't fix it:** this PR's CI runs 39463576576, 39814995718 and 39883948163 measured the slowest successful samples: | test | slowest sample (ms) | |---|---| | fm-backend-t3code | 239245 | | fm-t3-mcp | 57613 | | fm-watch-inbox-meta | 283 | | fm-backend-t3code-live-e2e (live-guard skip) | 51 | | fm-backend-t3code-pr-tools-live-e2e (live-guard skip) | 52 | With these the lane totals 10879395ms. That is more than nine shards can hold, and docs/fm-test-portable-shards.md says to refresh hints or add shards rather than raise the job timeout. **Fix (test and CI files only, nothing a home runs):** - `bin/fm-test-run.sh`: `PORTABLE_SERIAL_SHARDS` goes from 9 to 10, and the five measured hints are inserted without reordering existing lines. - `.github/workflows/ci.yml`: the serial matrix gains shard 10. The timing aggregate already collects artifacts by glob, so it picks up the new shard. - `docs/fm-test-portable-shards.md`: records where the hints came from, and says fifteen long-lived jobs, ten of them serial. - With ten shards the largest is 1192918ms, the indivisible fm-supervision-host test, and the others land near 1076300ms. This adds one CI runner per run. It is the remedy the shard docs prescribe, but the maintainer may want a say since the PR now changes CI capacity. **Verification (all pass):** - tests/fm-test-run.test.sh, including the coverage-guard and packing-boundary cases. - tests/fm-ci-workflow.test.sh and tests/fm-lint-workflows.test.sh. - tests/fm-pending-reply.test.sh and tests/fm-fleet-snapshot-contribution-input.test.sh. - `bin/fm-lint.sh` on bin/fm-test-run.sh and on the files both sides touched. - `bash -n` on every script in bin, bin/backends and tests, and `node --check` on bin/fm-t3-mcp.mjs * no-mistakes(review): Fix T3 review findings and revert tenth CI shard * no-mistakes(review): Prove next-since arrival write; keep T3 backend suite serial * test(t3code): run the T3 suites in the portable parallel lanes The two T3 suites pushed the portable serial lane past the nine-shard budget. Give every case id the backend suite spawns a per-run suffix so its /tmp/fm-<id> directories cannot collide across concurrent runs, with cleanup limited to the ids that run created, then move both suites into the proven-isolated set with their CI-measured hints as parallel hints and rebalance the two parallel lanes. Record the concurrent proof. * fix(t3code): refuse a Codex approval mode T3 cannot honor T3 starts every worker at its full-access runtime mode, so a t3code codex spawn with config/codex-approval-mode=approve-for-me would launch at full access while recording approval_mode=approve-for-me. Refuse it before any mutation, as the Claude permission-mode refusal already does, and cover the refusal and the bypass posture with fake-server tests. * no-mistakes(review): Refuse managed approval failover for t3code tasks * no-mistakes(document): List T3 failover refusal in approval coverage inventory * fix(t3code): name the Codex restricted mode in the T3 refusal config/codex-permission-mode=restricted sets the Codex approval posture that a t3code spawn already refuses, but the refusal named config/codex-approval-mode. Name the setting that produced the posture, document the limit beside the restricted mode, and cover the refusal. * no-mistakes(document): Name T3's Codex restricted refusal in fm-spawn header --------- Co-authored-by: Bryce Eppler <eppler97@gmail.com>
…unchenguid#7705) A Windows/Git Bash home records its session in state/.lock as a tagged win:<pid>, and fm_session_pid_valid owns whether a lock value is a usable identity. Several readers still decided that with a private numeric test, so a correctly locked Windows home read as malformed: - bin/fm-turnend-guard-cursor.sh (kunchenguid#4535): the owner check, the stale-owner reclaim fallback, and the owner read before parking. The Cursor park now recognizes its own tagged lock and reclaims a dead tagged holder's lock; liveness was already answered by fm_harness_pid_alive. - fm_extension_pair_owns_supervision in bin/fm-wake-lib.sh (kunchenguid#4539): a live tagged session read as dead, which printed the supervision-off banner during a healthy Pi extension hand-off. A win:-shaped value now loads the session-lock library and is answered by fm_session_pid_valid and fm_harness_pid_alive; a POSIX value keeps the existing kill -0 test. - The three .pi/extensions lock readers (kunchenguid#4539): on win32 only, a strict win:<digits> value is compared and probed by its digits, because native Node sees Windows pids directly. pid 1 stays rejected, and the branch extension keeps the tagged value whole for its lease holder. Malformed tags, and any tag off Windows, are still rejected. Regressions cover each reader with a faked Windows process table or platform, so they run on every host.
…7489) * Accept GitHub Enterprise pull request URLs fm_pr_url_parse accepted a GitHub pull request URL only on github.com and hard-set the recorded host, so a task PR on GitHub Enterprise (Cloud *.ghe.com or Enterprise Server) could not be registered, watched for merge, merged, or read back after a merge. A GitHub URL now carries its host like the GitLab, Gerrit, and Forgejo identities already do, with GitHub's owner and repository rules unchanged. github.com needs no configuration and behaves exactly as before. Any other host is accepted only when this home names it in config/github-hosts, because a URL shape cannot tell a real GitHub host from a look-alike such as github.1485827954.workers.dev.evil; only an exact line match authorizes, so comments and malformed lines allow nothing. The parsed host is then carried to every forge call on those paths as GH_HOST, which gh and gh-axi both honor: registration, the static merge poll, the merge command and its pre-merge reads, the merge-outcome read, the teardown read, and the crew-state PR state read. github.com exports nothing and keeps its ambient behavior. Backlog PR links still need the companion tasks-axi change, because that package validates the URL itself. * no-mistakes(review): Fix default-home Enterprise host configuration lookup * no-mistakes(document): Clarify GitHub Enterprise host configuration documentation * no-mistakes(ci): Captain, fixed the CI lint failure with three scoped ShellCheck comment lines in tests/fm-pr-check-security.test.sh. Canonical lint, the complete behavioral suite, and git diff --check pass. Full CI partition rerun remains with the outer executor
…nsitive tests (kunchenguid#7632) test_signal_catchup_without_running_watcher now starts each run's deadline only after the launched watcher holds its singleton lock, through a bounded wait_for_watcher_lock helper that still fails and stops a watcher that never takes its lock. The remaining run (one poll cycle plus the fixed signal grace) gets a finite bound sized from contention measurements; with heartbeat and checks disabled, a watcher that misses the catch-up never exits, so it still fails. test_owner_mutex_contention_preserves_failure_episode_reset now ends its reset-boundary wait on the arm handshake or the hook's own exit, failing at once with the hook's status and output when it dies before the boundary, and keeps a generous finite bound for a hook that stalls. All behavioral assertions are unchanged; no production file changes. Fixes kunchenguid#6678
…unchenguid#7167) * feat(bin): add Cortex Code as a verified crewmate and scout harness Adds the cortex adapter (Snowflake Cortex Code) for crewmate and scout work alongside the existing verified adapters, on the tmux and herdr backends. Herdr reads Cortex's titled composer lazily: it declares cortex=ask and the shared classifier answers need-identity only for a titled rounded glyph box, so panes that never show one make no extra agent get call. * no-mistakes(document): List paseo in Cortex backend-refusal docs * docs(cortex): list rex and t3code among refused backends
…chenguid#7731) * fix(supervision): acknowledge opt-in host hand-backs When the attended supervision host hands responsibility back to the main conversation, at the park boundary or on a main-only pass-through, it left no watcher that outlived a lost continuation, so a home could stay unsupervised with no alarm. With config/supervision-handoff-ack present, a Claude host hand-back now queues a token-bound check and starts a verified, home-scoped successor (bin/fm-supervision-handoff.sh). The successor keeps replacing closed watcher cycles and raises the hand-back again until the main conversation acknowledges it through the sequence-bound wake drain. Automatic retry delivery needs a verified tmux pane; other terminals keep watching and wait for a normal turn. The behavior is off unless the flag exists, so the default hand-back paths are unchanged. * no-mistakes(test): log host rows before the acknowledged hand-back * no-mistakes(document): document acknowledged hand-back flag, state files, retry knob * no-mistakes(ci): Fixed the test race in tests/fm-supervision-host.test.sh (test_acknowledged_handoff_at_the_turn_keeps_the_pass_through_row), the only failure in "Behavior portable serial 1". Invariant: after an acknowledged hand-back at the turn, a live watcher must exist, but the owner replaces the stopped successor arm only within its one-second poll, so a one-shot watcher_live read at the hand-back instant can observe the gap. The sibling lost-continuation cases already wait for the owner's replacement, so this was the one remaining one-shot site on the hand-back path. Change, per the user's instruction: the assertion is now `wait_until 150 watcher_live "$home" || fail "ack turns-main-only: the hand-back left no watcher: $(cat "$home/state/.watch-cycle-exits.log")"`, and the timed-out agent's comment is cut to two lines saying the owner replaces the stopped arm within its poll, with no date. Nothing else changed (diff: 4 insertions, 2 deletions in that one file). Verification: ran the four hand-back tests (lost boundary, lost pass-through, acknowledged at the turn, retry respects receiving pane) via a temporary reduced copy three times, all passed with exit 0 each time; shellcheck -x on the test file passes. A full-file run and an 8-iteration reproduction loop with the original one-shot assertion were started but stopped before completing when the structured result was demanded; the three repro iterations that finished passed locally, so the race was not reproduced on this host (it depends on the owner poll timing CI hit). Temporary copies were removed; the worktree contains only the one modified test file, uncommitted
…guid#7738) * feat(bin): pin a local omp secondmate to its own omp profile Add the opt-in config/secondmate-accounts/<id>/omp-profile file in the primary home. When present, that local secondmate's omp agent launches with --profile <name> and its pre-launch catalog check reads the same profile; the pin is recorded as omp_profile= in the task record and on the spawned line. A malformed file refuses before any endpoint, local copy, or record exists, and a relaunch checks it before stopping the running agent. An absent file leaves every launch unchanged. * no-mistakes(document): Document optional omp --profile flag in omp adapter reference * no-mistakes(review): Reject Windows reserved device names in omp profile pins
…e host's grant (kunchenguid#7265) * fix(wake): pin TZ in the process-table pid identity fm_pid_identity's ps fallback (macOS, or any host without /proc) renders lstart in local time. A supervision engine launched through a wrapper that exports a different TZ than the host's hook environment read the host's branch-grant owner identity as a different process, so its drain discarded the grant as stale and refused. The engine reported but could never acknowledge its granted rows, and the host handed nearly every wake to main. Pin TZ=UTC0 alongside the existing LC_ALL and COLUMNS pins, and pin the same zone in fm-extension.mjs's pidIdentity, which compares identities the bash helper writes. Add a host regression test that runs the engine in another time zone than the host on the process-table path. * no-mistakes(review): Document TZ-pin identity upgrade-window residual * no-mistakes(document): Note TZ pid-identity upgrade residual in turnend-guard doc
…id#7728) Rex's process view reports a block's foreground process and its ancestors only. A login shell that starts the harness through a wrapper in its own process group (a fish function, a bash shim) stays the reported foreground, so a live worker read as dead: steering was refused, relaunch could not confirm the running agent, and the watcher raised stale wakes. Before calling a shell foreground dead, walk its live descendants through the shared agent classifier, and trust OSC 7501 records from a harness found there under the same rule.
…unchenguid#7536) * feat(backends): add experimental tern runtime backend * docs(backends): document tern setup and verification limits * no-mistakes(review): Refuse tern kill when task tab was renamed * no-mistakes(test): Treat tern shell --rcfile/--init-file values as option arguments * no-mistakes(document): Document tern endpoint-close refusal for renamed task tabs * fix(tern): project safe fields before reading Carly answers * fix(backends): make tern explicit-only Tern is selected only by `--backend tern`, `FM_BACKEND=tern`, or `config/backend`; runtime auto-detection no longer routes a spawn into it. TERM_PROGRAM=tern and TERN_PANE reach every descendant process of a Tern block, including a tmux server or Herdr client started inside it, so an inherited marker never proves the captain chose Tern. - bin/fm-backend.sh: drop the tern arm from fm_backend_detect and the auto-detected tern NOTICE from fm_backend_name, which became unreachable with the arm. - Replace the tern detect-precedence and auto-detect-notice tests with test_backend_tern_is_never_autodetected, mirroring the Paseo case, and drop the Tern-marker unsets that only guarded detection hermeticity. - docs/tern-backend.md: replace "Runtime detection" with "Selection is explicit"; fm-spawn.sh and adapter headers, architecture, configuration, README, and the operational-home-layout skill now list tern beside zellij, orca, and Paseo as never auto-detected. * no-mistakes(review): Read tern surface capture JSON text; fix TERM_PROGRAM doc * no-mistakes(review): Narrow tern Carly projection; name rex as supervisor backend * no-mistakes(review): Name tern in Command Code backend refusal comment
…nguid#7729) A fleet pane already carries GIT_CONFIG core.hooksPath, and the suite's cases set the Git config they assert on themselves, so unset GIT_CONFIG_COUNT, GIT_CONFIG_KEY_0, GIT_CONFIG_VALUE_0 and GIT_CONFIG_PARAMETERS at the top as the sibling suites do.
… wait (kunchenguid#7740) * fix(bin): stop a watcher promptly when a stop lands in its event wait On bash 3.2 a TERM is held until a running command substitution's child exits. The watcher's push-backend event wait ran as rec=$(...) and blocks for up to POLL, so a supervision-host take-over that landed there could not confirm the stop within its 5s bound. The unconfirmed take-over skipped restoring main's acknowledgement, the stopped watcher's close minted a fresh downtime generation, and the next watcher announced it as check: rearm-resurface with nothing queued, repeating every ~30s. Run the event wait through the same waited background process group the pane reads already use (watcher_capture, generalized to watcher_waited). The helper's own setup failures now return 2, which the event wait reads as an unusable event path rather than a full-budget wait. Because a stop now kills the wait before its own cleanup, the wait gets a watcher-owned scratch TMPDIR that the watcher removes after each wait and on exit, and the cleanup's group stop is silenced so bash's job-termination notice does not reach the arm's output. Add a fm-watch-arm regression case that takes over a watcher inside its herdr event wait and asserts a confirmed take-over, an unchanged acknowledged marker, a quiet fresh cycle, and no leftover wait scratch. Make the event-wait unit case assert the capability flag outside the wait, since the wait now runs in its own process. * no-mistakes(test): Raise event-wait take-over regression POLL so it fails on base * no-mistakes(document): Document event-wait stop handling in watcher continuity --------- Co-authored-by: vatsa <pashupati@vatsa.lan>
…ee (kunchenguid#7752) The EXIT trap removed the fixture root with a plain rm -rf. When the run stops early, for example when the watcher auto-relaunch leg fails, the fixture still holds the read-only state/<id>.git-hooks strip folder, so cleanup prints "Permission denied" for each hook, leaves the fixture root behind and exits non-zero. Use the shared fm_test_remove_tree, which makes read-only fixture directories writable before it removes them. Refs kunchenguid#7629
* feat(bin): add allowlisted live record sync * feat(bin): archive teardown records by generation * feat(bin): export task records before teardown * docs: define the private record export contract * fix(bin): satisfy ShellCheck in the record exporter and its test * fix(bin): publish record exports as safe snapshots * fix(bin): make record archives transactional * fix(bin): fail closed on record export teardown * fix(bin): harden record export transactions * fix(bin): prevent record export staging wedges * no-mistakes(review): Archive task records before irreversible teardown cleanup * no-mistakes(review): Archive records after endpoint quiescence * no-mistakes(document): Consolidate record export architecture documentation * no-mistakes(ci): [Certain] Fixed both CI issues: quoted the remote-home test fixture assignment to clear ShellCheck, and added the missing `spawn_gen` to the export-enabled remote retirement fixture so the expected lost-slot exit code is preserved. ShellCheck, `git diff --check`, and the focused remote-home export test passed. The full lifecycle E2E was blocked locally by an earlier fixture failure (`remote spawn never reached its blocked inheritance write`); CI’s log identified the later failure this fixture correction addresses * no-mistakes(ci): [Certain] Fixed the fixture to replace any existing `spawn_gen` field before setting `remote-retirement-test`, preserving the exporter’s exactly-one-generation invariant. `git diff --check` passed. The full remote lifecycle test could not reach this scenario: it failed earlier at “remote spawn never reached its blocked inheritance write,” and cleanup reported permission errors on generated git-hook files * no-mistakes(ci): [Certain] Fixed the fixture race in `tests/fm-remote-secondmate-lifecycle-e2e.test.sh`: it now pins `spawn_gen` after the blocked respawn finishes publishing metadata, so the exporter receives exactly one generation key. `bash -n` and `git diff --check` passed. The full E2E remains blocked by an earlier failure to reach the blocked inheritance write, followed by cleanup permission errors; it did not reach the corrected assertion, captain * no-mistakes(ci): [Certain] Fixed `teardown_export_records` to return before config-directory safety checks when `record-export-root` is absent, and added a regression test for an unopted home with symlinked `config/`. The regression passed. The full teardown suite stopped in its existing inaccessible-config case: this environment runs as root, which can read the chmod-000 directory, so that case cannot reproduce its expected refusal here. `bash -n` and `git diff --check` passed; `fm-lint.sh` was blocked because `actionlint` is unavailable. The CI log shows steady test progress followed by GitHub cancelling the job and cleaning up orphan processes, with no reported test failure; treat it as provider cancellation and let the fresh push rerun it * no-mistakes(ci): [Certain] Updated the teardown test fixtures: a regular file at the export-root path now deterministically causes export failure, and a symlinked config directory tests the opted-in safety refusal across users, including root. The unopted symlinked-config regression remains intact. The relevant teardown cases passed; `bash -n` and `git diff --check` passed. The full suite later failed an unrelated leaked-process-reap case. Serial 1 was cancelled without a verdict and, per the provided instruction, needs no code change
…is warm (kunchenguid#7807) * feat(bin): add opt-in warm-cache compaction for the Claude primary and host engine Refs kunchenguid#7755 * no-mistakes(review): Persist engine compaction marker, run it abortable, match resume predicate * no-mistakes(review): Run engine compaction in host shell; skip marker on abandon * no-mistakes(review): Test abandoned engine compaction is not marked done * no-mistakes(document): Clarify warm-compact episode and engine resume rules * no-mistakes(lint): Fix ShellCheck SC2015 in engine compaction marker * no-mistakes(ci): Test coverage guard and portable parallel 2 failed because the two new warm-compact tests had no timing hint. The runner packed them at the 45000 ms default, pushing the largest serial shard to 1204066 ms, over the 1200000 ms limit. I added measured hints in bin/fm-test-run.sh (fm-warm-compact.test.sh 1500, fm-warm-compact-herdr-live-e2e.test.sh 170). `bin/fm-test-run.sh --check-coverage` now passes (largest serial shard 1194253 ms), and tests/fm-supervision-instructions.test.sh passes. A full run of tests/fm-test-run.test.sh was killed at its time limit and did not finish, so it is unverified. The serial-shard failures in the logs were watcher/timing tests unrelated to warm-compact. I did not reproduce them locally. main also has a failing run. They need a rerun, not a code change
…7810) * refuse remote Rex servers during spawn * no-mistakes(document): Clarify Rex locality requirements and remote-worker guidance
* fix(bin): read a Windows win:<pid> session lock in the supervision host and Claude auto-arm On Git Bash the session lock records its holder as a tagged win:<pid> (kunchenguid#6300), but four readers still passed that value to the numeric-only fm_pid_identity and fm_pid_alive: fm_supervision_host_main_key produced no key, fm_autoarm_claim_next pinned no lock-holder identity and dropped owner_session_id, fm_autoarm_claim_open rejected the non-numeric lock so a live claim never read as open, and fm_autoarm_midturn_healthy read a live holder as lapsed. Add fm_session_pid_alive and fm_session_pid_identity beside the tagged-pid contract in fm-session-lock-lib.sh. A tagged pid is answered from the Windows process table; every other value falls straight through to the existing numeric helpers, so POSIX behaviour is unchanged. The claim read-back checks the lock shape with fm_session_pid_valid. tests/fm-session-lock-windows-consumers.test.sh covers each reader on a faked Git Bash host, including an exited holder, a reissued Windows pid, and the tag off Windows, plus a parity case proving untagged values get exactly the numeric helpers' answers. Fixes kunchenguid#7739 * no-mistakes(document): Document tagged Windows session-lock consumers * no-mistakes(ci): Fixed tests/fm-afk-return.test.sh partial host fixtures to copy fm-session-lock-lib.sh alongside fm-supervision-engine-lib.sh in all three affected paths. The focused host/latch tests and tests/fm-session-lock-windows-consumers.test.sh pass; the full afk-return suite exceeded the 180s local timeout after earlier cases passed
…ation check is not caused by the code and needs no change. I ran the coverage guard and ShellCheck locally. I did not re-run the Behavior shards or the Lint job. A local run of `tests/fm-test-run.test.sh` was stopped at its background time limit, so I have no result for it. - **Lint 1, Behavior portable parallel 2, Behavior portable serial 7:** one cause. The upstream merge dropped the fork's `watch_start=$SECONDS` assignment in `tests/fm-remote-secondmate-lifecycle-e2e.test.sh`, which ShellCheck flagged as SC2154. A lint self-test in parallel 2 failed on that code. The unset variable most likely also aborted the e2e script under `set -u` in serial 7, though the log shows no explicit error. I restored the assignment, and a local ShellCheck of the file reports no SC2154. - **Behavior portable serial 3:** the watcher-resurface wait in `tests/fm-supervision-host.test.sh` (`park_after_stop`) timed out at 15 s on a slow runner, although the resurface arrived just after. I raised the wait to 60 s. I did not reproduce the slow runner locally. - **Test coverage guard:** 41 of 269 serial scripts had no duration hint, over the 15% limit. I added measured hints for all 41 from this run's timing artifacts to `portable_serial_weight_hints` in `bin/fm-test-run.sh`. `bin/fm-test-run.sh --check-coverage` now passes with `serial_unhinted=0`. Four existing hint lines moved only because the table is now sorted. - **PR must be raised via no-mistakes:** it failed because the pipeline attestation shows the `test` step as `skipped`, which this repo does not accept. No code change fixes that. It should pass once the pipeline completes `test` on the new head
…rvision-host.test.sh`, but the full script and the CI shard have not been re-run. The last round's 60 s wait raise did not fix it, because the real failure was elsewhere. The CI log shows `test_return_during_an_engine_turn_hands_its_outcomes_to_main` ("return: the host did not hand the late outcome to main") timing out. Its wait is 250 polls of 0.1 s, and the runner is sys-heavy and slow. Earlier cases in the log, including the one fixed last round, now passed. The invariant is that a wait in this suite must only bound a real hang, not a wake that is merely late on a slow runner. I fixed it at the one shared boundary, `wait_until`. It now scales every poll limit by 4, and the failure messages still fire on a real hang. I reverted last round's one-off 600 in `park_after_stop` to 150, since the shared scaling covers it. Every `wait_until` caller in the file is a `|| fail`, so scaling can't change a passing path. I ran the failing case locally and it passes. ShellCheck on the file reports only the file's existing include note (SC1091), nothing new. PR must be raised via no-mistakes: no code change is warranted. The pipeline attestation shows the `test` step as `skipped`, which this repo rejects. It does not depend on the code. It should pass once the pipeline completes `test` on the new head
Owner
Author
|
Live jcode end-to-end suites run on head d6c439a from a clean checkout against the real shared jcode daemon (claude-sonnet-5-5): fm-jcode-native-live-e2e 9/9 ok, fm-jcode-signals-live-e2e 8/8 ok, fm-jcode-secondmate-live-e2e 10/10 ok, fm-afk-jcode-live-e2e 1/1 ok. The required attestation check stays red only because the pipeline test step was skipped. |
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
Check the updates in the upstream firstmate project and merge or port them to our current fork (github.com/fbdo/firstmate), without losing our work so far for jcode compatibility.
What Changed
kunchenguid/firstmatemain into the fork. This adds the new runtime backends (paseo,rex,t3code,tern), a Cortex harness adapter, OpenCode 2 plugin support, and new helpers (fm-capacity,fm-usage-warner,fm-pr-health,fm-record-export,fm-approval-failover,fm-warm-compact-lib,fm-supervision-handoff). The matching docs, skills and tests came with them.decision-hold-lifecyclewas removed.Risk Assessment
Testing
The earlier run reported that the 10 jcode suites passed, that no conflict markers remained and that no jcode files were dropped. The suites use fake backends and the other check is static, so neither was a live run against the product. The live jcode end-to-end suite was not run because it is opt-in and needs a real model login. I did not run the full repository test suite.
Evidence: jcode test results
Source: jcode test results
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
⏭️ **Test** - skipped
bash tests/fm-jcode-{api,backend,brief,harness,keeper,native-spawn,secondmate,subagents,usage,viewer}.test.sh(reported passing, against fake backends, not live)git grepfor conflict markers (none reported, static check)Check that every jcode-named file in the base commit still exists (none missing, static check)bash tests/fm-jcode-native-live-e2e.test.sh(skipped, opt-in)✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Upstream sync summary
kunchenguid/firstmatemain, 78 upstream commits since merge base 45dd50a, against 40 fork commits.fm-backend.sh), control (fm-control-lib.sh), crew state, busy, harness, bootstrap, supervision engine, config inheritance: jcode added back next to paseo, rex, t3code, tern and cortex.jcode-apisupervisor backend kept.cdrule is rule 8, fork decide-and-move is rule 9 (test updated).fm-supervision-host.test.shwas replaced by the fork's split hints.Evidence requested for the skipped live-validation finding
git grep -nE "^(<<<<<<<|=======|>>>>>>>)( |$)"on the head is empty.jcodeon fork main (origin/main) still exist on the head, none missing.Also passing: fm-control, fm-bootstrap, fm-harness-precedence, fm-crew-state.
fm-briefhas one failing case ("metacharacter prefix") that fails the same way on fork main. The linter step only reported a ShellCheck 0.10.0 vs pinned 0.11.0 mismatch on the pipeline host.