Repository navigation
fix: enable isolated live validation in no-mistakes gates - #5615
Closed
kunchenguid wants to merge 11 commits into
Closed
kunchenguid wants to merge 11 commits into
kunchenguid wants to merge 11 commits into
Conversation
The gate refusal blocked every fleet lifecycle call, so a gate agent could never run honest live validation of a PR inside an isolated lab; the only escape was an honor-system bypass flag that trusted whatever exported it. Replace it with a structural proof: bin/fm-lab-home.sh mints marker-bound disposable lab homes under the temp root, and the gate authorizes a call only when the resolved FM_HOME carries a bound marker, sits under the temp root, is registered nowhere real, and the resolved backend target is the lab's own isolation (fm-lab-* Herdr session, private tmux socket dir, or a lab-local tool). Worktree and spawning-project locations are deliberately unpinned: a real treehouse or Orca spawn legitimately lands in the shared pool, and pinning it inside would force a fake pool. Everything else stays refused exactly as before - a real home refuses even with a forged marker. Also add the per-harness "primary in a lab" recipe to .no-mistakes.yaml (claude, codex, cursor, opencode, grok, omp: disposable home, private socket or named lab session, existing credentials, honest missing-login reports), and gate the test-only FM_TEST_HARNESS seam behind the FM_TEST_SEAM marker so a leaked variable stays inert in production. Verified: tests/fm-gate-refuse.test.sh 24/24 under a real gate marker; fm-omp-harness and fm-afk-launch fully green under pi ancestry plus gate; fm-control-relaunch fully green under gate (relaunch sweeps driven live in disposable lab homes); fm-backend-herdr-presentation-e2e green end-to-end with real treehouse delegation, a marked lab root, and a named Herdr lab session; instruction-refresh live E2E green in an isolated Pi session.
…test to require refusal for an unmarked home, and quoted the Herdr relationship value to satisfy ShellCheck without changing behavior. The focused tests, ShellCheck, syntax checks, and diff check pass
…gs now stop the owned watcher and clear its lifecycle state before the next leg. The wake-queue suite, ShellCheck, and diff check pass locally
…cle-e2e.test.sh: the liveness fixture now waits for lock acquisition, not just lock-directory creation. The focused test, ShellCheck, syntax check, and diff check pass locally
This was referenced Sep 25, 2026
kunchenguid
added a commit
that referenced
this pull request
Sep 25, 2026
* fix(bin): let gate agents drive lifecycle against marked lab homes Part 2 of the #5615 split. A no-mistakes gate agent runs inside a checkout carrying the fleet-captain identity, so fm-gate-refuse-lib refuses fleet mutation on the gate signal. That refusal was absolute, which kept gate validation from ever exercising the real lifecycle. Stamp a disposable lab FM_HOME with a .fm-lab-home marker file that only bin/fm-lab-home.sh writes, and only onto a fresh empty dir, so no call path can mark a populated real home. fm_refuse_if_gate_agent then permits lifecycle only when FM_HOME carries the marker and is driven through its stock layout - any FM_*_OVERRIDE relocation stays refused so part of the "lab" cannot be split back onto the real fleet. The threat model is a confused agent touching the real fleet, not deliberate forgery, so the marker is a plain token file rather than a bound record. FM_GATE_REFUSE_BYPASS is unchanged: it still serves the test harness, which cannot mark hundreds of temp homes. Teardown's slot-ownership scan compared state-dir paths textually while fm_firstmate_root_home canonicalizes, so a lab home under a symlinked TMPDIR scanned its own record twice and self-collided; compare file identity (-ef) instead. * no-mistakes(review): Refuse unlistable lab homes and hardlinked slot records * no-mistakes(review): Mint lab markers only on verified-empty fresh dirs * no-mistakes(document): Clarify lab-home gate documentation and comment contracts * no-mistakes(document): Clarify lab-home gate documentation and remove stale claims * no-mistakes(document): Clarify gate lab-home documentation and boundary wording
Owner
Author
kunchenguid
added a commit
that referenced
this pull request
Sep 25, 2026
Part 1 of the #5615 split: the pieces that let the no-mistakes pipeline live-validate firstmate changes, without the gate-refusal rescoping. - bin/fm-afk-launch.sh: FM_TEST_HARNESS pins the detected harness only alongside the FM_TEST_SEAM=1 marker test suites set, so a leaked variable in a real primary's environment stays inert and unknown tokens fall through to real detection. - tests/lib.sh: export FM_TEST_SEAM=1 for every suite. - .no-mistakes.yaml: per-harness recipe for running a real fixture primary from a gate run - a plain mktemp lab FM_HOME on a private tmux socket, with FM_GATE_REFUSE_BYPASS=1 scoped to it and NO_MISTAKES_GATE scrubbed. - tests/fm-wake-queue.test.sh: stop the owned watcher fixture with KILL and clear its lifecycle state so the next leg starts clean; TERM could leave bash waiting in a child on some runners. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh: wait for the liveness lock holder's post-acquire marker instead of the lock dir, which is published before the claim finishes.
kunchenguid
added a commit
that referenced
this pull request
Sep 25, 2026
* feat(tests): add FM_TEST_SEAM launch seam and gate lab-primary recipe Part 1 of the #5615 split: the pieces that let the no-mistakes pipeline live-validate firstmate changes, without the gate-refusal rescoping. - bin/fm-afk-launch.sh: FM_TEST_HARNESS pins the detected harness only alongside the FM_TEST_SEAM=1 marker test suites set, so a leaked variable in a real primary's environment stays inert and unknown tokens fall through to real detection. - tests/lib.sh: export FM_TEST_SEAM=1 for every suite. - .no-mistakes.yaml: per-harness recipe for running a real fixture primary from a gate run - a plain mktemp lab FM_HOME on a private tmux socket, with FM_GATE_REFUSE_BYPASS=1 scoped to it and NO_MISTAKES_GATE scrubbed. - tests/fm-wake-queue.test.sh: stop the owned watcher fixture with KILL and clear its lifecycle state so the next leg starts clean; TERM could leave bash waiting in a child on some runners. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh: wait for the liveness lock holder's post-acquire marker instead of the lock dir, which is published before the claim finishes. * no-mistakes(review): Scrub lab home overrides and require FM_TEST_SEAM separately * no-mistakes(document): Clarify test seam and disposable lab bypass documentation * no-mistakes(document): Clarify lab isolation and test-seam documentation * no-mistakes(ci): Fixed the CI failure: test cleanup killed the remote worker child but left its supervisor able to restart it during fixture removal. Cleanup now stops the worker tree. The lifecycle test passed locally; ShellCheck and diff checks passed
mituso89
pushed a commit
to mituso89/firstmate
that referenced
this pull request
Sep 26, 2026
…enguid#5635) * fix(bin): let gate agents drive lifecycle against marked lab homes Part 2 of the kunchenguid#5615 split. A no-mistakes gate agent runs inside a checkout carrying the fleet-captain identity, so fm-gate-refuse-lib refuses fleet mutation on the gate signal. That refusal was absolute, which kept gate validation from ever exercising the real lifecycle. Stamp a disposable lab FM_HOME with a .fm-lab-home marker file that only bin/fm-lab-home.sh writes, and only onto a fresh empty dir, so no call path can mark a populated real home. fm_refuse_if_gate_agent then permits lifecycle only when FM_HOME carries the marker and is driven through its stock layout - any FM_*_OVERRIDE relocation stays refused so part of the "lab" cannot be split back onto the real fleet. The threat model is a confused agent touching the real fleet, not deliberate forgery, so the marker is a plain token file rather than a bound record. FM_GATE_REFUSE_BYPASS is unchanged: it still serves the test harness, which cannot mark hundreds of temp homes. Teardown's slot-ownership scan compared state-dir paths textually while fm_firstmate_root_home canonicalizes, so a lab home under a symlinked TMPDIR scanned its own record twice and self-collided; compare file identity (-ef) instead. * no-mistakes(review): Refuse unlistable lab homes and hardlinked slot records * no-mistakes(review): Mint lab markers only on verified-empty fresh dirs * no-mistakes(document): Clarify lab-home gate documentation and comment contracts * no-mistakes(document): Clarify lab-home gate documentation and remove stale claims * no-mistakes(document): Clarify gate lab-home documentation and boundary wording
mituso89
pushed a commit
to mituso89/firstmate
that referenced
this pull request
Sep 26, 2026
…henguid#5638) * feat(tests): add FM_TEST_SEAM launch seam and gate lab-primary recipe Part 1 of the kunchenguid#5615 split: the pieces that let the no-mistakes pipeline live-validate firstmate changes, without the gate-refusal rescoping. - bin/fm-afk-launch.sh: FM_TEST_HARNESS pins the detected harness only alongside the FM_TEST_SEAM=1 marker test suites set, so a leaked variable in a real primary's environment stays inert and unknown tokens fall through to real detection. - tests/lib.sh: export FM_TEST_SEAM=1 for every suite. - .no-mistakes.yaml: per-harness recipe for running a real fixture primary from a gate run - a plain mktemp lab FM_HOME on a private tmux socket, with FM_GATE_REFUSE_BYPASS=1 scoped to it and NO_MISTAKES_GATE scrubbed. - tests/fm-wake-queue.test.sh: stop the owned watcher fixture with KILL and clear its lifecycle state so the next leg starts clean; TERM could leave bash waiting in a child on some runners. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh: wait for the liveness lock holder's post-acquire marker instead of the lock dir, which is published before the claim finishes. * no-mistakes(review): Scrub lab home overrides and require FM_TEST_SEAM separately * no-mistakes(document): Clarify test seam and disposable lab bypass documentation * no-mistakes(document): Clarify lab isolation and test-seam documentation * no-mistakes(ci): Fixed the CI failure: test cleanup killed the remote worker child but left its supervisor able to restart it during fixture removal. Cleanup now stops the worker tree. The lifecycle test passed locally; ShellCheck and diff checks passed
mehulbhagwani
pushed a commit
to mehulbhagwani/firstmate
that referenced
this pull request
Sep 26, 2026
…enguid#5635) * fix(bin): let gate agents drive lifecycle against marked lab homes Part 2 of the kunchenguid#5615 split. A no-mistakes gate agent runs inside a checkout carrying the fleet-captain identity, so fm-gate-refuse-lib refuses fleet mutation on the gate signal. That refusal was absolute, which kept gate validation from ever exercising the real lifecycle. Stamp a disposable lab FM_HOME with a .fm-lab-home marker file that only bin/fm-lab-home.sh writes, and only onto a fresh empty dir, so no call path can mark a populated real home. fm_refuse_if_gate_agent then permits lifecycle only when FM_HOME carries the marker and is driven through its stock layout - any FM_*_OVERRIDE relocation stays refused so part of the "lab" cannot be split back onto the real fleet. The threat model is a confused agent touching the real fleet, not deliberate forgery, so the marker is a plain token file rather than a bound record. FM_GATE_REFUSE_BYPASS is unchanged: it still serves the test harness, which cannot mark hundreds of temp homes. Teardown's slot-ownership scan compared state-dir paths textually while fm_firstmate_root_home canonicalizes, so a lab home under a symlinked TMPDIR scanned its own record twice and self-collided; compare file identity (-ef) instead. * no-mistakes(review): Refuse unlistable lab homes and hardlinked slot records * no-mistakes(review): Mint lab markers only on verified-empty fresh dirs * no-mistakes(document): Clarify lab-home gate documentation and comment contracts * no-mistakes(document): Clarify lab-home gate documentation and remove stale claims * no-mistakes(document): Clarify gate lab-home documentation and boundary wording
mehulbhagwani
pushed a commit
to mehulbhagwani/firstmate
that referenced
this pull request
Sep 26, 2026
…henguid#5638) * feat(tests): add FM_TEST_SEAM launch seam and gate lab-primary recipe Part 1 of the kunchenguid#5615 split: the pieces that let the no-mistakes pipeline live-validate firstmate changes, without the gate-refusal rescoping. - bin/fm-afk-launch.sh: FM_TEST_HARNESS pins the detected harness only alongside the FM_TEST_SEAM=1 marker test suites set, so a leaked variable in a real primary's environment stays inert and unknown tokens fall through to real detection. - tests/lib.sh: export FM_TEST_SEAM=1 for every suite. - .no-mistakes.yaml: per-harness recipe for running a real fixture primary from a gate run - a plain mktemp lab FM_HOME on a private tmux socket, with FM_GATE_REFUSE_BYPASS=1 scoped to it and NO_MISTAKES_GATE scrubbed. - tests/fm-wake-queue.test.sh: stop the owned watcher fixture with KILL and clear its lifecycle state so the next leg starts clean; TERM could leave bash waiting in a child on some runners. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh: wait for the liveness lock holder's post-acquire marker instead of the lock dir, which is published before the claim finishes. * no-mistakes(review): Scrub lab home overrides and require FM_TEST_SEAM separately * no-mistakes(document): Clarify test seam and disposable lab bypass documentation * no-mistakes(document): Clarify lab isolation and test-seam documentation * no-mistakes(ci): Fixed the CI failure: test cleanup killed the remote worker child but left its supervisor able to restart it during fixture removal. Cleanup now stops the worker tree. The lifecycle test passed locally; ShellCheck and diff checks passed
mehulbhagwani
pushed a commit
to mehulbhagwani/firstmate
that referenced
this pull request
Sep 26, 2026
…enguid#5635) * fix(bin): let gate agents drive lifecycle against marked lab homes Part 2 of the kunchenguid#5615 split. A no-mistakes gate agent runs inside a checkout carrying the fleet-captain identity, so fm-gate-refuse-lib refuses fleet mutation on the gate signal. That refusal was absolute, which kept gate validation from ever exercising the real lifecycle. Stamp a disposable lab FM_HOME with a .fm-lab-home marker file that only bin/fm-lab-home.sh writes, and only onto a fresh empty dir, so no call path can mark a populated real home. fm_refuse_if_gate_agent then permits lifecycle only when FM_HOME carries the marker and is driven through its stock layout - any FM_*_OVERRIDE relocation stays refused so part of the "lab" cannot be split back onto the real fleet. The threat model is a confused agent touching the real fleet, not deliberate forgery, so the marker is a plain token file rather than a bound record. FM_GATE_REFUSE_BYPASS is unchanged: it still serves the test harness, which cannot mark hundreds of temp homes. Teardown's slot-ownership scan compared state-dir paths textually while fm_firstmate_root_home canonicalizes, so a lab home under a symlinked TMPDIR scanned its own record twice and self-collided; compare file identity (-ef) instead. * no-mistakes(review): Refuse unlistable lab homes and hardlinked slot records * no-mistakes(review): Mint lab markers only on verified-empty fresh dirs * no-mistakes(document): Clarify lab-home gate documentation and comment contracts * no-mistakes(document): Clarify lab-home gate documentation and remove stale claims * no-mistakes(document): Clarify gate lab-home documentation and boundary wording
mehulbhagwani
pushed a commit
to mehulbhagwani/firstmate
that referenced
this pull request
Sep 26, 2026
…henguid#5638) * feat(tests): add FM_TEST_SEAM launch seam and gate lab-primary recipe Part 1 of the kunchenguid#5615 split: the pieces that let the no-mistakes pipeline live-validate firstmate changes, without the gate-refusal rescoping. - bin/fm-afk-launch.sh: FM_TEST_HARNESS pins the detected harness only alongside the FM_TEST_SEAM=1 marker test suites set, so a leaked variable in a real primary's environment stays inert and unknown tokens fall through to real detection. - tests/lib.sh: export FM_TEST_SEAM=1 for every suite. - .no-mistakes.yaml: per-harness recipe for running a real fixture primary from a gate run - a plain mktemp lab FM_HOME on a private tmux socket, with FM_GATE_REFUSE_BYPASS=1 scoped to it and NO_MISTAKES_GATE scrubbed. - tests/fm-wake-queue.test.sh: stop the owned watcher fixture with KILL and clear its lifecycle state so the next leg starts clean; TERM could leave bash waiting in a child on some runners. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh: wait for the liveness lock holder's post-acquire marker instead of the lock dir, which is published before the claim finishes. * no-mistakes(review): Scrub lab home overrides and require FM_TEST_SEAM separately * no-mistakes(document): Clarify test seam and disposable lab bypass documentation * no-mistakes(document): Clarify lab isolation and test-seam documentation * no-mistakes(ci): Fixed the CI failure: test cleanup killed the remote worker child but left its supervisor able to restart it during fixture removal. Cleanup now stops the worker tree. The lifecycle test passed locally; ShellCheck and diff checks passed
ashkonmousavi
added a commit
to ashkonmousavi/firstmate
that referenced
this pull request
Sep 26, 2026
Intent
Make Firstmate's no-mistakes pipeline perform honest live validation of pull requests inside isolated labs, motivated by live-validation gaps on PRs 5496 and 5503, by implementing two captain-authorized fixes only. Fix 1: harness-sensitive suites that directly invoke the launch path get a test-only simulated-harness seam (FM_TEST_HARNESS) that is honored only under the FM_TEST_SEAM marker so a leaked variable stays inert in production, plus per-harness 'primary in a lab' recipes in .no-mistakes.yaml for claude, codex, cursor, opencode, grok, and omp covering a disposable lab home, a private tmux socket or named non-default Herdr lab session, the machine's existing credentials, and honest reporting of missing CLI or login (never faked). Fix 2: replace the broad FM_GATE_REFUSE_BYPASS honor-system flag with structurally scoped lab authorization - a gate lifecycle call proceeds only when FM_HOME is a helper-marked disposable lab home under the temp root that is registered in no real home's registry and is not the primary checkout, and the resolved backend target is the lab's own isolation (fm-lab-* Herdr session, private tmux socket dir, or a lab-local tool). Deliberate decisions: the authorized lab proof covers FM_HOME and the backend target ONLY - worktree= and project= meta fields and orca_worktree_id are deliberately NOT location-checked because a real treehouse or Orca spawn legitimately lands its worktree in the shared pool outside the lab dir, so pinning it inside would force a fake treehouse (the captain explicitly forbade faking treehouse); the spawn-tools check that required a lab-local treehouse binary was removed for the same reason; production fm-harness.sh detect_own precedence is unchanged; .no-mistakes.yaml does not pin agent: claude; a real home stays refused even with forged lab markers; missing CLI or unavailable login is reported, never faked; Cause 4 (crediting prior worker live evidence) is deferred and no changes to the no-mistakes repo are included. Verified live: fm-gate-refuse 24/24 under a real gate marker including forged-marker and real-home refusals, fm-omp-harness and fm-afk-launch fully green under pi ancestry plus gate, fm-control-relaunch fully green under gate with relaunch sweeps driven live in disposable lab homes (the 5496 scenario), fm-backend-herdr-presentation-e2e green end-to-end under gate with real treehouse delegation and a named Herdr lab session, and the instruction-refresh live E2E green in an isolated Pi session.
What Changed
Risk Assessment
🚨 High: Recursive secondmate teardown can reach records or backend endpoints that the new gate lab authorization never checks, so the isolation boundary should be corrected before merge.
Testing
Targeted gate, launch, and relaunch checks passed. In a disposable named Herdr lab, real Claude detected itself despite a leaked test variable; Codex, OpenCode, and Pi answered one-shot prompts; and a Pi worker relaunched after pane closure with its task identity and Treehouse worktree preserved. A real-home gate call refused before delivery. The lab and pool slot were cleaned up. This was CLI validation, with no UI-facing change requiring visual evidence.
ompCLI is not on PATH. Provide an installed CLI on PATH or a repository-local executable path to test its primary launch.Evidence: Real-home gate refusal
Source: Real-home gate refusal
Evidence: Claude primary detects claude, not leaked omp
Source: Claude primary detects claude, not leaked omp
Evidence: Real worker relaunch output
Source: Real worker relaunch output
Evidence: Worker task record before relaunch
Source: Worker task record before relaunch
Evidence: Worker task record after relaunch
Source: Worker task record after relaunch
Evidence: Codex one-shot response
Source: Codex one-shot response
Evidence: OpenCode one-shot response
Source: OpenCode one-shot response
Evidence: Pi one-shot response
Source: Pi one-shot response
Gate-suite proofs (driven live before the pipeline run)
Recorded against this change before submission; each suite ran with
NO_MISTAKES_GATE=1from a shell whose process ancestry resolves topi(the same ancestry the gate agent runs under):tests/fm-omp-harness.test.shandtests/fm-afk-launch.test.shfully green under real pi ancestry plus the gate marker, including the check that a leakedFM_TEST_HARNESSstays inert withoutFM_TEST_SEAMand is honored only alongside it.tests/fm-gate-refuse.test.sh24/24 - a forged.fm-lab-homemarker on a non-lab directory, a forged lab binding record, and a real home carrying a valid marker are all refused; a properly created lab home authorizes.tests/fm-control-relaunch.test.shfully green under the gate, with relaunch sweeps driven live throughbin/fm-spawn.shin adopted disposable lab homes - corroborated above by the real-agent relaunch preserving task, endpoint rebinding, and Treehouse worktree.tests/fm-backend-herdr-presentation-e2e.test.shgreen end-to-end under the gate with real treehouse delegation, a marked lab root, and a namedfm-lab-*Herdr session - no bypass flag.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-spawn.sh:2836- The intent says the lab proof covers FM_HOME and the backend target ONLY, and deliberately does not location-check project=. This new assertion rejects a lab-backed spawn whose project is outside the lab, including a legitimate shared-pool project. Remove the project-location assertion.tests/herdr-test-safety.sh:35- The intent explicitly forbids faking treehouse, but this new helper replacestreehouse getwithgit worktree add. Its new uses in tests/fm-backend-autodetect-smoke.test.sh:66, tests/fm-backend-herdr-launcher-workspace-e2e.test.sh:50, and tests/fm-backend-herdr-workspace-per-home-e2e.test.sh:69 turn live spawn evidence into fake-treehouse evidence. Remove the helper and those substitutions rather than hardening the fake.bin/fm-gate-refuse-lib.sh:168- The intent requires the backend target to be the lab's own isolation. With FM_HOME in lab A and TMUX_TMPDIR or a tool in marked lab B, this helper authorizes access to B's backend. The same cross-lab acceptance is used by the tmux check at line 200 and tool check at line 181; tests/lib.sh:137 deliberately provisions the shared socket in a separate adopted lab. Align those paths with the authorized home's lab, or ask the captain to authorize shared lab backends.bin/fm-gate-refuse-lib.sh:357- A marked FM_HOME and isolated backend can pass authorization while FM_STATE_OVERRIDE points at a real home's empty state directory: this scan accepts it, and fm-spawn.sh:490 then uses that directory for task records. FM_DATA_OVERRIDE similarly redirects spawn data at fm-spawn.sh:491; fm-send.sh:235 and fm-teardown.sh:284-286 also consume overrides. This is a concrete route to modifying real fleet state despite .no-mistakes.yaml's prohibition. The intent expressly limits the lab proof to FM_HOME and backend target, so a remedy that constrains overrides needs a policy decision: may gate labs use overrides outside the lab?.no-mistakes.yaml:43- The required per-harness primary-in-a-lab recipe startstmux -L fm-lab new-session -dwithout a harness command, then only lists CLI names separately. Following it creates an empty session, not a Claude/Codex/etc. primary; subsequent firstmate tmux commands also do not supply-L fm-lab. Specify an executable launch for each harness on the same private socket.tests/fm-gate-refuse.test.sh:614- The newly added awk assertion extracts the first matching source line rather than checking the consumed YAML value. It can pass when that line is commented, nested, or overridden later. Remove this unrelated assertion or parse the configuration semantically, as the test-quality rule requires.🔧 Fix applied.
6 issues (5 errors, 1 warning) still open:
bin/fm-gate-refuse-lib.sh:168- The intent requires the backend target to be the lab's own isolation. With FM_HOME in lab A and TMUX_TMPDIR or a tool in marked lab B, this helper authorizes access to B's backend. The same cross-lab acceptance is used by the tmux check at line 200 and tool check at line 181; tests/lib.sh:137 deliberately provisions the shared socket in a separate adopted lab. Align those paths with the authorized home's lab, or ask the captain to authorize shared lab backends.bin/fm-gate-refuse-lib.sh:357- A marked FM_HOME and isolated backend can pass authorization while FM_STATE_OVERRIDE points at a real home's empty state directory: this scan accepts it, and fm-spawn.sh:490 then uses that directory for task records. FM_DATA_OVERRIDE similarly redirects spawn data at fm-spawn.sh:491; fm-send.sh:235 and fm-teardown.sh:284-286 also consume overrides. This is a concrete route to modifying real fleet state despite .no-mistakes.yaml's prohibition. The intent expressly limits the lab proof to FM_HOME and backend target, so a remedy that constrains overrides needs a policy decision: may gate labs use overrides outside the lab?bin/fm-lab-home.sh:75- The round-1 fix scoped tools to the authorized lab but left a symlink escape: canon_loose resolves a symlink to a regular executable as its lab-local parent plus basename, not its target. Put a symlink to the real tmux in the lab's PATH, leave TMUX_TMPDIR unset, and the gate authorizes calls to the default tmux server. The same check is used for lab-local herdr, ssh, zellij, orca, and cmux at bin/fm-gate-refuse-lib.sh:172-225. Resolve executable symlinks to their actual targets before accepting any of these tools.bin/fm-gate-refuse-lib.sh:417- The round-1 override fix confines FM_STATE_OVERRIDE and FM_DATA_OVERRIDE but leaves their default siblings unchecked. A marked lab home with state symlinked to a real home's empty state directory and a private backend passes authorization; bin/fm-spawn.sh:490 then writes task records there. A data symlink similarly redirects writes through bin/fm-spawn.sh:491, while send and teardown consume the corresponding default directories. Check the effective state and data directories, including default paths, at the shared authorization boundary.bin/fm-gate-refuse-lib.sh:205- The round-1 cross-lab fix bound socket directories and tools to the home's lab but left the Herdr sibling unchanged. With FM_HOME in lab A, HERDR_SESSION naming lab B's live fm-lab-* session passes here; an explicit fm-send target for B also passes at line 501, and recorded endpoints pass at line 372. A gate call can therefore steer B's pane. The captain required the home's own isolated session. Binding a session to its owning lab needs an authorized session-naming or ownership rule; the remedy, rather than the defect, needs a human decision.bin/fm-gate-refuse-lib.sh- recorded fix decision 01M3AX52275JG73W547Y30J59W/cross-lab-backend (review round 1): contradicted: The round-1 fix places fixture socket directories within their suite labs and scopes tool and tmux paths at bin/fm-gate-refuse-lib.sh:160-200. However, lines 205-209, 369-374, and 499-505 accept any fm-lab-* Herdr session without establishing that it belongs to the FM_HOME lab.🔧 Fix applied.
5 issues (4 errors, 1 warning) still open:
bin/fm-gate-refuse-lib.sh:168- The intent requires the backend target to be the lab's own isolation. With FM_HOME in lab A and TMUX_TMPDIR or a tool in marked lab B, this helper authorizes access to B's backend. The same cross-lab acceptance is used by the tmux check at line 200 and tool check at line 181; tests/lib.sh:137 deliberately provisions the shared socket in a separate adopted lab. Align those paths with the authorized home's lab, or ask the captain to authorize shared lab backends.bin/fm-gate-refuse-lib.sh:357- A marked FM_HOME and isolated backend can pass authorization while FM_STATE_OVERRIDE points at a real home's empty state directory: this scan accepts it, and fm-spawn.sh:490 then uses that directory for task records. FM_DATA_OVERRIDE similarly redirects spawn data at fm-spawn.sh:491; fm-send.sh:235 and fm-teardown.sh:284-286 also consume overrides. This is a concrete route to modifying real fleet state despite .no-mistakes.yaml's prohibition. The intent expressly limits the lab proof to FM_HOME and backend target, so a remedy that constrains overrides needs a policy decision: may gate labs use overrides outside the lab?bin/fm-gate-refuse-lib.sh:417- The round-1 override fix confines FM_STATE_OVERRIDE and FM_DATA_OVERRIDE but leaves their default siblings unchecked. A marked lab home with state symlinked to a real home's empty state directory and a private backend passes authorization; bin/fm-spawn.sh:490 then writes task records there. A data symlink similarly redirects writes through bin/fm-spawn.sh:491, while send and teardown consume the corresponding default directories. Check the effective state and data directories, including default paths, at the shared authorization boundary.bin/fm-gate-refuse-lib.sh:205- The round-1 cross-lab fix bound socket directories and tools to the home's lab but left the Herdr sibling unchanged. With FM_HOME in lab A, HERDR_SESSION naming lab B's live fm-lab-* session passes here; an explicit fm-send target for B also passes at line 501, and recorded endpoints pass at line 372. A gate call can therefore steer B's pane. The captain required the home's own isolated session. Binding a session to its owning lab needs an authorized session-naming or ownership rule; the remedy, rather than the defect, needs a human decision.bin/fm-gate-refuse-lib.sh- recorded fix decision 01M3AX52275JG73W547Y30J59W/cross-lab-backend (review round 1): contradicted: The round-1 fix places fixture socket directories within their suite labs and scopes tool and tmux paths at bin/fm-gate-refuse-lib.sh:160-200. However, lines 205-209, 369-374, and 499-505 accept any fm-lab-* Herdr session without establishing that it belongs to the FM_HOME lab.🔧 Fix applied.
2 warnings still open:
tests/fm-spawn-batch.test.sh:31- The change introduces a fake treehouse executable even though these cases stop at the missing-brief check and the lab authorization no longer requires a lab-local treehouse. No intent requirement needs this component; remove the stub and its PATH injection at lines 40, 109, and 114.tests/lib.sh:212- Fixture cleanup removes the adopted lab with rm -rf but leaves its binding record. Each subsequent record-herdr-session call scans every binding (bin/fm-lab-home.sh:224), so repeated gate runs accumulate stale records and progressively slow session registration. The same cleanup pattern remains in the changed Herdr suites, including tests/fm-backend-herdr-presentation-e2e.test.sh:306 and tests/fm-backend-herdr-launcher-workspace-e2e.test.sh:78. Use the existing lab teardown helper for adopted labs.🔧 Fix applied.
✅ Re-checked - no issues remain.
bin/fm-gate-refuse-lib.sh:361- Authorization scans only the selected home's state directory. A lab secondmate task can name a child home inside the lab whose state directory contains a task on another Herdr session—or whose state directory symlinks outside the lab. Gate-authorized teardown of the parent then traverses that child home and can close the foreign pane or process its external records. The sibling path is bin/fm-teardown.sh:3060-3080 (recursive preflight) and :3128-3169 (recursive close). Enforce the lab boundary on descendant homes, effective directories, and endpoints before recursive teardown reaches them.🔧 Fix applied.
5 issues (1 error, 4 warnings) still open:
bin/fm-gate-refuse-lib.sh:361- Authorization scans only the selected home's state directory. A lab secondmate task can name a child home inside the lab whose state directory contains a task on another Herdr session—or whose state directory symlinks outside the lab. Gate-authorized teardown of the parent then traverses that child home and can close the foreign pane or process its external records. The sibling path is bin/fm-teardown.sh:3060-3080 (recursive preflight) and :3128-3169 (recursive close). Enforce the lab boundary on descendant homes, effective directories, and endpoints before recursive teardown reaches them.🔧 **Test** - 2 issues found → no changes applied (3) ✅
ompwas not on PATH. Provide the missing CLI and authenticated isolated primary sessions to drive each recipe.tests/fm-gate-refuse.test.shtests/fm-control-relaunch.test.shtests/fm-omp-harness.test.shtests/fm-afk-launch.test.shtests/fm-backend-herdr-launcher-workspace-e2e.test.shProvisioned and tore down a named session withbin/fm-herdr-lab.sh; drove gate authorization andbin/fm-spawn.shagainst its recorded lab home🔧 No changes applied.
2 warnings still open:
NO_MISTAKES_GATE=1 tests/fm-gate-refuse.test.shNO_MISTAKES_GATE=1 tests/fm-omp-harness.test.shNO_MISTAKES_GATE=1 tests/fm-afk-launch.test.shNO_MISTAKES_GATE=1 tests/fm-control-relaunch.test.sh(timed out after 180 seconds)Launched Claude, Codex, Cursor Agent, OpenCode, Grok, and Pi in disposable lab homes on privatetmux -L fm-labsockets; captured their terminal output and tore down each lab.Ranbin/fm-harness.sh detect_ownfrom the live Claude primary withFM_TEST_HARNESS=cursorand noFM_TEST_SEAM.Invokedbin/fm-spawn.shunder the gate with an authorized lab socket, an external state override, and an unisolated backend.Spawned a real Claude task in a lab-private tmux backend, killed its worker pane, and invokedbin/fm-control.sh liverl relaunch --note ...; cleaned up the lab and local Treehouse fixture.🔧 No changes applied.
2 warnings still open:
bin/fm-herdr-lab.sh provision/run/teardownwith a named fm-lab-* session and a recorded lab-home bindingherdr pane runin that lab: one-shot Codex, OpenCode free-model, and Pi promptsNO_MISTAKES_GATE=1 bin/fm-spawn.shwith a different marked lab home targeting the first lab's Herdr sessionNO_MISTAKES_GATE=1 bin/fm-spawn.sh realrl ... --harness claude --backend herdr; closed its pane and rantreehouse return --force🔧 No changes applied.
✅ Re-checked - no issues remain.
bin/fm-harness.sh ownreturningclaudedespiteFM_TEST_HARNESS=omp.NO_MISTAKES_GATE=1 tests/fm-gate-refuse.test.shNO_MISTAKES_GATE=1 tests/fm-control-relaunch.test.shNO_MISTAKES_GATE=1 tests/fm-afk-launch.test.shNO_MISTAKES_GATE=1 tests/fm-omp-harness.test.shLaunched real Claude, Codex, OpenCode, and Pi one-shot prompts in disposable named Herdr labs; retried OpenCode with its free model.Spawned a real Claude worker through Treehouse in a named Herdr lab, closed its pane, and ranfm-control.sh relaunchbefore returning its worktree.Tried cross-lab Herdr targeting and an escaping state symlink underNO_MISTAKES_GATE=1; tore down the labs and removed transient test scripts.✅ No issues found.
ompCLI is not on PATH. Provide an installed CLI on PATH or a repository-local executable path to test its primary launch.tests/fm-gate-refuse.test.shtests/fm-afk-launch.test.shtests/fm-control-relaunch.test.shNO_MISTAKES_GATE=1 FM_HOME="$PWD" bin/fm-send.sh not-a-task 'must not deliver'bin/fm-herdr-lab.sh provision/run/teardownwith a recorded, named fm-lab-* sessionLaunched a real Claude primary with strayFM_TEST_HARNESS=ompand noFM_TEST_SEAM; asked it to runfm_afk_launch_primary_harnessRan Codex, OpenCode, and Pi one-shot prompts in isolated Herdr lab panesSpawned a real Pi worker, closed its pane, ranfm-control.sh liveworker relaunch, compared task records, returned the Treehouse slot, and tore down the lab✅ **Document** - passed
✅ No issues found.
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.