harness: --keep-droplet keeps the box but run-dir retention prunes its only root key (how Whakatōhea Demo lost its door) #1691

Closed
opened 2026-09-21 15:40:10 +00:00 by ben · 2 comments
Owner

What

--keep-droplet on the rented target keeps a GREEN box (oc_rented_teardown, scripts/lib/rehearsal-droplet.sh), but the box's ONLY root door — the rent-operator key — lives in that run's state/rent-operator/id_ed25519, inside the run dir. Run-dir retention in scripts/smoke-private-path.sh (the old_runs prune, ~line 830-860) later deletes the run dir, key included.

That is how Whakatōhea Demo (kept 2026-09-16, run 20260915T235523Z) lost its only root door by 2026-09-21: nobody could ssh in, the DO web console is useless on a key-only NixOS box, and the community was destroyed and re-founded rather than recovered.

Fix

  1. When a run ends with a KEPT box, copy the rent-operator key (and artifacts/kept.txt) to a durable home OUTSIDE test-results/ — e.g. ~/.idss-kept/<slug>/ (0700/0600) — and print the path in the run summary and kept.txt.
  2. Retention never prunes a run dir whose artifacts/kept.txt names a box that is still rented (or simply: never prunes a run dir carrying kept.txt; releasing the box removes the marker).
  3. Offline test beside the existing retention tests: a kept run survives --keep N pruning with its key readable.

Same lesson for hand foundings: the operator app keeps the key only in its state dir (~/.config/IDSS/rent-operator/), which a trial reset snapshots-then-wipes. Worth a separate product look (recovery kit should carry it?) — not in this ticket.

## What `--keep-droplet` on the rented target keeps a GREEN box (`oc_rented_teardown`, `scripts/lib/rehearsal-droplet.sh`), but the box's ONLY root door — the rent-operator key — lives in that run's `state/rent-operator/id_ed25519`, inside the run dir. Run-dir retention in `scripts/smoke-private-path.sh` (the `old_runs` prune, ~line 830-860) later deletes the run dir, key included. That is how Whakatōhea Demo (kept 2026-09-16, run `20260915T235523Z`) lost its only root door by 2026-09-21: nobody could ssh in, the DO web console is useless on a key-only NixOS box, and the community was destroyed and re-founded rather than recovered. ## Fix 1. When a run ends with a KEPT box, copy the rent-operator key (and `artifacts/kept.txt`) to a durable home OUTSIDE `test-results/` — e.g. `~/.idss-kept/<slug>/` (0700/0600) — and print the path in the run summary and `kept.txt`. 2. Retention never prunes a run dir whose `artifacts/kept.txt` names a box that is still rented (or simply: never prunes a run dir carrying `kept.txt`; releasing the box removes the marker). 3. Offline test beside the existing retention tests: a kept run survives `--keep N` pruning with its key readable. Same lesson for hand foundings: the operator app keeps the key only in its state dir (`~/.config/IDSS/rent-operator/`), which a trial reset snapshots-then-wipes. Worth a separate product look (recovery kit should carry it?) — not in this ticket.

swarm-claim host=elitebook-distributed-server-03 run=29329
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=29329 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1691 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1691,
  "status": "success",
  "commits": [
    "de7a25b6"
  ],
  "changed_files": [
    "scripts/lib/rehearsal-droplet.sh",
    "scripts/smoke-private-path.sh",
    "scripts/tests/rehearsal-kept-door-test.sh",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/rehearsal-kept-door-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-guest-disk-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-claim-secret-harvest-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/lib/rehearsal-droplet.sh scripts/smoke-private-path.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Kept box: copy rent-operator key + kept.txt to a durable home outside test-results (~/.idss-kept/<slug>/, 0700/0600) and print the path": "oc_kept_box_preserve in scripts/lib/rehearsal-droplet.sh, called on the --keep-droplet GREEN teardown branch; test check 1 asserts durable 0700/0600 copy + kept.txt + printed ssh path",
    "Retention never prunes a run dir carrying artifacts/kept.txt (releasing the box removes the marker)": "kept.txt guard added to the old_runs prune loop in scripts/smoke-private-path.sh; test check 3 proves a kept.txt run survives --keep 0 with its key readable while a plain run is pruned",
    "Offline test beside the existing retention tests: a kept run survives --keep N pruning with its key readable": "scripts/tests/rehearsal-kept-door-test.sh (extracts the guest-disk-retention block from smoke-private-path.sh); passes with 4 checks"
  },
  "summary": "A --keep-droplet KEPT box's only root door (the per-run rent-operator key) now survives run-dir retention via an artifacts/kept.txt prune-immunity marker and a durable ~/.idss-kept/<slug>/ copy.",
  "blockers": []
}
**close-report** for #1691 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1691, "status": "success", "commits": [ "de7a25b6" ], "changed_files": [ "scripts/lib/rehearsal-droplet.sh", "scripts/smoke-private-path.sh", "scripts/tests/rehearsal-kept-door-test.sh", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "bash scripts/tests/rehearsal-kept-door-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-guest-disk-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-claim-secret-harvest-test.sh", "exit_code": 0 }, { "command": "bash -n scripts/lib/rehearsal-droplet.sh scripts/smoke-private-path.sh", "exit_code": 0 } ], "criteria": { "Kept box: copy rent-operator key + kept.txt to a durable home outside test-results (~/.idss-kept/<slug>/, 0700/0600) and print the path": "oc_kept_box_preserve in scripts/lib/rehearsal-droplet.sh, called on the --keep-droplet GREEN teardown branch; test check 1 asserts durable 0700/0600 copy + kept.txt + printed ssh path", "Retention never prunes a run dir carrying artifacts/kept.txt (releasing the box removes the marker)": "kept.txt guard added to the old_runs prune loop in scripts/smoke-private-path.sh; test check 3 proves a kept.txt run survives --keep 0 with its key readable while a plain run is pruned", "Offline test beside the existing retention tests: a kept run survives --keep N pruning with its key readable": "scripts/tests/rehearsal-kept-door-test.sh (extracts the guest-disk-retention block from smoke-private-path.sh); passes with 4 checks" }, "summary": "A --keep-droplet KEPT box's only root door (the per-run rent-operator key) now survives run-dir retention via an artifacts/kept.txt prune-immunity marker and a durable ~/.idss-kept/<slug>/ copy.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1691
No description provided.