Destroy community 6/9 — honest facts for every gateway place and fleet: own VPS, home, owned devices, no idss.nz name, no claim secret #1790

Closed
opened 2026-09-23 18:06:52 +00:00 by ben · 3 comments
Owner

Parent

#1784 (spec) — from #1781.

What to build

The dialog must never over-promise "deletes all data". The preview and DC1 render the truth for each case:

  • Gateway place: gateway-fate renders exactly one variant (rented / own VPS / home). An own-VPS community gets the own-VPS destroy-headline: the server and its data are not deleted.
  • Owned devices: a fleet holding devices the community owns gets goes-owned-devices (count; their data stays until wiped). Rented devices are released with the gateway and get no row.
  • No idss.nz name: a community on its own apex domain has nothing to free at the broker. goes-name is absent, and the act only takes the gateway terminal (plus the rented release if rented).
  • No claim secret: a gateway without one gets an honest DC6x-style refusal in the dialog before the word is ever typed, with nothing sent (ADR 0100).

Acceptance criteria

  • gateway-fate renders exactly one variant, data-variant rented / own-vps / home, matching the gateway's recorded place (spec #1784 story 8)
  • own-VPS → the own-VPS destroy-headline (server and data not deleted); rented and home → the standard headline (8)
  • owned devices present → goes-owned-devices with their count; none → absent; rented devices → no row (9)
  • no idss.nz name → goes-name absent; the act makes no name-freeing claim; DC6 omits name-freed
  • no claim secret → the dialog shows the refusal instead of the word, confirm-destroy never arms, and nothing is sent to the broker
  • preview control-API tests for each variant; dashboard vitest for each rendered variant

Design contract: DDR 0274, flow docs/ux/flows/destroy-community.mermaid, frames docs/ux/wireframes/destroy-community/ — the data-field / data-action / data-status attributes are the element contract design-verify checks.

Blocked by

## Parent #1784 (spec) — from #1781. ## What to build The dialog must never over-promise "deletes all data". The preview and DC1 render the truth for each case: - **Gateway place:** `gateway-fate` renders exactly one variant (rented / own VPS / home). An own-VPS community gets the own-VPS `destroy-headline`: the server and its data are **not** deleted. - **Owned devices:** a fleet holding devices the community **owns** gets `goes-owned-devices` (count; their data stays until wiped). Rented devices are released with the gateway and get no row. - **No idss.nz name:** a community on its own apex domain has nothing to free at the broker. `goes-name` is absent, and the act only takes the gateway terminal (plus the rented release if rented). - **No claim secret:** a gateway without one gets an honest DC6x-style refusal in the dialog **before** the word is ever typed, with nothing sent (ADR 0100). ## Acceptance criteria - [ ] `gateway-fate` renders exactly one variant, `data-variant` rented / own-vps / home, matching the gateway's recorded place (spec #1784 story 8) - [ ] own-VPS → the own-VPS `destroy-headline` (server and data not deleted); rented and home → the standard headline (8) - [ ] owned devices present → `goes-owned-devices` with their count; none → absent; rented devices → no row (9) - [ ] no idss.nz name → `goes-name` absent; the act makes no name-freeing claim; DC6 omits `name-freed` - [ ] no claim secret → the dialog shows the refusal instead of the word, `confirm-destroy` never arms, and nothing is sent to the broker - [ ] preview control-API tests for each variant; dashboard vitest for each rendered variant Design contract: DDR 0274, flow `docs/ux/flows/destroy-community.mermaid`, frames `docs/ux/wireframes/destroy-community/` — the `data-field` / `data-action` / `data-status` attributes are the element contract `design-verify` checks. ## Blocked by - #1786

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

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

Ruled by agent under ADR 0174 — veto anytime.

Decision: owned_device_count in the destroy preview counts every fleet device besides the gateway (fleet.Nodes()), honest-absent (0) on a fleet read error.

Why: the fleet store carries no per-device rented/owned marker — a rented device's lease lives only at the broker, keyed by host, and is released with the gateway. So the local preview cannot distinguish a rented device from an owned one at any existing seam. Counting every enrolled device is the conservative choice: goes-owned-devices says the data on them stays until you wipe them, which is true of any disk the broker leave does not touch, and it never under-names a device the operator must go wipe (a mild over-count of a rented box that the provider already destroyed is safe; an under-count would lose data).

Two-way door: revertible in a later commit and proven by destroy_wiring_test.go (count = N nodes / 0 / 0-on-error) + the dashboard vitest (row present at N>0, absent at 0). Refinable the moment the fleet store records the rented split.

Not on the one-way-door list (no credential, no security-posture widening, no member-facing trust accept, no data destruction — a preview only, no spend).

Ruled by agent under ADR 0174 — veto anytime. **Decision:** `owned_device_count` in the destroy preview counts **every fleet device besides the gateway** (`fleet.Nodes()`), honest-absent (0) on a fleet read error. **Why:** the fleet store carries no per-device rented/owned marker — a rented device's lease lives only at the broker, keyed by host, and is released with the gateway. So the local preview cannot distinguish a rented device from an owned one at any existing seam. Counting every enrolled device is the conservative choice: `goes-owned-devices` says *the data on them stays until you wipe them*, which is true of any disk the broker leave does not touch, and it never **under**-names a device the operator must go wipe (a mild over-count of a rented box that the provider already destroyed is safe; an under-count would lose data). **Two-way door:** revertible in a later commit and proven by `destroy_wiring_test.go` (count = N nodes / 0 / 0-on-error) + the dashboard vitest (row present at N>0, absent at 0). Refinable the moment the fleet store records the rented split. Not on the one-way-door list (no credential, no security-posture widening, no member-facing trust accept, no data destruction — a preview only, no spend).

close-report for #1790 — status success

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

envelope
{
  "issue": 1790,
  "status": "success",
  "commits": [
    "1084013e79fff2d574a1f9db2d612a32ff54aa85"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/destroy_wiring.go",
    "control-plane/cmd/control-plane/destroy_wiring_test.go",
    "control-plane/cmd/control-plane/main.go",
    "dashboard/src/components/shell/DestroyDialog.vue",
    "dashboard/src/components/shell/DestroyTerminal.vue",
    "dashboard/src/lib/api/generated.ts",
    "dashboard/src/lib/destroy.ts",
    "dashboard/tests/fakes/destroy.ts",
    "dashboard/tests/unit/destroy.test.ts",
    "internal/controlapi/destroy.go",
    "internal/controlapi/destroy_integration_test.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "pnpm exec vitest run (dashboard, 149 files / 1917 tests)",
      "exit_code": 0
    },
    {
      "command": "pnpm exec vue-tsc --noEmit",
      "exit_code": 0
    },
    {
      "command": "node scripts/generate-client.mjs --check (check:client)",
      "exit_code": 0
    },
    {
      "command": "npm test (openapi-spec, 9 tests)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "gateway-fate renders exactly one variant, data-variant rented/own-vps/home, matching the recorded place (story 8)": "DestroyDialog.vue gateway-fate row keys :data-variant on preview.place (one of rented/own-vps/home); destroy.test.ts 'gateway-fate renders exactly ONE variant' asserts findAll length 1 and the variant for each place; server maps IDSS_ACCESS_KIND via destroyPlace + destroy_wiring_test.go TestDestroyPreviewAdapter_PlaceAndName",
    "own-VPS -> own-VPS destroy-headline (server and data not deleted); rented and home -> standard headline (8)": "DestroyDialog.vue headline computed returns the own-VPS 'not deleted' text for place own-vps, else 'cannot be undone'; destroy.test.ts 'own-VPS uses the own-VPS headline ...' asserts /not deleted/ for own-vps and /cannot be undone/ (not /not deleted/) for rented+home",
    "owned devices present -> goes-owned-devices with their count; none -> absent; rented devices -> no row (9)": "DestroyPreview.owned_device_count added (destroy.go); adapter counts fleet.Nodes() (destroy_wiring.go + destroy_wiring_test.go count=2/0/0-on-error); DestroyDialog.vue renders goes-owned-devices only when ownedDeviceCount>0; destroy.test.ts 'goes-owned-devices renders with the count ... absent when none'",
    "no idss.nz name -> goes-name absent; the act makes no name-freeing claim; DC6 omits name-freed": "DestroyDialog.vue goes-name is v-if=preview.hasName; DestroyActView/Record/Config gain has_name (isIdssName(apex)); destroy.go forces name_freed = HasName && broker.NameFreed; DestroyTerminal.vue name-freed row is v-if=outcome.hasName; destroy_integration_test.go TestDestroy_ActNoName + destroy.test.ts 'DC6 OMITS name-freed ...' + 'no idss.nz name shows no goes-name row'",
    "no claim secret -> the dialog shows the refusal instead of the word, confirm-destroy never arms, and nothing is sent to the broker": "DestroyDialog.vue: when !preview.hasClaimSecret renders no-claim-secret refusal (data-status=cannot-destroy) and omits the whole confirm-word/confirm-destroy branch; server act still refuses empty secret 503 nothing-sent; destroy.test.ts 'no claim secret -> the refusal is shown INSTEAD of the word ...' + destroy_integration_test.go TestDestroy_ActNoClaimSecret",
    "preview control-API tests for each variant; dashboard vitest for each rendered variant": "destroy_integration_test.go TestDestroy_PreviewVariants (own-vps/owned-devices/no-name/no-secret) + TestDestroy_ActNoName + TestDestroy_ActNoClaimSecret; destroy_wiring_test.go for the composition-root count/place/name; destroy.test.ts new describe block 'DC1 — honest facts for every place and fleet' (7 cases) + DC6 name omission"
  },
  "summary": "The destroy preview and DC1/DC6 render the honest truth for every gateway place and fleet — own-VPS headline, owned-devices count, no goes-name on an own-apex community, and a DC6x-style refusal before the word when no claim secret is held.",
  "blockers": []
}
**close-report** for #1790 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1790, "status": "success", "commits": [ "1084013e79fff2d574a1f9db2d612a32ff54aa85" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/destroy_wiring.go", "control-plane/cmd/control-plane/destroy_wiring_test.go", "control-plane/cmd/control-plane/main.go", "dashboard/src/components/shell/DestroyDialog.vue", "dashboard/src/components/shell/DestroyTerminal.vue", "dashboard/src/lib/api/generated.ts", "dashboard/src/lib/destroy.ts", "dashboard/tests/fakes/destroy.ts", "dashboard/tests/unit/destroy.test.ts", "internal/controlapi/destroy.go", "internal/controlapi/destroy_integration_test.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "go test ./internal/controlapi/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "pnpm exec vitest run (dashboard, 149 files / 1917 tests)", "exit_code": 0 }, { "command": "pnpm exec vue-tsc --noEmit", "exit_code": 0 }, { "command": "node scripts/generate-client.mjs --check (check:client)", "exit_code": 0 }, { "command": "npm test (openapi-spec, 9 tests)", "exit_code": 0 } ], "criteria": { "gateway-fate renders exactly one variant, data-variant rented/own-vps/home, matching the recorded place (story 8)": "DestroyDialog.vue gateway-fate row keys :data-variant on preview.place (one of rented/own-vps/home); destroy.test.ts 'gateway-fate renders exactly ONE variant' asserts findAll length 1 and the variant for each place; server maps IDSS_ACCESS_KIND via destroyPlace + destroy_wiring_test.go TestDestroyPreviewAdapter_PlaceAndName", "own-VPS -> own-VPS destroy-headline (server and data not deleted); rented and home -> standard headline (8)": "DestroyDialog.vue headline computed returns the own-VPS 'not deleted' text for place own-vps, else 'cannot be undone'; destroy.test.ts 'own-VPS uses the own-VPS headline ...' asserts /not deleted/ for own-vps and /cannot be undone/ (not /not deleted/) for rented+home", "owned devices present -> goes-owned-devices with their count; none -> absent; rented devices -> no row (9)": "DestroyPreview.owned_device_count added (destroy.go); adapter counts fleet.Nodes() (destroy_wiring.go + destroy_wiring_test.go count=2/0/0-on-error); DestroyDialog.vue renders goes-owned-devices only when ownedDeviceCount>0; destroy.test.ts 'goes-owned-devices renders with the count ... absent when none'", "no idss.nz name -> goes-name absent; the act makes no name-freeing claim; DC6 omits name-freed": "DestroyDialog.vue goes-name is v-if=preview.hasName; DestroyActView/Record/Config gain has_name (isIdssName(apex)); destroy.go forces name_freed = HasName && broker.NameFreed; DestroyTerminal.vue name-freed row is v-if=outcome.hasName; destroy_integration_test.go TestDestroy_ActNoName + destroy.test.ts 'DC6 OMITS name-freed ...' + 'no idss.nz name shows no goes-name row'", "no claim secret -> the dialog shows the refusal instead of the word, confirm-destroy never arms, and nothing is sent to the broker": "DestroyDialog.vue: when !preview.hasClaimSecret renders no-claim-secret refusal (data-status=cannot-destroy) and omits the whole confirm-word/confirm-destroy branch; server act still refuses empty secret 503 nothing-sent; destroy.test.ts 'no claim secret -> the refusal is shown INSTEAD of the word ...' + destroy_integration_test.go TestDestroy_ActNoClaimSecret", "preview control-API tests for each variant; dashboard vitest for each rendered variant": "destroy_integration_test.go TestDestroy_PreviewVariants (own-vps/owned-devices/no-name/no-secret) + TestDestroy_ActNoName + TestDestroy_ActNoClaimSecret; destroy_wiring_test.go for the composition-root count/place/name; destroy.test.ts new describe block 'DC1 — honest facts for every place and fleet' (7 cases) + DC6 name omission" }, "summary": "The destroy preview and DC1/DC6 render the honest truth for every gateway place and fleet — own-VPS headline, owned-devices count, no goes-name on an own-apex community, and a DC6x-style refusal before the word when no claim secret is held.", "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.

Reference
Matou/idss#1790
No description provided.