backups: the two Take-a-copy exports have no packer — stack-config + community-data endpoints, and stackExport wired in production #1429

Closed
opened 2026-09-12 15:03:23 +00:00 by ben · 3 comments
Owner

Parent

Control-panel UI pass (Ben, 2026-09-10 → 09-12, commit 078cd5b3 on founding-ui-two-colour-rail-ceremony, merged to main 2026-09-12). Filed from the end-of-pass review (#1399 sweep): every place the shipped UI shows or implies something the product does not do yet. Browser harness: cd dashboard && pnpm harness → http://localhost:5198/panel.html?scenario=steady&tab=<tab>.

What the UI shows

Ben's 2026-09-12 ruling: the Backups tab carries Download stack config and Download community data, each opening a dialog (dashboard/src/components/backups/DownloadBundleDialog.vue) that lists what the bundle holds, then Download / Cancel. Contract: dashboard/src/lib/stackExport.ts — StackExportClient { manifest(kind), pack(kind) } for 'stack-config' and 'community-data'; the dialog paints ONLY what the manifest says, so it cannot promise what the packer will not pack.

What exists

  • Production wires nothing: productionDashboardDeps (dashboard/src/lib/mountRegistry.ts) omits stackExport, so the whole "Take a copy with you" block does not render live (BackupsOverviewScreen.vue v-if="stackExport").
  • The only packer is dashboard/tests/fakes/stackExport.ts — it emits a JSON index of fixture facts (its own note admits it is the index of the archive a real packer would ship).
  • No openapi path, no Go handler, no ADR. Every read a packer needs already exists on the Go side: clan/configrepo.go (clan config), fleetstate/projection.go (devices), provision/assess.go + the catalogue (service selection), brandkit/kit.go, controlapi/settings.go:224 (community settings), the backup policy store, internal/member. Community data would ride the backup engine's packager (ADR 0104) plus /logs/download/{scope}.
  • Distinct from the per-dataset P7-S6 export (its own ticket: WithPackager unwired).

Why human — one-way door

The stack-config bundle is "everything needed to rebuild/redeploy the stack" (Ben's words). Taken literally that includes clan secrets and vars (mesh keys, IdP admin, DB passwords). A downloadable file holding those is a security-posture decision.

Proposed default ruling: the stack-config bundle carries clan config, the device ledger (name/kind/location/roles), the service selection and placement, the brand kit, community settings, the backup policy and the member/komiti roster — and no secrets: secrets are referenced by name and restorable from the recovery kit (DDR 0101) so the two artifacts together rebuild the stack and neither alone leaks it. community-data streams a tar (files, service DB dumps, logs) through the ADR 0104 packager with the same encryption the offsite copies use. Format version stamped; a rebuild.md inside explains the order of steps.

What to do (after the ruling)

  1. ADR recording the two bundle shapes.
  2. Go: GET /export/{kind}/manifest and POST /export/{kind} (or a streamed GET) in openapi + controlapi; the manifest is computed from the same reads the pack uses.
  3. Dashboard: HttpStackExportClient in dashboard/src/lib/api/, wired in productionDashboardDeps; pack() returns an href the browser can fetch (large archives never buffered in JS).

Acceptance criteria

  • Given a founded community, when Download stack config is confirmed, then the browser receives an archive whose contents match the manifest the dialog showed, part for part.
  • Given the ruling above, then the archive contains no secret material; the manifest names the recovery kit as the other half.
  • Given a resting or faulted packer, then the dialog shows the manifest-failed / download-failed state (already built), never a silent empty file.
## Parent Control-panel UI pass (Ben, 2026-09-10 → 09-12, commit `078cd5b3` on `founding-ui-two-colour-rail-ceremony`, merged to main 2026-09-12). Filed from the end-of-pass review (#1399 sweep): every place the shipped UI shows or implies something the product does not do yet. Browser harness: `cd dashboard && pnpm harness` → `http://localhost:5198/panel.html?scenario=steady&tab=<tab>`. ## What the UI shows Ben's 2026-09-12 ruling: the Backups tab carries **Download stack config** and **Download community data**, each opening a dialog (`dashboard/src/components/backups/DownloadBundleDialog.vue`) that lists what the bundle holds, then Download / Cancel. Contract: `dashboard/src/lib/stackExport.ts` — `StackExportClient { manifest(kind), pack(kind) }` for `'stack-config'` and `'community-data'`; the dialog paints ONLY what the manifest says, so it cannot promise what the packer will not pack. ## What exists - Production wires nothing: `productionDashboardDeps` (`dashboard/src/lib/mountRegistry.ts`) omits `stackExport`, so the whole "Take a copy with you" block does not render live (`BackupsOverviewScreen.vue` `v-if="stackExport"`). - The only packer is `dashboard/tests/fakes/stackExport.ts` — it emits a JSON *index* of fixture facts (its own note admits it is the index of the archive a real packer would ship). - No openapi path, no Go handler, no ADR. Every read a packer needs already exists on the Go side: `clan/configrepo.go` (clan config), `fleetstate/projection.go` (devices), `provision/assess.go` + the catalogue (service selection), `brandkit/kit.go`, `controlapi/settings.go:224` (community settings), the backup policy store, `internal/member`. Community data would ride the backup engine's packager (ADR 0104) plus `/logs/download/{scope}`. - Distinct from the per-dataset P7-S6 export (its own ticket: `WithPackager` unwired). ## Why human — one-way door The stack-config bundle is "everything needed to rebuild/redeploy the stack" (Ben's words). Taken literally that includes clan **secrets and vars** (mesh keys, IdP admin, DB passwords). A downloadable file holding those is a security-posture decision. **Proposed default ruling:** the stack-config bundle carries clan config, the device ledger (name/kind/location/roles), the service selection and placement, the brand kit, community settings, the backup policy and the member/komiti roster — and **no secrets**: secrets are referenced by name and restorable from the recovery kit (DDR 0101) so the two artifacts together rebuild the stack and neither alone leaks it. `community-data` streams a tar (files, service DB dumps, logs) through the ADR 0104 packager with the same encryption the offsite copies use. Format version stamped; a `rebuild.md` inside explains the order of steps. ## What to do (after the ruling) 1. ADR recording the two bundle shapes. 2. Go: `GET /export/{kind}/manifest` and `POST /export/{kind}` (or a streamed GET) in openapi + `controlapi`; the manifest is computed from the same reads the pack uses. 3. Dashboard: `HttpStackExportClient` in `dashboard/src/lib/api/`, wired in `productionDashboardDeps`; `pack()` returns an `href` the browser can fetch (large archives never buffered in JS). ## Acceptance criteria - [ ] Given a founded community, when Download stack config is confirmed, then the browser receives an archive whose contents match the manifest the dialog showed, part for part. - [ ] Given the ruling above, then the archive contains no secret material; the manifest names the recovery kit as the other half. - [ ] Given a resting or faulted packer, then the dialog shows the manifest-failed / download-failed state (already built), never a silent empty file.
Author
Owner

Ruled 2026-09-12 — KEEP, rescoped to the no-secrets default (Ben deferred the call to the session: "the purpose was something the operator could use to rebuild the stack if ever needed, but since the recovery kit is being worked on this can be discarded unless you think it's worth keeping both"). Ruled by agent under ADR 0174 — veto anytime.

Worth keeping both, because they answer different questions:

  • the recovery kit (#1428, DDR 0101) is the crown jewels — keys, shares, identity — the thing that lets a community be itself again on new hardware;
  • the stack-config bundle is the readable record of what the stack is — devices, placement, services, brand, settings, policy, roster — with NO secrets: a hand-over to the next operator, an audit trail, a redeploy of the same layout, and the rebuild.md that says which order to do it in and where the kit fits;
  • the community-data bundle is data portability — files, service DB dumps, logs — which offsite backups do not give an operator, because those copies are encrypted against the stack.

So: the proposed default in the body stands (no secrets in stack-config; community-data through the ADR 0104 packager with offsite-grade encryption; format version + rebuild.md). Depends on #1428 only for the sentence in rebuild.md that names the kit. Relabelled ready-for-session: step 1 is an ADR recording the two bundle shapes (design-tier, a session), steps 2–3 (Go endpoints + HttpStackExportClient wired in productionDashboardDeps) can then go ready-for-agent.

**Ruled 2026-09-12 — KEEP, rescoped to the no-secrets default (Ben deferred the call to the session: "the purpose was something the operator could use to rebuild the stack if ever needed, but since the recovery kit is being worked on this can be discarded unless you think it's worth keeping both"). Ruled by agent under ADR 0174 — veto anytime.** Worth keeping both, because they answer different questions: - the **recovery kit** (#1428, DDR 0101) is the crown jewels — keys, shares, identity — the thing that lets a community *be itself again* on new hardware; - the **stack-config bundle** is the readable record of *what the stack is* — devices, placement, services, brand, settings, policy, roster — with NO secrets: a hand-over to the next operator, an audit trail, a redeploy of the same layout, and the `rebuild.md` that says which order to do it in and where the kit fits; - the **community-data bundle** is data portability — files, service DB dumps, logs — which offsite backups do not give an operator, because those copies are encrypted against the stack. So: the proposed default in the body stands (no secrets in `stack-config`; `community-data` through the ADR 0104 packager with offsite-grade encryption; format version + `rebuild.md`). Depends on #1428 only for the sentence in `rebuild.md` that names the kit. Relabelled `ready-for-session`: step 1 is an ADR recording the two bundle shapes (design-tier, a session), steps 2–3 (Go endpoints + `HttpStackExportClient` wired in `productionDashboardDeps`) can then go `ready-for-agent`.

Session ruling (ADR 0174 — veto anytime). Adopting the no-secrets default Ben confirmed above and beginning the two-way-door work. Scope, split by what is revertible + provable in one session:

  1. ADR recording the two bundle shapes (no-secrets stack-config; sealed community-data).
  2. stack-config — full, live, proven. A real packer assembles the blueprint (clan definition, device ledger, service selection + placement, brand kit, community details, backup policy, member/komiti roster) into a portable tar with a rebuild.md and a stamped formatVersion, carrying no secret material — secrets are referenced by name and restored from the recovery kit (#1428, DDR 0101), named in rebuild.md as the other half. GET /export/{kind}/manifest + POST /export/{kind} + a streamed download route, modelled on the #1430 mint-token/serve-by-TTL packager. HttpStackExportClient wired in productionDashboardDeps. This satisfies AC1 + AC2.
  3. community-data — honest fail-loud, not a fabricated success. The ruling requires it sealed with offsite-grade encryption (ADR 0104's age-sealed artifacts + service DB dumps + /logs/download). Shipping it unsealed would put member content in plaintext in a browser download — a security-posture decision I will not make unilaterally (one-way door). Wiring the full sealed multi-dataset packer end-to-end is a larger slice than one session can prove. So community-data's pack refuses with a clear named reason (the same fail-loud discipline #1430's resting composition uses for ErrNoPackager), which drives the dialog's download-failed state honestly (AC3 — "a resting or faulted packer … never a silent empty file"). A follow-up issue will carry the sealed packer.

Proof: red-green Go seam + controlapi integration test (pack over HTTP → ref serves the tar off the real route → expires), dashboard seam + live-fetch tests; go build/vet/test, dashboard vitest/vue-tsc, openapi check:client. All revertible (a new on-disk packager + additive routes/field), no product loss on revert.

**Session ruling (ADR 0174 — veto anytime).** Adopting the no-secrets default Ben confirmed above and beginning the two-way-door work. Scope, split by what is revertible + provable in one session: 1. **ADR** recording the two bundle shapes (no-secrets `stack-config`; sealed `community-data`). 2. **`stack-config` — full, live, proven.** A real packer assembles the blueprint (clan definition, device ledger, service selection + placement, brand kit, community details, backup policy, member/komiti roster) into a portable tar with a `rebuild.md` and a stamped `formatVersion`, **carrying no secret material** — secrets are referenced by name and restored from the recovery kit (#1428, DDR 0101), named in `rebuild.md` as the other half. `GET /export/{kind}/manifest` + `POST /export/{kind}` + a streamed download route, modelled on the #1430 mint-token/serve-by-TTL packager. `HttpStackExportClient` wired in `productionDashboardDeps`. This satisfies AC1 + AC2. 3. **`community-data` — honest fail-loud, not a fabricated success.** The ruling requires it sealed with offsite-grade encryption (ADR 0104's age-sealed artifacts + service DB dumps + `/logs/download`). Shipping it **unsealed** would put member content in plaintext in a browser download — a security-posture decision I will not make unilaterally (one-way door). Wiring the full sealed multi-dataset packer end-to-end is a larger slice than one session can prove. So `community-data`'s pack **refuses with a clear named reason** (the same fail-loud discipline #1430's resting composition uses for `ErrNoPackager`), which drives the dialog's download-failed state honestly (AC3 — "a resting or faulted packer … never a silent empty file"). A follow-up issue will carry the sealed packer. Proof: red-green Go seam + controlapi integration test (pack over HTTP → ref serves the tar off the real route → expires), dashboard seam + live-fetch tests; `go build/vet/test`, dashboard `vitest`/`vue-tsc`, openapi `check:client`. All revertible (a new on-disk packager + additive routes/field), no product loss on revert.

Close report — landed (ADR 0174, veto anytime)

Commits: f291b54 (the feature) + 713f5cc (an incidental gate fix — see below). Both on main.

What landed

ADR 0242 records the two bundle shapes.

stack-config — the BLUEPRINT, live and proven (AC1 + AC2):

  • internal/stackexport.Store — a domain-free packager (injected read-funcs → plain fact DTOs) assembling the clan definition, device ledger, service selection + placement, brand kit, community details, backup policy and member/komiti roster into a portable .tar (stack-config.json, formatVersion stamped, a curated projection — never a raw inventory dump; + rebuild.md), served by an opaque handle under a 1h TTL (the #1430 mint-token/serve pattern).
  • No secret material (AC2): mesh keys / IdP admin / DB passwords are referenced by name and restored from the recovery kit (#1428, DDR 0101); the manifest caution and rebuild.md name the kit as the other half. A Go test fails on key-material markers in the archive.
  • Routes: GET /export/{kind}/manifest, POST /export/{kind}, GET /exports/{ref} (openapi + controlapi.WithStackExports/registerStackExports).
  • Dashboard: HttpStackExportClient (dashboard/src/lib/api/stackExportClient.ts) wired REAL in productionDashboardDeps.backups.stackExport; pack() returns an href off /exports/{ref} the browser fetches (large archives never buffered in JS). The "Take a copy with you" block now renders live.

community-data — honest fail-loud (AC3): its sealed multi-dataset packer (ADR 0104 age-sealed artifacts + service-DB dumps + a log archive) does not exist yet — the backup engine packages one locally-readable snapshot at a time today and there is no log-archive primitive. So it 501s with a named reason (ErrCommunityDataUnavailable), which the dialog reads out as its download-failed state — never a fabricated archive and never unsealed member content in a browser download (ADR 0100; the same discipline #1430's resting composition uses for ErrNoPackager). Follow-up filed: #1457.

Proof (red→green)

  • Go seam internal/stackexport — manifest counts + names the recovery kit; archive matches the manifest and carries no secrets; community-data refuses; TTL expiry.
  • controlapi integration internal/controlapi/stackexport_test.go — manifest → pack → the ref serves the tar off the REAL route (application/x-tar attachment); community-data 501; unknown kind/ref 404.
  • dashboard dashboard/tests/unit/stackExportLive.test.ts — manifest over real HTTP; browser-fetchable href off /exports/{ref}; community-data refusal surfaces the packer's sentence; production wiring is the real client.
  • go build ./..., go vet, go test ./internal/stackexport/ ./internal/controlapi/ ./control-plane/... green; dashboard vue-tsc + full vitest (129 files / 1635 tests) green; openapi check:client in sync.

Incidental gate fix (713f5cc)

The pre-push TS lint gate (#1252) blocked on ~2,341 eslint errors — all in result-payload/ (the closure-build payload's minified dashboard/assets/*.js), a gitignored build artifact eslint's flat config didn't ignore. Added **/result-payload/** to the ignore list — the same documented class/cause as dist-electron / dist-keriweb / dist-package already listed there (#871, #1352). Not #1429's feature, but it stood between the work and main.

Scope note

The two acceptance criteria that require a working download (AC1, AC2) are met by stack-config; AC3 (a resting/faulted packer shows the failed state, never a silent empty file) is met by community-data's honest 501. The sealed community-data packer is #1457.

Ruled by agent under ADR 0174 — veto anytime (two-way door: a revertible on-disk packager + additive routes + a nil-at-rest seam; no product loss on revert).

## Close report — landed (ADR 0174, veto anytime) **Commits:** `f291b54` (the feature) + `713f5cc` (an incidental gate fix — see below). Both on `main`. ### What landed **ADR 0242** records the two bundle shapes. **`stack-config` — the BLUEPRINT, live and proven (AC1 + AC2):** - `internal/stackexport.Store` — a domain-free packager (injected read-funcs → plain fact DTOs) assembling the clan definition, device ledger, service selection + placement, brand kit, community details, backup policy and member/komiti roster into a portable `.tar` (`stack-config.json`, `formatVersion` stamped, a curated projection — never a raw inventory dump; + `rebuild.md`), served by an opaque handle under a 1h TTL (the #1430 mint-token/serve pattern). - **No secret material** (AC2): mesh keys / IdP admin / DB passwords are referenced by name and restored from the recovery kit (#1428, DDR 0101); the manifest `caution` and `rebuild.md` name the kit as the other half. A Go test fails on key-material markers in the archive. - Routes: `GET /export/{kind}/manifest`, `POST /export/{kind}`, `GET /exports/{ref}` (openapi + `controlapi.WithStackExports`/`registerStackExports`). - Dashboard: `HttpStackExportClient` (`dashboard/src/lib/api/stackExportClient.ts`) wired REAL in `productionDashboardDeps.backups.stackExport`; `pack()` returns an `href` off `/exports/{ref}` the browser fetches (large archives never buffered in JS). The "Take a copy with you" block now renders live. **`community-data` — honest fail-loud (AC3):** its sealed multi-dataset packer (ADR 0104 age-sealed artifacts + service-DB dumps + a log archive) does not exist yet — the backup engine packages one locally-readable snapshot at a time today and there is no log-archive primitive. So it **501s with a named reason** (`ErrCommunityDataUnavailable`), which the dialog reads out as its download-failed state — never a fabricated archive and never unsealed member content in a browser download (ADR 0100; the same discipline #1430's resting composition uses for `ErrNoPackager`). Follow-up filed: **#1457**. ### Proof (red→green) - Go seam `internal/stackexport` — manifest counts + names the recovery kit; archive matches the manifest and carries no secrets; community-data refuses; TTL expiry. - controlapi integration `internal/controlapi/stackexport_test.go` — manifest → pack → the ref serves the tar off the REAL route (`application/x-tar` attachment); community-data 501; unknown kind/ref 404. - dashboard `dashboard/tests/unit/stackExportLive.test.ts` — manifest over real HTTP; browser-fetchable href off `/exports/{ref}`; community-data refusal surfaces the packer's sentence; production wiring is the real client. - `go build ./...`, `go vet`, `go test ./internal/stackexport/ ./internal/controlapi/ ./control-plane/...` green; dashboard `vue-tsc` + full `vitest` (129 files / 1635 tests) green; openapi `check:client` in sync. ### Incidental gate fix (`713f5cc`) The pre-push TS lint gate (#1252) blocked on ~2,341 eslint errors — all in `result-payload/` (the closure-build payload's minified `dashboard/assets/*.js`), a gitignored build artifact eslint's flat config didn't ignore. Added `**/result-payload/**` to the ignore list — the same documented class/cause as `dist-electron` / `dist-keriweb` / `dist-package` already listed there (#871, #1352). Not #1429's feature, but it stood between the work and `main`. ### Scope note The two acceptance criteria that require a working download (AC1, AC2) are met by `stack-config`; AC3 (a resting/faulted packer shows the failed state, never a silent empty file) is met by `community-data`'s honest 501. The sealed `community-data` packer is #1457. Ruled by agent under ADR 0174 — veto anytime (two-way door: a revertible on-disk packager + additive routes + a nil-at-rest seam; no product loss on revert).
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.

Dependencies

No dependencies set.

Reference
Matou/idss#1429
No description provided.