Skip to content

feat(bin): add Rex attention marks, event-driven watcher wakes, and short sidebar tab labels - #3

Merged
roderik merged 5 commits into
mainfrom
fm/rex-backend-p3
Oct 22, 2026
Merged

roderik merged 5 commits into
mainfrom
fm/rex-backend-p3

Conversation

@roderik

@roderik roderik commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Intent

I want to add Rex support /rex to firstmate, with full support for first and second mates, at the same level as the herdr support. It should use the Rex capabilties to the maximum, using its multiplexing and pane management and all other things to the maximum for an optimal development experience

Context: a planning investigation split this into phases. Phase 1 (workers and scouts in Rex tabs, #1) and Phase 2 (second mates in their own fm- sessions, local workers in fm-local, remote second mates, away mode inside Rex, #2) have merged. This task is Phase 3, the Rex-native experience: the captain sees which worker needs them from Rex itself (tab badges, session-picker indicators, Activity sidebar, Dock badge, notifications), and the watcher wakes on Rex events instead of only polling. A later Phase 4 covers features beyond Herdr parity (command-palette actions, web view, side panes, progress and tinting) and is out of scope here.

the terminal titles can be better right, can we make them relevant and sidebar sized?

Context: today a worker's Rex tab label is <project>·<task-id> (for example firstmate-rex·rex-backend-p3) and its block label is the identity string fm-<hometag>-<task-id>; both are long and say nothing about the work, and the Rex sidebar truncates them.

What Changed

  • Attention marks: the new bin/fm-rex-marks.sh maps each Rex task's latest status (needs-decision or hold, blocked, failed, done) to a Firstmate program-status record on that worker's pane. Rex then badges the tab, the session picker, the Activity sidebar and the Dock. When the mark changes to a new state that needs the captain, it also sends one OSC 777 desktop notification.
    • fm-watch.sh syncs the marks on every poll cycle, and fm-teardown.sh clears a task's mark before closing its pane.
    • config/rex-status-marks turns the marks on or off. They are on when the file is absent.
    • config/wedge-alarm gets a new rex channel, which auto adds when Firstmate's own pane is a Rex pane.
  • Event push and busy signal: the watcher now wakes on Rex events instead of only polling. bin/backends/rex.sh follows rex events for the watched session, and fm-backend.sh wires that into the shared transition dispatchers.
    • An agent's root status changing to blocked escalates right away. So does a child exiting or a block closing.
    • Tabs that Firstmate closes itself, such as at teardown, never escalate.
    • If the stream fails, the watcher falls back to polling.
    • fm_backend_busy_state and steer-submit confirmation now read the root program status for the harnesses that publish one: Claude Code by default, configurable with FM_BACKEND_REX_STATUS_APPS. All other harnesses keep capture and hash polling.
  • Sidebar tab labels: Rex tab labels are now at most 24 characters, clipped with an ellipsis. A label is either the explicit fm-spawn.sh --title, or a kind marker (Ship, Scout or Mate) plus the backlog title's first clause, falling back to the task id.
    • The label is recorded as rex_tab_label= and kept across relaunches unless a new --title is given.
    • The block label fm-<home>-<id> is still the identity check.
  • Docs and tests:
    • Updated docs: docs/rex-backend.md, configuration, wedge-alarm, and runtime-backends verification.
    • Extended Rex unit tests and the smoke test.
    • Added the live e2e test tests/fm-rex-program-status-live-e2e.test.sh, which checks that Claude Code's root program status is published on Rex.

🤖 Generated with Claude Code

Risk Assessment

⚠️ Medium: The change is broad and mostly well-guarded, but it adds a new actionable dead edge that sends a false wake on routine Rex teardowns, and its native busy trust depends on unproven turn-end behaviour of Claude Code's status record; both can be fixed in follow-ups, but both affect supervision.

Testing

Following the operator's budget-cut guidance, I ran only the listed deterministic suites with REX_* unset. The Rex smoke ran the real Rex binary against a disposable lab server, which its own teardown removed. It showed: unfocused, labeled sidebar tabs in one fm-local session; a tab rename taking effect; a Firstmate attention mark (an invisible id=fm program-status record plus a desktop notification) clearing on its own; the real rex events wait reporting blocked and dead edges; kill proving exit 3; and an unreachable server being exit 4 and never autostarting. The adapter suite covered the remaining Phase 3 behavior: sidebar-sized tab labels (explicit title, else a condensed backlog title, else the id), kill pre-committing its dead edge, event-wait escalation and subscribe reconcile, and the marks producer honoring on/off. Transition-lib, backend, daemon and endpoint-safety all passed. fm-teardown passed 118 assertions with 0 failures before my tool's 20-minute background limit stopped it. Not run, per the operator's 'run only' list: tests/fm-supervision-events.test.sh, which holds the retired-pane dead-wake guard test, and the opt-in, token-spending Claude live e2e. No UI screenshot was captured: the operator scoped this round to the deterministic suites and forbade new lifecycle drivers, so the Rex sidebar was shown through the smoke's real tab-label and mark output. The teardown false-wake scenario and the no-regression scenario were checked only by deterministic suites, not driven live, so they are recorded as untested.

  • Live validation: ✅ go - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
A worker's Rex tab gets a short, relevant sidebar label (kind marker plus explicit --title, else a condensed backlog title, else the task id), and the tab opens unfocused in the home's fm-local sessio… ✅ pass live fm-backend-rex-smoke.log: 'one fm-local session holding exactly the task tabs, unfocused labeled tabs'; fm-backend-rex.log: 'tab labels are sidebar sized - explicit title, else a condensed backlog tit…
A worker that needs the captain shows a Rex-native attention mark (program-status record plus desktop notification) that clears on its own when resolved, and config off disables it (labels channel rem… ✅ pass live fm-backend-rex-smoke.log: 'a mark is an invisible id=fm record plus a streamed desktop notification ... cleared alone; a tab rename takes'; fm-backend-rex.log: 'the marks producer plans from status, w…
The watcher wakes on real Rex events: a blocked or dead edge is reported, and an unreachable server reads as unusable, never as dead ✅ pass live fm-backend-rex-smoke.log: 'the event wait returns a real blocked report and a real exit as dead, and an unreachable server is unusable, never dead'; fm-backend-rex.log: event-wait escalation/reconcile…
Adversarial: tearing down a Rex worker does not wake Firstmate with a false 'pane closed' (kill pre-commits the dead edge) ⏸️ untested no The prior payload did not establish a live result: it recorded live=false. The kill pre-commit was checked only by the deterministic adapter suite, and the smoke proved only kill's exit 3 and session…
Existing teardown and daemon behavior does not regress (stale/wake handling, endpoint safety, Rex wedge-alarm channel) ⏸️ untested no The prior payload did not establish a live result: it recorded live=false. Only deterministic suites ran (fm-daemon 151 ok, fm-teardown-endpoint-safety 27 ok, fm-backend 32 ok, fm-transition-lib passe…
Evidence: Rex real-binary smoke transcript (private lab server)

Source: Rex real-binary smoke transcript (private lab server)

ok - rex smoke: the private server passes the version gate and its instance is recorded
ok - rex smoke: one fm-local session holding exactly the task tabs, unfocused labeled tabs, and duplicate refusal
ok - rex smoke: current_path is the live foreground cwd and an idle shell reads dead
ok - rex smoke: text rides stdin literally and submits with Enter
ok - rex smoke: agent_state reads real foreground processes (shell dead, other ambiguous, harness-named alive)
ok - rex smoke: capture includes scrollback (83 lines, 24 rows), so rex stays out of the viewport-capture list
ok - rex smoke: list_live finds this home's tabs
ok - rex smoke: a mark is an invisible id=fm record plus a streamed desktop notification ({"title":"Firstmate: smoke","body":"Needs your decision"}), cleared alone; a tab rename takes
ok - rex smoke: the event wait returns a real blocked report and a real exit as dead, and an unreachable server is unusable, never dead
ok - rex smoke: kill proves exit 3 and retires the emptied home session only after its last tab
ok - rex smoke: a secondmate pane is the first tab of its fm-<id> session and its own worker joins that session
ok - rex smoke: an unreachable server is exit 4 and unreadable, and nothing autostarts
Evidence: Rex adapter suite

Source: Rex adapter suite

ok - rex: every call carries a clean env, the pinned -S server, --autostart=false, and full typed ids
ok - rex: server resolution - spawn pin, then the task record, then FM_REX_SERVER/REX_SERVER, then the running default
ok - rex: the version gate checks the server API floor and methods and refuses an unreachable server
ok - rex: container_ensure pins the server and records its instance id
ok - rex: a primary-home task opens in the fm-local session (created with the task as its first tab), unfocused and kept open
ok - rex: create_task adopts a unique home session, refuses two, and refuses a duplicate or unreadable inventory
ok - rex: inside a proven Rex pane, task tabs open in fm-local and never in the supervisor's own session
ok - rex: targets are exactly <session-uuid>:<block-uuid>
ok - rex: target_ready verifies session, label, and separates gone (3) from unreachable (4)
ok - rex: capture tails without CR, text rides stdin, keys normalize, and unknown keys refuse
ok - rex: the styled composer capture feeds the shared classifier and the shared submit core
ok - rex: agent_state maps agent/shell/other foregrounds, last_exit, exit 3, and exit 4
ok - rex: absence is proven by exit 3 from the recorded server and never by an unreachable one
ok - rex: kill closes the exact block, proves exit 3, pre-commits its dead edge, retires only this home's emptied session, and refuses blind outcomes
ok - rex: list_live lists only this home's scoped blocks
ok - rex: detection stays innermost-first and needs live-block, session, and ancestry proof; config selects it explicitly
ok - rex: cleanup identity requires the server, both uuids, and window=<session>:<block>
ok - rex: a secondmate gets a new fm-<id> session whose first tab is its pane, never the parent's nor an unrecorded one
ok - rex: a secondmate's own workers open as further tabs of its fm-<id> session
ok - rex: a secondmate relaunch reuses its live recorded session (tab moved first), never a relabeled one, and refuses an unreadable one
ok - rex: a reclaim mints its tab in the recorded session while live and labeled, else in this home's session
ok - rex: an emptied secondmate session retires with that secondmate only, and a detached block keeps any session alive
ok - rex: a secondmate home scopes its workers' labels and its session label by its own tag
ok - rex: supervisor discovery takes a Rex pane only with ancestry proof, after tmux and herdr
ok - rex: a detached daemon block is created in the captain's session and closes only on proven exit 3
ok - rex: /afk runs the daemon in a recorded detached block on the captain's server and closes it by exact id
ok - rex: the remote host control routes to fm-<id>, reads a gone block as missing, and refuses inconsistent or cross-backend records
ok - rex: tab labels are sidebar sized - explicit title, else a condensed backlog title, else the id, under a kind marker
ok - rex: a mark is one id=fm program-status record (optionally with one OSC 777 notification), cleared alone, never on a foreign block
ok - rex: mark_read reports only Firstmate's record and fails on an unreadable pane; tab rename renames only on change
ok - rex: busy_state trusts only a proven harness's own root record, and busy also needs a live agent
ok - rex: submit confirmation accepts a proven harness's not-working -> working edge and nothing else
ok - rex: the event wait escalates a watched root blocked or dead edge once, ignores Firstmate's own marks, reconciles on subscribe, and treats exit 4 as unusable
ok - rex: the marks producer plans from status, writes once, repairs without re-notifying, clears on resolve, and honors off
Evidence: Transition lib suite

Source: Transition lib suite

ok - fm_transition_record builds a 5-field record and every accessor reads its field
ok - fm_transition_record uses a single TAB between each of the five fields
ok - fm_transition_record scrubs TAB/newline out of fields so the record stays exactly five columns
ok - fm_transition_record tolerates empty workspace/from/agent fields
ok - fm_transition_policy is the single-owner status->action table (blocked/dead=actionable, working=absorb, idle/done=defer, else=fallback)
# fm-transition-lib.test.sh: all assertions passed
Evidence: Daemon suite

Source: Daemon suite

ok - fm-afk-start.sh fails before daemon startup when the afk flag cannot be written
ok - fm-afk-start.sh ignores stale pidfile-only live pids
ok - fm-afk-start.sh reclaims stale daemon locks whose live pid identity no longer matches
ok - supervise daemon state root is scoped by FM_HOME
ok - routine signal self-handles
ok - captain-relevant status verbs escalate
ok - check + unknown escalate; heartbeat self-handles
ok - a delivered unknown wake is acknowledged once per away session; a new one and ordinary escalations still fire
ok - a failed unknown-wake acknowledgement write does not re-inject a delivered digest
ok - transient stale self-handles and records a persistence marker
ok - enriched stale wedges bypass status absorption except under a declared wait, without disturbing busy workers
ok - an enriched wedge under a declared wait uses the pause cadence and restores wedge detection on resume
ok - an enriched wedge under a worker blocker is not escalated only where config/wedge-defer-worker-wait arms it
ok - stale + terminal status escalates immediately
ok - stale escalation and current wait cadence remain independent
ok - paused reasons with captain phrases remain pause-classified
ok - a foreign resolved line keeps a pause, while the worker's own resolved line retracts it
ok - a captain-held transfer classifies as pause, not as a wedge candidate
ok - handle_wake on a paused stale records a pause marker, drops the wedge marker, and does not escalate
ok - handle_wake records a declared pause from a routine signal for long-cadence rechecks
ok - a terminal signal clears pause and stale tracking across both supervisors
ok - housekeeping migrates a normal-watcher's declared pause into daemon tracking
ok - housekeeping clears an already-resumed watcher pause across both supervisors
ok - housekeeping seeds pause tracking from status without a watcher marker
ok - persistent stale escalates after threshold and clears its marker
ok - resumed (busy) stale clears its marker without escalating
ok - housekeeping re-surfaces a stale declared pause on the long cadence and resets its window
ok - housekeeping re-surfaces a forgotten captain hold on the long cadence and resets its window
ok - housekeeping silences a captain hold only under an away record, never under quiet mode's
ok - a busy pane cannot gate the pause clear once its crew's status no longer declares the wait
ok - housekeeping matures a busy pane's declared-wait window into exactly one recheck per window
ok - housekeeping bounds a distant declared time, defers to a near one, and rechecks a passed one at once
ok - housekeeping clears a paused marker once the crew is no longer declaring the pause
ok - housekeeping clears the pause marker once a captain hold is answered
ok - housekeeping moves an existing stale marker to pause before wedge escalation
ok - housekeeping moves a captain hold's existing stale marker to pause before wedge escalation
ok - housekeeping clears tracking when a crew leaves pause
ok - persistent herdr stale resolves the target from metadata and escalates
ok - herdr idle busy-footer stale clears through capture corroboration
ok - resumed herdr stale clears through backend-aware busy state
ok - persistent Orca stale resolves the terminal from metadata
ok - multiple escalations flush as a single batched digest
ok - batch flush measures max-delay from the first append, not the last
ok - catch-all scan escalates a missed terminal once, not twice
ok - handle_wake routes routine->self and captain->escalate
ok - a decision-owned queued row escalates once as the decision, then suppresses until the status changes
ok - a captain-held decision-owned row is self-handled without escalation, now and on repeat
ok - INJECT_SKIP forces self-handle, bypassing captain-relevant classification
ok - is_wake_reason distinguishes watcher wake reasons from singleton-status stdout
ok - terminal-stale escalate removes its marker so housekeeping does not re-escalate
ok - captain signal escalate marks seen so the catch-all scan does not re-fire
ok - _collapse_newlines replaces newlines with literal separator
ok - afk flag absent: daemon does not inject, buffer preserved
ok - busy-guard defers injection when supervisor pane is busy
ok - marker detection: marker -> stay afk, no marker -> exit afk
ok - /afk invocation is exempt from afk exit (no self-cancel)
ok - should_exit_afk returns false when afk is not active
ok - strip_injection_marker removes the sentinel marker cleanly
ok - a marker-preserving primary still receives the typed U+2063 away-supervisor envelope and no record
ok - record-backed doorbell: only a doorbell naming this home's own record stays afk; a bare ASCII label, a missing record, and another home's record exit
ok - pane_input_pending detects partial input on the cursor line
ok - pane_input_pending: a blank unidentified cursor row defers (strict container-proof rule)
ok - pane_input_pending: only proven empty agent prompts pass
ok - fm_tmux_composer_state: a bare shell prompt ($/%/#/>) reads unknown, never empty (dead-shell injection safety)
ok - fm_tmux_composer_state: a bordered composer box and bare agent glyphs (❯/›) still read empty
ok - fm_tmux_composer_state: only matching edge borders form a composer box
ok - pane_input_pending preserves bright placeholder-like drafts in styled captures
ok - classify_signal dedupes against the catch-all scan seen marker
ok - turn-end markers stay routine while mixed actionable status batches escalate
ok - an actionable event is escalated to an away captain despite later routine appends
ok - the daemon commits exactly the endpoint captured by classification
ok - a stale wake escalates a blocker hidden by later progress
ok - a stale span read failure surfaces without advancing its marker
ok - a recreated status rejects the old captured identity
ok - an unverifiable status identity surfaces without advancing markers
ok - a status read failure surfaces without advancing the daemon suppressor
ok - catch-all routine scans advance before later actionable appends
ok - failed escalation writes retain durable wakes and classification positions
ok - stuck inbox escalation reaches supervision in away mode and survives buffering failure
ok - stuck inbox escalation reaches supervision in quiet mode and survives buffering failure
ok - write inbox escalation reaches supervision in away mode and survives buffering failure
ok - write inbox escalation reaches supervision in quiet mode and survives buffering failure
ok - reset inbox escalation reaches supervision in away mode and survives buffering failure
ok - reset inbox escalation reaches supervision in quiet mode and survives buffering failure
ok - inbox dispatch preserves ordinary stale, busy-turn, and other doorbell routing
ok - catch-all markers advance only after escalation buffering succeeds
ok - classification failure retains the complete durable wake batch
ok - missing-status stale wakes remain ordinary and acknowledgeable
ok - transient unreadable signals recover without advancing their position
ok - daemon catch-all reclassifies permission-recovered status content
ok - a permanent classification failure is reported, acknowledged, and never advances its position
ok - the away-mode catch-all scan surfaces a masked event once
ok - classify_stale dedupes against the signal path seen marker
ok - AFK nonterminal working:+merged keeps wedge aging and re-escalates at bound
ok - genuine done: and merge-check events still escalate
ok - pane_input_pending: an idle bordered composer is NOT pending (afk-invx-i5)
ok - pane_input_pending: text inside a bordered composer is still pending
ok - submit-ACK confirms a submit when the composer returns to a bordered-empty box
ok - submit-ACK reports pending on a persistently swallowed Enter (type-once)
ok - max-defer on an empty stuck pane types once, alarms, and preserves the buffer
ok - max-defer flushes and clears the buffer on an empty bordered pane
ok - max-defer on a pending composer alarms without typing
ok - normal flush clears a stale wedge marker
ok - an oversized buffered digest is delivered bounded, with the full text kept durable
ok - a digest past its byte budget counts the omitted events and keeps them in the full text
ok - an initial-send failure logs its stage, bytes, and stderr, and the wedge alarm names it
ok - an Enter-confirmation failure logs its own stage and byte count
ok - a bounded digest's full-text file survives a failure after typing, and a deferral writes none
ok - below MAX_DEFER: no inject, no alarm, buffer preserved
ok - max-defer does not flush or alarm while afk is inactive
ok - library mode: sourcing the daemon defaults FM_WEDGE_ALARM_EXEC to discard (no test can fire a real notification)
ok - wake helpers replace inherited notifier overrides with the safe recorder
ok - the discard seam suppresses every notifier, including command: (fires nothing)
ok - direct notifier helpers honor the discard seam, including command:
ok - osascript channel routes through the notifier seam with the summary (never a real notification)
ok - herdr channel routes through the notifier seam with the summary (never a real notification)
ok - rex channel routes through the notifier seam with the summary (never a real pane write)
ok - auto adds the rex channel for a Rex supervisor pane, alongside the OS banner, and not otherwise
ok - command channel runs the captain command with the summary on $1 and on stdin
ok - command channel failures redact configured commands while logging their exit status
ok - unknown channel directives are redacted while the alarm keeps running
ok - off disables every active alert regardless of directive position (marker and tmux flash are unaffected)
ok - auto resolves to the macOS osascript notifier on Darwin (default-on)
ok - auto on a non-macOS platform selects no built-in OS channel (the marker or a configured command carries it)
ok - config/wedge-alarm selects every configured channel and skips comment and blank lines
ok - a failing channel logs and falls back to the next channel, never crashing the alarm
ok - a hung notifier is bounded, logged, and falls through to the next channel
ok - a backgrounded command notifier remains bounded until its process group is reaped
ok - a hung notifier override is bounded, logged, and proceeds to the next channel
~/.no-mistakes/worktrees/42de5badf924/01M5HA91W61BRP1NTK126MGZCV/bin/fm-supervise-daemon.sh: line 1019: 42052 Terminated: 15          sh -c 'sleep 30 & printf "%s" "$!" > "$1"; wait' sh "$child_file"
ok - daemon shutdown stops and reaps the active notifier process group
ok - inject_wedge_alarm writes the marker AND emits the active alert even with no tmux status-line (herdr backend)
ok - in-process wedge throttle prevents alert spam when the marker cannot persist
ok - fm-send returns 3 with a non-error no-resend warning when confirmation stays pending
ok - fm-send exits non-zero when initial text send fails
ok - fm-send exits non-zero unless delivery is proven empty
ok - discover_supervisor_backend: override > TMUX_PANE > HERDR_ENV+HERDR_PANE_ID > tmux fallback
ok - discover_supervisor_target: override > TMUX_PANE > herdr '<session>:<pane-id>' composition > firstmate:0 fallback
ok - pane_is_busy: herdr native busy_state='busy' short-circuits without a capture fallback
ok - primary busy guard isolates rendered signatures by detected harness
ok - pane_is_busy: omitted backend defaults to tmux for Grok's isolated fallback
ok - pane_input_pending: dispatches through fm_backend_composer_state for backend=herdr
ok - inject_msg: herdr busy-guard defers before ever attempting a submit
ok - inject_msg: herdr composer-guard defers before ever attempting a submit
ok - inject_msg: herdr pane-gone check defers before any busy/composer/submit call
ok - inject_msg: dispatches busy-guard/composer-guard/submit through the herdr backend and succeeds on a confirmed empty composer
ok - inject_msg: defers on a dead-shell/unreadable composer (unknown), never typing the escalation into a shell
ok - inject_msg: unrecognized composer states defer by default
ok - a dialog name on a first-sight stale reaches the away persistence line
ok - a seen terminal status on the picker clears like a plain stale
ok - a dialog name joins the escalation of an unseen status
ok - a dialog name after demand-deep-inspection still escalates, and a declared wait still pauses
Evidence: Backend suite

Source: Backend suite

ok - fm_backend_name: FM_BACKEND env > config/backend > default tmux
ok - fm_backend_detect: no markers -> undetected, HERDR_ENV=1 -> herdr, $TMUX -> tmux, CMUX_WORKSPACE_ID -> cmux, nested combinations resolve innermost-first
ok - fm_backend_detect: falls back to __CFBundleIdentifier=com.cmuxterm.app when CMUX_WORKSPACE_ID is absent (signal bundle-id; foreign bundle ids rejected)
ok - fm_backend_detect: the cmux fallback signals are macOS-only (inert on a non-Darwin uname)
ok - fm_backend_detect: an inherited cmux bundle id never outranks $TMUX or HERDR_ENV (tmux/herdr-inside-cmux false positive absorbed)
ok - fm_backend_detect: ancestry fallback matches the lsappinfo-resolved (bundle-id) cmux app pid in the parent chain
ok - fm_backend_detect: ancestry fallback matches a bundle-shaped cmux comm path at any install location when lsappinfo cannot resolve a pid
ok - fm_backend_detect: ancestry fallback stops undetected at launchd (a reparented tmux server never reaches cmux)
ok - fm_backend_name: a fallback-detected cmux prints a NOTICE naming the fallback signal; the primary-marker notice is unchanged
ok - fm_backend_name: verified Herdr and tmux stay silent while experimental cmux remains loud
ok - fm_backend_detect/fm_backend_name: paseo is never auto-detected from PASEO_* markers or its bundle id (tmux default stays silent); only FM_BACKEND or config/backend select it
ok - fm_backend_name: an explicit FM_BACKEND or config/backend setting always wins over runtime auto-detection, including an ambient cmux marker
ok - fm_backend_validate: implemented adapters accepted, unknown and blocked codex-app backends refused loudly
ok - zsh: fm_backend_source recognizes known backends and rejects unknown ones
ok - zsh: fm_backend_source keeps PATH intact while loading a backend adapter
ok - bash: fm_backend_source recognizes known backends and rejects unknown ones
ok - fm_backend_source: missing adapter fails before lifecycle continuation
ok - fm_backend_source: unreadable adapter fails before lifecycle continuation
ok - fm_backend_validate_spawn: all implemented lifecycle backends are spawn-supported
ok - fm_meta_get / fm_backend_of_meta: read last key=value and default backend to tmux
ok - fm_backend_resolve_selector: session:window literal, exact task id first, legacy fm-<id> label fallback, ad hoc bare name via tmux list-windows
ok - fm_backend_of_selector: exact task ids, legacy fm-<id> labels, and matching explicit targets inherit metadata backend
ok - fm-send.sh: explicit tmux targets are verified; text types once and submits with Enter
ok - fm-peek.sh: capture-pane invocation and output are byte-identical old vs new
ok - fm-spawn.sh: a project reached through a symlinked prefix (e.g. macOS /tmp -> /private/tmp) does not trip the isolation guard's false refusal
ok - fm-teardown.sh: treehouse return remains compatible while tmux cleanup uses exact selectors
ok - fm-spawn.sh --backend bogus is refused loudly
ok - fm-spawn.sh --backend codex-app is refused
ok - fm-spawn.sh honors FM_BACKEND and refuses an unimplemented value loudly
ok - fm-spawn.sh: an explicit --backend tmux resolves silently and writes no backend= (missing means tmux)
ok - fm-spawn.sh: explicit --backend tmux wins over an ambient HERDR_ENV=1 auto-detect marker
ok - fm-spawn.sh: auto-detect resolves nested tmux-in-herdr to tmux and stays silent end to end
Evidence: Teardown suites (main partial, endpoint-safety complete)

Source: Teardown suites (main partial, endpoint-safety complete)

ok - teardown leaves opencode's busy plugin in the returned pool worktree as on main
ok - status archival is opt-in and preserves the complete log
ok - forced secondmate retirement preserves two descendant levels and refuses linked child directories
ok - local missing-status retirement stays lock-free without creating an archive
ok - reused task IDs never overwrite archives and retention removes only old owned logs
ok - archive sources and directories reject symlinks; pruning never follows children links
ok - failed archive publication preserves presentation and watcher bookkeeping
ok - cursor retirement failure removes its archive so retry publishes one history
ok - archive publication and cold logs never re-wake or re-present
ok - retention failures warn without aborting unrelated teardown
ok - a missing teardown startup source refuses before cleanup
ok - an unreadable teardown startup source refuses before cleanup
ok - a missing adapter sibling refuses before cleanup
ok - a forced descendant with a missing adapter sibling refuses before cleanup
ok - a forced secondmate with a missing own adapter sibling refuses before child cleanup
ok - present required sources still reach the ordinary teardown refusal
ok - local-only worktree with HEAD on a fork remote is torn down and the home summary is refreshed
ok - teardown closes its own backlog item before reporting success
ok - teardown closes a landed Gerrit task with its change URL as a note and a GitHub task with --pr
ok - teardown closes a landed GitLab task with its merge request URL as a note and GitHub and Forgejo tasks with --pr
ok - teardown honors config/backlog-backend=manual and still finishes cleanly
ok - local-only worktree with truly unpushed work is refused (safety preserved)
ok - local-only worktree with work merged into local main is torn down (no regression)
ok - no-mistakes worktree with HEAD on origin is torn down (no regression)
ok - no-mistakes worktree with genuinely unlanded work is refused (safety preserved)
ok - local-only worktree with unpushed work is torn down under --force (escape hatch)
ok - fm-pr-check publishes the PR-ready line on a secondmate's parent channel once
ok - fm-pr-check withholds the PR-ready line until checks are green when config/ready-after-green is present
ok - fm-pr-check releases the PR-ready line on a checks-green report that carries surrounding text
ok - a secondmate home's teardown delivers the child's final line or refuses until it can
ok - teardown completes when an exact busy-state sidecar is already absent
ok - teardown retires a polytoken task's generated worktree wiring on pool return
ok - teardown never deletes a tracked .polytoken hook layer
ok - teardown never deletes a .polytoken hook layer firstmate did not generate
ok - teardown scopes .polytoken wiring removal to polytoken tasks
ok - herdr teardown removes pane-owned escalation dedupe state
ok - herdr flat teardown refuses before returning the isolated copy under lock contention and the retry completes cleanly
ok - herdr flat teardown never erases records when pane presence is unparseable
ok - herdr flat teardown preflight refuses before every destructive change
ok - herdr teardown refuses a foreign-owned per-account namespace (owner-shim arms need the non-Darwin stat branch; skipped on Darwin)
ok - forced secondmate teardown preflights every Herdr child before cleanup mutation
ok - forced secondmate teardown holds every descendant lifecycle and metadata lock
ok - forced secondmate teardown retains Herdr child identity until exact pane disappearance
ok - forced teardown retains a nested secondmate home and its grandchild's Herdr identity when the grandchild close is unconfirmed
ok - herdr projection teardown retires its journal only after confirming the exact recorded pane is gone
ok - herdr projection teardown retains every record when post-close presence is unknown
ok - herdr projection teardown surfaces failed focus restoration without turning confirmed cleanup into a hard failure
ok - teardown retires the task's own watcher markers and orphaned presentation journal, leaving other tasks' markers alone
ok - teardown retains a presentation journal bound to a pane other than the closed endpoint
ok - teardown retires a v1 presentation journal once its token workspace is confirmed gone
ok - teardown retains a v1 presentation journal while its token workspace is still present
ok - teardown retains a v1 presentation journal when the workspace query is ambiguous
ok - squash-merged + deleted-branch worktree (PR merged) is torn down (the fix)
ok - squash-merged PR accepts a local HEAD that is an ancestor of the final PR head
ok - teardown discovers a merged PR by branch name and tears down when no pr= was ever recorded
ok - squash-merged PR accepts replayed unpushed local patches contained in the PR head
ok - merged PR does not allow teardown after a later local commit
ok - squash-merged task whose local branch followed the pipeline rebase is torn down
ok - teardown proves a Forgejo task landed from the merged pull request when the content check is inconclusive
ok - squash-merged same-path different content still refuses
ok - squash-merged rebased local still refuses a genuinely unlanded follow-up commit
ok - squash-merged stale local still refuses when the forge is unreachable
fm-contributions: data directory unavailable
contributions: observation not armed; coverage is unconfirmed
fm-contributions: data directory unavailable
contributions: observation not armed; coverage is unconfirmed
ok - fm-pr-check does not refresh PR head after HEAD moves
fm-contributions: data directory unavailable
contributions: observation not armed; coverage is unconfirmed
ok - fm-pr-check records the remote PR head when the local worktree lags
ok - worktree whose content already landed in the default branch is torn down (content fallback)
ok - the content-landed fallback checks a task's recorded base branch, not the default branch
ok - content fallback refreshes origin default before comparing trees
ok - dirty worktree is refused even when its committed work has landed (dirty always wins)
ok - untracked/no-mistakes: dirty refusal classifies leftovers and preserves work
ok - untracked/local-only: dirty refusal classifies leftovers and preserves work
ok - tracked/no-mistakes: dirty refusal classifies leftovers and preserves work
ok - tracked/local-only: dirty refusal classifies leftovers and preserves work
ok - mixed/no-mistakes: dirty refusal classifies leftovers and preserves work
ok - mixed/local-only: dirty refusal classifies leftovers and preserves work
ok - scout copy with a nested clone and a scratch file returns with no untracked entries
ok - ship copy with a nested clone is refused and its bytes stay
ok - a return that leaves residue names the lost slot and the remaining paths
ok - a dirty return is reported even when a later teardown step refuses
ok - a forced secondmate teardown returns a child scout copy with a nested clone clean
ok - a forced secondmate teardown warns about a dirty child return and still completes
ok - a return that leaves no readable copy reports the slot as unverified, not clean
ok - ignored files survive the scratch clean and plain scratch does not
ok - gh lookup error with content not in default refuses (fail-safe)
ok - a record predating spawn_gen refuses teardown until --legacy-record is passed
ok - a windowless leftover with no spawn_gen and no worktree tears down without --legacy-record
ok - a windowless leftover with no spawn_gen also tears down when --legacy-record is passed
ok - a windowless leftover still refuses while its worktree holds unlanded work
ok - a windowless record with a spawn_gen, a non-tmux backend or endpoint identity, no backlog validation, or ambiguous, foreign, or malformed identity still refuses
ok - a windowless leftover retries its retained legacy stamp without --legacy-record
ok - a landed legacy record with a dead endpoint tears down and logs its accepted incarnation
ok - --legacy-record never relaxes the unlanded-work refusal
ok - an endpoint that cannot be confidently read as dead refuses --legacy-record teardown
ok - --legacy-record teardown rolls its stamp back when the close marker write fails
ok - a legacy stamp a failed rollback left behind still faces the endpoint gate
ok - a corrupt spawn_gen is never accepted as a legacy record
ok - provably-stale worktree index.lock (old, no live holder) is cleared and teardown succeeds
ok - live-held worktree index.lock is never removed and teardown refuses
ok - lsof errors leave worktree index.lock in place and refuse teardown
ok - stale lock cleanup rechecks and refuses dirty worktree before return
ok - normal repo index.lock is resolved from the worktree and cleared when stale
ok - index-lock mtime fault injection is PATH-based; skipped on Darwin where stat is /usr/bin/stat
ok - transient index.lock cleared after first failed return is retried successfully without force-remove
ok - persistent index.lock exhausts retries and refuses without force-removing the lock
ok - empty retry wait overrides use the default without aborting teardown
ok - fractional legacy retry wait remains supported without arithmetic
ok - teardown records the task's pipeline spend before removing its branch and record
ok - teardown skips all pipeline-spend recording when the home has not opted in
ok - teardown records unavailable pipeline spend for an owned ship task whose copy is gone
ok - a task's own parked no-mistakes run is aborted, not orphaned, before the worker is removed
ok - a parked run in a resolved workspace no-mistakes home is aborted before the worker is removed
ok - a run that lands on passed-with-override after abort is still recognized as terminal
ok - a run that lands on passed-with-skips after abort is still recognized as terminal
ok - a parked run the pipeline advanced past the task copy is still concluded from the runs ledger, not orphaned
ok - a ledger row for a different head never authorizes a parked-run abort
ok - a malformed ledger row never authorizes a parked-run abort
ok - an impossible ledger date never authorizes a parked-run abort
ok - a terminal status with a stale gate never reaches ledger cleanup
ok - an advanced head present locally aborts through the strict rule alone - the ledger fallback stays dormant
Evidence: Smoke highlights
ok - rex smoke: one fm-local session holding exactly the task tabs, unfocused labeled tabs, and duplicate refusal
ok - rex smoke: a mark is an invisible id=fm record plus a streamed desktop notification ({"title":"Firstmate: smoke","body":"Needs your decision"}), cleared alone; a tab rename takes
ok - rex smoke: the event wait returns a real blocked report and a real exit as dead, and an unreachable server is unusable, never dead
ok - rex smoke: kill proves exit 3 and retires the emptied home session only after its last tab
- Outcome: 🔧 1 issue found → no changes applied ✅ across 2 runs (51m46s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 warnings
  • ⚠️ bin/fm-teardown.sh:3890 - Tearing down a Rex worker now sends Firstmate a false 'pane closed' wake. The change makes dead actionable (bin/fm-transition-lib.sh:102) and maps block_closed/child_exited to dead (bin/backends/rex.sh:1202-1204). Teardown closes the worker's pane through fm_backend_kill, but it does not pause the watcher or pre-mark the edge, and it only removes the dedupe markers afterwards (fm_backend_clear_transition at bin/fm-teardown.sh:3951). Concrete sequence: the armed watcher sits in fm_backend_rex_wait_transition with the task's window in its watched list, which is snapshotted at cycle start. Firstmate runs fm-teardown.sh. block_closed streams in and becomes a dead record. No .rex-escalated-…dead marker exists yet, so handle_push_transition (bin/fm-push-transition-lib.sh:167-170) appends a stale wake and calls wake &#34;stale: &lt;window&gt; (rex: agent exited or pane closed …)&#34; for a task Firstmate is deliberately removing. If the meta is already gone, window_to_task falls back to the block uuid. This happens on essentially every Rex teardown while the watcher is armed. Herdr never produced this because it has no dead status. The same unguarded edge also reaches the subscribe-time reconcile (bin/backends/rex.sh:1301-1311, exit 3 means dead) when a cycle starts between the kill and the meta removal. Smallest fix, at the shared boundary both paths dedupe on: for rex, have teardown create the dead dedupe marker (fm_backend_rex_escalation_marker &#34;$STATE&#34; &#34;$T&#34; dead, or an equivalent commit helper) before fm_backend_kill. The existing fm_backend_clear_transition call later removes it.
  • ⚠️ bin/backends/rex.sh:1134 - fm_backend_rex_busy_state treats a claude-code root record of working as busy whenever the agent process is alive. Nothing proves that Claude Code changes or drops that record when a turn ends. The live guard (tests/fm-rex-program-status-live-e2e.test.sh:145-148) only checks that working appears at some point. It stops sampling as soon as the status file says done, so it never checks the record after the turn ends. The recorded evidence for Claude Code 2.1.308 (docs/verification/runtime-backends.md) shows only working, with no done/idle, even though the probe finished. If 2.1.308 leaves working in place while idle, every new consumer of this verdict reads an idle pane as busy indefinitely: pane_is_busy (bin/fm-supervise-daemon.sh:734) keeps deferring away-mode injects until the wedge alarm fires; fm_pending_reply_backend_observation (bin/fm-pending-reply-lib.sh:815) never sees busy turn to idle; fm_task_inbox_ring (bin/fm-task-inbox-lib.sh:368) refuses the doorbell Enter; and fm_busy_classify (bin/fm-busy-lib.sh:1093) reports busy rex-native. Fix: extend the guard to keep sampling after the worker reports done and fail unless claude-code's root record leaves working (moves to idle/done or is removed) once the turn ends. Until that is shown, do not trust working as busy.
  • ⚠️ bin/fm-spawn.sh:965 - Simplification: the new fm-spawn.sh --title &lt;text&gt; option and its relaunch rename path (bin/fm-spawn.sh:4228-4239, 1013) are not needed for the intent ('make [titles] relevant and sidebar sized'). That intent is already met by the automatic label: a kind marker plus the condensed backlog title, else the task id (fm_backend_rex_tab_label). Nothing in AGENTS.md, the skills, or any caller passes --title, so it only adds an unused override plus a relaunch-time rename branch. Recommended: remove the option and keep the automatic backlog-derived label.
  • ⚠️ bin/fm-rex-marks.sh:207 - Simplification: the labels channel of config/rex-status-marks goes beyond the intent. It is a third mode that prefixes '⚑ ' to the tab label through window ls and window rename, and brings its own undo, a channel switch, and a cache mode (bin/fm-rex-marks.sh:205-209, 266-272; bin/backends/rex.sh:1079-1094 fm_backend_rex_label_flag). The intent asks for Rex-native attention signals (tab badges, session picker, Activity sidebar, Dock badge, notifications), and the on program-status mark already provides them. No requirement asks for a label-rewriting fallback. Recommended: remove labels and keep on/off. If it goes, the relaunch path's fm_backend_rex_label_flag rename is needed only by the --title option flagged separately.
  • ℹ️ bin/fm-spawn.sh:4239 - On relaunch, a task that has no recorded rex_tab_label (any task spawned before this change) gets a new tab labeled fm_backend_rex_tab_label &#34;$KIND&#34; &#34;$ID&#34; &#34;$DISPLAY_TITLE&#34;. That call omits the backlog title, so it reads Ship · &lt;id&gt; instead of the relevant title a fresh spawn gets (line 4572 passes ${FM_BACKLOG_ROW_TITLE:-}). The backlog probe at line 4173 has already filled FM_BACKLOG_ROW_TITLE when backlog transitions apply. Fix: pass &#34;${FM_BACKLOG_ROW_TITLE:-}&#34; here as well.

🔧 Fix applied.
8 issues (7 warnings, 1 info) still open:

  • ⚠️ bin/fm-teardown.sh:3890 - Tearing down a Rex worker now sends Firstmate a false 'pane closed' wake. The change makes dead actionable (bin/fm-transition-lib.sh:102) and maps block_closed/child_exited to dead (bin/backends/rex.sh:1202-1204). Teardown closes the worker's pane through fm_backend_kill, but it does not pause the watcher or pre-mark the edge, and it only removes the dedupe markers afterwards (fm_backend_clear_transition at bin/fm-teardown.sh:3951). Concrete sequence: the armed watcher sits in fm_backend_rex_wait_transition with the task's window in its watched list, which is snapshotted at cycle start. Firstmate runs fm-teardown.sh. block_closed streams in and becomes a dead record. No .rex-escalated-…dead marker exists yet, so handle_push_transition (bin/fm-push-transition-lib.sh:167-170) appends a stale wake and calls wake &#34;stale: &lt;window&gt; (rex: agent exited or pane closed …)&#34; for a task Firstmate is deliberately removing. If the meta is already gone, window_to_task falls back to the block uuid. This happens on essentially every Rex teardown while the watcher is armed. Herdr never produced this because it has no dead status. The same unguarded edge also reaches the subscribe-time reconcile (bin/backends/rex.sh:1301-1311, exit 3 means dead) when a cycle starts between the kill and the meta removal. Smallest fix, at the shared boundary both paths dedupe on: for rex, have teardown create the dead dedupe marker (fm_backend_rex_escalation_marker &#34;$STATE&#34; &#34;$T&#34; dead, or an equivalent commit helper) before fm_backend_kill. The existing fm_backend_clear_transition call later removes it.
  • ⚠️ bin/fm-spawn.sh:965 - Simplification: the new fm-spawn.sh --title &lt;text&gt; option and its relaunch rename path (bin/fm-spawn.sh:4228-4239, 1013) are not needed for the intent ('make [titles] relevant and sidebar sized'). That intent is already met by the automatic label: a kind marker plus the condensed backlog title, else the task id (fm_backend_rex_tab_label). Nothing in AGENTS.md, the skills, or any caller passes --title, so it only adds an unused override plus a relaunch-time rename branch. Recommended: remove the option and keep the automatic backlog-derived label.
  • ⚠️ bin/fm-rex-marks.sh:207 - Simplification: the labels channel of config/rex-status-marks goes beyond the intent. It is a third mode that prefixes '⚑ ' to the tab label through window ls and window rename, and brings its own undo, a channel switch, and a cache mode (bin/fm-rex-marks.sh:205-209, 266-272; bin/backends/rex.sh:1079-1094 fm_backend_rex_label_flag). The intent asks for Rex-native attention signals (tab badges, session picker, Activity sidebar, Dock badge, notifications), and the on program-status mark already provides them. No requirement asks for a label-rewriting fallback. Recommended: remove labels and keep on/off. If it goes, the relaunch path's fm_backend_rex_label_flag rename is needed only by the --title option flagged separately.
  • ℹ️ bin/fm-spawn.sh:4239 - On relaunch, a task that has no recorded rex_tab_label (any task spawned before this change) gets a new tab labeled fm_backend_rex_tab_label &#34;$KIND&#34; &#34;$ID&#34; &#34;$DISPLAY_TITLE&#34;. That call omits the backlog title, so it reads Ship · &lt;id&gt; instead of the relevant title a fresh spawn gets (line 4572 passes ${FM_BACKLOG_ROW_TITLE:-}). The backlog probe at line 4173 has already filled FM_BACKLOG_ROW_TITLE when backlog transitions apply. Fix: pass &#34;${FM_BACKLOG_ROW_TITLE:-}&#34; here as well.
  • ⚠️ bin/fm-teardown.sh:4053 - The round-1 fix (c5e179d) narrows the false teardown 'pane closed' wake but leaves one path open. fm_backend_rex_kill now writes the .dead dedupe marker before closing (bin/backends/rex.sh:869-870), and teardown moved fm_backend_clear_transition to just after the meta removal (bin/fm-teardown.sh:4053). The watcher still snapshots its watched windows at cycle start (recorded_windows, bin/fm-watch.sh:842 → wait_transition at :3057), and the subscribe-time reconcile only runs after the poke loop (bin/backends/rex.sh:1362-1378). Concrete sequence: (1) teardown has already closed the block and is finishing up. (2) A watcher cycle starts and reads the task's meta, so the dead block is still in watched. (3) Teardown removes the meta and immediately clears both markers. (4) The cycle's first poke is answered and the reconcile runs fm_backend_rex_reconcile_record; exit 3 gives dead, no marker exists any more, so fm_backend_rex_apply_transition returns the record. (5) handle_push_transition (bin/fm-push-transition-lib.sh:151-175) finds no meta, so window_to_task falls back to the block uuid, and it appends and fires stale: &lt;sid&gt;:&lt;bid&gt; (rex: agent exited or pane closed …) for a task Firstmate just retired. The window is the snapshot-to-reconcile latency (up to about a second, more under load), so it hits a minority of teardowns but does happen. docs/rex-backend.md:148 now promises such a close 'never escalates'. The same unguarded edge reaches the event loop (bin/backends/rex.sh:1385-1390) if block_closed is read after the clear. Earliest shared boundary that makes the invariant hold: in handle_push_transition, when to=dead and the window maps to no current task meta, commit the record and return without waking. That covers the reconcile and event paths for every caller. The alternative is to stop deleting the .dead marker in fm_backend_rex_clear_transition (block uuids are never reused).
  • ⚠️ docs/rex-backend.md:157 - The round-1 fix changed this doc to say Claude Code's root record 'leaves working once its turn ends, proven by tests/fm-rex-program-status-live-e2e.test.sh'. That round only added the assertion (tests/fm-rex-program-status-live-e2e.test.sh:153-166). No run of it is recorded: the dated table in docs/verification/runtime-backends.md still shows only working for Claude Code 2.1.308 and has no 'root record leaves working after the turn' result. So fm_backend_rex_busy_state still trusts working as busy (bin/backends/rex.sh:1149) with the turn-end edge unproven for the version that was probed. If it never leaves working, every busy consumer stays stuck on busy: away-mode inject deferral, pending-reply observation, the inbox doorbell, and busy rex-native. Fix: run the opt-in guard (FM_REX_STATUS_LIVE=1) and record its turn-end line in docs/verification/runtime-backends.md, or reword the doc to say the guard checks this instead of claiming it is proven.
  • ⚠️ bin/fm-spawn.sh:965 - Simplification (re-reported because it was never decided in round 1): the new fm-spawn.sh --title &lt;text&gt; option and its relaunch rename branch (bin/fm-spawn.sh:4226-4231, 1013-1016) go beyond the intent ('make [titles] relevant and sidebar sized'). The automatic label already meets it: a kind marker plus the condensed backlog title, else the task id (fm_backend_rex_tab_label). No caller in AGENTS.md, the skills, or the scripts passes --title. Recommended remedy: remove the option and keep the automatic backlog-derived label.
  • ⚠️ bin/fm-rex-marks.sh:207 - Simplification (re-reported because it was never decided in round 1): the labels channel of config/rex-status-marks is a third mode the intent does not ask for. It prefixes '⚑ ' to tab labels through window ls and window rename, and brings its own undo, channel switch, and cache mode (bin/fm-rex-marks.sh:205-209, 266-272; bin/backends/rex.sh fm_backend_rex_label_flag). The intent asks for Rex-native signals (tab badges, session picker, Activity sidebar, Dock badge, notifications), which the on program-status mark already provides. Recommended remedy: remove labels and keep on/off. If --title is also removed, fm_backend_rex_label_flag has no remaining caller.

🔧 Fix applied.
3 warnings still open:

  • ⚠️ bin/fm-spawn.sh:965 - Simplification: the new fm-spawn.sh --title &lt;text&gt; option and its relaunch rename path (bin/fm-spawn.sh:4228-4239, 1013) are not needed for the intent ('make [titles] relevant and sidebar sized'). That intent is already met by the automatic label: a kind marker plus the condensed backlog title, else the task id (fm_backend_rex_tab_label). Nothing in AGENTS.md, the skills, or any caller passes --title, so it only adds an unused override plus a relaunch-time rename branch. Recommended: remove the option and keep the automatic backlog-derived label.
  • ⚠️ bin/fm-spawn.sh:965 - Simplification (re-reported because it was never decided in round 1): the new fm-spawn.sh --title &lt;text&gt; option and its relaunch rename branch (bin/fm-spawn.sh:4226-4231, 1013-1016) go beyond the intent ('make [titles] relevant and sidebar sized'). The automatic label already meets it: a kind marker plus the condensed backlog title, else the task id (fm_backend_rex_tab_label). No caller in AGENTS.md, the skills, or the scripts passes --title. Recommended remedy: remove the option and keep the automatic backlog-derived label.
  • ⚠️ docs/verification/runtime-backends.md:2331 - Left behind by round 2's labels-channel removal (3e3fa93). That round deleted the labels fallback and rewrote the real smoke assertion (tests/fm-backend-rex-smoke.test.sh:142-145) into a plain tab-rename check with a new pass line ('...cleared alone; a tab rename takes'). The dated evidence block here still records the old output ('...cleared alone; the labels fallback flags the tab'). As a result, the verification doc presents a lab-run result for a feature that no longer exists, and the new rename assertion has no recorded run. No other stale reference remains: git grep finds no label_flag, FLAG_PREFIX, or ⚑ anywhere else, and the configuration, rex-backend and skill docs were all updated. Fix: re-run the real smoke and replace the recorded line, or mark the line as recorded before the labels channel was removed.

🔧 Fix applied.
2 warnings still open:

  • ⚠️ bin/fm-spawn.sh:965 - Simplification: the new fm-spawn.sh --title &lt;text&gt; option and its relaunch rename path (bin/fm-spawn.sh:4228-4239, 1013) are not needed for the intent ('make [titles] relevant and sidebar sized'). That intent is already met by the automatic label: a kind marker plus the condensed backlog title, else the task id (fm_backend_rex_tab_label). Nothing in AGENTS.md, the skills, or any caller passes --title, so it only adds an unused override plus a relaunch-time rename branch. Recommended: remove the option and keep the automatic backlog-derived label.
  • ⚠️ bin/fm-spawn.sh:965 - Simplification (re-reported because it was never decided in round 1): the new fm-spawn.sh --title &lt;text&gt; option and its relaunch rename branch (bin/fm-spawn.sh:4226-4231, 1013-1016) go beyond the intent ('make [titles] relevant and sidebar sized'). The automatic label already meets it: a kind marker plus the condensed backlog title, else the task id (fm_backend_rex_tab_label). No caller in AGENTS.md, the skills, or the scripts passes --title. Recommended remedy: remove the option and keep the automatic backlog-derived label.
🔧 **Test** - 1 issue found → no changes applied ✅
  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 414ms ago (178 observed); agent reported: claude parse events: context deadline exceeded. This is a budget or provider-slowness cut, not a code failure. Re-running the same request costs another full budget, so no further attempt is made automatically. If this repository's targeted tests or evidence gathering routinely approach the default 30m0s, raise test_agent_timeout in global config. Respond with fix to spend another budget: a repair turn runs only for selected findings other than this budget cut, then validation re-runs. Or abort and retry after raising the budget.

🔧 No changes applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
A worker's Rex tab gets a short, relevant sidebar label (kind marker plus explicit --title, else a condensed backlog title, else the task id), and the tab opens unfocused in the home's fm-local sessio… ✅ pass live fm-backend-rex-smoke.log: 'one fm-local session holding exactly the task tabs, unfocused labeled tabs'; fm-backend-rex.log: 'tab labels are sidebar sized - explicit title, else a condensed backlog tit…
A worker that needs the captain shows a Rex-native attention mark (program-status record plus desktop notification) that clears on its own when resolved, and config off disables it (labels channel rem… ✅ pass live fm-backend-rex-smoke.log: 'a mark is an invisible id=fm record plus a streamed desktop notification ... cleared alone; a tab rename takes'; fm-backend-rex.log: 'the marks producer plans from status, w…
The watcher wakes on real Rex events: a blocked or dead edge is reported, and an unreachable server reads as unusable, never as dead ✅ pass live fm-backend-rex-smoke.log: 'the event wait returns a real blocked report and a real exit as dead, and an unreachable server is unusable, never dead'; fm-backend-rex.log: event-wait escalation/reconcile…
Adversarial: tearing down a Rex worker does not wake Firstmate with a false 'pane closed' (kill pre-commits the dead edge) ⏸️ untested no The prior payload did not establish a live result: it recorded live=false. The kill pre-commit was checked only by the deterministic adapter suite, and the smoke proved only kill's exit 3 and session…
Existing teardown and daemon behavior does not regress (stale/wake handling, endpoint safety, Rex wedge-alarm channel) ⏸️ untested no The prior payload did not establish a live result: it recorded live=false. Only deterministic suites ran (fm-daemon 151 ok, fm-teardown-endpoint-safety 27 ok, fm-backend 32 ok, fm-transition-lib passe…
  • env -u REX_SESSION -u REX_BLOCK -u REX_CLIENT -u REX_SERVER bash tests/fm-backend-rex.test.sh (34 ok)
  • env -u REX_* PATH=$REX_BIN_DIR:$PATH FM_REX_SMOKE=1 bash tests/fm-backend-rex-smoke.test.sh against a private fm-rex-lab server, using the bundled Rex CLI at the adapter's documented app-bundle path (12 ok, lab torn down)
  • bash tests/fm-transition-lib.test.sh (all assertions passed)
  • bash tests/fm-backend.test.sh (32 ok)
  • bash tests/fm-daemon.test.sh (151 ok)
  • bash tests/fm-teardown-endpoint-safety.test.sh (27 ok)
  • bash tests/fm-teardown.test.sh (118 ok, 0 not ok before the 20-minute background limit stopped it)
  • Post-run check: /tmp/fm-rex-lab-$UID is empty, no fm-rexlab processes remain, worktree clean
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…bels

Phase 3 of the Rex backend: the captain sees which worker needs them from
Rex itself, and the watcher wakes on Rex events instead of only polling.

- fm-rex-marks.sh maps each Rex task's latest status to one OSC 7501
  id=fm program-status record on its pane plus an OSC 777 notification on
  each new attention state; the watcher syncs it each poll and cleanup
  clears it. config/rex-status-marks selects on (default), off, or labels.
- The Rex adapter follows `rex events` per session, reconciles after every
  subscribe, escalates a blocked root status or an exited agent or closed
  pane at once, ignores Firstmate's own records, and treats exit 4 as
  unusable, never dead.
- busy_state and submit confirmation read the root program status only for
  harnesses a live guard proves (Claude Code today).
- The away-mode wedge alarm gains a rex channel, added by auto when
  Firstmate runs in a Rex pane.
- Worker tab labels are sidebar-sized: kind marker plus a few words from
  fm-spawn --title, the backlog title, or the task id, at most 24 visible
  characters; the block label stays the identity check.
- New opt-in per-harness program-status live guard, docs, and dated
  verification evidence.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-22T09:29:00.977887Z
We couldn’t complete this review. Comment @codex review to try again.
1979d4e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant