Skip to content

feat(control): add task-pinned legacy handoff - #4

Merged
ryannmicua merged 8 commits into
mainfrom
fm/firstmate-guarded-worker-handoff-replacement
Sep 27, 2026
Merged

ryannmicua merged 8 commits into
mainfrom
fm/firstmate-guarded-worker-handoff-replacement

Conversation

@ryannmicua

Copy link
Copy Markdown
Owner

Intent

yes do the new support pr route

Create a clean, separate support branch and a new PR containing the preserved handoff implementation, the remote documentation change, and the retained CI repair. Run the full validation there. Leave the original support PR #2 and both of its histories untouched; do not merge either PR.

This replaces the blocked attempt to continue the existing support PR. The original support PR is #2; its remote head is 4ff8afb4a3b4f70e853ca36b21516322fd66ebac, and the unpublished CI repair is 764ff54baacf9afa19897514aa4847805b7e652b. Preserve their content in the new branch, not by changing, merging, or deleting the original histories.

The handoff implementation allows an attended handoff only for the stranded paseo-backend-adapter task. It requires the pinned endpoint, worktree, and HEAD, an operator note, and confirmations that the original worker stopped and the no-mistakes run is terminal. It creates a unique tmux session using the recorded worktree, preserves tracked and untracked changes, and refuses live endpoints and identity conflicts. The remote documentation change adds a blank line between the data-plane and control-plane descriptions in docs/agent-control.md. The CI repair excludes retained .validation-tmp/** evidence from the documentation-audience check while keeping maintained docs/*.txt classified, with a regression fixture.

What Changed

  • Add a journaled, attended handoff for only paseo-backend-adapter, requiring the pinned endpoint, worktree, branch, and HEAD, a recovery note, and operator confirmations. It creates a unique tmux session, preserves the existing worktree and its changes, and refuses live endpoints or conflicting task records.
  • Update control and recovery documentation with the handoff procedure and its limits, including the data-plane/control-plane paragraph separation in docs/agent-control.md.
  • Exclude retained .validation-tmp/** evidence from documentation-audience checks while keeping maintained docs/*.txt classified, with a regression fixture.

Risk Assessment

⚠️ Medium: This adds a tightly gated, one-task exception to a high-impact lifecycle path; its identity, confirmation, duplicate-owner, and rollback checks address the concrete risks reviewed.

Testing

The focused handoff and documentation-audience suites ran, prior same-run live transcripts cover successful Codex handoff and fail-closed guards, and the live whitespace-only note-file refusal was captured. The Markdown HTML artifact is available, but browser inspection and screenshot capture were blocked by BRIDGE_NOT_READY, so visual verification remains outstanding.

  • Live validation: ⚠️ inconclusive - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Operator confirms the stranded task handoff; a unique tmux endpoint starts in the recorded worktree and tracked, untracked, poll, status, and inbox state remain intact. ✅ pass live guarded-handoff-preserved-poll-transcript.txt; guarded-handoff-real-codex-transcript.txt
Handoff refuses when the original endpoint is live or either operator confirmation is incorrect, without mutating task state. ✅ pass live guarded-handoff-live-refusals.txt
Handoff refuses a mismatched HEAD or duplicate task owner before creating an endpoint. ✅ pass live guarded-handoff-identity-refusals.txt
Direct spawn cannot authorize itself with a caller-supplied handoff journal. ✅ pass live guarded-handoff-live-refusals.txt; tests/fm-control-relaunch.test.sh
Whitespace-only --note and --note-file inputs are rejected before mutation. ✅ pass live guarded-handoff-live-refusals.txt; handoff-note-file-live.txt; tests/fm-control-relaunch.test.sh
The audience checker excludes retained .validation-tmp evidence while continuing to classify maintained docs/*.txt. ✅ pass live documentation-audience-live-transcript.txt; tests/fm-documentation-audiences.test.sh
Reader sees the intended paragraph break between the data-plane and control-plane descriptions in a rendered view. ⏸️ untested no The available chrome-devtools-axi tool had no live Chrome DevTools target: both open and start returned BRIDGE_NOT_READY. Provide an active Chrome/Chromium DevTools endpoint via CHROME_DEVTOOLS_AXI_BR…
Evidence: Live Codex handoff with preserved task state

Source: Live Codex handoff with preserved task state

registered: state/paseo-backend-adapter.check.sh
SCENARIO: actual Codex handoff keeps its registered task poll, status history, and local changes
Confirm the original worker has stopped (type STOP paseo-backend-adapter): Confirm the no-mistakes run is terminal and no active run owns the branch (type TERMINAL paseo-backend-adapter): handed-off paseo-backend-adapter from=firstmate:fm-paseo-backend-adapter to=fm-handoff-paseo-backend-adapter-979554-20260927070328-18317:fm-paseo-backend-adapter harness=codex backend=tmux worktree=~/.no-mistakes/worktrees/ff5e17b6f5de/01M3GK6ZTXCG61C7VX2EQHFNN2/.tmp-live-handoff-preservation/fixture/task-worktree
exit=0
endpoint=fm-handoff-paseo-backend-adapter-979554-20260927070328-18317:fm-paseo-backend-adapter cwd=~/.no-mistakes/worktrees/ff5e17b6f5de/01M3GK6ZTXCG61C7VX2EQHFNN2/.tmp-live-handoff-preservation/fixture/task-worktree codex_state=alive
preserved HEAD=6241d91a12f12e5dd9eb7959575e92a759cd40f3 tracked_dirty=yes untracked=yes registered_check=yes check_trust=yes status_history=yes inbox_message=yes
check hash=fb99eae951f1adc14d1a4a9a186c21930db2786b3208c94c7d9af382bd1048e5 trust hash=ac16c51bdcf40e824616400e4155b27eb920b2daa9a53a489dad99c3510ec12c journal=complete




› Ask Codex to do anything


  ? for shortcuts
Evidence: Live handoff refusal cases

Source: Live handoff refusal cases

SCENARIO: a live original endpoint refuses handoff
error: attested handoff requires the original endpoint to read missing; a live, dead, ambiguous, or unreadable endpoint refuses
exit=1
SCENARIO: whitespace-only recovery note refuses handoff
error: handoff requires --note (or --note-file) so the replacement receives the recovery context
exit=1
SCENARIO: wrong worker-stop confirmation refuses handoff
Confirm the original worker has stopped (type STOP paseo-backend-adapter): error: handoff confirmation did not match; no task files or endpoint were changed
exit=1
SCENARIO: wrong terminal-run confirmation refuses handoff
Confirm the original worker has stopped (type STOP paseo-backend-adapter): Confirm the no-mistakes run is terminal and no active run owns the branch (type TERMINAL paseo-backend-adapter): error: handoff confirmation did not match; no task files or endpoint were changed
exit=1
SCENARIO: caller-supplied handoff journal cannot authorize direct spawn
error: operator-attested handoff must be launched by its active fm-control transaction; refusing to rebind the task
exit=1
asserted unchanged: no spawned task session; metadata and instructions untouched for every refusal
Evidence: Live handoff identity refusals

Source: Live handoff identity refusals

SCENARIO: a mismatched expected HEAD refuses before task mutation or endpoint creation
error: recorded local copy HEAD '21e4ebf247e2863fbeef4d7adc52854bbecb554e' does not match --expect-head '0000000000000000000000000000000000000000'
exit=1
SCENARIO: a second task record claiming the same worktree blocks handoff
error: task record '~/.no-mistakes/worktrees/ff5e17b6f5de/01M3GK6ZTXCG61C7VX2EQHFNN2/.tmp-live-handoff-identity/fixture/fm-home/state/other-owner.meta' already claims this endpoint or local copy; refusing a duplicate worker owner
exit=1
asserted unchanged: task record and brief remain byte-identical; no tmux session or handoff journal exists
Evidence: Live documentation-audience behavior

Source: Live documentation-audience behavior

SCENARIO: the real audience checker accepts maintained docs/*.txt and ignores retained .validation-tmp evidence
fm-doc-audience-check: ok surfaces=5 local_links=2
ADVERSARIAL CHECK: omitting maintained docs/evidence.txt is rejected as unclassified
fm-doc-audience-check: unclassified: docs/evidence.txt
exit=1
ADVERSARIAL CHECK: classifying excluded .validation-tmp/evidence.txt is rejected as out of scope
fm-doc-audience-check: not tracked/in scope: .validation-tmp/evidence.txt
exit=1
Evidence: Live whitespace-only note-file refusal

Source: Live whitespace-only note-file refusal

SCENARIO: actual fm-control CLI rejects a whitespace-only --note-file before resolving or mutating a task
error: handoff requires --note (or --note-file) so the replacement receives the recovery context
exit=1
Evidence: Rendered agent-control documentation HTML

Source: Rendered agent-control documentation HTML

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>Agent lifecycle control plane — Markdown render</title>
<style>
:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #17212b; background: #f3f5f7; }
body { margin: 0; padding: 40px 24px; }
main { max-width: 880px; margin: 0 auto; padding: 48px 56px; background: #fff; border: 1px solid #dbe1e6; border-radius: 10px; box-shadow: 0 8px 28px #17212b12; }
h1, h2, h3 { line-height: 1.25; color: #10283f; }
h1 { margin-top: 0; font-size: 2rem; }
p, li { line-height: 1.65; }
p { margin: 0 0 1.15em; }
code { padding: .12em .34em; border-radius: 4px; background: #eef2f5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
a { color: #155b8a; }
blockquote { margin: 1.2em 0; padding: .15em 1em; border-left: 3px solid #6f93aa; background: #f5f8fa; }
table { border-collapse: collapse; width: 100%; } th, td { border: 1px solid #dbe1e6; padding: .5em .65em; vertical-align: top; }
</style></head><body><main><h1>Agent lifecycle control plane</h1>
<p>Firstmate talks to a running agent two ways, and they are not the same channel.</p>
<p>The <strong>data plane</strong> is <a href="../bin/fm-send.sh"><code>bin/fm-send.sh</code></a>: conversational text for the agent to read.
For a <code>kind=secondmate</code> target it always prepends the from-firstmate routing marker, because a secondmate is itself a firstmate and its reply must come back through the status path rather than a chat nobody reads.</p>
<p>The <strong>control plane</strong> is <a href="../bin/fm-control.sh"><code>bin/fm-control.sh</code></a>: allowlisted lifecycle verbs addressed to an exact task id.</p>
<p>The split exists because the data plane's marking is exactly right for a message and exactly wrong for a lifecycle command.
A routing-marked <code>/quit</code> arrives as ordinary chat - <code>[fm-from-firstmate] /quit</code> - which the agent reasons about instead of executing.
The failure repeated across harnesses and homes, and the workaround (remember to use an unmarked send for agent-control commands, and improvise the right key or command per harness) lived only in agent prose, so it failed again every time a session did not happen to recall it.</p>
<h2>What the control plane owns</h2>
<p><code>bin/fm-control-lib.sh</code> is the single executable owner of the control-plane capability tables and their read-only state checks, so they can be read as a contract:</p>
<ul>
<li>The <strong>verb allowlist</strong>: <code>interrupt</code>, <code>exit</code>, <code>relaunch</code>, and the one-task <code>handoff</code> exception below.
There is no arbitrary-text and no generic raw-key entry point.
A caller either names an allowlisted verb or is refused.</li>
<li><strong>Per-harness mechanics</strong>: the key that cancels a running turn, how many times it must be delivered, whether the composer needs clearing afterwards, the command that exits the agent, and which task kinds the adapter is verified to run.
These were previously carried only in the <a href="../.agents/skills/harness-adapters/SKILL.md"><code>harness-adapters</code></a> skill's tool references, which now point here.
<code>bin/fm-send.sh</code>'s <code>--key</code> path reads the composer-clear table from this owner too, rather than keeping a second copy of it.</li>
<li><strong>Per-backend capability</strong>: which named keys a runtime backend can deliver, and whether it has a recovery-grade agent-state classifier able to prove an agent stopped.</li>
</ul>
<p>The two state checks are the <a href="#reclaiming-a-task-whose-endpoint-is-gone">endpoint-absence proof</a> and the handoff-journal validator; both read state without mutating it, and sourcing the file is still free.</p>
<p>A recorded <code>harness=</code> is not always an exact adapter name: a task launched from a raw command records that command's basename instead.
<code>fm_control_harness_family</code> is the one place that prefix rule is stated, and an unrecognized value resolves to no adapter rather than being guessed into one.</p>
<h2>Verbs</h2>
<p>| Verb | Effect | Postcondition |
| --- | --- | --- |
| <code>interrupt</code> | Deliver the harness's verified interrupt sequence while leaving the agent running. | Delivery succeeds while the endpoint still exists and the agent is still alive where the backend can classify that; cancellation is confirmed only from an adapter-owned acknowledgement and otherwise reports <code>cancel=unconfirmed</code>. |
| <code>exit</code> | Stop the agent, preserving the endpoint, the worktree, and every uncommitted change. | The backend's recovery-grade classifier reports the agent gone. Already-stopped is idempotent success. An endpoint reading <code>missing</code> goes through the same <a href="#reclaiming-a-task-whose-endpoint-is-gone">absence proof</a> the reclaim uses before anything is claimed about it, and only Herdr can supply one: proven gone reports <code>endpoint-gone</code> (the agent went with it, and the endpoint this verb normally preserves did not survive), a pane that turns out to be there and idle is the ordinary <code>already-stopped</code>, one whose agent is back takes the ordinary interrupt-then-exit path. A tmux <code>missing</code> always refuses rather than claim a stop it cannot see. |
| <code>relaunch</code> | Replace the running agent with a new one in the same worktree - and the same endpoint whenever that endpoint still exists - on the exact recorded adapter or an explicitly chosen harness, model, and effort. | The new agent is alive on the endpoint the task's record now names, and that record names the harness that is actually running. |
| <code>handoff</code> | Rebind only the pinned legacy task <code>paseo-backend-adapter</code> after an attended, journaled operator confirmation, preserving the task's exact worktree and current changes. | The old tmux endpoint still reads <code>missing</code>, the task record matches its pinned identity, no second local task record claims its endpoint or worktree, and one unique tmux session is created for the replacement. This does not make tmux's absence proof stronger; the task-specific human attestations are the authority for this one handoff. |</p>
<p>An exit that delivers lifecycle input but cannot prove the agent stopped fails with <code>exit=unconfirmed</code>, reports the observed agent state and any interrupt cancellation claim, and never claims that nothing changed.
Interrupt never rewrites busy state as proof of its own success.
Claude exposes no lifecycle acknowledgement for a manual interrupt, so delivery succeeds with <code>cancel=unconfirmed</code> and its adapter-owned busy state remains as observed.
muse's session log records <code>terminal=cancelled</code> for the interrupted run, so the control plane reports <code>cancel=confirmed</code> only after observing that exact acknowledgement.</p>
<p>An interrupt is not complete until the composer is empty.
muse is the one verified adapter that restores the cancelled prompt back into its composer as real text, so its interrupt key is followed by a Ctrl+U clear; without it the next submitted line - including this plane's own exit command - would concatenate onto the restored prompt and submit both as one line.
The clear is refused before anything is sent when the recorded backend cannot deliver it.</p>
<p><code>exit</code> reads the composer's state before typing the exit command and requires the exact <code>empty</code> verdict; a <code>pending</code> verdict refuses by naming the pending text, and any other verdict (<code>unknown</code>, <code>pending-unproven</code>, or an unreadable read) refuses as not proven empty, matching the fail-safe contract every other consumer that can overwrite composer input follows.</p>
<p><strong>Teardown and discard are not verbs and will not become verbs.</strong>
<code>exit</code> stops an agent and preserves everything else.
Removing a worktree, closing an endpoint, or discarding work stays with <a href="../bin/fm-teardown.sh"><code>bin/fm-teardown.sh</code></a>, which owns t

... [12313 bytes truncated] ...

ld harness would be a second, worse inaccuracy.</li>
</ul>
<h3>The one-task attended legacy handoff</h3>
<p><code>handoff</code> is limited to the existing <code>paseo-backend-adapter</code> task, its recorded tmux endpoint <code>firstmate:fm-paseo-backend-adapter</code>, Codex ship identity, no-mistakes delivery mode, and the <code>fm/paseo-backend-adapter</code> branch.
It is not a general way to bypass endpoint-absence proof.</p>
<p>Before using it, inspect the task's current run status and confirm no no-mistakes run is active or parked on the branch.
Confirm independently that the former worker has stopped.
If either check is ambiguous, stop without invoking the handoff.</p>
<p>Pass the exact recorded worktree path and the full current <code>HEAD</code> from that worktree as explicit expectations.
The command refuses if either value, the endpoint, task metadata, branch, or task identity differs.
It allows a dirty worktree because it neither resets nor cleans the checkout; the journal records its observed <code>HEAD</code> and dirty status, and the replacement uses that same worktree.
It refuses if another readable task record claims the same local copy or endpoint.</p>
<p>Run the command from the owning Firstmate home:</p>
<pre><code class="language-sh">FM_HOME=~/firstmate bin/fm-control.sh paseo-backend-adapter handoff \
  --expect-endpoint firstmate:fm-paseo-backend-adapter \
  --expect-worktree &lt;recorded-worktree-path&gt; \
  --expect-head &lt;full-current-HEAD&gt; \
  --note 'The prior terminal is unreachable after reboot; continue in this exact local copy and preserve all existing changes.'
</code></pre>
<p>The command asks for the exact typed confirmations <code>STOP paseo-backend-adapter</code> and <code>TERMINAL paseo-backend-adapter</code>.
The first records the operator's confirmation that the old worker has stopped.
The second records that current run status was checked and no active run owns the branch.
Both confirmations, the old endpoint, expected worktree and <code>HEAD</code>, observed dirty state, new session, and transaction id are kept in <code>state/paseo-backend-adapter.control-relaunch</code>.</p>
<p>The launch owner creates one transaction-unique tmux session rather than reusing the old session name, then republishes the same task id on that new endpoint.
The task's worktree, branch, commit history, uncommitted edits, task poll, and status log are not replaced or discarded.
If the endpoint state changes from <code>missing</code>, the identity checks fail, or a confirmation is wrong, no replacement endpoint is created.
If launch delivery fails before task-record publication begins, spawn cleanup retires the newly created session and leaves the old record and local copy authoritative.
If publication begins but its outcome is ambiguous, the endpoint is retained for reconciliation rather than risk closing one the task record may name.</p>
<h2>Fail-closed boundaries</h2>
<ul>
<li>Targeting is exact.
Only a bare task id with a <code>state/&lt;id&gt;.meta</code> record in this home is accepted, and that record must pass the shared endpoint-identity validation.
A legacy <code>fm-&lt;id&gt;</code> window label, an explicit <code>session:window</code> endpoint, and a record whose <code>endpoint_task_id</code> names another task are all refused.</li>
<li>A remotely placed secondmate is refused by name.
Its agent runs on another host, so none of the postconditions this plane verifies could be read for it here; local endpoint validation would refuse the record regardless, because <code>window=remote:&lt;id&gt;</code> can never match a local backend's required shape.
Drive that lifecycle on its own host and reconcile it through the secondmate recovery path.
For <code>relaunch</code> that host-side drive is <code>bin/fm-on.sh &lt;id&gt; fm-remote-secondmate-control.sh relaunch ...</code>, whose host-local leg runs this same plane against a record that is ordinary and local there, so every checkpoint, journal, rollback, and postcondition below applies unchanged (<a href="remote-secondmates.md"><code>docs/remote-secondmates.md</code></a>); <code>interrupt</code> and <code>exit</code> have no such route.</li>
<li>An unverified harness is refused rather than guessed at.</li>
<li>An implicit relaunch from a prefixed raw-command basename is refused before the agent or durable state is touched because its original launch command cannot be reconstructed.</li>
<li>An adapter that is not verified for this task's kind is refused <strong>before</strong> the running agent is stopped, not after.
Muse is a crewmate and scout adapter only, so relaunching a secondmate onto it refuses while its agent is still up rather than leaving that secondmate with no agent when the launch owner refuses.</li>
<li>A backend that cannot deliver the harness's interrupt key, or the composer clear that key needs, is refused rather than sent a different key.
Orca's terminal API exposes only an interrupt and an Enter, so it can deliver neither Escape nor Ctrl+U.</li>
<li><code>exit</code> and <code>relaunch</code> require a backend with a recovery-grade agent-state classifier - tmux and herdr - because without one the &quot;the agent stopped&quot; postcondition cannot be proven.
zellij, orca, and cmux are refused rather than reported as successful blind.</li>
<li>An ambiguous or unreadable endpoint state refuses.
Only a positively classified state acts.</li>
<li><code>exit</code>'s composer-empty check, above, is itself a fail-closed boundary that <code>relaunch</code> inherits by stopping the old agent through <code>exit</code>.</li>
<li><code>fm-spawn --relaunch</code> independently enforces the endpoint-state rules above; the operator-attested exception is limited to the <a href="#the-one-task-attended-legacy-handoff">one-task legacy handoff</a>.
It also requires the shell to be in the recorded worktree: tmux refuses immediately when it is not, while Herdr sends one <code>cd</code> to the recorded path and refuses unless a subsequent path read confirms the move.</li>
<li>The operator-attested handoff is rejected for every task except <code>paseo-backend-adapter</code>, and its launcher accepts only the live transaction journal from that task's <code>fm-control handoff</code>.</li>
</ul>
<h2>Capability matrix</h2>
<p>Backend capability comes from each adapter's real surface, not from a policy choice.</p>
<p>| Backend | Escape | Enter | Ctrl+C | Ctrl+U | Recovery-grade agent state |
| --- | --- | --- | --- | --- | --- |
| tmux | yes | yes | yes | yes | yes |
| herdr | yes | yes | yes | yes | yes |
| zellij | yes | yes | yes | yes | no |
| cmux | yes | yes | yes | yes | no |
| orca | no | yes | yes | no | no |</p>
<p>Per-harness interrupt keys, repeat counts, composer clears, exit commands, and supported task kinds live in <code>bin/fm-control-lib.sh</code> and are exercised for every verified harness by <code>tests/fm-control.test.sh</code>, with adapters outside its lane pinning their control mechanics in their own harness suites.
The empirical basis for each adapter's value is the <code>harness-adapters</code> skill's verification record for that adapter.</p>
<h2>Verification</h2>
<ul>
<li><code>tests/fm-control.test.sh</code> - the adapter contract for its verified-harness lane (adapters outside the lane pin their control mechanics in their own harness suites), the backend capability matrix, exact-id scoping, the closed verb list, the busy, idle, dead, and idempotent lifecycle cases, and marker non-regression, all against a stubbed session provider.</li>
<li><code>tests/fm-control-relaunch.test.sh</code> - the relaunch transaction: identity preservation, harness switching, the progress note, checkpoint refusals, rollback after a failed launch, and the endpoint-absence proof both verbs share - the Herdr reclaim of a destroyed endpoint, tmux refusing one it cannot prove absent, and the task-pinned handoff's identity refusals and preservation of dirty work.</li>
<li><code>tests/fm-control-herdr-smoke.test.sh</code> - the second state-verified backend against the real herdr binary, on an isolated throwaway lab session.</li>
</ul>
</main></body></html>
Evidence: Browser viewer unavailable
chrome-devtools-axi open/start: BRIDGE_NOT_READY — the attached CDP target had gone away.
- Outcome: ⚠️ 2 warnings across 2 runs (47m57s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed (2) ✅
  • ⚠️ bin/fm-control.sh:299 - The intent says the handoff “requires ... an operator note,” but the new guard at bin/fm-control.sh:299 only checks [ &#34;$NOTE_SET&#34; = 1 ] &amp;&amp; [ -n &#34;$NOTE&#34; ]. A whitespace-only --note or note file passes; the repeated guard at bin/fm-control.sh:1026 does too, and the replacement receives no recovery context. Require non-whitespace note content.

🔧 Fix applied.
2 issues (1 error, 1 warning) still open:

  • 🚨 bin/fm-spawn.sh:1611 - The intent requires “an operator note, and confirmations that the original worker stopped and the no-mistakes run is terminal.” A direct fm-spawn.sh &lt;id&gt; --relaunch caller can set FM_CONTROL_HANDOFF_TX and FM_CONTROL_RELAUNCH_TX and write a journal containing the expected lines; this check accepts those self-asserted values without proving fm-control performed either confirmation. The launcher then skips the note requirement and takes the missing-endpoint bypass to create a replacement. This contradicts the required handoff conditions. Related sites: bin/fm-control-lib.sh:92 (string-only journal validation), bin/fm-spawn.sh:1703 (bypasses absence proof), bin/fm-spawn.sh:3234 (creates session), docs/agent-control.md:202 (claims the journal is from fm-control). Tie launch authorization to the confirmed control transaction or restrict the alternate launch path.
  • ⚠️ bin/fm-control-lib.sh:94 - The journal validator repeats the pinned endpoint and branch literals already defined by fm_control_handoff_expected_endpoint and fm_control_handoff_expected_branch at bin/fm-control-lib.sh:73 and :78. No intent requirement needs this second definition; remove the duplicate literals and derive them from the existing helpers to avoid independent drift.

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Test** - 2 warnings
  • ⚠️ live validation verdict: inconclusive (6 of 7 scenarios were driven live against the product); untested: The reader sees a blank line separating the data-plane and control-plane descriptions in the updated documentation.
  • Live validation: ⚠️ inconclusive - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
The operator confirms the stranded task and gets a unique replacement session in the recorded worktree; the note, dirty files, registered task check, status history, and inbox remain intact. ✅ pass live Live handoff with real Codex and preserved task check
The operator tries handoff while the original endpoint still exists; the command refuses without changing task state. ✅ pass live Live refusal checks: present endpoint
The operator supplies a whitespace-only note or an incorrect worker-stop or terminal-run confirmation; handoff refuses without creating a journal or endpoint. ✅ pass live Live refusal checks: blank note and wrong confirmations
A direct spawn caller supplies matching handoff transaction variables and a forged journal; the launcher refuses to rebind the task. ✅ pass live Live refusal checks: forged journal
The operator supplies a mismatched HEAD or another task record claims the worktree; handoff refuses without mutation. ✅ pass live Live pinned HEAD and duplicate worktree-owner refusals
The maintainer runs the audience checker; retained .validation-tmp evidence is excluded, while omitting maintained .txt or classifying excluded evidence is rejected. ✅ pass live Live documentation audience checker with adversarial scope cases
The reader sees a blank line separating the data-plane and control-plane descriptions in the updated documentation. ⏸️ untested no The prior payload recorded this documentation observation with live=false, so it did not establish a live result for this scenario.
  • tests/fm-control-relaunch.test.sh
  • tests/fm-documentation-audiences.test.sh
  • Drove bin/fm-control.sh paseo-backend-adapter handoff and bin/fm-spawn.sh paseo-backend-adapter --relaunch against real tmux and Codex in isolated temporary homes; checked refusal cases, journal, endpoint, worktree, and preserved task state.
  • Ran bin/fm-doc-audience-check.sh --root &lt;fixture&gt; and verified missing maintained .txt and included .validation-tmp entries fail semantically.
  • Inspected git diff --unified=0 d5bdf07f47b69ef1c2f90c1fb198fa24764bbfb1..HEAD -- docs/agent-control.md for the requested paragraph break.

🔧 No changes applied.
2 warnings still open:

  • ⚠️ docs/agent-control.md:7 - The requested visual check of the data-plane/control-plane paragraph break is still missing. The Markdown was rendered to HTML, but chrome-devtools-axi open and start both failed with BRIDGE_NOT_READY because no live Chrome DevTools target was available, so I could not inspect or capture the rendered page. Provide a running Chrome/Chromium DevTools endpoint through CHROME_DEVTOOLS_AXI_BROWSER_URL and rerun this visual scenario.
  • ⚠️ live validation verdict: inconclusive (6 of 7 scenarios were driven live against the product); untested: Reader sees the intended paragraph break between the data-plane and control-plane descriptions in a rendered view.
  • Live validation: ⚠️ inconclusive - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Operator confirms the stranded task handoff; a unique tmux endpoint starts in the recorded worktree and tracked, untracked, poll, status, and inbox state remain intact. ✅ pass live guarded-handoff-preserved-poll-transcript.txt; guarded-handoff-real-codex-transcript.txt
Handoff refuses when the original endpoint is live or either operator confirmation is incorrect, without mutating task state. ✅ pass live guarded-handoff-live-refusals.txt
Handoff refuses a mismatched HEAD or duplicate task owner before creating an endpoint. ✅ pass live guarded-handoff-identity-refusals.txt
Direct spawn cannot authorize itself with a caller-supplied handoff journal. ✅ pass live guarded-handoff-live-refusals.txt; tests/fm-control-relaunch.test.sh
Whitespace-only --note and --note-file inputs are rejected before mutation. ✅ pass live guarded-handoff-live-refusals.txt; handoff-note-file-live.txt; tests/fm-control-relaunch.test.sh
The audience checker excludes retained .validation-tmp evidence while continuing to classify maintained docs/*.txt. ✅ pass live documentation-audience-live-transcript.txt; tests/fm-documentation-audiences.test.sh
Reader sees the intended paragraph break between the data-plane and control-plane descriptions in a rendered view. ⏸️ untested no The available chrome-devtools-axi tool had no live Chrome DevTools target: both open and start returned BRIDGE_NOT_READY. Provide an active Chrome/Chromium DevTools endpoint via CHROME_DEVTOOLS_AXI_BR…
  • tests/fm-control-relaunch.test.sh
  • tests/fm-documentation-audiences.test.sh
  • Drove bin/fm-control.sh ... handoff --note-file with a whitespace-only note in an isolated FM_HOME; captured the refusal transcript.
  • Rendered docs/agent-control.md to HTML with MarkdownIt and attempted to open and screenshot it using chrome-devtools-axi.
  • Reviewed the same-run live handoff, identity-refusal, and documentation-audience evidence artifacts.
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed ✅
  • ⚠️ linter found issues (exit code 1)

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

…dence is excluded while maintained `docs/*.txt` remains covered. The checker, inventory, and behavior fixture now agree; retained evidence was untouched. `bin/fm-doc-audience-check.sh` passed (102 surfaces, 458 links). The attestation failure is external: its log reports attested head `bf6ce01` versus PR head `4ff8afb`, so the outer executor must handle a fresh no-mistakes attestation. The full Test turn remains outstanding
@ryannmicua
ryannmicua merged commit fc409dd into main Sep 27, 2026
19 checks passed
@ryannmicua
ryannmicua deleted the fm/firstmate-guarded-worker-handoff-replacement branch September 28, 2026 21:27
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