member backups: spec rev 5, download job (§2b) and UX-pass layout (#898)
Paul asked for a console download as a background job with a preparing state and a zip, and a UX pass on the section. D8 and D9 recorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+56
−6
docs/superpowers/specs/2026-11-11-member-backups-design.md+53 −3go.mod+3 −3
CI cancelled — superseded by a newer push — run details
diff --git a/docs/superpowers/specs/2026-11-11-member-backups-design.md b/docs/superpowers/specs/2026-11-11-member-backups-design.md| index b66bf714c..f8a0d4838 100644 |
| --- a/docs/superpowers/specs/2026-11-11-member-backups-design.md |
| +++ b/docs/superpowers/specs/2026-11-11-member-backups-design.md |
| @@ -1,6 +1,6 @@ |
| # Backups owners can see and check |
| -Status: rev 4.1, 2026-11-11 (D7 recorded). Astra round 3 READY AFTER FIXES; its one fix (§9's backstop GETs) applied in rev 3.1. Fable 5.2's guidance (PROCEED WITH CHANGES, `FABLE-GUIDANCE-member-backups.md`) applied in rev 4, marked **(F-N)** (§17). Rev 4 changes product text and slicing, not the reviewed mechanisms. Paul's rulings D1-D5 (§11). Astra round 1 |
| +Status: rev 5, 2026-11-11 (D8 download job §2b, D9 UX pass and §2 layout; §2b awaits one Astra round). Rev 4.1: D7 recorded. Astra round 3 READY AFTER FIXES; its one fix (§9's backstop GETs) applied in rev 3.1. Fable 5.2's guidance (PROCEED WITH CHANGES, `FABLE-GUIDANCE-member-backups.md`) applied in rev 4, marked **(F-N)** (§17). Rev 4 changes product text and slicing, not the reviewed mechanisms. Paul's rulings D1-D5 (§11). Astra round 1 |
| (`docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-member-backups.md`) |
| was NOT READY with 3 P1s and 11 P2s; all 14 accepted (§14). Round 2 |
| (`CODEX-FINDINGS-member-backups-R2.md`) was NOT READY with one new P1, two |
| @@ -94,8 +94,8 @@ later loses data. |
| ## Non-goals |
| - Restoring a live instance in place (#894). |
| -- A browser download of a restored database. The console never holds one |
| - (`apidb.go:1-5`). The panel shows the CLI command instead. |
| +- (Rev 5: a browser download is now in scope, §2b, without the console |
| + ever holding a restored database.) |
| - The operator-side durability work itself (inventories, offsite copier, |
| restore-box). This design builds only the drill-verdict piece (§3), |
| because the panel needs it first. |
| @@ -208,6 +208,51 @@ restore point) is covered. `db query` and `db pull` gates are unchanged. |
| - **Get a copy:** the tab shows `carlos db pull --app shop --instance |
| <host>` ready to copy, plus an `--at` example inside the history. |
| - One line per field, each with its time. Draft copy in §8. |
| +- **Layout (rev 5, Paul's UX pass, 2026-11-11):** a section head |
| + "Backups" with **Download a copy** as its one primary action (slice 1b); |
| + three stat tiles (last change saved, go back as far as, restore test); |
| + a two-row "What we keep" table (Database, Files on disk) with a chip |
| + each (Copied, Not copied, Not shown here); one short line under the |
| + table only when a row needs a reason; the CLI commands inside a "Use |
| + the command line" disclosure. Every instance shows the same shape, so |
| + a gap is visible at a glance. Mockup: |
| + `mb-copy/copy-review/preview/index.html` on branch member-backups-1 |
| + (untracked review folder); approved copy replaces §8's drafts. |
| + |
| +### 2b. Download a copy (slice 1b; Paul, 2026-11-11) |
| + |
| +Paul: "Is there a case for offering a download via the web console? This |
| +would be via a background job that would have a 'preparing' state and I |
| +guess sent a zip file?" Yes: the CLI command only helps people with a |
| +terminal, and holding the file is the strongest proof the copy exists. |
| + |
| +- **Start.** Download a copy (POST, CSRF) creates a job for the instance. |
| + One job per instance at a time; admitted for the same people as |
| + `db pull` (any account member); every plan (D1). |
| +- **Build.** A box in the instance's region runs the job with the |
| + `dbreads` restore path: the identity bracket (§3), a pinned plan, the |
| + sandboxed restore worker, `integrity_check`, its size caps. It zips |
| + `db.sqlite3` and `manifest.json` (TXID, header time, SHA-256, platform |
| + version, `"files": "not_included"`). |
| +- **Hold.** The zip goes to the region's data bucket under |
| + `downloads/<job-id>.zip` (random id), deleted after 24 hours by bucket |
| + lifecycle. That bucket already holds this instance's replica, so no |
| + data leaves its trust zone. The console never holds the file. |
| +- **Fetch.** When ready, the button becomes "Download <file> (<size>)". |
| + Pressing it asks the console for a presigned GET valid for 15 minutes, |
| + issued only to a signed-in member at that moment, audited as |
| + `db-download`. The link is never emailed; the "ready" email links to |
| + the console page. Presigned GETs work on any S3-compatible store. |
| +- **States:** none, preparing (button disabled; "usually a minute or |
| + two"), ready (until the zip expires), failed (one line saying why, with |
| + the button back). Shown in the section head. |
| +- **Refused up front:** fleet-placed and pooled instances (as `db pull`), |
| + instances whose class has no copy, and a job over the size cap |
| + ("Too large to download here", pointing at the CLI). Another region's |
| + instance runs the job in its own region, as `db pull` forwarding does. |
| +- **Shares with 3b.** The nightly export is the same job with the |
| + owner's bucket as its destination; the two are built on one runner. |
| +- **Review.** This section gets one Astra round before its plan. |
| ### 3. Restore tests published per box (durability §5.2's tenant half) |
| @@ -425,6 +470,7 @@ Not in this design's slices. |
| | Slice | What | Needs | Size | |
| |---|---|---|---| |
| | 1 | §1 door (with #893), §2 tab and CLI, the "get a copy" command; the test line reads "not shown yet" | nothing | small | |
| +| 1b | §2b download job (preparing, ready, zip, 24-hour hold, presigned fetch) | slice 1, one Astra round on §2b | medium | |
| | 2a | §3 per-box records, the identity bracket, arming, the coverage target, operator alerts. Fixes today's fault where boxes erase each other's verdicts (F-4) | nothing | small-medium | |
| | 2b | §3 `copy_since` and the console reader, the test line, §4 operator view | 2a | medium | |
| | 3a | a narrow pull credential (§5a; D7) | nothing | small | |
| @@ -521,6 +567,10 @@ nothing in this design. |
| - **D7.** Yes: the narrow pull credential (§5a) ships as slice 3a, before |
| the managed export. It is new authority over database contents, so its |
| plan gets Fable as a second reviewer beside Astra. |
| +- **D8.** A console download of a copy, as a background job with a |
| + preparing state and a zip (§2b, slice 1b). Paul asked for it, 2026-11-11. |
| +- **D9.** Every UI change gets a UX pass before copy review (AGENTS.md, |
| + Paul 2026-11-11); §2's layout is the result for this section. |
| ## 12. Test plan (for the builder) |
diff --git a/go.mod b/go.mod| index a93f38095..27e639da1 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -35,7 +35,6 @@ require ( |
| require ( |
| github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.14 // indirect |
| - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect |
| github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18 // indirect |
| github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.40 // indirect |
| github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.40 // indirect |
| @@ -76,9 +75,7 @@ require ( |
| github.com/ulikunitz/xz v0.5.10 // indirect |
| github.com/wasilibs/go-re2 v1.3.0 // indirect |
| github.com/wlynxg/anet v0.0.5 // indirect |
| - golang.org/x/mod v0.41.0 // indirect |
| golang.org/x/sync v0.24.0 // indirect |
| - golang.org/x/text v0.43.0 // indirect |
| google.golang.org/protobuf v1.36.10 // indirect |
| modernc.org/libc v1.74.1 // indirect |
| modernc.org/mathutil v1.7.1 // indirect |
| @@ -88,9 +85,12 @@ require ( |
| require ( |
| amadan.net/carlos/platform.git/launchctx v0.0.0 |
| github.com/KarpelesLab/squashfs v1.2.0 |
| + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 |
| github.com/aws/aws-sdk-go-v2/service/sns v1.43.0 |
| github.com/klauspost/compress v1.20.2 |
| github.com/oschwald/maxminddb-golang v1.13.1 |
| + golang.org/x/mod v0.41.0 |
| + golang.org/x/text v0.43.0 |
| golang.org/x/tools v0.51.0 |
| ) |