rehearsal-4: executor target — --target rented; broker-rented droplet lifecycle with doctl fallback reap #651

Closed
opened 2026-08-22 04:12:41 +00:00 by ben · 2 comments
Owner

Arc: #183 rehearsal phase 4 — rented gateway (S4a). Spec: docs/superpowers/specs/2026-08-21-183-phase-4-rented-gateway-rehearsal-design.md. Plan: docs/superpowers/plans/2026-08-21-183-phase-4-rented-gateway-rehearsal.md (read its Global Constraints first — they apply to this task). This ticket's body is the plan's task verbatim. Phase-3 precedent: #515–#523.

Task 7: Executor target --target rented + rented droplet lifecycle

Files:

  • Modify: scripts/smoke-private-path.sh (accept rented in the target case and uses_droplet_machinery; for rented skip oc_droplet_create — the wizard rents; after the drive read test-results/drive-rented/<stamp>/artifacts/droplet-ip.txt into OC_E2E_DROPLET_IP for evidence/teardown)
  • Modify: scripts/lib/rehearsal-droplet.sh — oc_rented_preflight (doctl + IDSS_BROKER_URL + curl -sf $IDSS_BROKER_URL/v1/gateways/offer returns 200 with "price":""); oc_rented_teardown (offboard as today; then doctl compute droplet list --tag-name idss-gateway --format ID,Name,PublicIPv4 --no-header | awk -v ip=... '$3==ip{print $1}' → doctl compute droplet delete -f fallback when the spec's own release leg did not run)
  • Modify: scripts/rehearsal-cycle.sh (comment + drive-$target dir already generic; .env.example documents REHEARSAL_DRIVE_TARGET=rented)
  • Create: scripts/tests/rehearsal-rented-target-test.sh (offline: smoke-private-path.sh --target rented --dry-run style arg parsing accepts rented and refuses --drive; fake doctl teardown path deletes by IP)
  • Modify: docs/GOTCHAS.md (broker-created droplets are NOT clan-lab-tagged — clan-lab reap never sees them; the idss-gateway tag + broker reaper are the failsafe), STATUS.md

Interfaces:

  • Consumes: Task 6's droplet-ip.txt artifact + leg ids; Task 3's offer route.

  • Produces: REHEARSAL_DRIVE_TARGET=rented drives journey.rented.spec.ts under test-results/drive-rented/.

  • Step 1: Write the offline test (failing) → run → FAIL.

  • Step 2: Implement the three script edits.

  • Step 3: Run the test → PASS; bash -n both scripts; run the existing scripts/tests/*.sh suite → PASS (no regression for droplet/selfhosted).

  • Step 4: Commit — git commit -m "rehearsal-4: executor target — --target rented; broker-rented droplet lifecycle with doctl fallback reap (#651)".

**Arc:** #183 rehearsal phase 4 — rented gateway (S4a). Spec: `docs/superpowers/specs/2026-08-21-183-phase-4-rented-gateway-rehearsal-design.md`. Plan: `docs/superpowers/plans/2026-08-21-183-phase-4-rented-gateway-rehearsal.md` (read its **Global Constraints** first — they apply to this task). This ticket's body is the plan's task verbatim. Phase-3 precedent: #515–#523. ### Task 7: Executor target `--target rented` + rented droplet lifecycle **Files:** - Modify: `scripts/smoke-private-path.sh` (accept `rented` in the target case and `uses_droplet_machinery`; for `rented` skip `oc_droplet_create` — the wizard rents; after the drive read `test-results/drive-rented/<stamp>/artifacts/droplet-ip.txt` into `OC_E2E_DROPLET_IP` for evidence/teardown) - Modify: `scripts/lib/rehearsal-droplet.sh` — `oc_rented_preflight` (doctl + `IDSS_BROKER_URL` + `curl -sf $IDSS_BROKER_URL/v1/gateways/offer` returns 200 with `"price":""`); `oc_rented_teardown` (offboard as today; then `doctl compute droplet list --tag-name idss-gateway --format ID,Name,PublicIPv4 --no-header | awk -v ip=... '$3==ip{print $1}'` → `doctl compute droplet delete -f` fallback when the spec's own `release` leg did not run) - Modify: `scripts/rehearsal-cycle.sh` (comment + `drive-$target` dir already generic; `.env.example` documents `REHEARSAL_DRIVE_TARGET=rented`) - Create: `scripts/tests/rehearsal-rented-target-test.sh` (offline: `smoke-private-path.sh --target rented --dry-run` style arg parsing accepts `rented` and refuses `--drive`; fake `doctl` teardown path deletes by IP) - Modify: `docs/GOTCHAS.md` (broker-created droplets are NOT clan-lab-tagged — `clan-lab reap` never sees them; the `idss-gateway` tag + broker reaper are the failsafe), `STATUS.md` **Interfaces:** - Consumes: Task 6's `droplet-ip.txt` artifact + leg ids; Task 3's offer route. - Produces: `REHEARSAL_DRIVE_TARGET=rented` drives `journey.rented.spec.ts` under `test-results/drive-rented/`. - [ ] **Step 1: Write the offline test** (failing) → run → FAIL. - [ ] **Step 2: Implement** the three script edits. - [ ] **Step 3: Run** the test → PASS; `bash -n` both scripts; run the existing `scripts/tests/*.sh` suite → PASS (no regression for `droplet`/`selfhosted`). - [ ] **Step 4: Commit** — `git commit -m "rehearsal-4: executor target — --target rented; broker-rented droplet lifecycle with doctl fallback reap (#651)"`.

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

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

close-report for #651 — status success

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

envelope
{
  "issue": 651,
  "status": "success",
  "commits": [
    "01481218328d246cc5a87cec3ecf48282c359f7c"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "scripts/lib/rehearsal-droplet.sh",
    "scripts/rehearsal-cycle.sh",
    "scripts/smoke-private-path.sh",
    "scripts/tests/rehearsal-rented-target-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/rehearsal-rented-target-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/smoke-private-path.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/lib/rehearsal-droplet.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/rehearsal-cycle.sh",
      "exit_code": 0
    },
    {
      "command": "for t in scripts/tests/*.sh; do bash \"$t\"; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Step 1: offline test written (failing pre-impl, passing post-impl)": "scripts/tests/rehearsal-rented-target-test.sh — 6 checks: --target rented accepted, --drive refused beside it, unknown target still rejected, fake-doctl fallback reap deletes by tag+IP and no-ops on non-match/empty IP",
    "Step 2: the three script edits implemented": "smoke-private-path.sh (rented in target case + uses_droplet_machinery, skips oc_droplet_create, reads droplet-ip.txt, routes preflight/cleanup); rehearsal-droplet.sh (oc_rented_preflight offer-price'' gate, oc_rented_cleanup, oc_rented_teardown fallback reap); rehearsal-cycle.sh (REHEARSAL_DRIVE_TARGET=rented comment)",
    "Step 3: test PASS + bash -n both scripts + existing scripts/tests/*.sh suite PASS (no droplet/selfhosted regression)": "all in tests[] exit 0; the arg-parse regression guard (check 3) proves droplet+--drive still refuses",
    "GOTCHAS: broker-created droplets not clan-lab-tagged": "docs/GOTCHAS.md #48 — the idss-gateway tag + broker reaper are the failsafe; clan-lab reap is blind",
    "STATUS.md updated same commit": "STATUS.md header lead rewritten for #651 Task 7",
    ".env.example REHEARSAL_DRIVE_TARGET=rented (protected .sandcastle/ path)": "deferred to ready-for-session #653 per CLAUDE.md #445 protected-path rule; noted in STATUS lead"
  },
  "summary": "smoke-private-path.sh gains --target rented (wizard rents mid-drive, no harness create) with oc_rented_preflight/cleanup/teardown doing offer-gate + evidence + a tag+IP fallback reap, offline-proven.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #651 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 651, "status": "success", "commits": [ "01481218328d246cc5a87cec3ecf48282c359f7c" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "scripts/lib/rehearsal-droplet.sh", "scripts/rehearsal-cycle.sh", "scripts/smoke-private-path.sh", "scripts/tests/rehearsal-rented-target-test.sh" ], "tests": [ { "command": "bash scripts/tests/rehearsal-rented-target-test.sh", "exit_code": 0 }, { "command": "bash -n scripts/smoke-private-path.sh", "exit_code": 0 }, { "command": "bash -n scripts/lib/rehearsal-droplet.sh", "exit_code": 0 }, { "command": "bash -n scripts/rehearsal-cycle.sh", "exit_code": 0 }, { "command": "for t in scripts/tests/*.sh; do bash \"$t\"; done", "exit_code": 0 } ], "criteria": { "Step 1: offline test written (failing pre-impl, passing post-impl)": "scripts/tests/rehearsal-rented-target-test.sh — 6 checks: --target rented accepted, --drive refused beside it, unknown target still rejected, fake-doctl fallback reap deletes by tag+IP and no-ops on non-match/empty IP", "Step 2: the three script edits implemented": "smoke-private-path.sh (rented in target case + uses_droplet_machinery, skips oc_droplet_create, reads droplet-ip.txt, routes preflight/cleanup); rehearsal-droplet.sh (oc_rented_preflight offer-price'' gate, oc_rented_cleanup, oc_rented_teardown fallback reap); rehearsal-cycle.sh (REHEARSAL_DRIVE_TARGET=rented comment)", "Step 3: test PASS + bash -n both scripts + existing scripts/tests/*.sh suite PASS (no droplet/selfhosted regression)": "all in tests[] exit 0; the arg-parse regression guard (check 3) proves droplet+--drive still refuses", "GOTCHAS: broker-created droplets not clan-lab-tagged": "docs/GOTCHAS.md #48 — the idss-gateway tag + broker reaper are the failsafe; clan-lab reap is blind", "STATUS.md updated same commit": "STATUS.md header lead rewritten for #651 Task 7", ".env.example REHEARSAL_DRIVE_TARGET=rented (protected .sandcastle/ path)": "deferred to ready-for-session #653 per CLAUDE.md #445 protected-path rule; noted in STATUS lead" }, "summary": "smoke-private-path.sh gains --target rented (wizard rents mid-drive, no harness create) with oc_rented_preflight/cleanup/teardown doing offer-gate + evidence + a tag+IP fallback reap, offline-proven.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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.

Reference
Matou/idss#651
No description provided.