carlos / platform Public

member backups: rev 4 with Fable 5.2 guidance (#898)

Says "no copy" where that is known, words the copy time as the last
change saved, splits slice 2, adds a 7-day drill coverage target, an
owner-side export verify, a staleness email, a provider probe before
the export, and proposes a narrow pull credential (ruling D7).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 00d214f96573c6a34f14504fdd2e3565c16ba5e2 parent b115053
2 files changed, +141 −23
  • docs/superpowers/notes/reviews/member-backups/FABLE-GUIDANCE-member-backups.md +38 −0
  • docs/superpowers/specs/2026-11-11-member-backups-design.md +103 −23

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/reviews/member-backups/FABLE-GUIDANCE-member-backups.md b/docs/superpowers/notes/reviews/member-backups/FABLE-GUIDANCE-member-backups.md
index e69de29bb..354c1087b 100644
--- a/docs/superpowers/notes/reviews/member-backups/FABLE-GUIDANCE-member-backups.md
+++ b/docs/superpowers/notes/reviews/member-backups/FABLE-GUIDANCE-member-backups.md
@@ -0,0 +1,38 @@
+**PROCEED WITH CHANGES**
+
+1. **Fix the two lines that say "not shown" where we know the answer is "no copy".** This is the main trust risk.
+ - The draft line for instances that don't sleep says "Its database is copied a different way". The code's own sentence says the platform "does not keep a copy of its database" (`internal/dbreads/class.go:20-21`), and durability §4.4 says such an instance "has no backup" on UK, US and AU. Say "We don't keep a copy of this database yet" unless a record proves otherwise.
+ - "Files aren't shown here yet" reads as "copied, not displayed". Files are published only for born-HA hosts (`internal/activator/hafiles.go:22-36`), and §4.4 says "App files have no copy". For other hosts, say they aren't copied.
+ - The spec's rule covers missing records. These are known gaps, and an owner who loses uploads after reading a soft line will feel misled.
+
+2. **Slice 1 is thin but worth shipping, with two things restored.** "Copied up to" and "go back as far as" are new, checkable facts, and #893 rides along.
+ - Keep the "get a copy" command on other-region instances. `db pull` already forwards them (`internal/console/apidb.go:144`), so the cut should remove the metadata lines only.
+ - Add the honest files line from point 1.
+ - Don't announce slice 1 as the backups feature. The restore-test line in slice 2 is what builds confidence.
+
+3. **Anchor "Copied up to 14:02".** Owners will read it as a freshness claim whatever the spec intends, and an instance asleep for three weeks will look three weeks stale. If a record of when the instance last slept or last ran exists, show it beside the line. I didn't verify that one does; if not, the copy must say the time is the last change saved, not the last check.
+
+4. **Split slice 2 and ship the per-box records first.**
+ - **2a:** per-box records, the identity bracket, arming, and operator alerts. This fixes a real fault today: each box's publish replaces the single object, so boxes erase each other's verdicts.
+ - **2b:** `copy_since`, the console reader, the test line and the operator view.
+ - The bracket is reuse and earns its place. The reader machinery (per-box change scopes, `ReadGate`, six-hour relist, enumerating every `copy_since` path) is the part that is bigger than "medium". 2a lets drills run and alert while it is built.
+
+5. **Give drills a coverage target, not only a time budget.** The run is sequential and capped at 25 today (`internal/ops/ops.go:270`); a 45-minute budget on a full box may mean each host is tested every few weeks. Then most owners see an old test or "never tested", which lowers confidence. Set a target such as every host within 7 days, alert operators when the oldest verdict passes it, and state the cadence in the panel.
+
+6. **Put a pull credential before the managed export.** The export is the right answer to "what if I lose the service", but it is the heaviest slice, it waits on slice 2, and review has made it heavier (envelope, guarded client, create-only probe, attempt directories).
+ - **3a (small):** a narrow service role that may run `db pull`, which `dbGate` refuses today for every non-person principal (`apidb.go:119`). An owner's cron job or CI then takes a nightly copy to anywhere, on every plan, with no credential custody and no outbound path from boxes.
+ - **Its cost:** it lets service credentials read database contents, which was a deliberate refusal and needs its own ruling and review. It is easy for developers, not for everyone.
+ - **3b:** the managed export, for owners who want zero-touch.
+ - **Reject the scheduled download link.** The console never holds a restored database (`apidb.go:1-5`), so it means storing restored copies platform-side and emailing a bearer link to a whole database. It also only works if someone downloads it.
+
+7. **Check which providers honour create-only writes before building 3b.** Refusal 2 turns away any destination that ignores `If-None-Match: *`. I couldn't verify provider support from here. If a popular cheap destination fails the probe, "very easy" fails at setup with a message owners can't act on.
+
+8. **Risks not yet covered.**
+ - **Nobody tests the owner's copy.** A nightly success line invites the same false comfort the spec refuses elsewhere. Add `carlos backups export verify`, run on the owner's machine: fetch the newest complete attempt, check the manifest hash, open it. Warn at setup that a lost age key means unreadable copies.
+ - **The export looks like a full backup.** `"files": "not_included"` lives only in the manifest. Put it on the panel line and in the setup email.
+ - **Owners aren't told when it stops.** Only two failed nights email them. Downgrades and repeated deferrals should too: email when the newest copy is more than N days old, whatever the cause.
+ - **Deferred exports lose their drill.** That gives paying owners worse test coverage exactly when capacity is short. Fall back to a plain drill.
+ - **History is 7 days** (`internal/lease/lease.go:93-95`). Say so in the panel, since an owner who notices a bad change after a week has only the export.
+ - **"We've been alerted" is a promise.** On a self-hosted deployment, nobody may be receiving it.
+
+I changed no files, so `FABLE-GUIDANCE-member-backups.md` is still empty. Plan mode was active, but the brief is a read-only review with nothing to implement, so there is no plan file.
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 a3ef5e4d8..aa5979dfd 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 3.1, 2026-11-11. Astra round 3 READY AFTER FIXES; its one fix (§9's backstop GETs) applied. Paul's rulings D1-D5 (§11). Astra round 1
+Status: rev 4, 2026-11-11. 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
@@ -34,8 +34,10 @@ Two different fears need two different answers:
Confidence comes from things people can check, not from a promise. Every
line this design shows is backed by a record the platform wrote, about
-that instance, with its time. Where no such record exists, the line says
-"not shown", never "covered" and never "not covered".
+that instance, with its time. Where no record exists, the line says
+"not shown". Where we know there is no copy, the line says so plainly
+(F-1): a soft "not shown" over a known gap would mislead the owner who
+later loses data.
## Where things stand (2026-11-11, main 01d6ca78)
@@ -129,17 +131,26 @@ that instance, with its time. Where no such record exists, the line says
5. **An export that wakes an instance.** It reads the replica.
6. **Instances the console can't read a replica for** (`ClassRefusal`,
`resolveReplica`: doesn't sleep, pooled, fleet-placed, unit-backed).
- The panel says "not shown" with the reason; the export refuses them.
+ The export refuses them. The panel says what is known (F-1): for an
+ instance that doesn't sleep, served from its own address, or not an
+ instance, the platform keeps no copy of its database
+ (`internal/dbreads/class.go:20-21`), so the panel says "we don't keep a
+ copy of this database yet". Pooled and fleet-placed instances, whose
+ copies exist but aren't readable here, say "not shown".
7. **Other regions' instances in slice 1.** The forwarding path carries
database contents and admits people only, so it is not reused for
metadata (R1-11). The panel says "not shown here yet" and names the
- region. A metadata-only forward is follow-up F1.
+ region, and **still shows the "get a copy" command**, because
+ `db pull` forwards those instances today (F-2). A metadata-only
+ forward is follow-up F1.
8. **App files and the off-account copy in the owner panel, in this
design.** Neither has per-instance evidence today (R1-4, R1-14). Both
come back when durability publishes a completed-snapshot time per host
- (step 6) and per-host copy evidence (step 7). Until then the panel
- says files aren't shown, and the off-account copy appears only as
- regional progress in the operator view.
+ (step 6) and per-host copy evidence (step 7). Until then the files
+ line says files on disk **aren't copied** for every host that isn't
+ born HA, which is a known gap (durability §4.4), and "not shown" for
+ born-HA hosts (F-1). The off-account copy appears only as regional
+ progress in the operator view.
## Design
@@ -172,7 +183,10 @@ restore point) is covered. `db query` and `db pull` gates are unchanged.
`apidbforward.go:145`).
- **`copied_to`** is `PlanRestore(ctx, c, 0)`: the newest TXID and the
header time of the newest LTX file, the transaction `db pull` would
- restore to. It is not a claim the replica is current.
+ restore to. It is not a claim the replica is current. Because no record
+ says when an instance last slept or ran, the panel words it as the last
+ change saved, not as a check time, so an instance asleep for three
+ weeks doesn't read as three weeks stale (F-3).
- **`history_from`** is the earliest `--at` that would succeed, computed
by the same boundary rules `restore.go` applies (`:183` rounds to the
next whole second; `:281` admits a transaction-1 file before any
@@ -233,12 +247,18 @@ updated to point here.
- **Which box tests which host:** on a fixed box, the box whose registry
holds it; on group boxes, its HRW box over serving(region), as
durability §5.2 says.
+- **A coverage target (F-5).** Every replicated host gets a verdict at
+ least every 7 days. The time budget is the starting point; the
+ operator view shows the oldest verdict's age, and operators are alerted
+ when it passes 7 days, which is the signal to raise the budget or add
+ capacity.
- **The run (R1-8, R2-3).** Drills run first, oldest first, inside a
- 45-minute time budget, **over hosts not exporting tonight**. Exports
+ 45-minute time budget, **over hosts not exporting tonight, plus any
+ host whose export was deferred last night**, drilled first (F-8). Exports
(§5) then run inside their own capacity, and each export is its host's
drill: one restore, one verdict. An exporting host whose export is
- deferred gets no verdict that night; its verdict ages in the panel and
- the deferral alerts operators. The record is published every 10
+ deferred gets no verdict that night, and is drilled first the next
+ night; the deferral alerts operators. The record is published every 10
minutes and at the end, so an interrupted run keeps what it finished.
Hosts the budget didn't reach are counted in the record.
- **Arming (D4, Paul 2026-11-11).** `hibernate-verify` leaves the inert
@@ -359,10 +379,22 @@ restore serves both, and the verdict says so.
record as §3, under `export`, with the same binding: result, time, the
attempt directory, the TXID, and an error class (`credentials_refused`,
`bucket_missing`, `unreachable`, `address_refused`, `too_large`,
-`restore_failed`, `deferred`). Two failed nights in a row email the
-account's owners (`s.deliver`, `delivery.go:41`) and fire the owner's
-alert connectors. `restore_failed` and `deferred` are ours, so they also
-alert operators.
+`restore_failed`, `deferred`). The owners are emailed (`s.deliver`,
+`delivery.go:41`) and the owner's alert connectors fire **whenever the
+newest complete copy is more than 2 days old, whatever the cause**:
+failures, deferrals, a plan downgrade or a refused instance (F-8).
+`restore_failed` and `deferred` are ours, so they also alert operators.
+
+**What the copy holds is said everywhere, not only in the manifest
+(F-8):** the panel line, the setup output and the setup email say "the
+database only; files on disk aren't included yet".
+
+**Owners can test their own copy (F-8).** `carlos backups export verify
+--app shop` runs on the owner's machine with their own credentials:
+it finds the newest attempt with a manifest, fetches it, checks the
+SHA-256, decrypts with `age` if needed, and opens it with SQLite. Setup
+ends by suggesting it, and warns that a lost age key makes the copies
+unreadable.
**Retention is the owner's.** Their bucket's lifecycle rules and object
lock decide what stays (refusal 1). The docs give a recipe.
@@ -371,6 +403,17 @@ lock decide what stays (refusal 1). The docs give a recipe.
so owners decrypt with the standard `age` tool. Adds `filippo.io/age` to
`go.mod`.
+### 5a. A pull credential (proposed, ruling D7)
+
+`dbGate` refuses every service credential today, deliberately (contents
+stay person-only). Fable's proposal (F-6): a narrow role, owner-minted,
+scoped to one app, that may run `db pull` only (never `db query`), with
+every pull audited. An owner's own cron job or CI then takes a nightly
+copy to anywhere, on every plan, with no credential custody on our side
+and no outbound path from boxes. The cost: a leaked token reads the
+whole database. It is easy for developers, not for everyone, so it sits
+beside the managed export (3b), not instead of it.
+
### 6. Public targets (later)
Once durability steps 5 and 7 are live, a docs page states durability
@@ -382,33 +425,52 @@ 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 |
-| 2 | §3 per-box verdicts, `copy_since`, arming, console reader, the test line, §4 operator view, operator alerts | slice 1 | medium |
-| 3 | §5 owner export, database only; envelope; destination client; plan field; owner alerts | slice 2 | 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), if Paul rules for it (D7) | D7 | small |
+| 3b | §5 managed export, database only; envelope; destination client; plan field; owner alerts; `export verify` | 2b, the provider probe | medium |
| later | F1 other-region metadata forward; files and off-account lines once durability steps 6-7 publish per-host evidence; files in the export; F2 LAN destinations; browser download; §6 | durability | |
Each slice goes through plan, build, Astra review (three rounds at most),
release and roll, dev first.
+**Slice 1 is not announced as "backups".** It adds checkable facts and
+#893, but the restore-test line (2b) is what builds confidence (F-2).
+
+**Before 3b's plan: the provider probe (F-7).** Refusal 2 turns away a
+destination that ignores `If-None-Match: *`. Run the CLI's check against
+the destinations owners are most likely to use (AWS S3, Cloudflare R2,
+Backblaze B2, Hetzner Object Storage, Wasabi, MinIO). If a popular one
+fails, bring it to Paul before building, since "very easy" would fail at
+setup.
+
## 8. Draft copy (all through copy review before any build)
Panel lines (times in the viewer's zone):
-- "Copied up to 14:02 today."
+- "Last change saved: 14:02 today." (F-3)
- "You can go back as far as 4 Nov, 09:10. A restore uses the newest saved
point at or before the time you pick."
+- "We keep about 7 days of history. For anything older, use a copy of
+ your own." (F-8)
- "Last restore test passed on 11 Nov at 03:12, using the copy up to 02:58."
- "Last restore test failed on 11 Nov at 03:12. We've been alerted."
+ (The second sentence only on a deployment with alert delivery
+ configured; otherwise it is left out. F-8)
- "Restore tests aren't shown here yet."
-- "Files this app keeps on disk aren't shown here yet."
-- "Backups for this instance aren't shown here, because it doesn't sleep.
- Its database is copied a different way."
+- "Files this app keeps on disk aren't copied yet. Only the database is."
+ (born-HA hosts: "Copies of files on disk aren't shown here yet.")
+- "This instance doesn't sleep, and we don't keep a copy of its database
+ yet." (F-1)
- "Backups for instances in London aren't shown here yet."
- "Get a copy on your own computer:" followed by the command.
Export:
- "Every night we copy this app's databases to my-backups at s3.example.com."
-- "Last copy to your bucket: 11 Nov at 03:20, up to 02:58."
+- "Last copy to your bucket: 11 Nov at 03:20, up to 02:58. Database
+ only; files on disk aren't included yet."
+- "Your newest copy is 3 days old." (email, whatever the cause)
- "The last two copies to your bucket failed: the bucket refused our key."
- "Your plan doesn't include copies to your own bucket. Your settings are
kept if you change plans."
@@ -537,3 +599,21 @@ nothing in this design.
READY AFTER FIXES, no new findings. R1-1, R1-5, R2-1, R2-2 and R2-3 FIXED.
R1-12 PARTLY: §9 omitted the backstop's conditional GETs. Accepted and
applied in rev 3.1.
+
+## 17. Fable 5.2 guidance: dispositions
+
+PROCEED WITH CHANGES (`FABLE-GUIDANCE-member-backups.md`). Code claims
+checked: `class.go:20-21` and durability §4.4 confirm the known gaps; no
+record of an instance's last sleep exists.
+
+| # | Guidance | Disposition |
+|---|---|---|
+| F-1 | say "no copy" where we know there is none | Accepted: non-sleeping instances and non-HA files say so; "not shown" kept for real unknowns |
+| F-2 | slice 1 thin but worth it; keep "get a copy" for other regions; don't announce it as backups | Accepted |
+| F-3 | anchor "copied up to" | Accepted: worded as the last change saved |
+| F-4 | split slice 2; per-box records first | Accepted: 2a and 2b |
+| F-5 | coverage target, not only a time budget | Accepted: 7 days, operator alert past it |
+| F-6 | a pull credential before the managed export | Proposed as §5a and slice 3a; ruling D7 |
+| F-7 | check providers honour create-only before 3b | Accepted: the provider probe gates 3b's plan |
+| F-8 | owner verify, files on the line, staleness email, deferred drill, 7-day history, conditional "we've been alerted" | Accepted, each in §3, §5 or §8 |
+| F-6b | reject a scheduled download link | Agreed: the console never holds a restored database |