Repository navigation
Conversation
6b27cbd to
e2eeed0
Compare
…fore any destructive teardown step
An Orca scout teardown, or any Orca teardown run with --force, skipped the early Orca path-match check and only re-verified it after reap_task_worktree_processes had already run against the recorded worktree path, so a stale or reassigned Orca worktree id could have its processes signalled before ownership was ever proven. Fold the Orca proof into require_owned_task_worktree_slot, the same early, single-owner ownership determination the treehouse pool-slot claim already uses, so it runs once, well before Fix 1/Fix 2, for every kind and --force alike, instead of being re-checked ad hoc at each later call site.
…PATH sanitization
…all destructive steps
e2eeed0 to
88ea1c5
Compare
|
Speaking as Kun's firstmate: thanks @MLA82 — this closes a real safety gap, and the three live Orca teardown scenarios are exactly the evidence we look for. Where it stands: waiting on CI. I reviewed the diff ( contract-class: restore. Main already promises that Orca cleanup verifies the recorded worktree id/path before release and that ownership refusals are not relaxed by VISION.md: one captain — aligns · authority explicit — aligns (destructive steps gated on proof) · scripts own mechanics — aligns · restart non-event — aligns · delegation with a spine — aligns (strengthens the refusal path; unlanded work never torn down on a stale identity) · fleet outlives vendor — aligns (Orca adapter uses its own CLI proof) · scope — aligns. If CI and no-mistakes are green and it stays mergeable, it is eligible to merge on a following pass. |
What Changed
Risk Assessment
✅ Low: The change is well-bounded - it folds one already-existing Orca proof into the single early ownership determination, deletes a now-dead verified flag, and adds two behavioral regression tests; every traced path (scout, ship with and without --force, absent/mismatched/unresolvable worktree, existing Orca fixtures' CLI call order) keeps or improves its prior outcome, and the only finding is precision of the new safety wording.
Testing
The focused endpoint/worktree safety family passed. Three live marked-lab runs then confirmed early stale-identity refusal for scout and forced-ship teardown, plus successful cleanup when the recorded path is already absent. CLI transcripts were captured and all transient worktree artifacts were removed.
SCENARIO: scout-staleSCENARIO: forced-ship-staleSCENARIO: absent recorded path skips comparison but releases recorded Orca resourcesEvidence: Focused automated endpoint safety run
Source: Focused automated endpoint safety run
Evidence: Live Orca teardown transcript
Source: Live Orca teardown transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
docs/orca-backend.md:66- The change's three new safety claims assert a guarantee the code does not give when the recorded worktree path is already gone. docs/orca-backend.md:66 says "A recorded worktree path that no longer exists has nothing left to protect, so cleanup proceeds without asking Orca", docs/orca-backend.md:64 says --force "never act[s] on a worktree that may not be this task's", and bin/fm-teardown.sh:174 repeats "An Orca worktree path that is already gone has nothing left to protect and needs no proof" (same sentence again at bin/fm-teardown.sh:2504-2505; bin/fm-teardown.sh:3648 then states the match was "already verified"). Concrete sequence: a record with worktree=/path/gone (directory removed by hand or by a crashed earlier teardown) and orca_worktree_id=wt-7::/orca/wt-7, run asfm-teardown.sh <id> --force. At bin/fm-teardown.sh:2507 require_orca_worktree_path_match_if_present sees[ -e /path/gone ]false and returns 0 without calling Orca; --force skips the inspectable-worktree gate at bin/fm-teardown.sh:3507; execution reaches bin/fm-teardown.sh:3665 and runsorca worktree rm --worktree id:wt-7::/orca/wt-7 --forceagainst whatever Orca now resolves that id to, with no path proof at all. The identical shape exists on the sibling secondmate-child path at bin/fm-teardown.sh:3325 (child removal gated only by[ -e "$child_wt" ]around the match at bin/fm-teardown.sh:3080-3082). So there IS something still at stake in that case: the id, not the vanished path. The behavior is pre-existing, intentional, and pinned by tests/fm-backend-orca.test.sh:919 ("releases terminal/worktree when path is absent", which asserts terminal close + worktree rm with noworktree showcall), and round 1 already decided the tolerance is intended - I am not asking for it to change. The smallest honest remedy is to narrow the four sentences to state what is actually skipped (the path comparison, because there is no recorded path left to compare) instead of claiming nothing is at stake and that --force never acts on a worktree that may not be this task's; this is an ask-user because the sentences are the author's deliberate claim and the alternative remedy (gating the id-only release) would contradict a pinned test and a recorded decision.bin/fm-teardown.sh:2499- Scope note for the record, not a blocker. The User intent enumerates exactly eight contributions to update ("Acht Beitraege: 3722, 3725, 4170, 4186, 4683, 4773, 4838, 4845") and four explicitly out of scope (3726, 4190, 4366, 5288). This branch is fm/werft-pr3723-ersatz; upstream fix(bin): refuse teardown when the recorded worktree is not a Treehouse pool slot, and guard Claude hook removal #3723 ("fix(bin): refuse teardown when the recorded worktree is not a Treehouse pool slot, and guard Claude hook removal", author MLA82) is closed and appears in neither list. The branch is also not a transfer of a pre-verified staging state: its entire content relative to origin/main is the three commits c2b45f1/36dd879b/e063fbb6 authored on top of current main 4cca7d0. Nothing in the intent forbids 3723, and the recorded decisions show this same branch has already been through review round 1, lint round 1, and CI round 2, so this reads as a deliberate ninth, replacement contribution - stating it once so the mapping is explicit. No action needed unless that is not the case.🔧 Fix applied.
2 infos still open:
bin/fm-teardown.sh:2499- Scope note for the record, not a blocker. The User intent enumerates exactly eight contributions to update ("Acht Beitraege: 3722, 3725, 4170, 4186, 4683, 4773, 4838, 4845") and four explicitly out of scope (3726, 4190, 4366, 5288). This branch is fm/werft-pr3723-ersatz; upstream fix(bin): refuse teardown when the recorded worktree is not a Treehouse pool slot, and guard Claude hook removal #3723 ("fix(bin): refuse teardown when the recorded worktree is not a Treehouse pool slot, and guard Claude hook removal", author MLA82) is closed and appears in neither list. The branch is also not a transfer of a pre-verified staging state: its entire content relative to origin/main is the three commits c2b45f1/36dd879b/e063fbb6 authored on top of current main 4cca7d0. Nothing in the intent forbids 3723, and the recorded decisions show this same branch has already been through review round 1, lint round 1, and CI round 2, so this reads as a deliberate ninth, replacement contribution - stating it once so the mapping is explicit. No action needed unless that is not the case.bin/fm-teardown.sh:3652- Tradeoff note for the record, no action needed. Removing the deferred check at the old bin/fm-teardown.sh:3652 means no path proof runs adjacent to the destructive Orca calls any more: for kind=scout and forced ship teardowns the proof used to execute immediately before the branch delete, terminal close, andfm_backend_remove_worktree(bin/fm-teardown.sh:3670), and now runs only once at the single gate (bin/fm-teardown.sh:3405), with conclude_task_no_mistakes_run and up to several reap passes in between. That is exactly the window the non-forced ship path has always had (its proof sat at the old :3513, also well before :3670), so this is a deliberate uniform single-gate design, not a regression in kind; the trade is strictly in the right direction, since the reap and hook removal are now covered for every kind. Flagging only so the loss of the immediately-pre-removal re-check is a known, chosen property rather than an oversight.✅ **Test** - passed
✅ No issues found.
SCENARIO: scout-staleSCENARIO: forced-ship-staleSCENARIO: absent recorded path skips comparison but releases recorded Orca resourcesbash tests/fm-teardown-endpoint-safety.test.shTemporary evidence driver invoking realbin/fm-teardown.shin marked disposable lab homes with an isolated Orca CLI fixture (driver and fixtures removed afterward)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.