rehearsal-4: journey.rented.spec.ts — twelve teeth incl. rent-fails-clean + release honesty legs; rented fixtures #650

Closed
opened 2026-08-22 04:12:39 +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 6: Drive fixtures + journey.rented.spec.ts (twelve legs)

Files:

  • Create: app/tests/e2e/fixtures/rented.ts (REHEARSAL_RENTED_SLUG = 'rehearsal-rented', RENTFAIL_SLUG = 'rehearsal-rentfail', OFFER_PATH = '/v1/gateways/offer', RELEASE_PATH = '/v1/gateways/release', releaseBody(host), dropletExistsByTag(ip): Promise<boolean> via doctl compute droplet list --tag-name idss-gateway --format PublicIPv4 --no-header)
  • Create: app/tests/e2e/fixtures/rented.test.ts (offline: body builders, tag parsing)
  • Modify: app/tests/e2e/fixtures/wizard.ts — add s4aRent(live) (click option:rented, expect [data-field="terms"] visible and containing free while alpha, click [data-action="rent"], expect [data-status="address"] visible; returns the auto-filled IP read from [data-field="gateway-ip"]), s4aRentExpectFail(live) (same clicks; expects [data-status="rent-error"] containing provision; asserts the S4 option list is still visible), s7RentedChecklist(live) (expects rows rented, install, pairing marked done before connect runs)
  • Create: app/tests/e2e/journey.rented.spec.ts
  • Modify: STATUS.md

Interfaces:

  • Consumes: Task 5 selectors; Task 3 fault host; fixtures/selfhosted.ts bearer, digAnswers, foundingAddress, MISPOINT_IP, pointBody, POINT_PATH; fixtures/legs.ts runRecordedLeg, computeVerdict; fixtures/evidence.ts harvest; fixtures/droplet.ts sshDroplet (the box is reachable on the app's key — Task 7 exports OC_E2E_DROPLET_IP from the app's state after wizard-rent).

  • Produces: legs.json with leg ids exactly: rent-fails-clean, wizard-rent, claim, create, image-boot, pair, point, deploy, activation, founded, heartbeat-repoint, release; verdict target 'rented'.

  • Step 1: Write rented.test.ts (failing) for the pure helpers; run pnpm --filter app exec vitest run tests/e2e/fixtures/rented.test.ts → FAIL; implement rented.ts; → PASS.

  • Step 2: Write journey.rented.spec.ts — copy journey.selfhosted.spec.ts's scaffolding (run dir, legs.json writer, afterAll verdict with target 'rented', teardown offboard). Legs:

    1. rent-fails-clean (5 min): wizard to S2 with slug RENTFAIL_SLUG → S3 → s4aRentExpectFail → expect(await dropletExistsByTag(anyIp)).toBe(false) by asserting no droplet tagged idss-gateway whose name contains rehearsal-rentfail; then reset the draft (back to S2, rename slug to REHEARSAL_RENTED_SLUG).
    2. wizard-rent (8 min): s4aRent → IP captured → process.env.OC_E2E_DROPLET_IP = ip; write it to ${runDir}/artifacts/droplet-ip.txt.
    3. claim (3 min): S5 shows rehearsal-rented.idss.nz reserved (already claimed by rent); foundingAddress(state) has the secret.
    4. create (3 min): reviewAndCreate → s7RentedChecklist.
    5. image-boot (5 min): sshDroplet(ip, 'systemctl is-active idss-agent') = active; sshDroplet(ip, 'test ! -e /var/log/idss-install.log && echo noinstall') = noinstall; sshDroplet(ip, 'lsblk -o LABEL,PARTTYPE -n') contains the labels the disko contract test asserts (read them from a shared constant list in rented.ts).
    6. pair (5 min): journey row pair done; readFault undefined.
    7. point (5 min): digAnswers for the host = ip.
    8. deploy (15 min): rows through control-plane done; sshDroplet(ip, 'journalctl -b --no-pager | grep -c -E "kexec|disko" || true') = 0.
    9. activation (15 min), 10. founded (5 min): verbatim from selfhosted spec.
    10. heartbeat-repoint (15 min): verbatim from selfhosted + assert the broker's renew advanced expires (GET is not exposed; assert via the control-plane journal line renewed gateway rental over SSH).
    11. release (5 min): POST RELEASE_PATH with bearer → 204; poll doctl until no droplet at ip (≤ 2 min); write released=true to legs.
  • Step 3: Run pnpm --filter app exec tsc --noEmit -p tests/e2e (or the project's e2e typecheck) → PASS; pnpm --filter app exec playwright test --list journey.rented.spec.ts lists one test.

  • Step 4: Commit — git commit -m "rehearsal-4: journey.rented.spec.ts — twelve teeth incl. rent-fails-clean + release honesty legs; rented fixtures (#650)".

**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 6: Drive fixtures + `journey.rented.spec.ts` (twelve legs) **Files:** - Create: `app/tests/e2e/fixtures/rented.ts` (`REHEARSAL_RENTED_SLUG = 'rehearsal-rented'`, `RENTFAIL_SLUG = 'rehearsal-rentfail'`, `OFFER_PATH = '/v1/gateways/offer'`, `RELEASE_PATH = '/v1/gateways/release'`, `releaseBody(host)`, `dropletExistsByTag(ip): Promise<boolean>` via `doctl compute droplet list --tag-name idss-gateway --format PublicIPv4 --no-header`) - Create: `app/tests/e2e/fixtures/rented.test.ts` (offline: body builders, tag parsing) - Modify: `app/tests/e2e/fixtures/wizard.ts` — add `s4aRent(live)` (click `option:rented`, expect `[data-field="terms"]` visible and containing `free while alpha`, click `[data-action="rent"]`, expect `[data-status="address"]` visible; returns the auto-filled IP read from `[data-field="gateway-ip"]`), `s4aRentExpectFail(live)` (same clicks; expects `[data-status="rent-error"]` containing `provision`; asserts the S4 option list is still visible), `s7RentedChecklist(live)` (expects rows `rented`, `install`, `pairing` marked done before `connect` runs) - Create: `app/tests/e2e/journey.rented.spec.ts` - Modify: `STATUS.md` **Interfaces:** - Consumes: Task 5 selectors; Task 3 fault host; `fixtures/selfhosted.ts` `bearer`, `digAnswers`, `foundingAddress`, `MISPOINT_IP`, `pointBody`, `POINT_PATH`; `fixtures/legs.ts` `runRecordedLeg`, `computeVerdict`; `fixtures/evidence.ts` `harvest`; `fixtures/droplet.ts` `sshDroplet` (the box is reachable on the app's key — Task 7 exports `OC_E2E_DROPLET_IP` from the app's state after `wizard-rent`). - Produces: `legs.json` with leg ids exactly: `rent-fails-clean, wizard-rent, claim, create, image-boot, pair, point, deploy, activation, founded, heartbeat-repoint, release`; verdict target `'rented'`. - [ ] **Step 1: Write `rented.test.ts`** (failing) for the pure helpers; run `pnpm --filter app exec vitest run tests/e2e/fixtures/rented.test.ts` → FAIL; implement `rented.ts`; → PASS. - [ ] **Step 2: Write `journey.rented.spec.ts`** — copy `journey.selfhosted.spec.ts`'s scaffolding (run dir, `legs.json` writer, afterAll verdict with target `'rented'`, teardown offboard). Legs: 1. `rent-fails-clean` (5 min): wizard to S2 with slug `RENTFAIL_SLUG` → S3 → `s4aRentExpectFail` → `expect(await dropletExistsByTag(anyIp)).toBe(false)` by asserting no droplet tagged `idss-gateway` whose name contains `rehearsal-rentfail`; then reset the draft (back to S2, rename slug to `REHEARSAL_RENTED_SLUG`). 2. `wizard-rent` (8 min): `s4aRent` → IP captured → `process.env.OC_E2E_DROPLET_IP = ip`; write it to `${runDir}/artifacts/droplet-ip.txt`. 3. `claim` (3 min): S5 shows `rehearsal-rented.idss.nz` reserved (already claimed by rent); `foundingAddress(state)` has the secret. 4. `create` (3 min): `reviewAndCreate` → `s7RentedChecklist`. 5. `image-boot` (5 min): `sshDroplet(ip, 'systemctl is-active idss-agent')` = `active`; `sshDroplet(ip, 'test ! -e /var/log/idss-install.log && echo noinstall')` = `noinstall`; `sshDroplet(ip, 'lsblk -o LABEL,PARTTYPE -n')` contains the labels the disko contract test asserts (read them from a shared constant list in `rented.ts`). 6. `pair` (5 min): journey row `pair` done; `readFault` undefined. 7. `point` (5 min): `digAnswers` for the host = ip. 8. `deploy` (15 min): rows through `control-plane` done; `sshDroplet(ip, 'journalctl -b --no-pager | grep -c -E "kexec|disko" || true')` = `0`. 9. `activation` (15 min), 10. `founded` (5 min): verbatim from selfhosted spec. 11. `heartbeat-repoint` (15 min): verbatim from selfhosted + assert the broker's renew advanced `expires` (GET is not exposed; assert via the control-plane journal line `renewed gateway rental` over SSH). 12. `release` (5 min): POST `RELEASE_PATH` with bearer → 204; poll `doctl` until no droplet at `ip` (≤ 2 min); write `released=true` to legs. - [ ] **Step 3: Run** `pnpm --filter app exec tsc --noEmit -p tests/e2e` (or the project's e2e typecheck) → PASS; `pnpm --filter app exec playwright test --list journey.rented.spec.ts` lists one test. - [ ] **Step 4: Commit** — `git commit -m "rehearsal-4: journey.rented.spec.ts — twelve teeth incl. rent-fails-clean + release honesty legs; rented fixtures (#650)"`.

swarm-claim host=matou-dev-server-01 run=8645
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=8645 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #650 — status success

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

envelope
{
  "issue": 650,
  "status": "success",
  "commits": [
    "808aafa63ea29b76a52d8273a50e784bbfb7ce83"
  ],
  "changed_files": [
    "STATUS.md",
    "app/src/components/founding/FoundingAddress.vue",
    "app/tests/e2e/fixtures/rented.test.ts",
    "app/tests/e2e/fixtures/rented.ts",
    "app/tests/e2e/fixtures/wizard.ts",
    "app/tests/e2e/journey.rented.spec.ts"
  ],
  "tests": [
    {
      "command": "CI=true pnpm --filter app exec vitest run tests/e2e/fixtures/rented.test.ts",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm --filter app exec vitest run tests/e2e/fixtures/",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm --filter app exec vue-tsc --noEmit -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "CI=true OC_E2E_RUN_DIR=/tmp/rlist OC_E2E_SPEC=journey.rented.spec.ts pnpm --filter app exec playwright test --list journey.rented.spec.ts",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm --filter app exec vitest run tests/unit/foundingAccessAddress.test.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Step 1: rented.test.ts (failing) for the pure helpers, then implement rented.ts to PASS": "app/tests/e2e/fixtures/rented.test.ts (10 tests green) proves releaseBody, parseDropletField, hasAllLabels, DISKO_LABELS, communityNameForSlug in app/tests/e2e/fixtures/rented.ts",
    "Step 2: journey.rented.spec.ts — copy selfhosted scaffolding (run dir, legs.json, afterAll verdict target 'rented', teardown) + the twelve legs with exact ids": "app/tests/e2e/journey.rented.spec.ts: legs rent-fails-clean, wizard-rent, claim, create, image-boot, pair, point, deploy, activation, founded, heartbeat-repoint, release; computeVerdict(...,'rented',...); afterAll releases+offboards; wizard.ts gained s4aRent/s4aRentExpectFail/s7RentedChecklist",
    "Step 3: e2e typecheck PASS; playwright --list lists one test": "vue-tsc --noEmit exit 0; playwright --list shows exactly 1 test in journey.rented.spec.ts",
    "Step 4: commit with the required message naming #650": "commit 808aafa6 'rehearsal-4: journey.rented.spec.ts — twelve teeth incl. rent-fails-clean + release honesty legs; rented fixtures (#650)'"
  },
  "summary": "Shipped the phase-4 rented-gateway drive: fixtures/rented.ts (+offline test), wizard.ts s4a/s7 steps, journey.rented.spec.ts (twelve legs, verdict 'rented'), and the DDR 0190 S5 gateway-ip auto-fill the drive reads.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #650 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 650, "status": "success", "commits": [ "808aafa63ea29b76a52d8273a50e784bbfb7ce83" ], "changed_files": [ "STATUS.md", "app/src/components/founding/FoundingAddress.vue", "app/tests/e2e/fixtures/rented.test.ts", "app/tests/e2e/fixtures/rented.ts", "app/tests/e2e/fixtures/wizard.ts", "app/tests/e2e/journey.rented.spec.ts" ], "tests": [ { "command": "CI=true pnpm --filter app exec vitest run tests/e2e/fixtures/rented.test.ts", "exit_code": 0 }, { "command": "CI=true pnpm --filter app exec vitest run tests/e2e/fixtures/", "exit_code": 0 }, { "command": "CI=true pnpm --filter app exec vue-tsc --noEmit -p tsconfig.json", "exit_code": 0 }, { "command": "CI=true OC_E2E_RUN_DIR=/tmp/rlist OC_E2E_SPEC=journey.rented.spec.ts pnpm --filter app exec playwright test --list journey.rented.spec.ts", "exit_code": 0 }, { "command": "CI=true pnpm --filter app exec vitest run tests/unit/foundingAccessAddress.test.ts", "exit_code": 0 } ], "criteria": { "Step 1: rented.test.ts (failing) for the pure helpers, then implement rented.ts to PASS": "app/tests/e2e/fixtures/rented.test.ts (10 tests green) proves releaseBody, parseDropletField, hasAllLabels, DISKO_LABELS, communityNameForSlug in app/tests/e2e/fixtures/rented.ts", "Step 2: journey.rented.spec.ts — copy selfhosted scaffolding (run dir, legs.json, afterAll verdict target 'rented', teardown) + the twelve legs with exact ids": "app/tests/e2e/journey.rented.spec.ts: legs rent-fails-clean, wizard-rent, claim, create, image-boot, pair, point, deploy, activation, founded, heartbeat-repoint, release; computeVerdict(...,'rented',...); afterAll releases+offboards; wizard.ts gained s4aRent/s4aRentExpectFail/s7RentedChecklist", "Step 3: e2e typecheck PASS; playwright --list lists one test": "vue-tsc --noEmit exit 0; playwright --list shows exactly 1 test in journey.rented.spec.ts", "Step 4: commit with the required message naming #650": "commit 808aafa6 'rehearsal-4: journey.rented.spec.ts — twelve teeth incl. rent-fails-clean + release honesty legs; rented fixtures (#650)'" }, "summary": "Shipped the phase-4 rented-gateway drive: fixtures/rented.ts (+offline test), wizard.ts s4a/s7 steps, journey.rented.spec.ts (twelve legs, verdict 'rented'), and the DDR 0190 S5 gateway-ip auto-fill the drive reads.", "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#650
No description provided.