Spec: Destroy community — give up a community from Settings; the panel drives it, the page reports its own ending, the app backstops it (#1781, DDR 0274) #1784
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1784
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#1781 (the gap and Ben's rulings). There is no wayfinder map: this is a standalone feature.
Design contract:
docs/ux/flows/destroy-community.mermaiddocs/ux/wireframes/destroy-community/(DC1–DC6u, DCA1–DCA3), plus the amendedshell/shell-ds-settings.htmlandshell/shell-hox-operator-home-unreachable.htmlSpecced in auto mode. Every call below not already ruled by Ben is an agent call under ADR 0174 (veto anytime).
Problem Statement
An operator can found a community from the app but can never give it up.
Once founding hands off, nothing in the operator app or the control panel releases the rented gateway they are billed for or frees the
<slug>.idss.nzname they claimed. Two facts make this so:The broker's own terms, shown at founding, promise "you can leave any time". Today the only way out is a hand repair: decrypt the sealed claim secret, then curl the broker. Once the gateway is dead even that is gone, because the credential died with it (#1751). Every torn-down trial, demo and rehearsal community has burned its name.
Solution
A Destroy community door, last on the control panel's Settings, opens one dialog in three parts.
Confirm is one request. The gateway uses its claim secret to ask the broker to leave in one act: free the name, release the rented gateway and any rented devices. The panel is served by the box it is destroying, so it draws its own ending:
The operator app backstops it:
User Stories
Acceptance criteria are sourced from the flow's nodes and edges (the node IDs in brackets).
The door (DS)
destroy-community-sectionappears after the not-here signpost. It holds one sentence and adestroy-communityaction, and no other control.destroy-community, then the destroy dialog opens (DC1) and nothing has changed on the fleet.destroy-community-section.Understand (DC1)
goes-servicesshows the count and names of every installed service, taken from the catalogue's truth.goes-datashows the dataset count and total size from the backups inventory.goes-membersshows the member count.members-notesays IDSS won't notify them.goes-namenames the host and says anyone can claim it afterwards, including the operator.gateway-faterenders exactly one variant:destroy-headlineuses the own-VPS variant, which says the server and its data are not deleted.goes-owned-devicesnames their count and says their data stays until wiped.cancelorcloseis pressed, then the dialog closes on Settings (DS), and nothing was sent to the broker.Back up (DC1 → DC2 → DC3 / DC3x)
backup-sectionshowsbackup-size(before anything starts),backup-contentsandcreate-and-download-backup.sealed-copies-notesays the IDSS offsite storage and This computer copies are sealed with this community's keys and are not a way to keep the data.create-and-download-backup, then DC2 shows:backup-progresswith one row per dataset (downloaded, current or waiting);backup-remainingwith bytes done, bytes total, rate and time left.confirm-destroyis disabled even if the word matches, andconfirm-locked-notesays why.cancel-backupis pressed, then the export in flight stops, finished archives stay downloaded, and the dialog returns to DC1.backup-files: a manifest plus one archive per dataset, with names and sizes.backup-unencrypted-notesays the files are not encrypted.backup-failed-datasetwithbackup-failure-reason, and the other datasets keep their state.retry-datasetis pressed, then only that dataset re-exports (→ DC2).continue-withoutis pressed, then the dialog returns to DC1 with a standingbackup-missingline naming what the backup lacks, still visible at confirm.Type the word (DC1 ↔ DC4)
confirm-wordprints the destroy word in the interface's language, anddestroy-word-inputis empty.confirm-wordshows that locale's translation of the word, drawn from the translation catalogue.confirm-destroybecomesarmed(DC4).disabled.confirm-destroyreturns todisabled(→ DC1).Destroying (DC5)
confirm-destroyis pressed, then DC5 shows, exactly one destroy request goes to the control plane, and the control plane makes exactly one broker leave call.page-will-lose-server-noteis shown, and there is no cancel.The ending (DC6 / DC6x / DC6u)
destroyed-at;server-released;name-freed;backup-recap;next-step-forget;open-operator-app;reload-warning.name-freedshows the time of that confirmation.name-freedsays it couldn't be confirmed from this page, and never shows a hopeful tick.server-releasedreads "release under way — IDSS finishes it".nothing-releasedandrefusal-reasonverbatim.try-againre-runs the act (→ DC5) without retyping the word within the same dialog;closereturns to DS.name-checkfrom the page's own availability call, in one of three variants: free / still reserved / couldn't ask.server-checksays it can't be confirmed from here,check-againrepeats the name check, andopen-operator-appis offered.The operator app (DCA1–DCA3)
destroyed-summary,name-freedandserver-released.server-releasedreads "Not confirmed" andfinish-releasingis the primary action.destroy-communityaction sits last, and pressing it opens DCA2.goes-name,gateway-fateandgoes-membersrender (from what the app knows), along withconfirm-word-prompt.no-backup-possiblesays a backup can't be taken from here.gateway-unreachablenames since when.confirm-destroyarms only on the word.why,what-stays-reserved,server-lapseandmatou-recovery, with nothing sent.closereturns to HOx.forget-communityandkeep-for-noware offered.forget-listnames the keys, the config replica, the This computer copies (sealed to those keys) and, for a home community only, the gateway on this computer.untouchedsays downloaded backup files are not touched.forgetcarries a warning that the name may stay reserved, andfinish-releasingstays the primary action on DCA1.The broker
leavewith a valid claim secret:{released | release_owed, name_freed, at}.47a. Given a missing or wrong secret, then the broker answers 401 or 403, and nothing changes.
47b. Given a zone-delete failure (after the rentals are settled), then the broker answers 502. The name is not freed and the host's record and claim secret remain, while the rentals stay released or owed. So a retry still authenticates and completes the leave. The name is always freed last for exactly this reason.
leaveis called with the secret that left, then it returns the recorded outcome and re-asks any owed teardown.POST /v1/subdomains/availablefrom any origin, then the broker answers the CORS preflight and the call.Implementation Decisions
Seams: three, each the highest available.
leaveroute, a tombstone in the issuer/rentals ledger, CORS onavailable.The dashboard and the app UIs are built against their clients through the existing fake-client patterns. No new seam is introduced beyond these.
Broker: one
leaveverb (under the gateways routes, authorised by the claim secret exactly asreleaseandoffboardare, ADR 0135). Order inside the act:The response carries
released/release_owed,name_freedandat.releaseandoffboardstay as they are;leavecomposes them. A host with no rental (a home or own-VPS gateway) leaves with just the name freed. The ledger schema change is additive (the tombstones set), following therelease_owedprecedent.Broker CORS: only
POST /v1/subdomains/availableanswers CORS preflight with a wildcard origin. The route is public, uncredentialed and writes nothing.brokerclient gains a
Leavecall returning the outcome shape, with the existing error mapping, so a refusal's words pass through verbatim (ADR 0100).Control plane: destroy preview (read, operator-only). It returns the facts DC1 renders:
It composes existing seams and adds no new store. When no claim secret is present, the preview says so, and the dialog shows a DC6x-style honest refusal before the word is ever typed.
Control plane: destroy act (operator-only). The body must name this community's host exactly; anything else is a 400. It calls
brokerclient.LeavewithIDSS_CLAIM_SECRETsynchronously and replies with the outcome before doing anything else. On success it writes a durable left marker, and from then on:The act is idempotent: a second call while one is in flight joins it, and after
leftit returns the recorded outcome. It is logged in the activity log.Dashboard: a destroy dialog owned by the frame's dialog state (the device-add precedent), opened from the Settings screen's new section. The terminal DC6 / DC6u screens replace the whole frame, like the unreachable screen (DDR 0096), and never route back into the panel.
The backup drives the existing per-dataset export endpoints in sequence and downloads each archive via the existing export-download route. The manifest is generated client-side from those results. The time-left figure is derived from bytes received over elapsed time.
The browser's availability call goes straight to the broker's public URL, which the control plane exposes to the SPA as config.
i18n: the destroy word is one catalogue key in the dashboard's (and app's) existing vue-i18n catalogues (en/es/nl/fr, #1377). The match normalises case, whitespace and diacritics (Unicode NFD with combining marks stripped).
Operator app:
brokerclient.Leave.Places:
goes-nameis absent, and the rented-release still happens if the gateway is rented.Testing Decisions
Test external behaviour at the seam, never internals. A good test drives the HTTP route, the client or the component the way its caller does, and asserts what the caller observes: the response, the ledger state through the public read, the rendered
data-field/data-action/data-statuscontract. It never asserts private call order.Broker (prior art: the rent/release shape tests, the offboard-frees-slug test, the release-owed and reaper tests).
leave:release_owedand the reaper finishes it;CORS: the preflight and response headers exist on
availableand nowhere else.brokerclient (prior art: its existing HTTP-fake tests): outcome parsing and verbatim refusal words.
Control API (prior art: the community-app and backups controlapi seam tests with fakes):
left, and answers 410 thereafter;left;Dashboard (prior art: the Settings, device-add dialog and backups overview vitest suites; the unreachable screen's tests). Each DC frame's contract fields render for its state:
Operator app (prior art: the operator-home and unreachable-home screen tests; the helper's founding-orchestrator tests with a fake broker):
Live proof (a drive ticket, not a unit): found a rented community on a throwaway name, destroy it from the panel, and assert:
Re-founding under the same name then succeeds. That is the #1751 regression, proven in the positive.
Out of Scope
afterAllteardowns switching toleave. It is worth doing, but separately.Further Notes
leaveverb and its tombstone;availableonly.goes-owned-devicesand the own-VPSdestroy-headlinevariant in the same commit that publishes this spec.slug-takenand the app card dead-ends at "Coa already holds a page for this name" #1805slug-takenand the app card dead-ends at "Coa already holds a page for this name" #1805slug-takenand the app card dead-ends at "Coa already holds a page for this name" #1805