device-target re-found rents the fixed rehearsal-c slug with no pre-rent reservation sweep, and oc_standing_teardown bins the claim secret on a red re-found — the name is now permanently wedged (GOTCHAS #80 / #757) #896

Closed
opened 2026-08-27 07:51:42 +00:00 by matou-build-agent · 2 comments

Drive 20260827T073657Z (--target device) red at leg 1 standing, sig 25304f657c24, 482660ms into s4aRent's expect(locator('[data-status="address"]')).toBeVisible({ timeout: 8*60_000 }) (app/tests/e2e/fixtures/wizard.ts:212).

The locator is a symptom. The page snapshot in artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md:42 shows the wizard still standing on S4a with an in-place, retriable rent error:

claim — That community name is already taken, so the gateway couldn't be reserved — pick a different name. + a Retry button

S5 was never reached, so [data-status="address"] correctly does not exist. logs/founding-state.log confirms the draft stalled at step: "access", founded: false, slug rehearsal-c.

The prior heal (5c8f4c6, the standing-home directory split) worked — this drive launched cold on Welcome and walked the wizard, which is exactly what that commit intended. The signature is unchanged only because both faults end at the same address locator.

Why the name is taken

The previous device drive, test-results/drive-device/20260827T065053Z, rented and claimed rehearsal-c, reached point, and then red at enroll-activate on the #893 cloud-init IsADirectoryError (artifacts/legs.json, leg standing). Its logs/founding-state.log carries the reservation: address.host = rehearsal-c.idss.nz, address.secret = qNeo7vv8lyWUkzsKdBZZJH6iNEtzZHxUbw80kfVnv3s.

Because it reached point, the reservation is REDEEMED and never lapses (#278; GOTCHAS #80 amendment). Proven from outside, per that amendment's own dig test — the records are the slug's own, not the apex wildcard:

rehearsal-c.idss.nz            A      168.144.173.213   (the 06:50 drive's gateway)
_acme-challenge.rehearsal-c…   CNAME  2169ba97-….acme.rehearsal-c.idss.nz.
acme-dns.rehearsal-c.idss.nz   A      168.144.173.213
nonexistent-xyz.idss.nz        A      143.198.134.168   (the *.idss.nz wildcard — control)

Defect 1 — the standing teardown drops the secret and skips the offboard whenever the re-found drive red before facts.json

scripts/lib/rehearsal-standing-lib.sh:158-197. host and slug come only from facts.json (lines 160-161), but facts.json is written only on a drive that re-founded green (scripts/smoke-private-path.sh:632, guarded on artifacts/standing-founded.json). The 06:50 drive red at enroll-activate, so no facts were ever written — while its state/founding-state.json held the live secret. On the 07:36 tick:

  • oc_standing_secret (line 162) did mine qNeo7vv8… out of the state dir;
  • the remember at lines 168-170 passed an empty slug, and oc_slug_secret_remember no-ops immediately on an empty slug (scripts/lib/rehearsal-droplet.sh:777-778) — the secret was silently discarded;
  • the release + offboard at line 172 is gated on -n "$host" && -n "$secret", so it took the line 191-193 "never reached S5" branch — which is factually wrong here: the community reached point;
  • line 195 rm -rf "$OC_STANDING_DIR" then deleted the only copy.

Confirmed on disk: test-results/slug-claims/rehearsal-c.secrets holds 7 secrets, last appended 04:39, and qNeo7vv8… is not among them. test-results/standing-rented/ now holds state/ only, no facts.json.

This is the #757 wedge reopened through a path #757 did not cover — the comment at rehearsal-standing-lib.sh:26-28 claims the secret is "REMEMBERED before it is spent", and on this path it is not.

Defect 2 — the device preflight has no pre-rent sweep at all

scripts/lib/rehearsal-droplet.sh:693-702 — oc_rented_preflight closes both halves of this hatch before --target rented rents: oc_rented_release_stale_slug (#748), then oc_slug_secrets_harvest + oc_rented_offboard_stale_slug (#757).

The device branch runs none of them. scripts/smoke-private-path.sh:373-379 does only a read-only offer GET, with the comment at line 376 stating the intent outright: "a read-only GET, so it stays dry-run-safe (no stale-slug sweeps here)". But a device re-found rents the same fixed slug (REHEARSAL_SLUG, scripts/lib/swarm-identity.sh:41) through the same runRentedPrefix, so it inherits the identical wedge with none of the guard. Dry-run safety is a real constraint — the sweeps are destructive and the existing re-found teardown already solves it by sitting past the dry-run gate at scripts/smoke-private-path.sh:565-569.

Secondary: oc_slug_secrets_harvest (rehearsal-droplet.sh:807-818) walks <results_root>/<run>/state, but a device run dir's state/ is empty — the state lives in the standing home. The secret survives only as logs/founding-state.log, which the harvest does not read.

Suspected layer

Harness lifecycle wiring only (scripts/). No product code is implicated: the broker's refusal is correct and the wizard reported it honestly, in place, with a Retry and the stage named — DDR 0190 decision 3 behaving exactly as specified.

What plugging it needs

  1. Unwedge rehearsal-c operationally first — no code change frees a redeemed reservation. The key still exists at test-results/drive-device/20260827T065053Z/logs/founding-state.log (address.secret); spend it before retention prunes that run dir: POST /v1/gateways/release then POST /v1/subdomains/offboard for rehearsal-c.idss.nz, bearing that secret. If it is gone, rotate REHEARSAL_SLUG (GOTCHAS #32) — every drive stays red until one or the other happens.
  2. rehearsal-standing-lib.sh — derive slug/host from state/founding-state.json when facts.json is absent (the state already carries details.slug and address.host), remember the secret unconditionally before the rm -rf at line 195, and attempt release + offboard whenever a secret exists rather than only when facts do. Correct the line 191-193 note, which mis-reports a post-point community as one that never reached S5.
  3. smoke-private-path.sh — when OC_STANDING_REFOUND=1, run the same pre-rent sweeps oc_rented_preflight runs, placed past the dry-run gate beside the existing oc_standing_teardown call at line 568, so --dry-run --target device stays side-effect-free.
  4. oc_slug_secrets_harvest — decide whether it should also mine harvested logs/founding-state.log, so a drive whose home was wiped can still be recovered from its own evidence. This is the one design call in the ticket.
  5. Tests — scripts/tests/rehearsal-standing-test.sh should pin the facts-absent teardown path (secret remembered, offboard attempted, note honest); scripts/tests/rehearsal-device-target-test.sh should pin the sweep's presence and its position relative to the dry-run gate and ==> driving, in the shape of its existing check 12.

Evidence absent from this run, for the record

  • state/ in the run directory is empty — no state/clan-config flake was captured (the app's state lives in the standing home on this target).
  • logs/broker-journal.txt is a harvest failure, not a log: dev@100.98.48.68: Permission denied (publickey) — the executor is off the admin mesh, by design (#681, ADR 0208); it would have shown the broker's own view of the 409.
  • artifacts/journey.json is {rows: null, fault: null} — the journey bar never started, consistent with a red before stand-up.
  • logs/device-journal.txt / device-stall.txt / device-do-forensics.txt are the member device (droplet 595534017, clan-lab-rehearsal-d47f6f57, plain Ubuntu 24.04, up 8 min, nothing deployed) — correct for a drive that red at leg 1, and not evidence about the gateway, which was never rented.

Advances #854.

drive 20260827T073657Z red at standing: expect(locator).toBeVisible() failed Locator: locator('[data-status="address"]') Expected: visible Timeout: 480000ms Error: element(s) not found Call log: - Expect "toBeVisible" with timeout 480000ms
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260827T073657Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

Drive `20260827T073657Z` (`--target device`) red at leg 1 `standing`, sig `25304f657c24`, 482660ms into `s4aRent`'s `expect(locator('[data-status="address"]')).toBeVisible({ timeout: 8*60_000 })` (`app/tests/e2e/fixtures/wizard.ts:212`). The locator is a **symptom**. The page snapshot in `artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md:42` shows the wizard still standing on S4a with an in-place, retriable rent error: > `claim — That community name is already taken, so the gateway couldn't be reserved — pick a different name.` + a `Retry` button S5 was never reached, so `[data-status="address"]` correctly does not exist. `logs/founding-state.log` confirms the draft stalled at `step: "access"`, `founded: false`, slug `rehearsal-c`. The prior heal (`5c8f4c6`, the standing-home directory split) **worked** — this drive launched cold on Welcome and walked the wizard, which is exactly what that commit intended. The signature is unchanged only because both faults end at the same `address` locator. ## Why the name is taken The previous device drive, `test-results/drive-device/20260827T065053Z`, rented and claimed `rehearsal-c`, reached `point`, and then red at `enroll-activate` on the #893 cloud-init `IsADirectoryError` (`artifacts/legs.json`, leg `standing`). Its `logs/founding-state.log` carries the reservation: `address.host = rehearsal-c.idss.nz`, `address.secret = qNeo7vv8lyWUkzsKdBZZJH6iNEtzZHxUbw80kfVnv3s`. Because it reached `point`, the reservation is **REDEEMED** and never lapses (#278; GOTCHAS #80 amendment). Proven from outside, per that amendment's own `dig` test — the records are the slug's own, not the apex wildcard: ``` rehearsal-c.idss.nz A 168.144.173.213 (the 06:50 drive's gateway) _acme-challenge.rehearsal-c… CNAME 2169ba97-….acme.rehearsal-c.idss.nz. acme-dns.rehearsal-c.idss.nz A 168.144.173.213 nonexistent-xyz.idss.nz A 143.198.134.168 (the *.idss.nz wildcard — control) ``` ## Defect 1 — the standing teardown drops the secret and skips the offboard whenever the re-found drive red before `facts.json` `scripts/lib/rehearsal-standing-lib.sh:158-197`. `host` and `slug` come **only** from `facts.json` (lines 160-161), but `facts.json` is written only on a drive that re-founded *green* (`scripts/smoke-private-path.sh:632`, guarded on `artifacts/standing-founded.json`). The 06:50 drive red at `enroll-activate`, so no facts were ever written — while its `state/founding-state.json` held the live secret. On the 07:36 tick: - `oc_standing_secret` (line 162) **did** mine `qNeo7vv8…` out of the state dir; - the remember at lines 168-170 passed an **empty** `slug`, and `oc_slug_secret_remember` no-ops immediately on an empty slug (`scripts/lib/rehearsal-droplet.sh:777-778`) — the secret was silently discarded; - the release + offboard at line 172 is gated on `-n "$host" && -n "$secret"`, so it took the line 191-193 "never reached S5" branch — which is factually wrong here: the community reached `point`; - line 195 `rm -rf "$OC_STANDING_DIR"` then deleted the only copy. Confirmed on disk: `test-results/slug-claims/rehearsal-c.secrets` holds 7 secrets, last appended 04:39, and `qNeo7vv8…` is **not** among them. `test-results/standing-rented/` now holds `state/` only, no `facts.json`. This is the #757 wedge reopened through a path #757 did not cover — the comment at `rehearsal-standing-lib.sh:26-28` claims the secret is "REMEMBERED before it is spent", and on this path it is not. ## Defect 2 — the device preflight has no pre-rent sweep at all `scripts/lib/rehearsal-droplet.sh:693-702` — `oc_rented_preflight` closes both halves of this hatch before `--target rented` rents: `oc_rented_release_stale_slug` (#748), then `oc_slug_secrets_harvest` + `oc_rented_offboard_stale_slug` (#757). The device branch runs **none** of them. `scripts/smoke-private-path.sh:373-379` does only a read-only offer GET, with the comment at line 376 stating the intent outright: *"a read-only GET, so it stays dry-run-safe (no stale-slug sweeps here)"*. But a device re-found rents the **same fixed slug** (`REHEARSAL_SLUG`, `scripts/lib/swarm-identity.sh:41`) through the same `runRentedPrefix`, so it inherits the identical wedge with none of the guard. Dry-run safety is a real constraint — the sweeps are destructive and the existing re-found teardown already solves it by sitting past the dry-run gate at `scripts/smoke-private-path.sh:565-569`. Secondary: `oc_slug_secrets_harvest` (`rehearsal-droplet.sh:807-818`) walks `<results_root>/<run>/state`, but a device run dir's `state/` is empty — the state lives in the standing home. The secret survives only as `logs/founding-state.log`, which the harvest does not read. ## Suspected layer Harness lifecycle wiring only (`scripts/`). No product code is implicated: the broker's refusal is correct and the wizard reported it honestly, in place, with a `Retry` and the stage named — DDR 0190 decision 3 behaving exactly as specified. ## What plugging it needs 1. **Unwedge `rehearsal-c` operationally first** — no code change frees a redeemed reservation. The key still exists at `test-results/drive-device/20260827T065053Z/logs/founding-state.log` (`address.secret`); spend it before retention prunes that run dir: `POST /v1/gateways/release` then `POST /v1/subdomains/offboard` for `rehearsal-c.idss.nz`, bearing that secret. If it is gone, rotate `REHEARSAL_SLUG` (GOTCHAS #32) — every drive stays red until one or the other happens. 2. **`rehearsal-standing-lib.sh`** — derive `slug`/`host` from `state/founding-state.json` when `facts.json` is absent (the state already carries `details.slug` and `address.host`), remember the secret **unconditionally** before the `rm -rf` at line 195, and attempt release + offboard whenever a secret exists rather than only when facts do. Correct the line 191-193 note, which mis-reports a post-`point` community as one that never reached S5. 3. **`smoke-private-path.sh`** — when `OC_STANDING_REFOUND=1`, run the same pre-rent sweeps `oc_rented_preflight` runs, placed **past the dry-run gate** beside the existing `oc_standing_teardown` call at line 568, so `--dry-run --target device` stays side-effect-free. 4. **`oc_slug_secrets_harvest`** — decide whether it should also mine harvested `logs/founding-state.log`, so a drive whose home was wiped can still be recovered from its own evidence. This is the one design call in the ticket. 5. **Tests** — `scripts/tests/rehearsal-standing-test.sh` should pin the facts-absent teardown path (secret remembered, offboard attempted, note honest); `scripts/tests/rehearsal-device-target-test.sh` should pin the sweep's presence and its position relative to the dry-run gate and `==> driving`, in the shape of its existing check 12. ## Evidence absent from this run, for the record - `state/` in the run directory is **empty** — no `state/clan-config` flake was captured (the app's state lives in the standing home on this target). - `logs/broker-journal.txt` is a harvest failure, not a log: `dev@100.98.48.68: Permission denied (publickey)` — the executor is off the admin mesh, by design (#681, ADR 0208); it would have shown the broker's own view of the 409. - `artifacts/journey.json` is `{rows: null, fault: null}` — the journey bar never started, consistent with a red before stand-up. - `logs/device-journal.txt` / `device-stall.txt` / `device-do-forensics.txt` are the **member device** (droplet 595534017, `clan-lab-rehearsal-d47f6f57`, plain Ubuntu 24.04, up 8 min, nothing deployed) — correct for a drive that red at leg 1, and not evidence about the gateway, which was never rented. Advances #854. drive `20260827T073657Z` red at `standing`: `expect(locator).toBeVisible() failed Locator: locator('[data-status="address"]') Expected: visible Timeout: 480000ms Error: element(s) not found Call log: - Expect "toBeVisible" with timeout 480000ms ` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260827T073657Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 25304f657c24 -->
Author
Member

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

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

close-report for #896 — status success

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

envelope
{
  "issue": 896,
  "status": "success",
  "commits": [
    "41c35b67e574bb4dff7db13454547b4699a4e907"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "scripts/lib/rehearsal-droplet.sh",
    "scripts/tests/rehearsal-rented-target-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/rehearsal-rented-target-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-device-target-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-standing-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/lib/rehearsal-droplet.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Defect 1 (standing teardown bins the secret on a facts-absent red re-found)": "Already closed by #897 (cba3764): oc_standing_teardown falls back to founding-state.json (draft.details.slug / draft.address.host) when facts.json is absent, remembering the secret under a REAL slug before rm -rf. This ticket is the duplicate of #897; verified present in the tree at scripts/lib/rehearsal-standing-lib.sh:158-197 and pinned by rehearsal-standing-test.sh (14 checks green).",
    "Defect 2 (device path has no pre-rent sweep)": "Already closed by #897: scripts/smoke-private-path.sh device branch runs oc_rented_release_stale_slug + oc_slug_secrets_harvest + oc_rented_offboard_stale_slug on a re-found, past the dry-run gate. Pinned by rehearsal-device-target-test.sh check 13 (13 checks green).",
    "Item 4 (the design call: should oc_slug_secrets_harvest mine harvested logs/founding-state.log?)": "RULED YES and IMPLEMENTED in commit 41c35b6: oc_slug_secrets_harvest (scripts/lib/rehearsal-droplet.sh) now scans state/ AND logs/founding-state.log per run under one combined slug guard. This was the residual gap — #897 wired the harvest into the device branch but it read only state/, which is EMPTY for a device run (app state lives in the standing home), so the key survives only as evidence.ts's cat-founding-state.json harvest. Proven by rehearsal-rented-target-test.sh check 15 (device-run shape: empty state/, key only in logs/founding-state.log, plus a wrong-slug-log negative) — red before, green after. Two-way door ruled under ADR 0174.",
    "Item 5 (tests: facts-absent teardown + device sweep presence/position)": "The facts-absent teardown path is pinned by rehearsal-standing-test.sh (#897) and the sweep presence/position by rehearsal-device-target-test.sh check 13 (#897); this commit adds the harvest-from-log functional pin to rehearsal-rented-target-test.sh check 15.",
    "Item 1 (unwedge rehearsal-c operationally)": "RESIDUE — not fixable from this sandbox. No code frees an ALREADY-wedged (redeemed) reservation; the name must be released/offboarded by hand or REHEARSAL_SLUG rotated (GOTCHAS #32). The executor is off the admin mesh (#681) and cannot reach the broker or the workstation's test-results tree that holds the lost secret. Named as operational residue on #897/#896 and in GOTCHAS #105 / STATUS.md. The code fixes prevent recurrence."
  },
  "summary": "oc_slug_secrets_harvest now also mines logs/founding-state.log, so #897's device-branch pre-rent sweep can actually find a device run's claim key (whose run-dir state/ is empty); the rest of #896 was closed by its duplicate #897.",
  "reason": "#896 is the duplicate of #897 (same fault, same drive); #897 landed the bulk fix. This commit closes the one design call #896 flagged that #897 did not — the harvest's own blind spot on the device path. Harness-only in an agent-owned path (scripts/), two-way door ruled under ADR 0174. The one un-fixable-in-code item (freeing the already-wedged rehearsal-c) is named as operational residue.",
  "blockers": []
}
**close-report** for #896 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 896, "status": "success", "commits": [ "41c35b67e574bb4dff7db13454547b4699a4e907" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "scripts/lib/rehearsal-droplet.sh", "scripts/tests/rehearsal-rented-target-test.sh" ], "tests": [ { "command": "bash scripts/tests/rehearsal-rented-target-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-device-target-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-standing-test.sh", "exit_code": 0 }, { "command": "bash -n scripts/lib/rehearsal-droplet.sh", "exit_code": 0 } ], "criteria": { "Defect 1 (standing teardown bins the secret on a facts-absent red re-found)": "Already closed by #897 (cba3764): oc_standing_teardown falls back to founding-state.json (draft.details.slug / draft.address.host) when facts.json is absent, remembering the secret under a REAL slug before rm -rf. This ticket is the duplicate of #897; verified present in the tree at scripts/lib/rehearsal-standing-lib.sh:158-197 and pinned by rehearsal-standing-test.sh (14 checks green).", "Defect 2 (device path has no pre-rent sweep)": "Already closed by #897: scripts/smoke-private-path.sh device branch runs oc_rented_release_stale_slug + oc_slug_secrets_harvest + oc_rented_offboard_stale_slug on a re-found, past the dry-run gate. Pinned by rehearsal-device-target-test.sh check 13 (13 checks green).", "Item 4 (the design call: should oc_slug_secrets_harvest mine harvested logs/founding-state.log?)": "RULED YES and IMPLEMENTED in commit 41c35b6: oc_slug_secrets_harvest (scripts/lib/rehearsal-droplet.sh) now scans state/ AND logs/founding-state.log per run under one combined slug guard. This was the residual gap — #897 wired the harvest into the device branch but it read only state/, which is EMPTY for a device run (app state lives in the standing home), so the key survives only as evidence.ts's cat-founding-state.json harvest. Proven by rehearsal-rented-target-test.sh check 15 (device-run shape: empty state/, key only in logs/founding-state.log, plus a wrong-slug-log negative) — red before, green after. Two-way door ruled under ADR 0174.", "Item 5 (tests: facts-absent teardown + device sweep presence/position)": "The facts-absent teardown path is pinned by rehearsal-standing-test.sh (#897) and the sweep presence/position by rehearsal-device-target-test.sh check 13 (#897); this commit adds the harvest-from-log functional pin to rehearsal-rented-target-test.sh check 15.", "Item 1 (unwedge rehearsal-c operationally)": "RESIDUE — not fixable from this sandbox. No code frees an ALREADY-wedged (redeemed) reservation; the name must be released/offboarded by hand or REHEARSAL_SLUG rotated (GOTCHAS #32). The executor is off the admin mesh (#681) and cannot reach the broker or the workstation's test-results tree that holds the lost secret. Named as operational residue on #897/#896 and in GOTCHAS #105 / STATUS.md. The code fixes prevent recurrence." }, "summary": "oc_slug_secrets_harvest now also mines logs/founding-state.log, so #897's device-branch pre-rent sweep can actually find a device run's claim key (whose run-dir state/ is empty); the rest of #896 was closed by its duplicate #897.", "reason": "#896 is the duplicate of #897 (same fault, same drive); #897 landed the bulk fix. This commit closes the one design call #896 flagged that #897 did not — the harvest's own blind spot on the device path. Harness-only in an agent-owned path (scripts/), two-way door ruled under ADR 0174. The one un-fixable-in-code item (freeing the already-wedged rehearsal-c) is named as operational residue.", "blockers": [] } ``` </details>
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.

Reference
Matou/idss#896
No description provided.