Repository navigation
Conversation
…dmate teardown gates
…nal binding unproven
|
Speaking as Kun's firstmate: thanks @Cubatica, and thanks for re-raising this through no-mistakes. The attestation now binds head Contract-class: new-default (my own read, same as on #7397). An Orca What I need from you: the live validation on this head is inconclusive (4 of 8). The labelled-worker / M1 visual check, guarded retirement, durable-inbox steering, and the unbound-terminal receipt case still lean on the earlier proof from Overlap notes: this looks like the no-mistakes re-raise of your #7397 (same lifecycle, and |
…1" fail. Both were in files this PR changed. 1. **`bin/backends/orca.sh:97` (SC2034):** the retry loop in `fm_backend_orca_close_confirmed` had a counter variable `attempt` that was never read. I renamed it to `_` in the `local` declaration and in the `for` loop. That is the only unused counter in this file, and behaviour is unchanged. 2. **`tests/fm-orca-secondmate-live-e2e.test.sh:17` (SC1091):** ShellCheck could not resolve the sourced `lib.sh`. I added `# shellcheck source=tests/lib.sh` above that line, which is how the other test scripts do it. Checks run: - `shellcheck -x` on both files: no findings. - `bin/fm-lint.sh` on both files: rc=0. - `tests/fm-backend-orca.test.sh`: the last four checks shown passed. I only looked at the tail of the output and didn't capture the exit code, so I haven't confirmed the whole file passed. I didn't run the live Orca test; it only runs when someone opts in
|
Speaking as Kun's firstmate: thanks @Cubatica for the lint fix. The new head Contract-class stays new-default (my own read). VISION.md: it still aligns. Still waiting on you, same ask as before: the live validation on this head is still inconclusive (4 of 8). The M1 labelled-worker visual check, guarded retirement, durable-inbox steering and the unbound-terminal receipt case haven't been run live on the current code. When you can, please run those on a disposable seeded home in your own Orca setup and post the evidence here, or re-raise through no-mistakes so it records a live #7397 is still open. If this PR replaces it, feel free to close it. |
IntentFinish live validation for #7401 at What Changed
Risk AssessmentTestingThe three fresh checks passed at the exact head. The M1 visual check is prior measured evidence, reconfirmed by the operator today, not a fresh visual inspection of this head.
Prior M1 visual evidence and current confirmationThe preserved 2026-10-15T23:49:20Z firstmate confirmation records screenshots plus CLI checks:
The operator reconfirmed today: “the visual check worked we proved it in the past”. Exact-head live setup, steering, retirement and fault injectionA fresh standalone seeded home was created beneath git fetch https://github.com/Cubatica/firstmate 2dc5f5ae07f8ef9248bfed2f64578e50824570e7
git checkout --detach 2dc5f5ae07f8ef9248bfed2f64578e50824570e7
# FM_HOME was the disposable primary throughout:
bash bin/fm-brief.sh lab7401 --secondmate --no-projects
bash bin/fm-home-seed.sh lab7401 "$LAB/mate" --no-projects
FM_SKIP_SECONDMATE_SYNC=1 bash bin/fm-spawn.sh lab7401 --secondmate --backend orca --harness pi
bash bin/fm-send.sh lab7401 'Lifecycle proof nonce ORCA7401-STEER-20261019. Acknowledge this durable inbox message and reply with exactly this nonce through the correlated parent channel, then idle. Do not spawn workers or update code.'Observed durable acknowledgement: For The home and receipt survived, parent metadata was absent, and the returned terminal remained live in the other lab workspace.
Home and parent metadata still existed. The unbound home's empty owned registration was released with This replaces #7397, which is superseded and being closed. |
What Changed
fm-spawn.sh --secondmatenow works on the Orca backend instead of refusing it. The seeded home is registered as an Orca repository, and a2ndmate-<id>terminal is opened in the home's root workspace. The helpers for this live in the newbin/backends/orca-home.jsand inbin/backends/orca.sh. Astate/orca-secondmate-launchreceipt is held during launch. That receipt, or existing secondmate metadata, makes spawn refuse a duplicate or uncertain launch. The receipt stays in place whenever terminal creation, workspace binding, or close can't be confirmed. Workers spawned from an Orca secondmate stay independent in their own project repos and are labelled2ndmate-<id> · fm-<task-id>in both the worktree display name and the terminal title.fm-teardown.shcloses an Orca secondmate's exact terminal and confirms it is gone, including during forced cleanup of child homes. Only after the final teardown gates pass does it retire the registrations the adapter created, then remove the home. It never calls worktree removal on the persistent home and leaves pre-existing registrations alone. Registration receipts are serialized with a per-home lock.fm-backend.shrefuses secondmate metadata whose home and workspace binding don't match.orca serveruntimes and the label-only worker grouping. They also state that agent-process recovery for Orca is still unverified. Tests added: new Orca backend cases, a send-marker test and an opt-in live end-to-end test (tests/fm-orca-secondmate-live-e2e.test.sh).🤖 Generated with Claude Code
Risk Assessment
Testing
I ran the two changed Orca test suites (fm-backend-orca and fm-send-secondmate-marker) with fake runtimes, a restricted PATH and an isolated fixture home. Both passed with no gate skips, including the round-1 test that a terminal not bound to its home keeps the launch receipt. That test is not a live run, so the scenario is marked untested. Against the real Orca 1.4.224, I drove the product's runtime check and fm-spawn --secondmate from a disposable marked lab home with a seeded secondmate home. Base code refuses Orca secondmates. Head removes that gate and still refuses safely when a leftover launch receipt or existing parent metadata is present, keeping both untouched and leaving Orca's inventory unchanged. I tore down the lab afterwards. I did not re-run the full Orca/Pi lifecycle, the M1 visual check or retirement here, because that would change the captain's real Orca and the plan says not to. Those scenarios rely on the earlier measured proof, so the verdict is inconclusive. There are no screenshots because none of the scenarios I ran shows a UI.
2ndmate-<id> · fm-<task>, no parent)Evidence: Live real-Orca lab transcript: runtime gate, base vs head secondmate spawn, receipt/metadata refusals, unchanged Orca inventory
Source: Live real-Orca lab transcript: runtime gate, base vs head secondmate spawn, receipt/metadata refusals, unchanged Orca inventory
Evidence: Hermetic focused suite log (fm-backend-orca, fm-send-secondmate-marker)
Source: Hermetic focused suite log (fm-backend-orca, fm-send-secondmate-marker)
Evidence: Hermetic focused suite timing JSON
Source: Hermetic focused suite timing JSON
Evidence scope and accepted exception
Relates to #2083.
The automated live verdict is inconclusive: 4 of 8 scenarios driven live in this run.
Firstmate explicitly accepted that Test exception using the earlier measured Orca/Pi lifecycle and M1 visual proof plus the hermetic regressions.
This is not an all-scenarios live pass.
The earlier sanitized live-proof record covers the separately seeded home, Pi terminal, independently labelled read-only olilit scout, correlated reply, M1 visibility under
M6 clean, and guarded retirement.The scout used GitHub deployment status without Railway credentials, CLI or API access; the operational primary fleet was untouched.
Those proof identities were retired and were not resurrected by this run.
The complete scenario mapping, including what the generated tables mean by “untested”, is:
fm-send-secondmate-markerintegration suiteBefore pipeline validation, six affected suites passed with zero gate skips:
fm-backend-orca,fm-backend,fm-secondmate-safety,fm-send-secondmate-marker,fm-control, andfm-pending-reply.Lint and documentation-audience checks passed.
Eleven bounded base/head comparisons found no head-only assertion failure: six assertion failures occurred on both revisions; reconciliation and backlog atomicity passed on both; teardown passed on head but timed out on base; captain-hold lifecycle and public followup timed out on both.
The broader local suite did not finish or pass, and further broad reruns were cancelled.
These comparisons do not establish a full-suite pass or complete behavioral equivalence.
Real tmux/Herdr live suites were excluded; no such lifecycle or shared Orca restart was performed.
Orca 1.4.224 rejects cross-repository parenting (
LINEAGE_PARENT_CONTEXT_CONFLICT), so worker grouping uses labels, not Orca lineage.Pi alive/dead state, restart and recovery remain unverified; control-plane exit/relaunch refusal remains in place.
The latest pipeline fix retains the launch receipt when a returned terminal cannot be proven bound to the expected home, in addition to the earlier late-retirement ordering and concurrent receipt-update fixes.
Prior art
Thanks to #3579 for the persistent-home terminal-reuse approach, and #5348 for exact workspace identity, persistent-home protection and explicit unknown-state handling.
These design ideas informed the implementation; neither branch was imported wholesale.
No supervised-worker implementation was imported and no recovery parity is claimed.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed → no changes applied ✅
bin/backends/orca.sh:95-fm_backend_orca_close_confirmedtreats an 'absent' result from the home-scoped terminal inventory as a confirmed close and returns success without ever sendingorca terminal close. That is safe in teardown, where the recorded terminal has already been validated against the home workspace. It is not safe in the secondmate spawn abort path. Concrete sequence:orca terminal createreturns handle H (it is written to the launch receipt). The binding check at bin/fm-spawn.sh:4284 then finds H absent from the home workspace inventory, because H is bound elsewhere or not yet listed, and prints 'new Orca secondmate terminal is not bound to its home workspace' and exits. The abort at bin/fm-spawn.sh:1492 calls close_confirmed with the same workspace scope, gets 'absent', returns 0 without closing H, sets SPAWN_ENDPOINT_CLOSED=1 and deletesstate/orca-secondmate-launch. So the one condition this check exists to detect ends up reported as a confirmed close. The retained receipt that should block a duplicate launch is removed while H may still be live. This contradicts the intent that 'uncertain identities ... and failed closes ... preserve the home and records'. The same helper is also used at bin/fm-spawn.sh:4637 (rovo endpoint cleanup), but there the terminal had already passed the binding check. Remedy: when the post-create binding check fails, keep the attempt receipt and mark the endpoint not closed. Alternatively, have the abort path always issueorca terminal close --terminal Hbefore trusting a scoped 'absent', and remove the receipt only when that close returns an authoritative success or not-found.🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 No changes applied.
✅ Re-checked - no issues remain.
2ndmate-<id> · fm-<task>, no parent), Guarded retirement closes the exact home terminal, removes only owned registrations, then the home and route, Orca secondmate steers go through the durable inbox and correlated parent channel2ndmate-<id> · fm-<task>, no parent)env -i HOME=<fixture> TMPDIR=<fixture> FM_LIVE=0 PATH=<restricted hermetic-bin without tmux/herdr/orca/treehouse> bash bin/fm-test-run.sh tests/fm-backend-orca.test.sh tests/fm-send-secondmate-marker.test.sh --json <evidence>/focused-tests.jsonLive:. bin/fm-backend.sh; fm_backend_source orca; fm_backend_orca_runtime_checkagainst real Orca 1.4.224Live:bin/fm-lab-home.sh create <canonical LAB>+bin/fm-brief.sh labmate --secondmate --no-projects+bin/fm-home-seed.sh labmate <home> --no-projects(disposable seeded secondmate home, registry route)Live: base 5f2b81bfm-spawn.sh labmate --secondmate --backend orca --harness pi(from git archive) → old refusalLive: headfm-spawn.sh labmate --secondmate --backend orca --harness piwith plantedstate/orca-secondmate-launchreceipt → refusal, receipt retainedLive: head same spawn with pre-existing parentstate/labmate.meta→ duplicate-launch refusal, metadata unchangedBefore/after structural digest oforca repo list --jsonpaths +orca worktree list --jsonids, plus grep for lab pathsTeardown: removed lab home, seeded home, fixture dirs;git status --porcelainclean✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.