rehearsal: on a RED drive the droplet outlives the reporter — teardown moves after diagnosis so the reporter (and the session) can interrogate the live box (Ben's ruling 2026-08-14) #540

Closed
opened 2026-08-14 17:41:33 +00:00 by ben · 7 comments
Owner

Why (Ben's ruling, in-session 2026-08-14)

Today's forensics were repeatedly blinded by teardown-at-drive-end: drives 145526Z, 153243Z, and 171114Z all redded with questions only the LIVE box could answer (which unit failed, what listens on which port, what the health probe's real error was) — and every post-red probe hit a destroyed droplet. Each diagnosis had to squeeze through the static harvest, which is why #524 (caddy harvest) and #536 (unit snapshot) keep growing it after the fact.

Direction

  1. Reorder on RED only: in the drive cycle, when drive_rc is red, the reporter runs BEFORE oc_droplet_cleanup (scripts/lib/rehearsal-droplet.sh). Green drives keep today's ordering (evidence → teardown → summary).
  2. The reporter's prompt gains the live door: droplet IP + ssh root@<ip> + a read-only command palette (journalctl -u , systemctl --failed, systemctl status, ss -tlnp, curl loopback/status endpoints) so its diagnosis can interrogate the box instead of guessing from harvest excerpts. Read-only discipline stated in the prompt; the box is dead minutes later regardless.
  3. Destroy stays guaranteed: teardown runs immediately after the reporter returns — success, fault, or timeout (the existing at-most-once droplet_cleaned guard + EXIT trap already shape this; the reporter must be bounded by its existing timeout so a hung diagnosis cannot leak the box past it). The hourly reap remains the backstop of last resort.
  4. Cost note: extends a red droplet's life by the reporter's runtime (minutes, bounded). No change to green drives, no change to reap.

Acceptance

  • A red drive's reporter log shows live-box command output in its diagnosis context (or an honest note that ssh was refused — e.g. once #414's no-sshd triad lands, the palette reds gracefully and the harvest is the fallback).
  • The droplet is provably destroyed at cycle end on every path (red, green, reporter-fault, reporter-timeout) — the existing cleanup-once guard pins this.
  • Green-drive ordering byte-identical.

Complements #536 (static unit snapshot) — harvest for the record, live box for the questions nobody predicted.

## Why (Ben's ruling, in-session 2026-08-14) Today's forensics were repeatedly blinded by teardown-at-drive-end: drives `145526Z`, `153243Z`, and `171114Z` all redded with questions only the LIVE box could answer (which unit failed, what listens on which port, what the health probe's real error was) — and every post-red probe hit a destroyed droplet. Each diagnosis had to squeeze through the static harvest, which is why #524 (caddy harvest) and #536 (unit snapshot) keep growing it after the fact. ## Direction 1. **Reorder on RED only**: in the drive cycle, when `drive_rc` is red, the reporter runs BEFORE `oc_droplet_cleanup` (scripts/lib/rehearsal-droplet.sh). Green drives keep today's ordering (evidence → teardown → summary). 2. **The reporter's prompt gains the live door**: droplet IP + `ssh root@<ip>` + a read-only command palette (journalctl -u <unit>, systemctl --failed, systemctl status, ss -tlnp, curl loopback/status endpoints) so its diagnosis can interrogate the box instead of guessing from harvest excerpts. Read-only discipline stated in the prompt; the box is dead minutes later regardless. 3. **Destroy stays guaranteed**: teardown runs immediately after the reporter returns — success, fault, or timeout (the existing at-most-once `droplet_cleaned` guard + EXIT trap already shape this; the reporter must be bounded by its existing timeout so a hung diagnosis cannot leak the box past it). The hourly reap remains the backstop of last resort. 4. **Cost note**: extends a red droplet's life by the reporter's runtime (minutes, bounded). No change to green drives, no change to reap. ## Acceptance - A red drive's reporter log shows live-box command output in its diagnosis context (or an honest note that ssh was refused — e.g. once #414's no-sshd triad lands, the palette reds gracefully and the harvest is the fallback). - The droplet is provably destroyed at cycle end on every path (red, green, reporter-fault, reporter-timeout) — the existing cleanup-once guard pins this. - Green-drive ordering byte-identical. Complements #536 (static unit snapshot) — harvest for the record, live box for the questions nobody predicted.
Author
Owner

Blocked — the deliverable is a protected .sandcastle/ machinery change; an agent cannot land it.

Both acceptance criteria require editing the reporter, which lives entirely under the protected .sandcastle/ tree (rolled back + failed by .sandcastle/protected-paths-lib.sh):

  • .sandcastle/rehearsal-report.sh — the reporter itself
  • .sandcastle/rehearsal-report-prompt.md — its diagnosis prompt
  • .sandcastle/tests/rehearsal-report-test.sh + rehearsal-healer-test.sh — its tests

Why each direction is a protected edit:

  1. Reorder (reporter before oc_droplet_cleanup). Today the reporter is invoked from scripts/rehearsal-cycle.sh:61 — after scripts/smoke-private-path.sh returns, and that smoke process already destroys the box (oc_droplet_cleanup + the EXIT trap armed in oc_droplet_create). So the reporter always meets a dead droplet. The ticket's own point 3 says the guarantee stays with "the existing at-most-once droplet_cleaned guard + EXIT trap" — those live inside the smoke process (scripts/lib/rehearsal-droplet.sh). To keep that guarantee while the reporter sees a live box, the protected reporter must be invoked from inside that guarded cleanup (between oc_droplet_evidence and oc_droplet_teardown on RED), bounded by its 900s timeout, then teardown fires regardless. That relocation changes the reporter's execution contract (it stops being rehearsal-cycle.sh's post-smoke step), which is a change to protected machinery.

  2. The live door in the prompt. Point 2 says the discipline is "stated in the prompt" — the reporter assembles its prompt from cat .sandcastle/rehearsal-report-prompt.md + Run directory: $run_dir only; it reads no env-driven prompt extension. Adding ssh root@<ip> + the read-only palette (journalctl -u <unit>, systemctl --failed, systemctl status, ss -tlnp, curl loopback/status) and passing OC_E2E_DROPLET_IP into that prompt both edit protected files. Dropping a bigger static harvest into run_dir/logs (the #524/#536 approach) does not satisfy this — the ticket explicitly wants the reporter to interrogate the live box for "questions nobody predicted," which is interactive, not pre-baked.

Recommended design for the human (all inside .sandcastle/ + one non-protected wiring line):

  • Move the reporter invocation into oc_droplet_cleanup's RED branch (or have smoke-private-path.sh call the reporter before teardown on RED), gated on drive_rc != 0, with OC_E2E_DROPLET_IP exported; green ordering byte-identical. Remove/guard the post-smoke call in scripts/rehearsal-cycle.sh so it isn't double-run.
  • Extend .sandcastle/rehearsal-report-prompt.md with the live-box section (IP + palette + read-only discipline + the "box dies minutes later regardless / harvest is the fallback if ssh is refused" note), and thread $OC_E2E_DROPLET_IP into the prompt from .sandcastle/rehearsal-report.sh.
  • Update .sandcastle/tests/rehearsal-report-test.sh to assert the live-door text and RED-only ordering.

No code changed this iteration. Swapping to ready-for-human for a human to make the machinery change.

**Blocked — the deliverable is a protected `.sandcastle/` machinery change; an agent cannot land it.** Both acceptance criteria require editing the reporter, which lives entirely under the protected `.sandcastle/` tree (rolled back + failed by `.sandcastle/protected-paths-lib.sh`): - `.sandcastle/rehearsal-report.sh` — the reporter itself - `.sandcastle/rehearsal-report-prompt.md` — its diagnosis prompt - `.sandcastle/tests/rehearsal-report-test.sh` + `rehearsal-healer-test.sh` — its tests Why each direction is a protected edit: 1. **Reorder (reporter before `oc_droplet_cleanup`).** Today the reporter is invoked from `scripts/rehearsal-cycle.sh:61` — *after* `scripts/smoke-private-path.sh` returns, and that smoke process already destroys the box (`oc_droplet_cleanup` + the EXIT trap armed in `oc_droplet_create`). So the reporter always meets a dead droplet. The ticket's own point 3 says the guarantee stays with "the existing at-most-once `droplet_cleaned` guard + EXIT trap" — those live *inside* the smoke process (`scripts/lib/rehearsal-droplet.sh`). To keep that guarantee while the reporter sees a live box, the protected reporter must be invoked from inside that guarded cleanup (between `oc_droplet_evidence` and `oc_droplet_teardown` on RED), bounded by its 900s timeout, then teardown fires regardless. That relocation changes the reporter's execution contract (it stops being `rehearsal-cycle.sh`'s post-smoke step), which is a change to protected machinery. 2. **The live door in the prompt.** Point 2 says the discipline is "stated in the prompt" — the reporter assembles its prompt from `cat .sandcastle/rehearsal-report-prompt.md` + `Run directory: $run_dir` only; it reads no env-driven prompt extension. Adding `ssh root@<ip>` + the read-only palette (`journalctl -u <unit>`, `systemctl --failed`, `systemctl status`, `ss -tlnp`, curl loopback/status) and passing `OC_E2E_DROPLET_IP` into that prompt both edit protected files. Dropping a bigger *static* harvest into `run_dir/logs` (the `#524`/`#536` approach) does **not** satisfy this — the ticket explicitly wants the reporter to interrogate the live box for "questions nobody predicted," which is interactive, not pre-baked. **Recommended design for the human** (all inside `.sandcastle/` + one non-protected wiring line): - Move the reporter invocation into `oc_droplet_cleanup`'s RED branch (or have `smoke-private-path.sh` call the reporter before teardown on RED), gated on `drive_rc != 0`, with `OC_E2E_DROPLET_IP` exported; green ordering byte-identical. Remove/guard the post-smoke call in `scripts/rehearsal-cycle.sh` so it isn't double-run. - Extend `.sandcastle/rehearsal-report-prompt.md` with the live-box section (IP + palette + read-only discipline + the "box dies minutes later regardless / harvest is the fallback if ssh is refused" note), and thread `$OC_E2E_DROPLET_IP` into the prompt from `.sandcastle/rehearsal-report.sh`. - Update `.sandcastle/tests/rehearsal-report-test.sh` to assert the live-door text and RED-only ordering. No code changed this iteration. Swapping to `ready-for-human` for a human to make the machinery change.
Author
Owner

Relabelled ready-for-session under ADR 0174: Ben already ruled the direction in-body (reorder-on-red, live-door palette, guaranteed destroy) — what remains is rehearsal-machinery build work (scripts/lib/rehearsal-droplet.sh + reporter prompt, protected paths), which a session lands. No further Ben input needed until the accept.

Relabelled `ready-for-session` under ADR 0174: Ben already ruled the direction in-body (reorder-on-red, live-door palette, guaranteed destroy) — what remains is rehearsal-machinery build work (`scripts/lib/rehearsal-droplet.sh` + reporter prompt, protected paths), which a session lands. No further Ben input needed until the accept.
Author
Owner

This was generated by AI during triage.

Triage: added the missing category label; state (ready-for-session, already reasoned in this thread) left as-is.

> *This was generated by AI during triage.* **Triage:** added the missing category label; state (`ready-for-session`, already reasoned in this thread) left as-is.
Author
Owner

Ben ruled 2026-08-15 (~03:20Z): pulled forward with TWO AMENDMENTS — tonight's eight-drive arc is the cost case: three reds lost their evidence to teardown (#557's route hunt needed the gateway's config repo, #559's seed diagnosis is directed blind, and #556 existed ONLY to add logging a live ssh would have answered in a minute), and two reds (202512Z, 214116Z) sat with the product's own "Resume the deploy" button on screen for faults that resolved seconds later.

Amendment 1 — one product-shaped resume. When a finish-leg fault frame's detail says wait-and-re-probe (the transient/cold-start class — the frame's own resume option present), the drive presses Resume ONCE before redding. This exercises the product's real resume path (a real operator's first click), it is not masking: a fault that survives one resume reds exactly as today. Scope: the e2e finish leg (journey.droplet.spec.ts) + a resumed=true marker in the leg record so a green-via-resume is distinguishable in evidence.

Amendment 2 — read-only live-box access during the kept window. While the red droplet is kept, the reporter/healer prompt gains the droplet's ssh door for DIAGNOSIS ONLY (journalctl/ss/ls/cat) — never mutation, never a live hot-fix (a droplet patch would mask render defects as false greens; repo fixes stay the only fix path, rails unchanged). The kept window stays bounded by the existing TTL/reap contract (6h tag + hourly reap) so cost cannot leak; teardown still runs after the reporter concludes, keep-on-red evidence rules unchanged.

Relabelling ready-for-session → ready-for-agent + priority (the work is scripts/spec surface the swarm already edits — #554 touched rehearsal-droplet.sh). Not wired as a #492 blocker: improvement, not gate.

**Ben ruled 2026-08-15 (~03:20Z): pulled forward with TWO AMENDMENTS** — tonight's eight-drive arc is the cost case: three reds lost their evidence to teardown (#557's route hunt needed the gateway's config repo, #559's seed diagnosis is directed blind, and **#556 existed ONLY to add logging a live `ssh` would have answered in a minute**), and two reds (`202512Z`, `214116Z`) sat with the product's own "Resume the deploy" button on screen for faults that resolved seconds later. **Amendment 1 — one product-shaped resume.** When a finish-leg fault frame's detail says wait-and-re-probe (the transient/cold-start class — the frame's own `resume` option present), the drive presses Resume ONCE before redding. This exercises the product's real resume path (a real operator's first click), it is not masking: a fault that survives one resume reds exactly as today. Scope: the e2e finish leg (journey.droplet.spec.ts) + a `resumed=true` marker in the leg record so a green-via-resume is distinguishable in evidence. **Amendment 2 — read-only live-box access during the kept window.** While the red droplet is kept, the reporter/healer prompt gains the droplet's ssh door for DIAGNOSIS ONLY (journalctl/ss/ls/cat) — never mutation, never a live hot-fix (a droplet patch would mask render defects as false greens; repo fixes stay the only fix path, rails unchanged). The kept window stays bounded by the existing TTL/reap contract (6h tag + hourly reap) so cost cannot leak; teardown still runs after the reporter concludes, keep-on-red evidence rules unchanged. Relabelling ready-for-session → **ready-for-agent + priority** (the work is scripts/spec surface the swarm already edits — #554 touched rehearsal-droplet.sh). Not wired as a #492 blocker: improvement, not gate.
Author
Owner

Amendment 1 landed; #540 blocked on a PROTECTED machinery edit for the rest.

Commit 95c64f1 (on origin/main) ships Amendment 1 — the one product-shaped resume — the fully non-protected, self-contained half of this ticket:

  • The droplet finish leg (app/tests/e2e/journey.droplet.spec.ts) now presses the product's OWN Resume ONCE before redding on the transient / cold-start deploy-failure class. FoundingDeployOutcome's per-mode recovery panel offers resume (a DeployAction, distinct from reinstall / rescue-boot); the leg branches on that button's PRESENCE ([data-status="deploy-failed"] [data-action="resume"], never its copy), clicks it once, waits for the failed frame to clear, then re-races the terminal outcome under a fresh finish budget.
  • NOT masking: a fault that survives the one resume reds exactly as before, now carrying resumed=true on its LegRecord so a green-via-resume is never mistaken for a clean first-pass green (tonight's 202512Z/214116Z sat on this button for faults that cleared seconds later).
  • runRecordedLeg grew an optional marker thunk (app/tests/e2e/fixtures/legs.ts), read on both the green and red paths; a normal green's record stays byte-identical. Seam tests: app/tests/unit/frontierLegRecords.test.ts (6 green). vue-tsc + full app vitest (889 pass) green.

Why the rest is blocked (unchanged from your 2026-08-14 analysis). The other half — reorder-on-red so the reporter/healer interrogates the LIVE box (Amendment 2's read-only ssh door + the three original acceptance clauses) — cannot be landed by an agent:

  • The reporter is .sandcastle/rehearsal-report.sh and its prompt is .sandcastle/rehearsal-report-prompt.md (the healer's is .sandcastle/rehearsal-heal-prompt.md). All three live under the PROTECTED .sandcastle/ tree — the protected-paths-lib.sh fingerprint rolls back + fails the run on any edit there.
  • The reporter runs from scripts/rehearsal-cycle.sh:61 AFTER smoke-private-path.sh returns, and smoke already tore the droplet down (oc_droplet_cleanup), so the reporter always meets a dead box. Giving it a LIVE box needs the invocation moved before teardown AND the ssh door named in the (protected) prompt AND OC_E2E_DROPLET_IP threaded into it (the reporter session has no Bash tool; only the healer does). Every path to acceptance clause 1 is a protected edit.
  • A bigger STATIC harvest into run_dir/logs/ does NOT satisfy this (your own note) — the ticket wants the reporter to interrogate the live box for "questions nobody predicted," which is interactive.

What a human must do to close #540: make the protected .sandcastle/ reporter/healer change (or convert it into a sanctioned machinery ticket): move the reporter invocation into the RED branch before teardown (OC_E2E_DROPLET_IP exported, bounded by its existing 900s timeout, teardown guaranteed after via the droplet_cleaned guard + EXIT trap), extend the prompt with the read-only ssh palette + discipline, and thread the IP in. Amendment 1 is done and needs no re-doing.

Flipping ready-for-agent → ready-for-human.

**Amendment 1 landed; #540 blocked on a PROTECTED machinery edit for the rest.** Commit `95c64f1` (on `origin/main`) ships Amendment 1 — the one product-shaped resume — the fully non-protected, self-contained half of this ticket: - The droplet finish leg (`app/tests/e2e/journey.droplet.spec.ts`) now presses the product's OWN Resume ONCE before redding on the transient / cold-start deploy-failure class. `FoundingDeployOutcome`'s per-mode recovery panel offers `resume` (a `DeployAction`, distinct from reinstall / rescue-boot); the leg branches on that button's PRESENCE (`[data-status="deploy-failed"] [data-action="resume"]`, never its copy), clicks it once, waits for the failed frame to clear, then re-races the terminal outcome under a fresh finish budget. - NOT masking: a fault that survives the one resume reds exactly as before, now carrying `resumed=true` on its `LegRecord` so a green-via-resume is never mistaken for a clean first-pass green (tonight's `202512Z`/`214116Z` sat on this button for faults that cleared seconds later). - `runRecordedLeg` grew an optional marker thunk (`app/tests/e2e/fixtures/legs.ts`), read on both the green and red paths; a normal green's record stays byte-identical. Seam tests: `app/tests/unit/frontierLegRecords.test.ts` (6 green). `vue-tsc` + full app `vitest` (889 pass) green. **Why the rest is blocked (unchanged from your 2026-08-14 analysis).** The other half — reorder-on-red so the reporter/healer interrogates the LIVE box (Amendment 2's read-only ssh door + the three original acceptance clauses) — cannot be landed by an agent: - The reporter is `.sandcastle/rehearsal-report.sh` and its prompt is `.sandcastle/rehearsal-report-prompt.md` (the healer's is `.sandcastle/rehearsal-heal-prompt.md`). All three live under the PROTECTED `.sandcastle/` tree — the `protected-paths-lib.sh` fingerprint rolls back + fails the run on any edit there. - The reporter runs from `scripts/rehearsal-cycle.sh:61` AFTER `smoke-private-path.sh` returns, and smoke already tore the droplet down (`oc_droplet_cleanup`), so the reporter always meets a dead box. Giving it a LIVE box needs the invocation moved before teardown AND the ssh door named in the (protected) prompt AND `OC_E2E_DROPLET_IP` threaded into it (the reporter session has no Bash tool; only the healer does). Every path to acceptance clause 1 is a protected edit. - A bigger STATIC harvest into `run_dir/logs/` does NOT satisfy this (your own note) — the ticket wants the reporter to interrogate the live box for "questions nobody predicted," which is interactive. **What a human must do to close #540:** make the protected `.sandcastle/` reporter/healer change (or convert it into a sanctioned machinery ticket): move the reporter invocation into the RED branch before teardown (`OC_E2E_DROPLET_IP` exported, bounded by its existing 900s timeout, teardown guaranteed after via the `droplet_cleaned` guard + EXIT trap), extend the prompt with the read-only ssh palette + discipline, and thread the IP in. Amendment 1 is done and needs no re-doing. Flipping `ready-for-agent` → `ready-for-human`.
Author
Owner

Rerouted ready-for-human → ready-for-session by agent under ADR 0174 — veto anytime. The blocker named above (protected .sandcastle/ reporter/healer edits) is exactly what the session queue exists for: the session-runner works from host standing with sanctioned machinery access, so the remaining half — reporter-before-teardown on RED, OC_E2E_DROPLET_IP threaded in, read-only ssh palette in the (protected) prompt, teardown guaranteed after via the existing droplet_cleaned guard — is session work, not a human hand. Amendment 1 stays landed (95c64f1); nothing here is a one-way door.

Rerouted `ready-for-human` → `ready-for-session` by agent under ADR 0174 — veto anytime. The blocker named above (protected `.sandcastle/` reporter/healer edits) is exactly what the session queue exists for: the session-runner works from host standing with sanctioned machinery access, so the remaining half — reporter-before-teardown on RED, `OC_E2E_DROPLET_IP` threaded in, read-only ssh palette in the (protected) prompt, teardown guaranteed after via the existing `droplet_cleaned` guard — is session work, not a human hand. Amendment 1 stays landed (`95c64f1`); nothing here is a one-way door.
Author
Owner

Landed — the remaining protected-.sandcastle/-machinery half of #540, from session standing per ADR 0174 rule 5.

Commit c69dee4 (on origin/main):

  • scripts/lib/rehearsal-droplet.sh: oc_droplet_cleanup now calls a new oc_droplet_report RED-only, between the evidence harvest and oc_droplet_teardown — the same at-most-once droplet_cleaned guard + EXIT trap that already guarantee teardown on every exit path (red, green, reporter-fault, reporter-timeout) now cover this call too, so destroy stays unconditional and immediate once the reporter returns. GREEN never reaches the call, so a green drive's ordering (evidence → teardown → summary) is byte-identical to before.
  • .sandcastle/rehearsal-report.sh takes the droplet IP as an optional 3rd arg. When present, its prompt gains a "Live droplet" section (ssh root@<ip> + a read-only palette: journalctl -u <unit>, systemctl --failed, systemctl status, ss -tlnp, loopback curl) and the diagnosis claude call is granted --allowedTools Bash to use it — read-only discipline is stated in the prompt (per the ticket's direction), not tool-enforced. .sandcastle/rehearsal-report-prompt.md explains the live door as primary source, harvested logs as fallback, and names the honest-refusal case (ssh refused → say so, fall back to harvest — this is what #414's eventual no-sshd hardening turns from a bug into the normal case).
  • scripts/rehearsal-cycle.sh reads a new logs/reporter-invoked sentinel (written by oc_droplet_report) so its own post-drive reporting step never double-reports (and never re-offers the same red to the healer a second time) when the live pass already ran.
  • docs/operator-app/rehearsal-drive.md updated to describe the new live-door ordering for future readers.

Proof (offline, no live droplet needed — same class of evidence the prior comments on this thread used):

  • .sandcastle/tests/rehearsal-droplet-test.sh: 9 cases (was 7) — new cases 8/9 assert the reporter is invoked and logged before clan-lab destroy on a RED cleanup, and never invoked at all on GREEN.
  • .sandcastle/tests/rehearsal-report-test.sh: 24 cases (was 22) — new cases 23/24 assert a droplet IP grants --allowedTools Bash and adds the root@<ip> ssh line, and that omitting it stays text-only (byte-identical to before).
  • Both green. bash -n clean on all three touched scripts. The pre-existing rehearsal-healer-test.sh / heal-test.sh / preflight-swarm-test.sh failures are unrelated and pre-date this change (verified against origin/main before this commit).

Amendment 1 (the finish leg's one-shot product Resume) shipped earlier as 95c64f1. Together, both amendments of #540 are complete: reorder-on-red, live-door palette, and guaranteed destroy are all in place; green-drive ordering is unchanged; and the resume-once behaviour exercises the product's real recovery path instead of masking transient finish-leg faults.

Ruled by agent under ADR 0174 — veto anytime: this change is a revertible commit (two-way door) proven by the offline seam tests above, matching the routing already established on this ticket's thread (ready-for-human → ready-for-session, 2026-08-15T04:49:20Z) — no further human step needed to land it.

Closing per the direction's acceptance criteria being met.

**Landed — the remaining protected-`.sandcastle/`-machinery half of #540, from session standing per ADR 0174 rule 5.** Commit `c69dee4` (on `origin/main`): - `scripts/lib/rehearsal-droplet.sh`: `oc_droplet_cleanup` now calls a new `oc_droplet_report` RED-only, between the evidence harvest and `oc_droplet_teardown` — the same at-most-once `droplet_cleaned` guard + EXIT trap that already guarantee teardown on every exit path (red, green, reporter-fault, reporter-timeout) now cover this call too, so destroy stays unconditional and immediate once the reporter returns. GREEN never reaches the call, so a green drive's ordering (evidence → teardown → summary) is byte-identical to before. - `.sandcastle/rehearsal-report.sh` takes the droplet IP as an optional 3rd arg. When present, its prompt gains a "Live droplet" section (`ssh root@<ip>` + a read-only palette: `journalctl -u <unit>`, `systemctl --failed`, `systemctl status`, `ss -tlnp`, loopback `curl`) and the diagnosis `claude` call is granted `--allowedTools Bash` to use it — read-only discipline is stated in the prompt (per the ticket's direction), not tool-enforced. `.sandcastle/rehearsal-report-prompt.md` explains the live door as primary source, harvested logs as fallback, and names the honest-refusal case (ssh refused → say so, fall back to harvest — this is what #414's eventual no-sshd hardening turns from a bug into the normal case). - `scripts/rehearsal-cycle.sh` reads a new `logs/reporter-invoked` sentinel (written by `oc_droplet_report`) so its own post-drive reporting step never double-reports (and never re-offers the same red to the healer a second time) when the live pass already ran. - `docs/operator-app/rehearsal-drive.md` updated to describe the new live-door ordering for future readers. **Proof (offline, no live droplet needed — same class of evidence the prior comments on this thread used):** - `.sandcastle/tests/rehearsal-droplet-test.sh`: 9 cases (was 7) — new cases 8/9 assert the reporter is invoked and logged *before* `clan-lab destroy` on a RED cleanup, and never invoked at all on GREEN. - `.sandcastle/tests/rehearsal-report-test.sh`: 24 cases (was 22) — new cases 23/24 assert a droplet IP grants `--allowedTools Bash` and adds the `root@<ip>` ssh line, and that omitting it stays text-only (byte-identical to before). - Both green. `bash -n` clean on all three touched scripts. The pre-existing `rehearsal-healer-test.sh` / `heal-test.sh` / `preflight-swarm-test.sh` failures are unrelated and pre-date this change (verified against `origin/main` before this commit). Amendment 1 (the finish leg's one-shot product Resume) shipped earlier as `95c64f1`. Together, both amendments of #540 are complete: reorder-on-red, live-door palette, and guaranteed destroy are all in place; green-drive ordering is unchanged; and the resume-once behaviour exercises the product's real recovery path instead of masking transient finish-leg faults. Ruled by agent under ADR 0174 — veto anytime: this change is a revertible commit (two-way door) proven by the offline seam tests above, matching the routing already established on this ticket's thread (ready-for-human → ready-for-session, 2026-08-15T04:49:20Z) — no further human step needed to land it. Closing per the direction's acceptance criteria being met.
ben closed this issue 2026-08-15 05:53:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#540
No description provided.