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
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#540
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why (Ben's ruling, in-session 2026-08-14)
Today's forensics were repeatedly blinded by teardown-at-drive-end: drives
145526Z,153243Z, and171114Zall 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
drive_rcis red, the reporter runs BEFOREoc_droplet_cleanup(scripts/lib/rehearsal-droplet.sh). Green drives keep today's ordering (evidence → teardown → summary).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.droplet_cleanedguard + 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.Acceptance
Complements #536 (static unit snapshot) — harvest for the record, live box for the questions nobody predicted.
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 testsWhy each direction is a protected edit:
Reorder (reporter before
oc_droplet_cleanup). Today the reporter is invoked fromscripts/rehearsal-cycle.sh:61— afterscripts/smoke-private-path.shreturns, and that smoke process already destroys the box (oc_droplet_cleanup+ the EXIT trap armed inoc_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-oncedroplet_cleanedguard + 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 (betweenoc_droplet_evidenceandoc_droplet_teardownon RED), bounded by its 900s timeout, then teardown fires regardless. That relocation changes the reporter's execution contract (it stops beingrehearsal-cycle.sh's post-smoke step), which is a change to protected machinery.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_dironly; it reads no env-driven prompt extension. Addingssh root@<ip>+ the read-only palette (journalctl -u <unit>,systemctl --failed,systemctl status,ss -tlnp, curl loopback/status) and passingOC_E2E_DROPLET_IPinto that prompt both edit protected files. Dropping a bigger static harvest intorun_dir/logs(the#524/#536approach) 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):oc_droplet_cleanup's RED branch (or havesmoke-private-path.shcall the reporter before teardown on RED), gated ondrive_rc != 0, withOC_E2E_DROPLET_IPexported; green ordering byte-identical. Remove/guard the post-smoke call inscripts/rehearsal-cycle.shso it isn't double-run..sandcastle/rehearsal-report-prompt.mdwith 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_IPinto the prompt from.sandcastle/rehearsal-report.sh..sandcastle/tests/rehearsal-report-test.shto assert the live-door text and RED-only ordering.No code changed this iteration. Swapping to
ready-for-humanfor a human to make the machinery change.Relabelled
ready-for-sessionunder 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.Triage: added the missing category label; state (
ready-for-session, already reasoned in this thread) left as-is.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
sshwould 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
resumeoption 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) + aresumed=truemarker 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.
Amendment 1 landed; #540 blocked on a PROTECTED machinery edit for the rest.
Commit
95c64f1(onorigin/main) ships Amendment 1 — the one product-shaped resume — the fully non-protected, self-contained half of this ticket: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 offersresume(aDeployAction, 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.resumed=trueon itsLegRecordso a green-via-resume is never mistaken for a clean first-pass green (tonight's202512Z/214116Zsat on this button for faults that cleared seconds later).runRecordedLeggrew 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 appvitest(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:
.sandcastle/rehearsal-report.shand 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 — theprotected-paths-lib.shfingerprint rolls back + fails the run on any edit there.scripts/rehearsal-cycle.sh:61AFTERsmoke-private-path.shreturns, 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 ANDOC_E2E_DROPLET_IPthreaded into it (the reporter session has no Bash tool; only the healer does). Every path to acceptance clause 1 is a protected edit.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_IPexported, bounded by its existing 900s timeout, teardown guaranteed after via thedroplet_cleanedguard + 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.Rerouted
ready-for-human→ready-for-sessionby 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_IPthreaded in, read-only ssh palette in the (protected) prompt, teardown guaranteed after via the existingdroplet_cleanedguard — is session work, not a human hand. Amendment 1 stays landed (95c64f1); nothing here is a one-way door.Landed — the remaining protected-
.sandcastle/-machinery half of #540, from session standing per ADR 0174 rule 5.Commit
c69dee4(onorigin/main):scripts/lib/rehearsal-droplet.sh:oc_droplet_cleanupnow calls a newoc_droplet_reportRED-only, between the evidence harvest andoc_droplet_teardown— the same at-most-oncedroplet_cleanedguard + 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.shtakes 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, loopbackcurl) and the diagnosisclaudecall is granted--allowedTools Bashto use it — read-only discipline is stated in the prompt (per the ticket's direction), not tool-enforced..sandcastle/rehearsal-report-prompt.mdexplains 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.shreads a newlogs/reporter-invokedsentinel (written byoc_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.mdupdated 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 beforeclan-lab destroyon 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 Bashand adds theroot@<ip>ssh line, and that omitting it stays text-only (byte-identical to before).bash -nclean on all three touched scripts. The pre-existingrehearsal-healer-test.sh/heal-test.sh/preflight-swarm-test.shfailures are unrelated and pre-date this change (verified againstorigin/mainbefore 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.