Destroy community 2/9 — destroy from Settings end to end: the door, the dialog, the word, the act, the gateway goes terminal, DC5/DC6/DC6x #1786

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

Parent

#1784 (spec) — from #1781.

What to build

The tracer bullet. An operator on a rented community opens Settings and presses Destroy community… (the new last section, DS). The dialog (DC1) shows what goes, read from a new operator-only destroy preview on the control API that composes existing seams:

  • services (catalogue);
  • datasets and total size (backups inventory);
  • member count;
  • the host;
  • the gateway's place;
  • whether a claim secret is present.

Typing the printed word (English here; the forgiving match ignores case, whitespace and diacritics) arms Destroy community (DC4). Confirm sends one destroy request to a new operator-only destroy act. The body must name this community's host exactly. The control plane calls the broker leave (ticket 1) with its claim secret, replies with the outcome before anything else, then writes a durable left marker. From then on:

  • the address heartbeat and the gateway renewal loop rest;
  • every control API route answers 410 with a destroyed body;
  • the static SPA still serves, so a reload of a surviving box shows the ending.

The act is idempotent: a second call joins one in flight, and after left it returns the recorded outcome. It is logged in the activity log.

The dashboard shows DC5 (no cancel, and the page-will-lose-its-server note). Then it shows either DC6 (drawn client-side, replacing the whole frame, no link back into the panel, Open the operator app) or DC6x (the broker's refusal verbatim, try-again, close).

The dialog is owned by the frame's dialog state (the device-add precedent). The terminal screens follow the unreachable-screen precedent (DDR 0096). The Settings section amends DDR 0099's inventory, and nothing else on Settings changes.

Acceptance criteria

  • DS: destroy-community-section renders after the not-here list for an operator, holding one sentence and destroy-community; absent for a non-operator session (spec #1784 stories 1–3)
  • the preview endpoint is operator-only and returns services, datasets + total size (unknown size said, never 0), member count, host, place and claim-secret presence; DC1 renders destroy-headline, goes-services, goes-data, goes-members, goes-name, gateway-fate (rented) and members-note from it (4–7)
  • cancel / close from DC1 or DC4 closes on Settings with nothing sent to the broker (10)
  • confirm-word prints the word; destroy-word-input matching it (ignoring case, surrounding whitespace, diacritics) sets confirm-destroy data-status="armed", and anything else or an edit that stops matching sets disabled (22, 24–26)
  • confirm → DC5 with destroy-steps and page-will-lose-server-note, no cancel; exactly one act request, exactly one broker leave (27, 28)
  • the act refuses a body not naming this community's host (400) and a non-operator session, with nothing sent to the broker (3, 29); a second request joins or returns the recorded outcome (30)
  • on success the control plane is left: heartbeats rest, every control API answers 410 with a destroyed body, and a reload shows the ending rather than a broken dashboard (36)
  • DC6 replaces the frame with destroyed-at, server-released (or "release under way — IDSS finishes it" on release_owed), backup-recap ("No backup taken" until ticket 4), next-step-forget, open-operator-app, reload-warning, and no panel link (31, 33); name-freed shows the gateway's reply for now (ticket 3 adds the browser's own witness)
  • DC6x on a broker refusal or unreachable broker: nothing-released, refusal-reason verbatim, try-again re-runs the act without retyping, close → DS (34)
  • control-API seam tests with a fake broker (the community-app/backups controlapi test precedent); dashboard vitest for each frame's contract fields; vue-tsc, eslint, prettier, go test for the touched packages green

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 tracer bullet. An operator on a **rented** community opens Settings and presses **Destroy community…** (the new last section, DS). The dialog (DC1) shows what goes, read from a new operator-only **destroy preview** on the control API that composes existing seams: - services (catalogue); - datasets and total size (backups inventory); - member count; - the host; - the gateway's place; - whether a claim secret is present. Typing the printed word (English here; the forgiving match ignores case, whitespace and diacritics) arms **Destroy community** (DC4). Confirm sends **one** destroy request to a new operator-only **destroy act**. The body must name this community's host exactly. The control plane calls the broker `leave` (ticket 1) with its claim secret, replies with the outcome **before anything else**, then writes a durable **left** marker. From then on: - the address heartbeat and the gateway renewal loop rest; - every control API route answers 410 with a destroyed body; - the static SPA still serves, so a reload of a surviving box shows the ending. The act is idempotent: a second call joins one in flight, and after `left` it returns the recorded outcome. It is logged in the activity log. The dashboard shows DC5 (no cancel, and the page-will-lose-its-server note). Then it shows either DC6 (drawn client-side, replacing the whole frame, no link back into the panel, **Open the operator app**) or DC6x (the broker's refusal verbatim, `try-again`, `close`). The dialog is owned by the frame's dialog state (the device-add precedent). The terminal screens follow the unreachable-screen precedent (DDR 0096). The Settings section amends DDR 0099's inventory, and nothing else on Settings changes. ## Acceptance criteria - [ ] DS: `destroy-community-section` renders **after** the not-here list for an operator, holding one sentence and `destroy-community`; absent for a non-operator session (spec #1784 stories 1–3) - [ ] the preview endpoint is operator-only and returns services, datasets + total size (unknown size said, never 0), member count, host, place and claim-secret presence; DC1 renders `destroy-headline`, `goes-services`, `goes-data`, `goes-members`, `goes-name`, `gateway-fate` (rented) and `members-note` from it (4–7) - [ ] `cancel` / `close` from DC1 or DC4 closes on Settings with nothing sent to the broker (10) - [ ] `confirm-word` prints the word; `destroy-word-input` matching it (ignoring case, surrounding whitespace, diacritics) sets `confirm-destroy` `data-status="armed"`, and anything else or an edit that stops matching sets `disabled` (22, 24–26) - [ ] confirm → DC5 with `destroy-steps` and `page-will-lose-server-note`, no cancel; exactly one act request, exactly one broker `leave` (27, 28) - [ ] the act refuses a body not naming this community's host (400) and a non-operator session, with nothing sent to the broker (3, 29); a second request joins or returns the recorded outcome (30) - [ ] on success the control plane is `left`: heartbeats rest, every control API answers 410 with a destroyed body, and a reload shows the ending rather than a broken dashboard (36) - [ ] DC6 replaces the frame with `destroyed-at`, `server-released` (or "release under way — IDSS finishes it" on `release_owed`), `backup-recap` ("No backup taken" until ticket 4), `next-step-forget`, `open-operator-app`, `reload-warning`, and no panel link (31, 33); `name-freed` shows the gateway's reply for now (ticket 3 adds the browser's own witness) - [ ] DC6x on a broker refusal or unreachable broker: `nothing-released`, `refusal-reason` verbatim, `try-again` re-runs the act without retyping, `close` → DS (34) - [ ] control-API seam tests with a fake broker (the community-app/backups controlapi test precedent); dashboard vitest for each frame's contract fields; vue-tsc, eslint, prettier, `go test` for the touched packages green 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 - #1785

swarm-claim host=bens-mac-04 run=30974
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=30974 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1786 — status success

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

envelope
{
  "issue": 1786,
  "status": "success",
  "commits": [
    "a3b7b58187664b952a1774c65bd6a6842ef44da9"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/destroy_wiring.go",
    "control-plane/cmd/control-plane/main.go",
    "dashboard/src/bootstrap.ts",
    "dashboard/src/components/DashboardComposition.vue",
    "dashboard/src/components/shell/DestroyDialog.vue",
    "dashboard/src/components/shell/DestroyTerminal.vue",
    "dashboard/src/components/shell/SettingsScreen.vue",
    "dashboard/src/components/shell/SettingsSurface.vue",
    "dashboard/src/lib/api/destroyClient.ts",
    "dashboard/src/lib/api/generated.ts",
    "dashboard/src/lib/dashboardNavigator.ts",
    "dashboard/src/lib/destroy.ts",
    "dashboard/src/lib/i18n.ts",
    "dashboard/src/lib/mountRegistry.ts",
    "dashboard/tests/fakes/destroy.ts",
    "dashboard/tests/support/defaultDashboardDeps.ts",
    "dashboard/tests/unit/destroy.test.ts",
    "internal/controlapi/destroy.go",
    "internal/controlapi/destroy_integration_test.go",
    "internal/controlapi/handler.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi/ ./internal/brokerclient/",
      "exit_code": 0
    },
    {
      "command": "go test ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/controlapi/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/vue-tsc --noEmit -p dashboard/tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/vitest run (dashboard, full suite)",
      "exit_code": 0
    },
    {
      "command": "eslint + prettier --check (touched files)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "DS: destroy-community-section renders after the not-here list for an operator; absent for a non-operator (stories 1-3)": "SettingsScreen.vue renders the section (v-if canDestroy) last after not-here-list; destroy.test.ts 'DS — the Destroy community door' asserts present-after-not-here + absent when canDestroy=false + the destroy-community route intent",
    "preview operator-only, returns services/datasets+size(unknown never 0)/members/host/place/claim-secret; DC1 renders headline/goes-*/gateway-fate(rented)/members-note (4-7)": "controlapi WithDestroy GET /destroy/preview via operatorAuthed; DestroyPreview composed in destroy_wiring.go (SizeKnown=false ⇒ unknown); destroy_integration_test.go TestDestroy_PreviewOperatorOnly (200 facts, 403 member, 401 unauth, size unknown); DestroyDialog.vue + destroy.test.ts assert the fields incl gateway-fate data-variant=rented",
    "cancel/close from DC1 or DC4 closes on Settings, nothing sent (10)": "DestroyDialog cancel/close emit close → navigator.closeDialog; destroy.test.ts 'closes on cancel or ✕ with nothing sent' (destroyCalls 0)",
    "confirm-word prints the word; matching (case/whitespace/diacritics) → armed, else disabled (22,24-26)": "confirm-word = t('panel.destroy.word') (en/es/nl/fr in i18n.ts); destroyWordMatches normalises NFD/marks/case/trim (destroy.ts); destroy.test.ts arming + the forgiving-match unit test incl macrons",
    "confirm → DC5 with destroy-steps + page-will-lose-server-note, no cancel; exactly one act, one broker leave (27,28)": "navigator.beginDestroy → DestroyTerminal DC5; watch runs source.destroy once (inFlight guard); destroy.test.ts DC5 fields+no-cancel, DC6 asserts destroyCalls===1; seam TestDestroy_ActLeavesAndReplays asserts one broker leave",
    "act refuses a body not naming this host (400) and a non-operator, nothing sent (3,29); a second request joins/returns the recorded outcome (30)": "registerDestroy host-mismatch→400 + operatorAuthed; destroy_integration_test.go TestDestroy_ActRefusesHostMismatch / TestDestroy_ActNonOperator (broker calls 0) / TestDestroy_ActLeavesAndReplays (replay, one leave)",
    "on success control plane left: heartbeats rest, every control API 410 destroyed body, reload shows the ending (36)": "durable left marker (destroyed.json) + leftGate 410 (except act path) + GET /destroy status read; main.go rests the address heartbeat/renewer at boot on the marker; TestDestroy_LeftGateAfterLeave (410 + act replays + status left:true); DashboardComposition onMounted reads status→DC6",
    "DC6: destroyed-at/server-released(or release_owed)/name-freed/backup-recap('No backup taken')/next-step-forget/open-operator-app/reload-warning, no panel link (31,33)": "DestroyTerminal DC6 renders all fields; serverReleasedLine reads release_owed as 'release under way'; destroy.test.ts DC6 + release_owed cases",
    "DC6x on refusal/unreachable: nothing-released, refusal-reason verbatim, try-again re-runs without retyping, close → DS (34)": "act relays broker refusal 502 verbatim (TestDestroy_BrokerRefusalIntact); DestroyTerminal DC6x renders nothing-released/refusal-reason, try-again→retryDestroy re-runs, close→closeDestroy; destroy.test.ts DC6x asserts verbatim + re-run + close→idle",
    "control-API seam tests with a fake broker; dashboard vitest for each frame; vue-tsc/eslint/prettier/go test green": "destroy_integration_test.go (7, fakeLeaver) + destroy.test.ts (12); go test controlapi/brokerclient/control-plane green; golangci-lint 0 issues; vue-tsc/eslint/prettier + full dashboard suite (1866) green; check:client in sync"
  },
  "summary": "Destroy community lands end to end from the panel — the DS door, the DC1/DC4 dialog, the typed word, the one-act destroy over the #1785 broker leave, and the terminal DC5/DC6/DC6x frames backed by the operator-only preview/act and the durable left marker's 410 gate.",
  "reason": "",
  "blockers": []
}
**close-report** for #1786 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1786, "status": "success", "commits": [ "a3b7b58187664b952a1774c65bd6a6842ef44da9" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/destroy_wiring.go", "control-plane/cmd/control-plane/main.go", "dashboard/src/bootstrap.ts", "dashboard/src/components/DashboardComposition.vue", "dashboard/src/components/shell/DestroyDialog.vue", "dashboard/src/components/shell/DestroyTerminal.vue", "dashboard/src/components/shell/SettingsScreen.vue", "dashboard/src/components/shell/SettingsSurface.vue", "dashboard/src/lib/api/destroyClient.ts", "dashboard/src/lib/api/generated.ts", "dashboard/src/lib/dashboardNavigator.ts", "dashboard/src/lib/destroy.ts", "dashboard/src/lib/i18n.ts", "dashboard/src/lib/mountRegistry.ts", "dashboard/tests/fakes/destroy.ts", "dashboard/tests/support/defaultDashboardDeps.ts", "dashboard/tests/unit/destroy.test.ts", "internal/controlapi/destroy.go", "internal/controlapi/destroy_integration_test.go", "internal/controlapi/handler.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "go test ./internal/controlapi/ ./internal/brokerclient/", "exit_code": 0 }, { "command": "go test ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/controlapi/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 }, { "command": "node_modules/.bin/vue-tsc --noEmit -p dashboard/tsconfig.json", "exit_code": 0 }, { "command": "node_modules/.bin/vitest run (dashboard, full suite)", "exit_code": 0 }, { "command": "eslint + prettier --check (touched files)", "exit_code": 0 } ], "criteria": { "DS: destroy-community-section renders after the not-here list for an operator; absent for a non-operator (stories 1-3)": "SettingsScreen.vue renders the section (v-if canDestroy) last after not-here-list; destroy.test.ts 'DS — the Destroy community door' asserts present-after-not-here + absent when canDestroy=false + the destroy-community route intent", "preview operator-only, returns services/datasets+size(unknown never 0)/members/host/place/claim-secret; DC1 renders headline/goes-*/gateway-fate(rented)/members-note (4-7)": "controlapi WithDestroy GET /destroy/preview via operatorAuthed; DestroyPreview composed in destroy_wiring.go (SizeKnown=false ⇒ unknown); destroy_integration_test.go TestDestroy_PreviewOperatorOnly (200 facts, 403 member, 401 unauth, size unknown); DestroyDialog.vue + destroy.test.ts assert the fields incl gateway-fate data-variant=rented", "cancel/close from DC1 or DC4 closes on Settings, nothing sent (10)": "DestroyDialog cancel/close emit close → navigator.closeDialog; destroy.test.ts 'closes on cancel or ✕ with nothing sent' (destroyCalls 0)", "confirm-word prints the word; matching (case/whitespace/diacritics) → armed, else disabled (22,24-26)": "confirm-word = t('panel.destroy.word') (en/es/nl/fr in i18n.ts); destroyWordMatches normalises NFD/marks/case/trim (destroy.ts); destroy.test.ts arming + the forgiving-match unit test incl macrons", "confirm → DC5 with destroy-steps + page-will-lose-server-note, no cancel; exactly one act, one broker leave (27,28)": "navigator.beginDestroy → DestroyTerminal DC5; watch runs source.destroy once (inFlight guard); destroy.test.ts DC5 fields+no-cancel, DC6 asserts destroyCalls===1; seam TestDestroy_ActLeavesAndReplays asserts one broker leave", "act refuses a body not naming this host (400) and a non-operator, nothing sent (3,29); a second request joins/returns the recorded outcome (30)": "registerDestroy host-mismatch→400 + operatorAuthed; destroy_integration_test.go TestDestroy_ActRefusesHostMismatch / TestDestroy_ActNonOperator (broker calls 0) / TestDestroy_ActLeavesAndReplays (replay, one leave)", "on success control plane left: heartbeats rest, every control API 410 destroyed body, reload shows the ending (36)": "durable left marker (destroyed.json) + leftGate 410 (except act path) + GET /destroy status read; main.go rests the address heartbeat/renewer at boot on the marker; TestDestroy_LeftGateAfterLeave (410 + act replays + status left:true); DashboardComposition onMounted reads status→DC6", "DC6: destroyed-at/server-released(or release_owed)/name-freed/backup-recap('No backup taken')/next-step-forget/open-operator-app/reload-warning, no panel link (31,33)": "DestroyTerminal DC6 renders all fields; serverReleasedLine reads release_owed as 'release under way'; destroy.test.ts DC6 + release_owed cases", "DC6x on refusal/unreachable: nothing-released, refusal-reason verbatim, try-again re-runs without retyping, close → DS (34)": "act relays broker refusal 502 verbatim (TestDestroy_BrokerRefusalIntact); DestroyTerminal DC6x renders nothing-released/refusal-reason, try-again→retryDestroy re-runs, close→closeDestroy; destroy.test.ts DC6x asserts verbatim + re-run + close→idle", "control-API seam tests with a fake broker; dashboard vitest for each frame; vue-tsc/eslint/prettier/go test green": "destroy_integration_test.go (7, fakeLeaver) + destroy.test.ts (12); go test controlapi/brokerclient/control-plane green; golangci-lint 0 issues; vue-tsc/eslint/prettier + full dashboard suite (1866) green; check:client in sync" }, "summary": "Destroy community lands end to end from the panel — the DS door, the DC1/DC4 dialog, the typed word, the one-act destroy over the #1785 broker leave, and the terminal DC5/DC6/DC6x frames backed by the operator-only preview/act and the durable left marker's 410 gate.", "reason": "", "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#1786
No description provided.