backups: P7-S6 per-dataset export 500s live — WithPackager is never wired and no route serves the archive ref #1430

Closed
opened 2026-09-12 15:03:30 +00:00 by ben · 2 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>.

Symptom

The existing per-dataset export (BackupExportClient, dashboard/src/lib/backups.ts ~:615, openapi /backups/.../export ~:524-558, internal/controlapi/backups.go:162-168) cannot succeed on a live gateway:

  1. internal/backup/export.go:123 returns ErrNoPackager — WithPackager is only ever called in tests; whole_composition.go:410-413 wires policy / offsite / oplog and no packager. Every export 500s.
  2. Even if it packed, dashboard/src/lib/api/backupsClient.ts:145-150 fetches archive.ref against the origin and no route serves it — not in openapi, not in controlapi. A success would 404.

Governing: ADR 0079, ADR 0080, ADR 0104, DDR 0084 §4. Unit test dashboard/tests/unit/backupExport.test.ts passes against the fake only.

What to do

  • Wire a real packager in the whole composition (the ADR 0104 engine's archive writer), producing an archive on disk under the control plane's export dir with a TTL.
  • Add GET /backups/exports/{ref} (openapi + handler) that streams the archive with the right content type, 404 after expiry; the export response's ref is that path.
  • Extend backupExport.test.ts's live leg (or add one under tests/unit/*Live*) so the fetch of archive.ref is asserted against the real server, not the fake.

Acceptance criteria

  • Given a covered dataset, when Export is confirmed on P7-S6, then the browser receives the archive and the screen shows its size and checksum from the seam.
  • Given no packager (a resting composition), then the seam refuses with a named reason and the screen renders it (ADR 0100), never a 500.
  • Given an expired ref, then the route 404s with export_expired.
## 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>`. ## Symptom The existing per-dataset export (`BackupExportClient`, `dashboard/src/lib/backups.ts` ~:615, openapi `/backups/.../export` ~:524-558, `internal/controlapi/backups.go:162-168`) cannot succeed on a live gateway: 1. `internal/backup/export.go:123` returns `ErrNoPackager` — `WithPackager` is only ever called in tests; `whole_composition.go:410-413` wires policy / offsite / oplog and no packager. Every export 500s. 2. Even if it packed, `dashboard/src/lib/api/backupsClient.ts:145-150` fetches `archive.ref` against the origin and **no route serves it** — not in openapi, not in controlapi. A success would 404. Governing: ADR 0079, ADR 0080, ADR 0104, DDR 0084 §4. Unit test `dashboard/tests/unit/backupExport.test.ts` passes against the fake only. ## What to do - Wire a real packager in the whole composition (the ADR 0104 engine's archive writer), producing an archive on disk under the control plane's export dir with a TTL. - Add `GET /backups/exports/{ref}` (openapi + handler) that streams the archive with the right content type, 404 after expiry; the export response's `ref` is that path. - Extend `backupExport.test.ts`'s live leg (or add one under `tests/unit/*Live*`) so the fetch of `archive.ref` is asserted against the real server, not the fake. ## Acceptance criteria - [ ] Given a covered dataset, when Export is confirmed on P7-S6, then the browser receives the archive and the screen shows its size and checksum from the seam. - [ ] Given no packager (a resting composition), then the seam refuses with a named reason and the screen renders it (ADR 0100), never a 500. - [ ] Given an expired ref, then the route 404s with `export_expired`.

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

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

close-report for #1430 — status success

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

envelope
{
  "issue": 1430,
  "status": "success",
  "commits": [
    "35ce2e115e6ae232946a238f351eea0573a37264"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/backup_wiring.go",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "dashboard/src/components/backups/BackupExportScreen.vue",
    "dashboard/src/lib/api/generated.ts",
    "dashboard/src/lib/backups.ts",
    "dashboard/tests/unit/backupExport.test.ts",
    "dashboard/tests/unit/backupsGuard304.test.ts",
    "dashboard/tests/unit/backupsLive.test.ts",
    "internal/backup/export.go",
    "internal/backup/export_test.go",
    "internal/backupexport/store.go",
    "internal/backupexport/store_test.go",
    "internal/controlapi/backups.go",
    "internal/controlapi/backups_integration_test.go",
    "internal/controlapi/handler.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "go test ./internal/backupexport/ ./internal/backup/ ./internal/controlapi/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./internal/backupexport/ ./internal/controlapi/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/backupexport/... ./internal/controlapi/...",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/unit/backupExport.test.ts tests/unit/backupsLive.test.ts tests/unit/backupsGuard304.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc --noEmit -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "node scripts/generate-client.mjs --check",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a covered dataset, when Export is confirmed on P7-S6, then the browser receives the archive and the screen shows its size and checksum from the seam": "Real packager wired (internal/backupexport.Store as backup.WithPackager in whole_composition.go); added checksum to the seam's Archive (internal/backup/export.go) + openapi ExportArchive + generated.ts + TS ExportArchive; BackupExportScreen.vue paints the export-archive summary (name/size/checksum). Proven by internal/controlapi TestBackupsHandler_ExportPackagesAndServesArchiveThenExpires (export over HTTP -> ref serves the archive off the real route with the seam's size) and dashboard backupExport.test.ts (export-size + export-checksum rendered).",
    "Given no packager (a resting composition), then the seam refuses with a named reason and the screen renders it (ADR 0100), never a 500": "The resting composition wires no packager, so Export returns ErrNoPackager, which writeActErr maps to a 400 act_failed carrying the operator-facing sentence (never a 500) — the OcErrorState renders it. Proven by internal/backup TestExport_RefusesWithNoPackager (named refusal, no snapshot taken, nothing logged).",
    "Given an expired ref, then the route 404s with export_expired": "GET /api/v1/backups/exports/{ref} (registerBackupExports / controlapi.WithBackupExports) 404s export_expired past the TTL or for an unminted ref. Proven by internal/backupexport TestStore_ExpiredRefIsNotServed and internal/controlapi TestBackupsHandler_ExportPackagesAndServesArchiveThenExpires (advances the clock past the TTL -> GET returns 404 with Problem code export_expired)."
  },
  "summary": "Wire a real on-disk packager and a GET /backups/exports/{ref} route so the P7-S6 per-dataset export succeeds live, with size + checksum on the screen and an export_expired TTL.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1430 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1430, "status": "success", "commits": [ "35ce2e115e6ae232946a238f351eea0573a37264" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/backup_wiring.go", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/whole_composition.go", "dashboard/src/components/backups/BackupExportScreen.vue", "dashboard/src/lib/api/generated.ts", "dashboard/src/lib/backups.ts", "dashboard/tests/unit/backupExport.test.ts", "dashboard/tests/unit/backupsGuard304.test.ts", "dashboard/tests/unit/backupsLive.test.ts", "internal/backup/export.go", "internal/backup/export_test.go", "internal/backupexport/store.go", "internal/backupexport/store_test.go", "internal/controlapi/backups.go", "internal/controlapi/backups_integration_test.go", "internal/controlapi/handler.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "go test ./internal/backupexport/ ./internal/backup/ ./internal/controlapi/ ./control-plane/...", "exit_code": 0 }, { "command": "go build ./... && go vet ./internal/backupexport/ ./internal/controlapi/ ./control-plane/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/backupexport/... ./internal/controlapi/...", "exit_code": 0 }, { "command": "npx vitest run tests/unit/backupExport.test.ts tests/unit/backupsLive.test.ts tests/unit/backupsGuard304.test.ts", "exit_code": 0 }, { "command": "npx vue-tsc --noEmit -p tsconfig.json", "exit_code": 0 }, { "command": "node scripts/generate-client.mjs --check", "exit_code": 0 } ], "criteria": { "Given a covered dataset, when Export is confirmed on P7-S6, then the browser receives the archive and the screen shows its size and checksum from the seam": "Real packager wired (internal/backupexport.Store as backup.WithPackager in whole_composition.go); added checksum to the seam's Archive (internal/backup/export.go) + openapi ExportArchive + generated.ts + TS ExportArchive; BackupExportScreen.vue paints the export-archive summary (name/size/checksum). Proven by internal/controlapi TestBackupsHandler_ExportPackagesAndServesArchiveThenExpires (export over HTTP -> ref serves the archive off the real route with the seam's size) and dashboard backupExport.test.ts (export-size + export-checksum rendered).", "Given no packager (a resting composition), then the seam refuses with a named reason and the screen renders it (ADR 0100), never a 500": "The resting composition wires no packager, so Export returns ErrNoPackager, which writeActErr maps to a 400 act_failed carrying the operator-facing sentence (never a 500) — the OcErrorState renders it. Proven by internal/backup TestExport_RefusesWithNoPackager (named refusal, no snapshot taken, nothing logged).", "Given an expired ref, then the route 404s with export_expired": "GET /api/v1/backups/exports/{ref} (registerBackupExports / controlapi.WithBackupExports) 404s export_expired past the TTL or for an unminted ref. Proven by internal/backupexport TestStore_ExpiredRefIsNotServed and internal/controlapi TestBackupsHandler_ExportPackagesAndServesArchiveThenExpires (advances the clock past the TTL -> GET returns 404 with Problem code export_expired)." }, "summary": "Wire a real on-disk packager and a GET /backups/exports/{ref} route so the P7-S6 per-dataset export succeeds live, with size + checksum on the screen and an export_expired TTL.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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.

Dependencies

No dependencies set.

Reference
Matou/idss#1430
No description provided.