Repository navigation
feat: merge upstream harness-aware supervision, dispatch profiles, and fleet tooling - #6
Merged
Merged
Conversation
…-governance section (kunchenguid#307) * Encode project AGENTS authoring bar * no-mistakes(review): Captain, centralize CLAUDE promotion governance * no-mistakes(review): make ensure_maintenance_section idempotent-success, drop || true guards * no-mistakes(review): separate appended maintenance section on newline-less CLAUDE.md promotion * no-mistakes(review): assert maintenance heading present before separator check in test * no-mistakes(document): sync docs with AGENTS.md authoring bar and self-governance --------- Co-authored-by: fmtest <fmtest@example.invalid>
…chenguid#300) * Add captain-invocable bearings skill Generates a pick-up-where-I-left-off status report from live fleet state to data/status-report-<YYYY-MM-DD>.md plus a concise chat summary. Read-mostly procedure: reads backlog, per-task crew state via bin/fm-crew-state.sh, open PRs via gh-axi, scout reports, pending decisions, and date-gated queued work; composes the exemplar's sections (TL;DR, Check first, Landed, In flight, Plans, Decisions pending, Date-gated/queued); never tears down, merges, or mutates task state as a side effect. * no-mistakes(document): docs: list new /bearings skill in README built-in skills table
* fix(watcher): pin LC_ALL=C in fm_pid_identity for locale-invariant identity ps's lstart date format follows the caller's LC_TIME/LC_ALL. The watcher records its process identity under one locale, but arm/guard/turn-end re-read it under the machine's ambient locale. On a non-C locale (e.g. ko_KR) the two strings differ only in the date portion, so fm_watcher_lock_matches_pid / fm_watcher_healthy reject a genuinely live watcher - breaking fm-watch-arm.sh, fm-guard.sh, and fm-turnend-guard.sh on every non-C-locale machine. Pin LC_ALL=C on that one ps call so the write and read sides agree regardless of machine locale, matching the LC_ALL=C determinism the file already uses elsewhere. Add a colocated regression test asserting fm_pid_identity is locale-invariant across exported LC_ALL/LC_TIME. * no-mistakes(document): Document watcher PID identity coverage
* docs: reconcile Codex App backend contract * no-mistakes(document): Sync backend docs * docs: clarify Codex Desktop bridge blocker * no-mistakes(document): Align Codex App backend docs * no-mistakes(test): Captain, stabilize watcher self-eviction test cadence * no-mistakes(document): Document Codex App backend contract * no-mistakes(document): Captain, document blocked codex-app coverage * docs: make Codex App contract doc authoritative * no-mistakes(document): Align Codex App backend docs * docs: redact local Codex App smoke paths --------- Co-authored-by: Stephen Brouhard <vesta@stephens-macbook-air.tail2122af.ts.net>
* docs: add Codex App coordination skill * no-mistakes(review): Captain, mark Codex App skill agent-only * no-mistakes(document): Document Codex App backend boundary * no-mistakes(document): Captain, document Codex Desktop backend boundary * no-mistakes(lint): Captain, lint clean * no-mistakes(document): Document Codex Desktop boundaries * docs: narrow Codex App skill playbook
* fix(afk): recognize unbordered herdr composer rows to stop escalation redelivery loop fm_backend_herdr_composer_state only recognized bordered composer rows (the grok shape). Real claude and codex render their live input row with no border at all, so once a harness's own startup banner scrolled out of the capture window the classifier read the composer as unknown forever. fm_backend_herdr_send_text_submit never confirmed "empty", so escalate_flush never cleared state/.subsuper-escalations, and the away-mode daemon retyped and resubmitted the same buffered digest every housekeeping cycle - reproduced live against a real herdr+claude pane (5+ identical deliveries in 40s). The classifier now recognizes an unbordered (bare) composer row led by a known prompt glyph alongside the existing bordered shape, keeping whichever match is bottom-most so a stale decorative box never outranks the live composer. * no-mistakes(review): Narrow herdr bare prompt matcher * no-mistakes(document): Sync herdr composer docs
…guid#323) * fix(herdr): confirm message submit via native agent-state, not composer text fm_backend_herdr_send_text_submit now confirms a landed submit by polling herdr's own agent-state (agent get) for the idle->working transition instead of reading composer content. Composer scraping remains, unchanged, for the away-mode daemon's pre-injection empty-box guard only. This fixes the practical effect of the codex idle-tip gap from the 2026-07-07 incident: codex's dynamic idle-composer hint text can no longer misread as pending and block/mis-confirm a send, since confirmation no longer looks at composer text at all. Verified empirically against real claude and codex agents (timing, swallowed-Enter, unreadable-target, and already-busy-target scenarios), and against the real away-mode daemon end-to-end after updating its synthetic supervisor-pane test fixture to register itself as a real herdr agent (herdr's own report-agent primitive) so it can still exercise the new confirmation path. * no-mistakes(review): Captain, harden herdr submit confirmation * no-mistakes(review): Captain, harden herdr submit confirmation * no-mistakes(document): Sync Herdr submit docs * no-mistakes: apply CI fixes
* Add quota-balanced dispatch selection * no-mistakes(document): Document dispatch selector guidance
* fix(session-start): deterministically respawn dead-shell secondmates A secondmate agent that exits leaves its backend pane alive as a bare shell. The session-start endpoint check only verified pane presence, so recovery and the watcher (which exempts secondmates from stale-pane detection) never noticed - evidence 2026-07-07: every secondmate in one fleet was found sitting at a dead zsh shell. Add fm_backend_agent_alive (bin/fm-backend.sh), a deeper per-backend liveness probe distinct from pane presence: fm_backend_tmux_agent_alive classifies the pane's live foreground process via tmux's own pane_current_command, and fm_backend_herdr_agent_alive reuses the already-verified pane_agent_state husk classifier. Both are conservative: anything ambiguous reports unknown, never a false dead. Wire this into a new session-start-only, locked-and-primary-only sweep in bin/fm-bootstrap.sh that kills and respawns only a confidently dead secondmate endpoint, leaving alive/unknown readings untouched - idempotent by construction, so repeated runs converge without duplicating agents. * no-mistakes(review): Guard raw secondmate liveness respawns * no-mistakes(review): Fix detect-only bootstrap test * no-mistakes(test): Pin liveness fixture harness * no-mistakes(document): Sync secondmate liveness docs * no-mistakes: apply CI fixes
* Fix NUDGE_SECONDMATES to print stable fm-<id> selectors. Session-start secondmate sync used to accumulate raw backend window targets into NUDGE_SECONDMATES, but the liveness sweep in the same bootstrap run can respawn secondmates onto new endpoints. fm-send with those stale explicit targets bypasses meta resolution and fails, while fm-<id> resolves correctly. Accumulate fm-<id> in process_secondmate, update the bootstrap/update contracts and /updatefirstmate skill, and add a herdr respawn regression test. * no-mistakes(review): Captain, guard herdr regression jq dependency * no-mistakes(document): Document stable secondmate nudge selectors * no-mistakes(lint): Fix shell lint hints
* Make tasks-axi and quota-axi required bootstrap tools Add both to the normal toolchain checks alongside lavish-axi, keep the tasks-axi 0.1.1+ compatibility gate, and report quota-axi through the standard MISSING install-consent flow. TASKS_AXI: available remains a backlog-backend capability signal only; manual opt-out no longer suppresses the missing-tool report. Update bootstrap tests and point docs/configuration.md at the canonical toolchain contract. * no-mistakes(review): Clarify manual backlog bootstrap reporting * no-mistakes(document): Document bootstrap AXI tools
Replace overwrite-in-place wording with explicit delete-then-create instructions so agents do not modify an existing daily report file.
* Add primary turn-end guards for all harnesses * no-mistakes(review): Normalize Codex hook cwd resolution * no-mistakes(review): Fix OpenCode guard worktree anchoring * no-mistakes(review): Anchor Codex guard outside nested roots * no-mistakes(review): Anchor Codex guard to hook root * no-mistakes(review): Avoid Grok permission escalation * no-mistakes(document): Sync turn-end guard docs
* fix backend selector task id resolution * no-mistakes(document): Document selector resolution behavior
* fix bootstrap fleet sync timeout * no-mistakes(review): Fix bootstrap fleet-sync timeout regressions * no-mistakes(document): Sync bootstrap timeout docs * no-mistakes(lint): Clean ShellCheck directives * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes
* Add fleet snapshot and view * no-mistakes(review): Fix fleet snapshot parsing and overrides * no-mistakes(review): Fix secondmate fleet rendering * no-mistakes(review): Fix backlog title and completion parsing * no-mistakes(review): Include durable scout reports * no-mistakes(review): Fix fleet snapshot edge cases * no-mistakes(review): Captain: gate fleet hints on current state * no-mistakes(review): Captain: parse bracketed Done PR artifacts * no-mistakes(document): Sync fleet snapshot docs
* Make fm-send fail loudly on unresolved targets * no-mistakes(review): Document fm-send FM_HOME contract * Fix fm-send readiness docs and backend send path * Fix fm-send docs for cmux and X skill metadata * Make gotmp teardown test home-explicit * Scope watcher warning wording to fm-send * Fix fm-send review findings * Verify explicit tmux targets before sending * Isolate turnend guard test home * no-mistakes(document): Documented fm-send FM_HOME/backend guard additions missing from doc inventories --------- Co-authored-by: mielyemitchell <249051873+mielyemitchell@users.noreply.github.com>
* fix afk codex ghost composer delivery * no-mistakes(review): Harden AFK startup flag writes * no-mistakes(review): Harden AFK daemon liveness checks * no-mistakes(document): Sync AFK herdr docs * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes
* Add harness-aware supervision * no-mistakes(review): Captain, harden watcher supervision regressions * no-mistakes(review): Captain, harden watcher supervision cadence * no-mistakes(review): Harden watcher supervision ownership * no-mistakes(review): Captain, harden Pi extension marker * no-mistakes(review): Captain, harden Pi supervision restart checks * no-mistakes(review): Harden watcher ownership checks * no-mistakes(review): Captain, harden Pi supervision loading * no-mistakes(review): Captain, require Pi guard extension loading * no-mistakes(review): Captain, harden watcher supervision recovery * no-mistakes(test): Fix fm-send baseline log filtering * no-mistakes(document): Sync harness supervision docs * no-mistakes: apply CI fixes
* fix: make x replies split by platform * no-mistakes(review): Captain: preserve Discord recovery relink context * no-mistakes(test): Captain: keep split markers outside fences * no-mistakes(document): Sync X-mode reply docs
* docs: make stow inspect-then-update * no-mistakes(review): Remove unsupported archive-body guidance * no-mistakes(review): Clarify stow read-before-write exception * no-mistakes(test): Require archive-body for stow task notes * no-mistakes(document): Sync stow memory docs * no-mistakes(lint): Silence ShellCheck source warning
…d#375) * fix: attach-and-wait when arm finds a healthy watcher Grok and Claude re-arm after every turn with work in flight. When a watcher was already healthy, fm-watch-arm exited immediately with watcher: healthy, which completed the harness background task and injected an empty false wake. Attach to the live identity-matched holder instead, stay until that cycle ends, then exit 0 so notify fires for a real end-of-cycle. The peer-startup-race path uses the same contract. --restart and the started path are unchanged. * no-mistakes(review): Gate restart watcher peer attach * no-mistakes(document): Sync watcher arm docs
* docs(readme): reformat Quick Start and recommend Grok equally with Claude Code * no-mistakes(review): Captain: align harness launch guidance * no-mistakes(review): Captain, clarify Pi supervised launch * no-mistakes(review): Captain, document Pi first-launch bridge * feat(pi): track primary watcher extension for plain-pi launch Move Pi's primary watcher bridge from a generated state/ file to a tracked .pi/extensions/fm-primary-pi-watch.ts, matching how the turn-end guard extension already works: self-hashing version, project-local auto-discovery after one-time Pi trust. This drops the state/-generation step and dual -e requirement from the happy path, so Pi's Quick Start launch becomes plain 'pi', the same friction class as 'claude' and 'grok --trust'. - bin/fm-pi-watch-extension.sh is removed; nothing generates the extension anymore since it is committed. - fm-session-start.sh and fm-supervision-instructions.sh resolve the watcher extension path from FM_ROOT instead of state/, and the session-start diagnostic now points at restarting plain pi after trust, with -e as a documented fallback. - fm-spawn.sh points Pi secondmate launches at the tracked extension path in the secondmate home instead of generating a state/ copy. - README Quick Start Pi block is now just 'pi' plus a trust note. - Tests, docs, and the harness-adapters skill updated to match. * fix(pi): drop backticks from session-start diagnostic to satisfy shellcheck SC2016
* feat(supervision): add PreToolUse seatbelt against watcher-arm anti-patterns Adds bin/fm-arm-pretool-check.sh, a shared PreToolUse-style checker that denies a primary shell command backgrounding, piping, or bundling the watcher arm/checkpoint, or force-killing the watcher process broadly - the exact shapes that silently took Grok's supervision down. Wires it into all five verified harnesses (grok, claude, codex, opencode, pi), each validated empirically against the real harness. Also fixes a grok 0.2.93 regression discovered during that validation: the existing turnend-guard Stop hook's bare root variable broke grok's own variable pre-substitution and silently no-op'd the hook. * no-mistakes(review): Harden watcher arm validation * no-mistakes(review): Harden arm guard metacharacter checks * no-mistakes(review): Harden nested shell arm guard * fix(lint): rewrite SC2015 guards in fm-arm-pretool-check.sh as if/then A && B || C is not if-then-else; C can run when A is true. Replace both occurrences of the quote-state early-continue with an explicit if/then.
* fix Pi primary supervision lifecycle * no-mistakes(document): Synchronize Pi primary extension documentation
Resolution policy: take upstream wherever it shipped an equivalent (watcher-arm semantics, turn-end guard generalization, fm-send strict resolution, guard wording); keep fork-only work upstream lacks (stale-ack terminal parks, claude background-task working evidence, fire-time beacon re-stamp, packaged dual-review machinery, config/branch-prefix).
…d-pid healthy race
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.
This PR merges
upstream/main(kunchenguid/firstmate, 25 commits through80ecc8d) into the fork as a true merge commit (e627524) preserving upstream ancestry.Use "Create a merge commit". Squashing or rebasing discards the upstream parent and every future upstream merge will re-conflict on everything.
Conflict resolution summary
Policy (captain-set): wherever upstream shipped an equivalent, take upstream's version; keep fork changes only where upstream has no equivalent.
AGENTS.mdconfig/branch-prefixregistry line and beacon fire-re-stamp sentence (no upstream equivalents); took upstream's codex-app backend note,FM_HOME=promotion wording, and "supervision resume" liveness wordingCONTRIBUTING.mdbin/fm-guard.shbin/fm-promote.shFM_HOME=prefix + fork's branch-prefix parenthetical in the next-step hintbin/fm-watch.shwake()beacon re-stamp auto-merged intact (upstream has no equivalent)docs/architecture.mdfm-afk-start, and liveness-probe sentences; branch-prefix stays in the inheritable-config list (matches merged code)docs/scripts.mdtests/fm-brief.test.shFork features verified fork-only and kept: stale-ack terminal parks, claude background-task working evidence, fire-time beacon re-stamp, dual-review machinery (
crew/review/,bin/fm-review-launch.sh, no-GitHub-posting prompts),config/branch-prefix.Fork versions dropped for upstream equivalents: watcher-arm semantics (kunchenguid#375/kunchenguid#387/kunchenguid#397), turn-end guard generalization (kunchenguid#339), harness-aware supervision (kunchenguid#367), fm-send strict resolution (kunchenguid#254), ensure-agents-md self-governance (kunchenguid#307).
Deferred findings (captain decision, 2026-07-09)
Pipeline review found 12 actionable findings, all in upstream-authored code. Two operationally serious ones were fixed in this PR (herdr secondmate false-respawn, watch-arm
--restartfalse-healthy race — see Review details below). The remaining 7 auto-fix findings and 3 ask-user findings (pretool-hook overbreadth, OpenCode plugin session scoping, x-link legacy relink) are deferred with no action here to keep the merge minimal; the pretool-hook overbreadth becomes a separate firstmate follow-up task. Full text of every deferred finding is in the Review details below.What Changed
upstream/maininto the fork, bringing in the upstream feature set: harness-aware supervision with per-harness turn-end guards and watch-arm seatbelt hooks for claude/codex/opencode/pi/grok (bin/fm-supervision-instructions.sh,bin/fm-arm-pretool-check.sh,bin/fm-turnend-guard.sh, plus.claude/.codex/.grok/.opencode/.pihook wiring), quota-balanced crew dispatch (bin/fm-dispatch-select.sh), fleet snapshot/view commands (bin/fm-fleet-snapshot.sh,bin/fm-fleet-view.sh), a bootstrap secondmate liveness sweep with conservative respawn, fail-closedfm-sendtarget resolution, per-platform X-mode reply splitting, herdr AFK escalation delivery and native-agent submit confirmation, and the bearings and codex-app skills.no-agentdowngrades to unknown for unverified harnesses, so live pi/grok/opencode secondmates are never killed), andfm-watch-arm.sh --restartno longer reportshealthyoff a just-TERM'd watcher pid — it polls to the deadline and reports FAILED instead of leaving supervision silently down.Risk Assessment
✅ Low: The only new change is a small, well-commented fix commit that correctly implements both captain-approved fixes with extended colocated tests, shellcheck-clean scripts, and no behavior changes outside the two findings' scope; all other diff content was reviewed and triaged in round 1.
Testing
Completed 1 recorded test check.
Pipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-bootstrap.sh:287- The bootstrap secondmate liveness sweep can kill a LIVE secondmate on the herdr backend: the sweep's confident-dead gate (bin/fm-bootstrap.sh lines 287-296) whitelists harnesses claude|codex|opencode|pi|grok as trustworthy 'dead' verdicts, calibrated to the tmux classifier where dead means a bare shell. But herdr's classifier (bin/backends/herdr.sh lines 414-422) also maps 'no-agent' (pane exists, agent get -> agent_not_found) to 'dead', and docs/herdr-backend.md verifies herdr's native agent registration only for claude and codex. A live pi/grok/opencode secondmate on backend=herdr that herdr's agent detection does not register reads agent_not_found -> dead, so the sweep fm_backend_kill's the live agent mid-task and respawns a duplicate supervisor - exactly the failure the unknown-never-acts rule was designed to prevent. Key the confidence gate on backend-specific classifier coverage (downgrade herdr no-agent to unknown for harnesses without verified agent registration), not on harness alone.bin/fm-arm-pretool-check.sh:147- bin/fm-arm-pretool-check.sh is_relevant() (lines 147-153) matches any Bash command that merely MENTIONS fm-watch.sh/fm-watch-arm/fm-watch-checkpoint anywhere in its text - including as a git pathspec, grep target, or file argument - and then denies it if it contains any pipe, redirection, or multiple statements. Combined with .claude/settings.json registering the hook for every Bash call in every session in this worktree tree (no primary scoping, unlike fm-turnend-guard.sh), this denies legitimate read-only work: during this review session,git show <rev> --cc -- bin/fm-watch.sh | headandgit show ... -- bin/fm-watch.sh > /tmp/fwere both denied. Any crewmate or reviewer working ON the watcher scripts hits the same false positives. Consider requiring the pattern in command position rather than anywhere in the text, and/or scoping the hook out of crewmate/scout worktrees.bin/fm-fleet-snapshot.sh:389- bin/fm-fleet-snapshot.sh renders per-task action commands as barebin/fm-send.sh fm-<id> '<request>'(lines 389 and 394), and .agents/skills/firstmate-orca/SKILL.md line 54 instructs the same form, but fm-send.sh is now fail-closed on FM_HOME (bin/fm-send.sh lines 41-44) and refuses to run without it. A supervising agent copying the snapshot's own suggested steer command verbatim gets exit 1 'FM_HOME is not set'. Fail-closed and loud so nothing is misdelivered, but the tool's self-emitted guidance is broken as written - prependFM_HOME=<home>in the rendered commands.bin/backends/herdr.sh:706- bin/backends/herdr.sh's FM_BACKEND_HERDR_BARE_PROMPT_RE='^[❯›]' (line 706, used at line 726) is a multibyte bracket expression: under a C/POSIX locale (daemon or hook environments without LANG/LC_ALL) the bracket degrades to a byte set, matching any line whose first byte is 0xE2 - which includes every box-drawing glyph. A bordered composer's bottom border row can then be classified as a bare composer row with non-empty content -> 'pending', making fm-send's busy-baseline path and the away-mode daemon's pre-injection pane_input_pending guard read a permanently pending composer (swallowed-Enter errors, indefinite escalation deferral). Pin LC_ALL for the grep or use explicit alternation.bin/fm-watch-arm.sh:217- bin/fm-watch-arm.sh --restart can reportwatcher: healthy(exit 0) off a watcher that is about to die: the TERM sent to the old watcher is deferred by bash until its current foreground sleep returns (signal-grace 30s or poll 15s), which exceeds the restart path's 5s wait loop (lines 144-151). The fresh child sees the still-live lock holder and stands down, restart mode takes report_healthy (line 217) naming the TERM'd pid, and moments later the old watcher exits without firing - leaving no watcher despite a success report. Supervision is then silently down until fm-guard's beacon goes stale (up to 300s). Wait past the maximum foreground-sleep deferral, or verify the old pid actually exited before treating the surviving lock holder as healthy.bin/fm-arm-pretool-check.sh:311- bin/fm-arm-pretool-check.sh's is_piped_truncated (lines 311-313) only matches head/tail/timeout AFTER a pipe, so the natural prefix formtimeout 60 bin/fm-watch-arm.shis allowed (verified empirically: exit 0). timeout then kills the attach-and-wait mid-cycle and the wake is never delivered - exactly the early-teardown class docs/arm-pretool-check.md item 2 claims to deny. Also match prefix timeout/gtimeout on the arm statement.bin/fm-arm-pretool-check.sh:288- bin/fm-arm-pretool-check.sh's is_backgrounded (lines 288-294) recognizes only bare '&', nohup, and disown, socoproc bin/fm-watch-arm.shis allowed (verified: exit 0) despite being shell-level backgrounding that reproduces the founding incident verbatim (child reaped when the tool call ends, no watcher running). setsid -f is a sibling gap on Linux. Add coproc (and optionally setsid) to the backgrounding pattern..opencode/plugins/fm-primary-watch-arm.js:233- The OpenCode plugins act on ANY session.idle event and bind future wake prompts to whichever sessionID idled at arm time (.opencode/plugins/fm-primary-watch-arm.js lines 233-238 and 164/193-197; .opencode/plugins/fm-primary-turnend-guard.js lines 60-71): if a child/subagent session idles first, the arm binds to the subagent's sessionID and a watcher wake fired later is sent to the finished subagent session - the primary never sees it, while the fresh beacon makes the turn-end guard pass. Also skipNextIdle (fm-primary-turnend-guard.js line 7) is module-global, so a follow-up in one session suppresses the next guard run in whichever session idles next. Lower confidence (depends on whether OpenCode emits session.idle for child sessions), but nothing in the plugins filters for the main session - worth confirming against OpenCode's event semantics.bin/fm-x-link.sh:144- bin/fm-x-link.sh's relink path (--carry-ts, lines 144-147) now hard-fails with exit 2 when no platform context is resolvable. Links created BEFORE this merge have no x_platform/x_reply_max_chars in state/<id>.meta to carry, and the inbox payload is normally drained after answering, so stuck-crewmate recovery relinking a pre-upgrade X-linked task onto a successor now fails where it previously succeeded with the 280 default. Intentional and tested for new links, but there is no migration path for pre-existing links short of the operator guessing --carry-platform x --carry-max 280. Decide whether legacy links should default to the x/280 profile on relink.bin/backends/tmux.sh:44- bin/backends/tmux.sh's fm_backend_tmux_send_key runs a target-verification preflight (lines 44-45) whose exit status is never gated before the unconditional send-keys, so a dead target still gets the send attempt and tmux's error prints twice; net exit code is still nonzero because send-keys fails on the same missing target, so impact is cosmetic. Add|| return 1..pi/extensions/fm-primary-pi-watch.ts:107- .pi/extensions/fm-primary-pi-watch.ts lockOwnership() (line 107) returns 'missing' both when no state/.lock exists and when the recorded pid is dead, and startArm then reports 'session lock is held by another firstmate session' - false in the missing case, sending an operator hunting for a session that doesn't exist. Same predicate shape in .opencode/plugins/fm-primary-watch-arm.js lines 105-122 (status 'read-only'). Refusing to arm may be intended; the diagnostic wording is the defect.bin/fm-session-start.sh:186- bin/fm-session-start.sh line 186:QLEN=$(grep -c . "$STATE/.wake-queue" 2>/dev/null || printf '0')- when the wake-queue file contains only blank lines, grep -c prints 0 AND exits 1, so the fallback appends a second zero and QLEN becomes '0<newline>0', corrupting the read-only banner's record-count line. Edge case only (grep exits 1 exactly when the count is 0); use the grep output or drop the fallback duplication.bin/fm-watch.sh:568- Pre-existing in BOTH merge parents (not introduced by this branch), noted for follow-up: in bin/fm-watch.sh's stale path for a provably-working crew whose status log carries a leftover captain-relevant line, the wedge timer file is removed when the escalation fires (wedge_timer_check, line 295) but the terminal-override branch (lines 568-574) only consults the timer when it already exists, unlike the non-terminal branch (line 602) which self-heals it. Escalations 2..N never fire on that path and the documented demand-deep-inspection marker at FM_WEDGE_DEMAND_INSPECT_COUNT=3 is unreachable there; a permanently wedged validation pane escalates once and then goes quiet except for a single heartbeat backstop wake.bin/fm-classify-lib.sh:20- Full review coverage completed across four deep passes plus direct merge-seam inspection: no leftover conflict markers; all 16 conflicted files resolved both-sided with no dropped work in either direction (merge-base analysis); fork-kept features (stale_is_acked, claude background-task evidence, beacon re-stamp, branch-prefix, dual-review machinery) fully integrate with upstream symbols and formats; fm-send strict resolution, secondmate marker keying, herdr submit confirmation, dispatch quota selection (float-safe jq, never blocks), fleet snapshot escaping (no eval/unquoted interpolation of untrusted content), X-mode thread splitting and payload validation, bootstrap timeout scaling, branch-prefix validation, turn-end guard primary scoping, and harness hook wiring all verified against their tests and docs.🔧 Fix: fix herdr liveness dead-gate and restart signaled-pid healthy race
2 infos still open:
bin/fm-watch-arm.sh:230- Both round-1 auto-fixes are correctly implemented in b77079e. Herdr dead-gate: bin/fm-bootstrap.sh:293-297 keys confidence on backend:harness with correct pattern ordering; backend defaults to tmux (never empty) and all non-tmux/herdr backends already return unknown from fm_backend_agent_alive, so no sibling gap remains. Restart race: bin/fm-watch-arm.sh records the TERM'd pid and refuses report_healthy off it, polling to the deadline and reporting FAILED (exit 1) instead; the check is only reachable in restart mode and an empty restart_stopped_pid preserves the genuine-peer healthy path. Both test suites were extended to cover the new contracts (herdr grok-inconclusive + claude-respawn; signaled-holder FAILED + fresh-watcher replace), docs updated one sentence per line, scripts shellcheck-clean (only pre-existing info SC1091 sourcing note).bin/fm-watch-arm.sh:237- Accepted tradeoff, per the fix instructions' explicit contract: in the deferred-signal race the fresh child stands down and exits early, and the confirm loop never re-forks after the old watcher finally dies mid-window, so that race now always resolves to the loud FAILED (requiring a re-arm) rather than occasionally converting to a fresh cycle. A follow-up could re-fork the child once the signaled pid is observed dead within the deadline, converting some FAILED outcomes to started, but FAILED-then-re-arm is safe and matches the requested 'confirms a genuinely fresh watcher or reports FAILED' behavior.🔧 **Test** - 1 issue found → auto-fixed ✅
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"🔧 Fix: skip Pi TS extension tests when node lacks type stripping
✅ Re-checked - no issues remain.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"bin/fm-arm-pretool-check.sh:361- Code-level conflict needing a judgment call, documented but not fixable in docs: bin/fm-supervision-instructions.sh renders the grok x-mode watcher-arm recipe with a shell-quoted absolute config path (pinned by tests/fm-supervision-instructions.test.sh), but bin/fm-arm-pretool-check.sh's blessed shape only accepts the literal relative 'config/x-mode.env' clause (pinned by tests/fm-arm-pretool-check.test.sh:55), so the rendered x-mode arm command is denied by the seatbelt (verified empirically: relative form exit 0, rendered absolute form exit 2). Fixing requires changing one of two test-pinned behaviors; I corrected docs/arm-pretool-check.md's false 'matches the documented arm recipe' claim and recorded this as a known gap with the verified relative-path workaround.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.