Skip to content

fix(bin): keep secondmate restarts from losing or masking a navigator - #48

Merged
ductiletoaster merged 7 commits into
mainfrom
fm/op-sm-restart-fix
Nov 2, 2026
Merged

ductiletoaster merged 7 commits into
mainfrom
fm/op-sm-restart-fix

Conversation

@ductiletoaster

@ductiletoaster ductiletoaster commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Intent

Ship ONE operator PR with all the Recommendations in the navigator restart diagnosis report:
(a) the secondmate relaunch holds the per-task liveness lock, and the liveness relaunch never kills an endpoint while a spawn of that task is in flight;
(b) firstmate-launched Claude agents get "disableAgentView": true (no /background, --bg, agent view or on-demand daemon);
(c) fm-control refuses /exit on a background-kind Claude session with a precise reason;
(d) fm-secondmate-restart reports the real error line and does not wait 900 s on a mate whose endpoint is already gone.
Include a regression test from the lab reproduction. It is a local carry in pixeloven/operator under the maintainer role; an upstream offer is drafted later, not published now. The operator merges.

Report substance: restarting a persistent secondmate failed two ways. (1) During fm-control.sh relaunch the pane holds only a shell for 20-30 s; the watcher's secondmate liveness tick (bin/fm-watch.sh, bin/fm-secondmate-liveness-lib.sh) classifies it dead, kills the endpoint, then its own fm-spawn is refused by the relaunch's spawn lock ("another spawn is already creating task"), leaving no endpoint. Reproduced in a tmux lab; holding the per-task liveness lock during the relaunch prevents it. fm-secondmate-restart masked the real error by reporting the first stderr line (an unrelated NOTICE or fm-config-inherit advisory). (2) A Claude session converted to a Claude Code background session by /background treats /exit as detach (prints a recap) and keeps running outside its pane, so fm-control's 30 s exit wait ends exit=unconfirmed.

Follow-up decision (operator, 2026-11-02): PR #47 merged to main (1aaf68c) and added ADR-0025 (remote-test timing deflake). Bring PR #48 up to date by MERGING origin/main into fm/op-sm-restart-fix as a new merge commit (no rebase, no force-push). The merge resolves the shared ADR index, documentation-audiences, fork-contract and identity conflicts by keeping BOTH entries (ADR-0025 from #47 and ADR-0026 from #48), and the A4 allowlist in .github/workflows/pixeloven-gates.yml (mirrored in docs/pixeloven/identity.md) as the union of both sides. Do not merge the PR.

What Changed

  • Liveness and relaunch no longer race. fm-control.sh <id> relaunch for a secondmate, and fm-remote-secondmate-relaunch.sh, now take the mate's per-task liveness lock before the old agent stops. They wait up to FM_CONTROL_LIVENESS_WAIT (default 30 s) for the lock and refuse if a check still holds it after that. They keep it until the relaunch settles. Separately, fm_secondmate_liveness_relaunch refuses to kill an endpoint while that task's fm-spawn lock is held, and checks again under the lock that the endpoint still reads dead. The watcher logs these deferred skips (FM_SM_LIVE_DEFERRED) and checks again on the next tick instead of raising an error.
  • Background Claude sessions are disabled and refused. Every Claude agent launched by fm-spawn.sh now gets "disableAgentView": true in its --settings, for both crewmates and secondmates. This turns off /background, --bg, agent view and the on-demand daemon. fm-control.sh exit and relaunch now refuse a Claude agent that claude agents --json --cwd lists as a live background-kind session. The check runs before any key is sent, and the refusal names the session ID and pid and gives the claude stop recovery steps.
  • fm-secondmate-restart.sh reports the real failure and skips dead mates. A failed restart now reports its first and last error: lines and ignores NOTICE:, WARNING: and fm-config-inherit: advisories. A local mate whose endpoint already reads missing or dead is reported unreached straight away, without sending the persist request or waiting out its timeout. Regression tests are added for the liveness, control, relaunch, remote-relaunch, restart and wake-queue paths. A new default-on live test, fm-claude-agent-view-live-e2e.test.sh, checks the installed claude against both agent-view assumptions. The change is recorded as a local carry in ADR-0026 and added to the fork-contract A4 allowlist, the ADR index and the documentation-audiences file, next to ADR-0025 from main.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The new merge commit only resolves the shared ADR registry and fork-contract conflicts as the user asked: it keeps both the ADR-0025 and ADR-0026 entries and makes the A4 allowlist the union of both sides, identical in the workflow and identity.md. The carried secondmate fixes already went through earlier review rounds, and re-tracing their locking, spawn-lock guard, restart reporting and disableAgentView changes found no new reachable defect.

Testing

I drove the disableAgentView guard live. A real Claude session in a disposable tmux lab, given fm-spawn's exact settings, rejected /background as an unknown command, stayed interactive and exited cleanly on /exit. All seven targeted suites that finished passed, but they ran on fixtures or a scripted lab, not against the live product, so their scenarios are marked untested. The spawn-dispatch-profile suite hit the background time limit with no failures. The worktree is clean.

  • Live validation: ⚠️ inconclusive - 1 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A Firstmate-launched Claude agent (disableAgentView) cannot be sent to the background: /background is an unknown command and /exit really exits ✅ pass live live-claude-background-disabled.txt; fm-claude-agent-view-live-e2e.log
A watcher liveness tick on a real tmux endpoint holding only a shell, during an in-flight relaunch, leaves the endpoint intact (lab reproduction) ⏸️ untested no The prior payload did not establish a live result. This ran only as a scripted reproduction on a private tmux server (fm-secondmate-liveness.test.sh, exit 0), not as a restart driven by the primary ag…
fm-control relaunch holds the per-task liveness lock across the agent-free gap, releases it after, and refuses while a liveness check holds it ⏸️ untested no The prior payload did not establish a live result. This ran only against the fixture backend in fm-control-relaunch.test.sh.
Remote secondmate relaunch holds the parent's liveness lock and refuses before contacting the host when the lock stays busy ⏸️ untested no The prior payload did not establish a live result. This ran only on fixtures, because no remote host was available for a live drive.
fm-control exit/relaunch on a background-kind Claude session is refused with a precise reason and nothing is typed ⏸️ untested no The prior payload did not establish a live result. A live drive needs a real session sent to the background on the operator's Claude daemon, which was not done without the operator's opt-in. Only the…
fm-secondmate-restart reports the real error line and reports a missing-endpoint mate at once, without the 900 s wait ⏸️ untested no The prior payload did not establish a live result. This ran only in the fixture-driven fm-secondmate-restart.test.sh suite.
Evidence: Live Claude /background refused under disableAgentView

Source: Live Claude /background refused under disableAgentView

 ▐▛███▛█   Claude Code v2.1.316
▝▜██████▀  Opus 5.5 · Claude Enterprise
 ▝▝   ▝▝   /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-lab.OiS7Zt/cwd
  ⎿  SessionStart:startup says: dotfiles: 2 changes not codified - run /codify
⏺ Unknown command: /background
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ 
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏵⏵ auto mode on (shift+tab to cycle)                    tmux focus-events off · add 'set -g focus-events on' to ~/.tmux.conf and reattach for focus tracking
no server running on /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-lab.OiS7Zt/tmux/tmux-502/fm-lab
Evidence: Live agent-view e2e guard

Source: Live agent-view e2e guard

ok - claude 2.1.316 (Claude Code): 13 listed session(s) carry the kind, pid, cwd, and id fields the background check reads
ok - claude 2.1.316 (Claude Code): a disableAgentView --settings value disables agent view, and the session listing is a JSON array
EXIT=0 secs=4
Evidence: Secondmate liveness suite incl. real-tmux reproduction

Source: Secondmate liveness suite incl. real-tmux reproduction

ok - fm_backend_tmux_agent_state: separates live, dead, missing, ambiguous, and unreadable
ok - fm_backend_tmux_agent_state: rejects malformed targets before probing tmux
ok - fm_backend_herdr_agent_state: preserves missing/no-agent/live/unknown husk behavior
ok - fm_backend_agent_state: routes tmux/Herdr and keeps Zellij unverified
ok - sweep: a confirmed-dead secondmate endpoint is killed and respawned
ok - sweep: secondmate recovery resolves its durable account despite a different ambient login
ok - sweep: distinct secondmate relaunches serialize across the task-set lock
ok - sweep: an already-live secondmate is untouched and distinguishable in verbose diagnostics
ok - sweep: an authoritatively missing Pi secondmate window is relaunched
ok - sweep: an authoritatively missing pi-signed secondmate window is relaunched
ok - sweep: an existing ambiguous Pi process prevents duplicate recovery
ok - sweep: transient target unreadability never licenses recovery
ok - sweep: failed relaunch diagnostics distinguish a confidently missing endpoint
ok - sweep: an unverified harness blocks recovery with a concrete diagnostic
ok - sweep: idempotent by construction - a live secondmate is never re-touched on a later run
ok - sweep: skipped entirely under FM_BOOTSTRAP_DETECT_ONLY=1, exactly like the other mutating sweeps
ok - sweep: a silent no-op with no kind=secondmate meta present (a secondmate home's own natural scoping)
ok - sweep: a mate mid-episode under the shared liveness lock is skipped entirely
ok - relaunch: the spawn timeout bounds the lock wait before touching the endpoint
ok - sweep: an unreadable or unwritable relaunch ledger refuses to kill or spawn
ok - real tmux: a tick during an in-flight relaunch leaves the mate's endpoint intact
ok - relaunch: an endpoint that no longer reads dead under the spawn lock is never killed
ok - poll probe: remote states map to the same contract as local, one call each
ok - poll probe: unreachable or inconclusive remote reads preserve the route
# all fm-secondmate-liveness tests passed
EXIT=0 secs=270
Evidence: fm-control relaunch suite (liveness lock)

Source: fm-control relaunch suite (liveness lock)

ok - fm-spawn --relaunch: tracked opencode wiring is retired as on main
ok - fm-control removes the dialog file after exit and after relaunch
ok - fm-control exit removes the dialog file before it releases the control lock
ok - fm-control relaunch: a same-harness relaunch replaces the agent in the same endpoint and worktree
ok - fm-control relaunch: pending composer text refuses before the exit command is typed
ok - fm-control relaunch: an unreadable composer fails safe before the exit command is typed
ok - fm-control relaunch: a linked spawning home preserves committed and unfinished work in the recorded copy
ok - fm-control relaunch: durable task metadata survives replacement launch publication
ok - fm-control relaunch: delivery and concurrent task metadata publication serialize
ok - fm-control relaunch: disabling tracing clears metadata and pane context
ok - fm-control relaunch: progress and the Firstmate-worktree worker identity reach the replacement
ok - fm-control relaunch: the progress note's inbox listing is silent on an empty inbox
ok - fm-control relaunch: a ship task refuses without the progress note its replacement needs
ok - fm-control relaunch: switching harness is one ordinary relaunch, and the old wiring goes with the old agent
ok - fm-control relaunch: a refused relaunch onto polytoken keeps the project's own hook layer and the running agent
ok - fm-control relaunch: a refused polytoken profile leaves the running agent untouched
ok - fm-spawn --relaunch: retiring a raw polytoken launch's wiring keeps the project's own layers
ok - fm-control relaunch: a harness switch resets model and effort unless they are named too
ok - fm-control relaunch: a prefixed recorded harness can switch adapters transactionally
ok - fm-control relaunch: a prefixed command requires an explicit replacement harness
ok - fm-control relaunch: a same-harness relaunch keeps the profile axes it was running with
ok - native Ultra relaunch preserves its profile and rejects an unsupported model before stopping
ok - fm-control relaunch: a signed-out worker account pin refuses before the old agent stops
ok - fm-control relaunch: the replacement follows the home's current worker account pin
ok - fm-control relaunch: mate pins are re-read for Claude and Pi, and unusable pins refuse before stopping the agent
ok - fm-control relaunch: a Pi replacement keeps the home's tool exclusions
ok - fm-control relaunch: exclusion-list refusals happen before the running agent stops
ok - fm-control relaunch: explicit model and effort win over the recorded ones
ok - fm-control relaunch: refuses to relaunch onto an adapter with no verified mechanics
ok - fm-control relaunch: the retired incarnation's global turn-end token is revoked
ok - fm-control relaunch: wiring cleanup failure refuses replacement arming
ok - fm-control-lib: one owner resolves each harness's turn-end registry entry, and refuses a malformed token
ok - fm-control relaunch: a secondmate relaunch re-resolves its durable configured harness pin
ok - fm-control relaunch: a claude secondmate keeps settings.local.json and retires the state settings file and the Stop pointer
ok - fm-control relaunch: a mate with a per-mate override line lands on that override, not the default pin
ok - fm-control relaunch: a mate with no override line still resolves the default pin
ok - fm-control relaunch: a legacy secondmate pin file still relaunches the mate onto its first line
ok - fm-control relaunch: an unparseable secondmate pin refuses before anything is stopped
ok - fm-control relaunch: invalid configured effort is ignored before stop
ok - fm-control relaunch: an adapter unverified for this task kind refuses before the agent is stopped
ok - fm-control relaunch: explicit secondmate harness resets unnamed profile axes
ok - fm-control relaunch: a ship task keeps its recorded harness instead of re-reading crew config
ok - fm-spawn --relaunch: with no explicit harness it reuses the task's recorded one, never the crew default
ok - fm-spawn --relaunch: a promoted scout with a recorded custom branch relaunches on it instead of being refused
ok - fm-promote/fm-spawn --relaunch: the current ship contract supersedes stale scout delivery text
ok - fm-spawn --relaunch: wiring armed under a prefixed harness name is still retired
ok - fm-spawn --relaunch: switching away from muse retires its session binding
ok - fm-spawn --relaunch: switching away from cursor retires its session binding
ok - fm-control relaunch: an unaccountable local copy refuses before the agent is touched
ok - fm-control relaunch: a worker with nothing to work from is never launched
ok - fm-control relaunch: a refusal before the agent is stopped leaves the durable record untouched
ok - fm-control relaunch: checkpoint inspection failures refuse before stopping
ok - fm-control relaunch: a launch failure after the stop keeps the prior record and reports the real state
ok - fm-control relaunch: unpublished rollback keeps concurrent durable metadata
ok - fm-control relaunch: post-publication failure keeps the new durable record
ok - fm-control relaunch: partial stop reconciles actual agent state
ok - fm-control relaunch: failed journal replacement preserves durable phase
ok - fm-spawn relaunch: prepublication abort removes replacement state
ok - fm-control relaunch: the checkpoint records the exact unlanded work it preserved
ok - fm-control relaunch: a secondmate's child work is accounted for and its charter is left alone
ok - fm-control relaunch: a secondmate's liveness lock spans the agent-free gap and is released after
ok - fm-control relaunch: a mate held by a liveness check is refused before its agent is touched
ok - fm-control relaunch: a secondmate home that is not this secondmate's is refused
ok - fm-control relaunch: unreadable child records fail checkpoint
ok - fm-control relaunch: unlistable state fails checkpoint
ok - fm-control relaunch: a vanished watcher scratch file does not fail the child-record checkpoint
ok - fm-control relaunch: two control actions on one task serialize instead of interleaving
ok - fm-spawn relaunch: direct entry participates in lifecycle serialization
ok - fm-promote: promotion participates in lifecycle serialization
ok - fm-spawn --relaunch: refuses to launch a second agent into a live endpoint
ok - fm-spawn --relaunch: symlinked records refuse before inspection
ok - fm-spawn --relaunch: keeps its early meta lock continuous
ok - fm-spawn --relaunch: pending closes refuse before replacement begins
ok - fm-spawn --relaunch: every identity axis comes from the record, and a contradicting flag refuses
ok - fm-spawn --relaunch: an unrecorded task is refused
ok - fm-spawn --relaunch: refuses to start a replacement outside the copy holding its work
ok - tmux: a window absent from its session refuses both verbs rather than being assumed gone
ok - tmux: an unfindable session refuses both verbs, so a live agent is never duplicated
ok - tmux: a dead server on this socket refuses both verbs rather than proving absence
ok - reclaim: an unclassifiable endpoint is still refused, so two agents cannot share one
sed: 1: "/private/var/folders/1c ...": invalid command code v
sed: 1: "/private/var/folders/1c ...": invalid command code v
ok - fm-spawn --relaunch: resumes the bound Pi session only for a Pi registration
ok - reclaim: a herdr pane that outlived its stopped server is adopted, never orphaned beside a new tab
ok - fm-control exit: a herdr pane that outlived its stopped server is already-stopped, not gone
ok - reclaim: a herdr rebind is created in the session the record names, never the ambient one
ok - reclaim: a herdr agent that came back with its server refuses, so one worktree keeps one agent
ok - reclaim: a herdr reclaim rebinds the endpoint and leaves the whole rest of the task alone
ok - reclaim: a herdr secondmate whose endpoint is gone is sent to its own respawn owner
ok - reclaim: a rebind refused from a plain shell reports the real cause, not a fabricated session mismatch
ok - relaunch re-reads the backlog item instead of blindly re-running the transition
ok - relaunch heals an item that drifted out of In flight while the task stayed live
ok - away supervision relaunches existing In-flight and queued items under the saturated fresh-spawn spend cap
EXIT=0 secs=1248
Evidence: fm-control suite (background refusal)

Source: fm-control suite (background refusal)

ok - fm-control exit: every verified harness gets its own verified exit command
ok - fm-control interrupt: every verified harness gets its own verified key and repeat count
ok - fm-control Devin interrupt: second press only after the armed hint, then busy invalidated without fabricating idle
ok - fm-control Devin interrupt: an idle agent gets one Escape and reports not-running
ok - fm-control Devin exit: a busy record whose turn already ended never opens the revert picker
ok - fm-control Devin interrupt: a revert picker a press opened is closed with Escape, never Enter
ok - fm-control Devin: an open revert picker refuses every typed command
ok - fm-control interrupt: opencode needs a double Escape, claude a single one
ok - fm-control: a harness with no verified control mechanics is refused, not guessed at
ok - fm-control-lib: a recorded harness resolves to its verified adapter without guessing
ok - fm-control-lib: only a runtime's own recorded session has a relaunch resume form
ok - fm-control: prefixed recorded harnesses reach interrupt and exit mechanics
ok - fm-control-lib: the backend key matrix matches each adapter's real send-key surface
ok - fm-control-lib: adapter capability is per task kind, not per adapter alone
ok - fm-control interrupt: a backend that cannot deliver the harness's key refuses instead of sending another
ok - fm-control: a backend that cannot prove an agent stopped refuses exit and relaunch
ok - fm-control relaunch: commandcode off tmux and herdr is refused before the running agent is stopped
ok - fm-control-lib: stop-proving verbs are gated on the backends that really classify agent state
ok - fm-control: a legacy window label is refused and the exact task id is named
ok - fm-control: an explicit backend endpoint is never a control target
ok - fm-control: an unrecorded task id is refused
ok - fm-control: a record whose endpoint identity names another task is refused
ok - fm-control: a remotely placed secondmate is refused by placement, not by a metadata complaint
ok - fm-control: interrupt and exit lock before task-state resolution
ok - fm-control: the verb list is closed - no raw keys, arbitrary text, or clear verb
ok - fm-control: resume is refused with the determinism reason and the alternative
ok - fm-control: profile and note flags belong to relaunch only
ok - fm-control exit: an already-stopped agent is idempotent success with no bytes sent
ok - fm-control exit/relaunch: a Claude background session is refused with its recovery, nothing typed
ok - fm-control exit: an unprovable tmux endpoint refuses instead of claiming the agent stopped
ok - fm-control interrupt: refuses when no agent is running rather than keying a shell
ok - fm-control exit: an endpoint whose process cannot be attributed refuses
ok - fm-control exit: a busy agent receives interrupt delivery before the exit command
ok - fm-control exit: an idle agent goes straight to its exit command
ok - fm-control exit: retiring a codex incarnation drops busy_gen with the sidecar
ok - fm-control exit: an already-open background-task picker is not typed into
ok - fm-control exit: the Enter that opens the background-task picker is not followed by a confirming Enter
ok - fm-control exit: a picker that renders after the submit returned is named when the stop wait times out
ok - fm-control interrupt: unconfirmed delivery preserves observed busy state
ok - fm-control interrupt: muse confirms cancellation from its session log
ok - fm-control interrupt: postconditions are revalidated after acknowledgement polling
ok - fm-control exit: an interrupt-stopped agent satisfies the gone-state postcondition
ok - fm-control exit: a stubborn agent reports delivered input and an unconfirmed exit
ok - fm-control interrupt: grok reports delivery without claiming cancellation
ok - fm-control interrupt: grok's idle footer does not confirm cancellation
ok - fm-control: a lifecycle command to a secondmate is unmarked and opens no reply expectation
ok - fm-control's arrival leaves fm-send's from-firstmate marking untouched
EXIT=0 secs=617
Evidence: Secondmate restart suite

Source: Secondmate restart suite

ok - T1 persist is a gate, and asks for open records and task status only
ok - T2 the mate persists before anything is stopped
ok - T2b an arrived persist answer is resolved before timeout
ok - T2c a reply between the preliminary scan and timeout decision wins
ok - T3 a runtime that cannot prove a restart falls back to the re-read message
ok - T4 every named mate is accounted for, including one this home does not know
ok - T5 a refused restart leaves the mate running and reports an unknown outcome
ok - T8 a local restart re-resolves this home's pin and reports the runtime that came up
ok - native Ultra survives local restart and the remote restart transport
ok - T6 a remote mate restarts through the host-local control plane over the fm-on hop
ok - T6a a remote mate with a per-mate override restarts onto that override, not the default pin
ok - T6b a remote mate with no override line still restarts onto the default pin
ok - T6d a legacy pin file still restarts the mate onto its first line
ok - T6c an unreadable per-mate pin falls back to the re-read path with its agent left running
ok - T7 an unreachable host is reported honestly instead of claimed as reloaded
ok - T9 the persist gate retains its explicitly allocated correlation
ok - T10 pending persist answers are polled as one fleet
ok - T11 post-stop restart failure is never misreported as a nudge
ok - T11b a failed restart reports its error lines, never an advisory printed on the way
ok - T11c a gone or agent-less mate is reported at once, with no request and no wait
ok - T12 relaunch waits do not block fleet persistence polling
ok - T13 a dead restart worker cannot hang the parent
ok - T14 a result published during reaping is honored
ok - T15 an already-current live mate is named by the update pass and genuinely restarted
ok - T16 an already-current mate with an unprovable runtime keeps the honest nudge path
# all fm-secondmate-restart tests passed
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/pre-rebase: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/pre-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/pre-auto-gc: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/pre-merge-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/post-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/sendemail-validate: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/applypatch-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/prepare-commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/post-checkout: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/post-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/post-rewrite: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/pre-push: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/post-merge: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks/pre-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state/sm1.git-hooks: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home/state: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737/home: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/already-current-2737: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/pre-rebase: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/pre-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/pre-auto-gc: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/pre-merge-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/post-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/sendemail-validate: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/applypatch-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/prepare-commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/post-checkout: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/post-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/post-rewrite: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/pre-push: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/post-merge: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks/pre-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state/sm1.git-hooks: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home/state: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419/home: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/pin-20419: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/answer-at-timeout-decision-13565/home/state/sm1.git-hooks/pre-rebase: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/

... [16345 bytes truncated] ...

arrived-at-bound-20296/home/state/sm1.git-hooks/applypatch-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/prepare-commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/post-checkout: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/post-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/post-rewrite: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/pre-push: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/post-merge: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks/pre-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state/sm1.git-hooks: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home/state: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296/home: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/arrived-at-bound-20296: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/pre-rebase: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/pre-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/pre-auto-gc: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/pre-merge-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/post-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/sendemail-validate: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/applypatch-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/prepare-commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/post-checkout: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/post-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/post-rewrite: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/pre-push: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/post-merge: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks/pre-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state/sm1.git-hooks: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home/state: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694/home: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/native-local-29694: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/pre-rebase: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/pre-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/pre-auto-gc: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/pre-merge-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/post-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/sendemail-validate: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/applypatch-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/prepare-commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/post-checkout: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/post-applypatch: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/post-rewrite: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/commit-msg: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/pre-push: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/post-merge: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks/pre-commit: Permission denied
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state/sm1.git-hooks: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home/state: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772/home: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6/post-stop-8772: Directory not empty
rm: /private/var/folders/1c/ft160xld787dzk2t3vdtrx0r0000gp/T/fm-secondmate-restart.OKvbS6: Directory not empty
EXIT=0 secs=566

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (1 of 6 scenarios were driven live against the product); untested: A watcher liveness tick on a real tmux endpoint holding only a shell, during an in-flight relaunch, leaves the endpoint intact (lab reproduction), fm-control relaunch holds the per-task liveness lock across the agent-free gap, releases it after, and refuses while a liveness check holds it, Remote secondmate relaunch holds the parent's liveness lock and refuses before contacting the host when the lock stays busy, fm-control exit/relaunch on a background-kind Claude session is refused with a precise reason and nothing is typed, fm-secondmate-restart reports the real error line and reports a missing-endpoint mate at once, without the 900 s wait
  • Live validation: ⚠️ inconclusive - 1 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A Firstmate-launched Claude agent (disableAgentView) cannot be sent to the background: /background is an unknown command and /exit really exits ✅ pass live live-claude-background-disabled.txt; fm-claude-agent-view-live-e2e.log
A watcher liveness tick on a real tmux endpoint holding only a shell, during an in-flight relaunch, leaves the endpoint intact (lab reproduction) ⏸️ untested no The prior payload did not establish a live result. This ran only as a scripted reproduction on a private tmux server (fm-secondmate-liveness.test.sh, exit 0), not as a restart driven by the primary ag…
fm-control relaunch holds the per-task liveness lock across the agent-free gap, releases it after, and refuses while a liveness check holds it ⏸️ untested no The prior payload did not establish a live result. This ran only against the fixture backend in fm-control-relaunch.test.sh.
Remote secondmate relaunch holds the parent's liveness lock and refuses before contacting the host when the lock stays busy ⏸️ untested no The prior payload did not establish a live result. This ran only on fixtures, because no remote host was available for a live drive.
fm-control exit/relaunch on a background-kind Claude session is refused with a precise reason and nothing is typed ⏸️ untested no The prior payload did not establish a live result. A live drive needs a real session sent to the background on the operator's Claude daemon, which was not done without the operator's opt-in. Only the…
fm-secondmate-restart reports the real error line and reports a missing-endpoint mate at once, without the 900 s wait ⏸️ untested no The prior payload did not establish a live result. This ran only in the fixture-driven fm-secondmate-restart.test.sh suite.
  • bash tests/fm-claude-agent-view-live-e2e.test.sh (installed Claude Code v2.1.316): exit 0
  • bash tests/fm-secondmate-liveness.test.sh (real private-tmux lab reproduction of the in-flight relaunch): exit 0, 24 ok
  • bash tests/fm-control-relaunch.test.sh: exit 0, 91 ok, including the liveness-lock gap and busy-lock refusal tests
  • bash tests/fm-control.test.sh: exit 0, 47 ok, including the background-session refusal
  • bash tests/fm-secondmate-restart.test.sh: exit 0, 25 ok
  • bash tests/fm-remote-secondmate-relaunch.test.sh: exit 0
  • bash tests/fm-secondmate-harness.test.sh: exit 0, 56 ok
  • bash tests/fm-spawn-dispatch-profile.test.sh: stopped at the background time limit after 71 ok and no failures
  • Live lab: tmux on the private fm-lab socket, a disposable mktemp lab, real claude --settings &#39;{&#34;feedbackDrafts&#34;:&#34;off&#34;,&#34;disableAgentView&#34;:true}&#39;; /background returned 'Unknown command'; claude agents --json reported kind interactive; /exit ended the session; lab removed
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

Firstmate Autonomous Worker and others added 7 commits October 30, 2026 16:15
Restarting a persistent secondmate failed two ways, and the restart
report hid the first.

- fm-control relaunch of a secondmate now holds that mate's per-task
  liveness lock from before the old agent stops until the transaction
  settles, so the watcher tick and session-start sweep skip the mate
  instead of reading the shell-only gap as dead and killing its endpoint.
- The liveness relaunch never kills an endpoint while a spawn of that
  task holds its spawn lock (a relaunch or a hand-run respawn), and
  re-reads the endpoint under that lock before killing it. Those skips
  are flagged deferred, so the watcher logs them instead of failing.
- Every firstmate-launched Claude agent gets "disableAgentView": true
  in its --settings value (crewmate inline JSON and the secondmate
  settings file), turning off /background, --bg, agent view and the
  on-demand daemon for those agents only.
- fm-control exit and relaunch refuse, before any key is sent, a Claude
  agent that `claude agents --json --cwd` lists as a live background
  session, and name the recovery (persist, claude stop, relaunch).
- fm-secondmate-restart reports the restart's own error lines (first
  cause and last state) and skips NOTICE/WARNING/warning and
  fm-config-inherit advisories; a local mate whose endpoint is already
  missing or dead is reported at once with no persist request and no
  900 s wait.

Tests: the lab reproduction becomes a real private-tmux regression (a
tick during an in-flight relaunch leaves the endpoint intact) plus a
watcher-level regression of the incident; fm-control lock and
background-session cases; restart reason and no-agent cases; and a
token-free live guard for the Claude agent-view surfaces, recorded in
docs/verification/runtime-backends.md.
…stly

- fm-remote-secondmate-relaunch.sh holds the parent home's per-task
  liveness lock for the whole remote relaunch (bounded by
  FM_CONTROL_LIVENESS_WAIT, released on every exit), so the parent
  watcher's remote probe cannot read the host's agent-free gap as a dead
  mate and start a relaunch of its own; a check that keeps the lock
  refuses the relaunch before anything reaches the host.
- fm-secondmate-restart reports a local mate whose endpoint reads
  missing as not found from this home (gone or unreachable), since a
  missing reading alone does not prove the endpoint was destroyed.
- The restart suite's concurrency test now keeps its modeled remote
  relaunch in flight until the local relaunch stops its agent (bounded),
  instead of betting on a fixed sleep.
…d because this PR changes 15 upstream-owned files that no ADR covers. They are bin/fm-control.sh, bin/fm-remote-secondmate-relaunch.sh, bin/fm-secondmate-liveness-lib.sh, bin/fm-secondmate-restart.sh, bin/fm-test-run.sh, docs/agent-control.md, docs/verification/runtime-backends.md, and eight test files. The rule A4 enforces: every path that differs from the upstream pin must sit in a PixelOven namespace or an ADR's file list, and the workflow allowlist must match its copy in identity.md. The fix follows the pattern from ADR-0021, 0023 and 0024: - **New ADR:** added docs/adr/0025-secondmate-restart-reliability.md, which lists every inherited file this PR touches and what each may carry. That includes fm-spawn.sh, fm-watch.sh, configuration.md, remote-secondmates.md and the spawn tests, which were already on the allowlist but only for other ADRs' changes. - **Allowlist:** added the 15 paths to the A4 allowlist in .github/workflows/pixeloven-gates.yml, and made the identical edit to its copy in docs/pixeloven/identity.md. - **Registration:** added the ADR to docs/adr/README.md and docs/documentation-audiences.json, and to the ADR lists in fork-contract.md and identity.md. - **Status:** I set the ADR to Accepted, because the user intent explicitly asks for this local carry. ADR-0024 was set to Proposed in a similar case, so the operator may want to change it. - **Alternatives:** the ADR's "Alternatives considered" section is my own reasoning, not taken from the diagnosis report, so the operator should review it before merging. Local results: I ran the fork-contract step taken from the workflow, and checks A1–A4 and A6–A11 pass, including A4. A5 still fails locally, but only because macOS sed rejects the step's `1{/^$/d}` command. That was the same in earlier rounds, README.md is unchanged, and A5 passed in CI. tests/fm-documentation-audiences.test.sh and bin/fm-doc-audience-check.sh pass. bin/fm-lint-workflows.sh was not run because actionlint is not on PATH; the workflow edit only changes the allowlist pattern. The new ADR file is staged with `git add -N` so the documentation-audience check can see it
ADR-0025 is taken by the open serial 5 carry, so this carry becomes
ADR-0026, titled to match the decision. The ADR index, documentation
inventory, fork contract, and identity ADR lists follow, and the ADR now
states that the upstream offer is drafted later, not published now.
# Conflicts:
#	.github/workflows/pixeloven-gates.yml
#	docs/adr/README.md
#	docs/documentation-audiences.json
#	docs/pixeloven/fork-contract.md
#	docs/pixeloven/identity.md
@ductiletoaster ductiletoaster changed the title fix(secondmate): stop restarts from losing or masking a navigator fix(bin): keep secondmate restarts from losing or masking a navigator Nov 2, 2026
@ductiletoaster
ductiletoaster merged commit 4919eb0 into main Nov 2, 2026
25 of 26 checks passed
@ductiletoaster
ductiletoaster deleted the fm/op-sm-restart-fix branch November 2, 2026 23:34
ductiletoaster added a commit that referenced this pull request Nov 3, 2026
…02bd60). The Full suite check only failed because the lanes below failed. Fixes: 1. **Lint 1 (SC2329).** The merge left two definitions of `finish_concurrent_recovery` in `tests/fm-backend-herdr-presentation-e2e.test.sh`, so the first one was never called. Rule broken: a function should be defined only once. I removed the old fork copy, which used `$PROJECT_DIR`. Upstream's copy, which uses `$RECOVERY_PROJECT_DIR`, is the one the test was already calling. The lint-phase decline was about the generic local lint finding; this CI lint check was selected for fixing in this round. 2. **Behavior portable serial 5** (`tests/fm-wake-queue.test.sh`, "sequence 9223372036854775806 advanced to -9223372036854775807"). The fork's `_fm_wake_sequence_floor_locked` found the highest queue sequence using awk numbers. awk rounds 9223372036854775806 up to …808, which overflows bash. Rule broken: a recovered sequence must be computed from the exact decimal text. Upstream's exact decimal-text pass, which runs right after this helper in `fm_wake_append_locked`, already raises the sequence to the queue's highest row. So I removed the fork's duplicate queue scan. I kept its fail-closed refusal of an unreadable queue and its process-event marker floor. The helper has no other callers. 3. **Behavior portable parallel 1** (`tests/fm-backend-t3code.test.sh`, "an unproved close must stop recovery"). The fork's #48 recheck in `fm_secondmate_liveness_relaunch` re-reads the endpoint before any kill. When T3 thread reads fail, it now refuses with "endpoint now reads unreadable rather than dead". Upstream's kill-proof path never runs, because it uses the same thread read. The rule still holds: nothing is spawned and the record is kept. Only the reason string changed, and no relaunch-ledger entry is written. Removing the recheck would let the kill archive a newly republished live thread, so it stays. I updated the upstream test to assert the merged behaviour: same no-spawn and record-kept checks, the deferral reason, and no ledger attempt. The "could not prove" branch is still reachable if the state changes between the recheck and the kill. `tests/fm-secondmate-liveness.test.sh` still covers its non-T3 side. 4. **gitleaks.** Two fake values in upstream test fixtures, now in our history: 7647d6b (#5409, `EFFECTIVE_SECRET='kc-effective-…-never-on-argv'`) and 3004ccb (#7518, `secret=fm-inherited-secret-7f3a`). History can't be rewritten without a force-push, so I added both fingerprints with reason comments to `docs/pixeloven/gitleaksignore`. This follows the existing #4692 entry. **Verification** - gitleaks 8.30.1 full-history scan with the ignore file: no leaks found. - `bin/fm-lint.sh` on the three edited shell files: no findings. - The updated t3code test passes when run alone with `FM_TEST_ONLY`. - The full `tests/fm-wake-queue.test.sh` exits 0, with no `not ok` lines. I did not run the whole t3code suite or the herdr e2e suite locally
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