carlos / platform Public

member backups: design rev 2 after Astra round 1 (#898)

Accepts all 14 round 1 findings. Cuts the files and off-account lines
and other-region instances from the owner panel; gives the export its
own envelope, a guarded destination client, attempt directories, a
create-only check, deadlines and a disk pin. Records Paul's D1-D5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 016391be3864be2f02de9b975d6938076f7f7e7f parent 3022418
3 files changed, +383 −275
  • docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-member-backups.md +29 −0
  • docs/superpowers/notes/reviews/member-backups/CODEX-REVIEW-BRIEF-member-backups-R2.md +16 −0
  • docs/superpowers/specs/2026-11-11-member-backups-design.md +338 −275

CI cancelled — superseded by a newer push — run details

Intent

Human

<task-notification> <task-id>bzpeqepy4</task-id> <tool-use-id>toolu_011NREAofEeShT9cRxaTT8Xs</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/bzpeqepy4.output</output-file> <status>completed</status> <summary>Background command "Run Astra spec review round 1" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 33.3 g CO₂e (2,629,728 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-member-backups, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-member-backups.md b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-member-backups.md
new file mode 100644
index 000000000..f5e5041dc
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-member-backups.md
@@ -0,0 +1,29 @@
+1. **P1 — Put-only credentials do not guarantee immutable backups.** Refusal 1; §5, lines 278–283. The daily object names repeat, and conditional writes are optional “where the provider honours it.” A rerun can therefore overwrite a backup. A compromised uploader can also omit the condition. **Evidence:** [store.go:993](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/release/store.go:993) explicitly distinguishes create-only and replacement PUTs; [s3compat.go:113](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/s3compat/s3compat.go:113) provides no general immutability guarantee. **Fix:** require supported conditional creation for the uploader, refuse unsupported destinations, and make the compromise-resistance claim conditional on owner-enforced retention or write restrictions.
+
+2. **P1 — Export credentials need a separate cryptographic purpose.** §5, lines 256–260. The proposed app-secret envelope binds only account and app. Someone with access to the export ciphertext and app-config writes can transplant it into a secret variable for the same app and have a box decrypt it into the app’s environment. Separately stored destination fields are not authenticated by that envelope. **Evidence:** [crypto.go:73](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/appconfig/crypto.go:73) defines the binding; [materialize.go:50](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/appconfig/materialize.go:50) decrypts such envelopes into environment values. **Fix:** use an export-specific envelope that app-secret readers reject, binding the credential, destination and encryption recipient together. Explicitly define whether the console is trusted to authorize destination changes; public-key sealing alone does not authenticate the owner.
+
+3. **P1 — Owner-selected endpoints introduce an unrestricted outbound-request path from boxes.** §5 and §10. The CLI’s successful test does not establish that the endpoint is safe when resolved from a production box. The design permits private, loopback or link-local destinations and says nothing about DNS changes or redirects. **Evidence:** [s3compat.go:66](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/s3compat/s3compat.go:66) configures endpoint addressing and checksums, without a network-destination guard; it also reads a process-wide endpoint. **Fix:** specify a dedicated destination client with owner credentials only, HTTPS, destination checks at connection time, prohibited internal address ranges, and redirects disabled. Keep its endpoint configuration separate from source-storage clients.
+
+4. **P2 — The files manifest cannot prove the proposed copy time or completeness.** §1, lines 166–168; §8. The manifest contains no publication timestamp. Its object modification time can advance after a platform-only update, and incomplete app snapshots can still commit. Consequently, “Files on disk last copied at…” can describe a time when app files were not copied completely. **Evidence:** [manifest.go:64](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/hostfiles/manifest.go:64), [hafiles.go:404](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/activator/hafiles.go:404), and [hafiles.go:468](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/activator/hafiles.go:468). **Fix:** publish an explicit completed-app-snapshot timestamp and coverage result, distinguish partial publication, and report unknown when that evidence is absent.
+
+5. **P2 — Per-box verdicts lack move and deletion invalidation.** §3, lines 198–217. “Nothing reads” the old record is incorrect: move landing removes its host entry specifically because the old verdict describes the source copy. Keeping the newest verdict per hostname does not preserve that rule, and an additive in-memory merge can retain removed hosts indefinitely. **Evidence:** [movespass.go:576](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/host/movespass.go:576), [movesinstall.go:905](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/host/movesinstall.go:905), and [dbverify.go:129](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbverify/dbverify.go:129). **Fix:** bind verdicts to account, app and replica identity, including region and applicable lifetime/generation. Migrate the cleanup caller, replace each box’s contribution on refresh, and invalidate evidence when the instance’s source changes or disappears.
+
+6. **P2 — The HRW drill box is not necessarily the live database’s holder.** §3, lines 202–208. Reusing the local freshness check on the selected drill box can report a healthy remote-held database as missing or compare against an obsolete local copy. **Evidence:** [coldwake.go:21](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/boxchoice/coldwake.go:21) permits placement based on the previous releaser or available capacity; [hibernate_verify.go:98](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/ops/hibernate_verify.go:98) checks the local path; [freshness.go:97](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/ops/freshness.go:97) treats its absence as a fault. **Fix:** keep restore integrity separate from freshness. Compare counters only against a proven matching source; otherwise report freshness unknown.
+
+7. **P2 — `history_from` is not a valid inclusive restore boundary as specified.** §1, lines 157–161; §8. A snapshot uploaded at time T is excluded by an `--at T` restore. History can also begin with a file starting at transaction 1 before any snapshot exists. Upload time alone does not justify “restore to any point,” because restoration selects retained file boundaries. **Evidence:** [restore.go:183](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/restore.go:183) returns the *next whole second*; [restore.go:281](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/restore.go:281) includes transaction-1 files; [restore.go:99](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/restore.go:99) documents unavailable targets inside compacted files. **Fix:** share those boundary rules, handle missing timestamps, and describe recovery to retained state at or before the requested time.
+
+8. **P2 — Unbounded exports can starve drills and prevent verdict publication.** §3 and §5, lines 271–274. Putting all exports first and outside the budget allows one slow destination—or enough legitimate exports—to occupy the nightly pass indefinitely. The design therefore cannot promise either nightly completion or progress for other hosts. **Evidence:** [ops.go:289](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/ops/ops.go:289) uses an unbounded context, [hibernate_verify.go:85](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/ops/hibernate_verify.go:85) processes hosts sequentially, and [ops.go:337](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/ops/ops.go:337) publishes after the pass. **Fix:** define per-export deadlines, bounded retries and total capacity, reserve drill progress, and publish completed results despite interrupted exports.
+
+9. **P2 — The disk check does not bound the work that follows it.** §5, lines 275–285. Checking twice a planned size is insufficient unless the restore is pinned to that plan and its scratch requirements are defined. A subsequent latest restore may be larger; the door restore also stages LTX inputs on disk. **Evidence:** [plan.go:23](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/plan.go:23) separates input bytes from restored bytes; [restore.go:93](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/restore.go:93) restores latest; [restore.go:322](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/restore.go:322) downloads inputs into scratch. **Fix:** pin the planned transaction, reserve the chosen implementation’s complete scratch requirement, retain a free-space floor, and enforce byte limits during execution. Existing [read.go:189](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbreads/read.go:189) provides a relevant bounded precedent.
+
+10. **P2 — Daily keys have no safe partial-upload retry contract.** §5, lines 278–283. If the database PUT succeeds and the manifest PUT fails, a retry restores potentially different bytes but encounters the existing database key. Neither treating that conflict as success nor abandoning the night establishes a matching database and manifest. **Evidence:** [store.go:1000](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/release/store.go:1000) rejects a repeated create-only PUT; [restore.go:93](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/restore.go:93) independently selects latest. **Fix:** use unique attempt-qualified keys and publish a manifest only for that attempt’s completed objects. Define how retries handle ambiguous completion without destination reads.
+
+11. **P2 — Existing cross-region forwarding has no metadata-only operation.** §1, lines 136–139 and 173–174. Reusing it is not sufficient for this door: it accepts people only and supports query/pull operations carrying database-derived contents. Simply admitting service credentials would widen an existing contents boundary. **Evidence:** [apidbforward.go:285](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/apidbforward.go:285), [apidbforward.go:353](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/apidbforward.go:353), and [limits.go:28](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbreads/limits.go:28). **Fix:** design a separately authorized metadata operation with a fixed response schema, preserving the person-only query/pull gates and accounting for its forwarding requests.
+
+12. **P2 — One `verify` scope cannot identify which boxes changed.** §3 and §9. `ChangeWatch` reports scope generations, not changed object keys. A shared scope therefore cannot support “reads changed records only” without another discovery mechanism. Sole reliance on notifications would also miss failed index bumps. **Evidence:** [changeindex.go:35](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/release/changeindex.go:35), [changeindex.go:122](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/release/changeindex.go:122), and [changewatch.go:13](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/release/changewatch.go:13). **Fix:** specify per-box change identification or a scoped listing with conditional reads, plus initial loading and the existing backstop. Include those requests in the budget.
+
+13. **P2 — The panel’s listing budget understates the reused planner.** §9, lines 352–354. `PlanRestore` does not list only populated levels: it requests all ten levels. Each listing can consume multiple storage pages and is collected in memory. A five-minute cache limits repetition, not the cost of one miss. **Evidence:** [coords.go:24](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/coords.go:24) documents levels 9 through 0; [plan_from.go:30](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbdoor/plan_from.go:30) consumes the whole iterator. **Fix:** budget actual paginated listings, bound planning time and memory, and coalesce concurrent cache misses. Any optimization that skips levels needs its own established layout contract.
+
+14. **P2 — A finished regional offsite pass does not prove this instance has an offsite copy.** §1, lines 148 and 169–172; §8. The proposed `state: "copied"` promotes deployment-level progress into host-level coverage. The underlying durability design explicitly says a finished pass does not establish completeness. **Evidence:** durability §5.5, lines 777–827; the existing copy machinery distinguishes deferred objects in [mirror.go:89](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/lease/mirror.go:89) and binds receipts to specific source/destination pairs in [mirror.go:133](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/lease/mirror.go:133). **Fix:** expose the regional pass as regional progress only. Require host-specific coverage or restore evidence before claiming that instance’s copy exists.
+
+NOT READY
\ No newline at end of file
diff --git a/docs/superpowers/notes/reviews/member-backups/CODEX-REVIEW-BRIEF-member-backups-R2.md b/docs/superpowers/notes/reviews/member-backups/CODEX-REVIEW-BRIEF-member-backups-R2.md
new file mode 100644
index 000000000..3d1e8b5e7
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/CODEX-REVIEW-BRIEF-member-backups-R2.md
@@ -0,0 +1,16 @@
+# Review brief, round 2: backups owners can see and check (rev 2)
+
+Spec: `docs/superpowers/specs/2026-11-11-member-backups-design.md`, rev 2.
+Round 1 findings: `docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-member-backups.md`.
+The original brief, `CODEX-REVIEW-BRIEF-member-backups.md`, still applies.
+
+1. First, a disposition table: for each round 1 finding (R1-1 to R1-14),
+ is the rev 2 text a sound fix? Answer FIXED, PARTLY (say what is
+ missing), or NOT FIXED. Spec §14 lists what rev 2 claims.
+2. Then only NEW findings in rev 2's text, in the original format
+ (severity, section, code evidence with file:line, concrete fix). Verify
+ every citation. Don't re-raise a round 1 finding that rev 2 fixed.
+3. Prefer cuts and up-front refusals over new mechanism when you suggest
+ a fix.
+4. End with one line: READY, READY AFTER FIXES, or NOT READY. This is
+ round 2 of at most three.
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 32d9e279d..0375bc334 100644
--- a/docs/superpowers/specs/2026-11-11-member-backups-design.md
+++ b/docs/superpowers/specs/2026-11-11-member-backups-design.md
@@ -1,10 +1,13 @@
# Backups owners can see and check
-Status: rev 1 draft, 2026-11-11. Not reviewed. Discussion #898; branch
-`design-member-backups`. Builds on the durability design
-(`2026-10-23-durability-design.md`, rev 4.2, called "durability" below)
-and absorbs #893 (the replica position without contents). #894 (an owner
-restoring a live instance in place) stays its own design.
+Status: rev 2, 2026-11-11. 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 are accepted (§14), marked
+**(R1-N)** where they changed the text. Round 2 of at most three is next.
+Discussion #898; branch `design-member-backups`. Builds on the durability
+design (`2026-10-23-durability-design.md`, rev 4.2, called "durability"
+below) and absorbs #893. #894 (an owner restoring a live instance in
+place) stays its own design.
## Why
@@ -14,8 +17,8 @@ disaster? Should we also offer very easy offsite / nightly backups?"
Durability is written for operators. Its drills, alerts and runbooks make
the platform recoverable, and nothing in it tells an owner anything. An
-owner today has no way to see whether their instance is copied, how far
-back it reaches, or whether anyone has ever restored it.
+owner today can't see whether their instance is copied, how far back it
+reaches, or whether anyone has ever restored it.
Two different fears need two different answers:
@@ -26,106 +29,111 @@ Two different fears need two different answers:
answers this, however good it is. Only a copy in the owner's own hands
does, in a format they can open without CARLOS.
-Confidence comes from things people can check, not from a promise. So
-every line this design shows is backed by a record the platform wrote,
-with its age. Where no record exists, it says so.
+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".
-## Where things stand (2026-11-11, read from main 01d6ca78)
-
-What any surface must not overstate:
+## Where things stand (2026-11-11, main 01d6ca78)
- **Databases of sleeping instances** replicate continuously, awake or
asleep, to `<CARLOS_HIBERNATE_PREFIX>/<host>/` in the region's data
- bucket (`internal/activator/activator.go:167`, `internal/lease/lease.go:98-106`).
- Snapshots are daily and kept 7 days (`lease.go:93-95`), and pruning runs
- only while awake (`:70-78`), so a sleeping instance's history can reach
- further back.
+ bucket (`internal/activator/activator.go:167`,
+ `internal/lease/lease.go:98-106`). Snapshots are daily and kept 7 days
+ (`lease.go:93-95`); pruning runs only while awake (`:70-78`).
- **Other databases** (instances that don't sleep, unit-backed, pooled,
fleet-placed, served from their own address) are covered, if at all, by
- box-wide Litestream under hand-chosen prefixes, on IE only
- (durability §4.2, §4.4). `carlos db` refuses them
- (`internal/dbreads/class.go:14-25`, `internal/console/apidb.go:54-72`).
+ box-wide Litestream under hand-chosen prefixes, on IE only (durability
+ §4.2, §4.4). `carlos db` refuses them (`internal/dbreads/class.go:14-25`,
+ `internal/console/apidb.go:54-72`).
- **`carlos db pull --at`** restores on the member's own machine. The
console reads LTX files with its own role and passes the bytes through,
and by design never holds a restored database (`apidb.go:1-5`,
`db.go:4-10`, `internal/dbdoor/restore.go:136-215`). Any account member
may run it (`dbGate`, `apidb.go:110-176`); service credentials may not.
-- **The position line** ("It holds every change up to transaction N,
- written T", `db.go:232-256`) comes from a full restore today. A cheap
- version exists: `dbdoor.PlanRestore` (`internal/dbdoor/plan.go:44`)
- lists the levels and reads one header. Nothing computes where history
- starts except a failed `--at` restore (`restore.go:259-293`).
+ Another region's instance is read through a box in that region
+ (`apidbforward.go`), people only.
+- **Position without a restore:** `dbdoor.PlanRestore`
+ (`internal/dbdoor/plan.go:44`) lists all ten Litestream levels
+ (`coords.go:24`, `plan_from.go:30`) and reads one header. Where history
+ starts is worked out only inside a failed `--at` restore
+ (`restore.go:183`, `:259-293`).
- **Drills.** `hibernate-verify` (`internal/ops/ops.go:260-358`) restores
- up to 25 sleeping hosts per run, oldest verdict first, and publishes
- `control/restore-verify.json` (`internal/dbverify/dbverify.go:29`).
- That is one key for the whole deployment, and each box's `Publish`
- replaces the object (`:167`), so boxes erase each other's verdicts.
- Both drill timers are inert by default (`internal/host/bootstrap.go:183`).
- Nothing reads the record.
-- **App files** are published only for born-HA hosts (every 15 minutes,
- `internal/activator/hafiles.go:22-36`). Non-HA hosts publish only their
- sealed escrow (`escrow.go:25-30`). Durability step 6 is not started.
-- **Off-account copy:** the interim rclone job copies eu-west-1 buckets to
- Hetzner. UK, US and AU have none. `control/offsite.json` is spec only
- (durability §5.5).
-- **Instance restore (#658)** is inert until the lifetimes cutover.
+ up to 25 sleeping hosts per run, sequentially, oldest verdict first, and
+ publishes `control/restore-verify.json` once at the end
+ (`internal/dbverify/dbverify.go:29`, `ops.go:337`). It is one key for
+ the whole deployment, and each box's `Publish` replaces the object
+ (`:167`), so boxes erase each other's verdicts. Move landing removes a
+ host's entry because the verdict described the source copy
+ (`internal/host/movespass.go:576`, `movesinstall.go:905`). Both drill
+ timers are inert by default (`internal/host/bootstrap.go:183-186`). The
+ console doesn't read the record.
+- **App files** are published only for born-HA hosts
+ (`internal/activator/hafiles.go:22-36`). The files manifest has no
+ completed-snapshot time (`internal/hostfiles/manifest.go:64`).
+- **Off-account copy:** the interim rclone job copies eu-west-1 buckets
+ to Hetzner. `control/offsite.json` is spec only, and durability §5.5
+ says a finished pass proves nothing about any one object.
## Goals
1. An owner or member can see, for each instance, how recent its copy is,
- how far back it reaches, when a restore of it was last tested and with
- what result, whether a copy exists outside the hosting provider, and
- what isn't covered at all.
+ how far back it reaches, and when a restore of it was last tested and
+ with what result.
2. An owner can get a copy into their own hands now, and every night
without thinking about it, in a format that opens without CARLOS.
3. An operator can see the same evidence for the whole fleet in one place,
and is alerted when it goes bad.
-4. Nothing shown claims more than a record proves.
+4. Nothing shown claims more than a record about that instance proves.
## Non-goals
- Restoring a live instance in place (#894).
-- A browser download of a restored database. The console never holds a
- restored database (`apidb.go:1-5`). A browser path needs its own design
- (in-browser restore, or a box streaming the file sealed to a browser
- key). Slice 1 shows the CLI command instead.
+- A browser download of a restored database. The console never holds one
+ (`apidb.go:1-5`). The panel shows the CLI command instead.
- The operator-side durability work itself (inventories, offsite copier,
- restore-box). This design reads what that work publishes, and builds one
- piece of it (§3) because the panel needs it first.
-- A public status or trust page. §6 records the intent; it waits for
- durability steps 5 and 7.
+ restore-box). This design builds only the drill-verdict piece (§3),
+ because the panel needs it first.
+- A public status or trust page. §6 records the intent.
## Anti-goals
- **A green tick, "backed up", or "up to date" anywhere.** A drill never
- proves a replica is current (durability §3.1 item 12, #290). The panel
- shows times and ages.
-- **"Not covered" for something that may be covered by a copy we can't
- see.** Instances whose copies the console can't read are "not shown
- here", with the reason.
+ proves a replica is current (durability §3.1 item 12, #290).
+- **Regional or deployment progress shown as an instance's coverage**
+ (R1-14).
- **The console holding a restored database or an owner's plaintext
credential.**
-- **A new per-box poll, or a console loop that lists replicas.** Panel
- reads happen on request and are cached; verdicts ride the change index
- (§9).
+- **A new per-box poll, or a console loop that lists replicas.**
- **Requiring AWS for any of it.**
## Refused up front
-1. **An export that lists, deletes or overwrites in the owner's bucket.**
- It only writes new objects. A put-only key is enough, and object lock on
- the owner's side works. A compromised platform cannot erase an owner's
- backups.
-2. **Exporting a copy that failed its integrity check.** Nothing is
- uploaded; the verdict says failed.
-3. **An export that wakes an instance.** It reads the replica.
-4. **Export for instances the console can't read a replica for** (the
- `ClassRefusal` and `resolveReplica` refusals: doesn't sleep, pooled,
- fleet-placed, unit-backed). Fleet-placed instances also seal to the
- fleet's key, which only the fleet's boxes hold. Each refusal names its
- reason. A later slice may lift them as durability §5.1 lands.
-5. **Showing an off-account copy that no record backs.** The line reads
- `control/offsite.json` and nothing else.
+1. **Claiming the export can't be erased.** The export never lists,
+ deletes or overwrites, but an uploader that is compromised could. Only
+ the owner's own object lock or versioning makes the copies tamper-proof,
+ and the docs say exactly that (R1-1).
+2. **A destination that doesn't honour create-only writes.** The CLI tests
+ `If-None-Match: *` at setup and refuses the destination if a second
+ create-only PUT to the same key succeeds (R1-1).
+3. **A destination at an internal address**, a plain-HTTP endpoint, or one
+ that redirects (R1-3).
+4. **Exporting a copy that failed its integrity check.** Nothing is
+ uploaded.
+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.
+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.
+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.
## Design
@@ -134,110 +142,112 @@ What any surface must not overstate:
`GET /api/cli/apps/{account}/{app}/instances/{host}/backups`
Admitted for any account member (person), and for service credentials
-with the `deploy`, `operate` or `admin` role. It returns no database
-contents, so #893's case (release automation recording a restore point)
-is covered.
+with the `deploy`, `operate` or `admin` role. It returns a fixed schema
+with no database contents, so #893's case (release automation recording a
+restore point) is covered. `db query` and `db pull` gates are unchanged.
```json
{
- "class": "replicated", // or "not_shown", with "reason"
+ "class": "replicated", // "not_shown" + "reason", or "no_database"
"copied_to": {"transaction": 48213, "written_at": "2026-11-11T14:02:07Z"},
- "history_from": "2026-11-04T09:10:00Z",
- "last_test": {"result": "passed", "at": "...", "copy_written_at": "...", "box": "..."},
- "files": {"state": "copied", "at": "..."}, // or "not_copied", "no_record"
- "offsite": {"state": "copied", "pass_finished_at": "..."}, // or "not_shown"
- "export": { ... } // §5, present when configured
+ "history_from": "2026-11-04T09:10:01Z",
+ "last_test": {"result": "passed", "at": "...", "copy_written_at": "..."},
+ "export": { ... } // §5, present when configured
}
```
+- **`class`** comes from one function over `ClassRefusal`,
+ `resolveReplica` and the region check, shared with `db pull` and the
+ export, so the three never disagree. Other region: `not_shown`,
+ `reason: "other_region"`.
- **`copied_to`** is `PlanRestore(ctx, c, 0)`: the newest TXID and the
- header time of the newest LTX file. It is the same transaction and
- time `db pull` would restore to, and it is not a claim the replica is
- current.
-- **`history_from`** comes from the same level listing: the time of the
- oldest retained snapshot, using the listing's upload time. Upload time
- is at or after the snapshot's own time, so the value never claims more
- history than exists. A new `dbdoor.HistoryFrom` shares `PlanRestore`'s
- listing so one request pays for both.
-- **`class`** is decided by the existing refusals (`ClassRefusal`,
- `resolveReplica`) through one function, so the door, `db pull` and the
- export never disagree about which instances are visible. A stateless
- instance is `no_database`.
-- **`files`:** a born-HA host reports its newest files publication time
- (one GET of the manifest). Every other host reports `not_copied` until
- durability step 6 publishes its files.
-- **`offsite`** reads `control/offsite.json` for the host's region. With
- no record it is `not_shown`. An optional carloku ops step can have the
- interim rclone job write the same record after each finished pass, so
- eu-west-1 shows truthfully before the copier verb exists.
-- **Another region's instance** goes through the same forwarding as
- `db` reads (`apidbforward.go`).
-- **Cost:** computed on request only, cached per host for 5 minutes in
- the console. §9 counts it.
+ header time of the newest LTX file, the transaction `db pull` would
+ restore to. It is not a claim the replica is current.
+- **`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
+ snapshot). One function serves both, so the door and the restore can't
+ drift (R1-7). Absent when it can't be decided.
+- **Bounds (R1-13):** one miss lists all ten levels, page by page. The
+ planner runs under a 10-second deadline and a cap on files listed;
+ concurrent misses for one host share one plan (singleflight); results
+ are cached per host for 5 minutes. Past either bound the door answers
+ `not_shown`, `reason: "too_large_to_plan"`.
### 2. The Backups tab and the CLI
- A **Backups** tab on the instance page (`AppLinks`, `mobilenav.go:60-80`;
- `templates/app_instance.html`), for owners and members. "Protection" is
- taken by the edge guard and stays as it is.
-- `carlos instances backups --app shop [--instance <host>]` prints the same
- lines. `--json` prints the door's body.
-- **Get a copy:** the tab shows the exact command, ready to copy:
- `carlos db pull --app shop --instance <host>`, plus an `--at` example
- using a time inside the history. Any member can already run it.
-- Each line comes from one field of the door and shows its time. Draft
- copy is in §8.
+ `templates/app_instance.html`), for owners and members. "Protection"
+ stays the edge guard's.
+- `carlos instances backups --app shop [--instance <host>]` prints the
+ same lines; `--json` prints the door's body.
+- **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.
### 3. Restore tests published per box (durability §5.2's tenant half)
-The panel's "last restore test" line needs verdicts that survive more
-than one box. This is the hibernate-verify half of durability step 5,
-built here because the panel needs it first. Durability's text is updated
-to point here.
-
-- `hibernate-verify` publishes `control/verify/<ref>.json`, one object per
- box, under a new change-index scope `verify`. The single
- `control/restore-verify.json` stops being written. Nothing reads it, so
- nothing breaks; a later cleanup deletes it.
-- Each verdict carries: result (`passed`, `failed`, `unverified` with a
- reason), when, the TXID and header time of the restored copy, its size,
- and `stale` only when proved (the existing `freshness.go` arm). Never
- "current".
+Built here because the panel needs it first. Durability §5.2's text is
+updated to point here.
+
+- **The record.** `hibernate-verify` publishes `control/verify/<ref>.json`,
+ one object per box, replacing that box's whole contribution each time.
+ The single `control/restore-verify.json` stops being written. Move
+ landing's `RemoveVerifyEntry` (`movespass.go:576`) moves to the box's own
+ record (R1-5).
+- **Each verdict is bound to its copy (R1-5):** account, app, host, region,
+ the replica prefix, the restored TXID and header time, size, the
+ result (`passed`, `failed`, `unverified` with a reason), and when.
+- **The console shows a verdict only if** account, app, host and region
+ match the instance's current record, and the verdict was reached after
+ the instance's `copy_since`. The console stamps `copy_since` whenever a
+ new copy starts: create, restore (#658), move landing, and a region
+ change. The builder enumerates every such path, with a test that fails
+ when a new one appears. Existing instances are stamped at the release
+ that ships this. A verdict from a box that has left the roster for 7
+ days is dropped.
+- **Freshness (R1-6).** The drill reports restore integrity and the copy's
+ age. It compares change counters only when the box proves it holds the
+ live database (the instance's lease names this box). Otherwise freshness
+ is unknown. `stale` appears only when proved; "current" never does.
- **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 already says.
-- **The cap becomes a time budget.** A count of 25 per run means a
- verdict could be weeks old on a busy box. The run works oldest-first
- within a time budget (proposed 45 minutes) and reports how many hosts it
- didn't reach. The panel shows the verdict's real date, whatever it is.
-- **Arming:** `hibernate-verify` leaves the inert list on every box that
- holds sleeping hosts. This reverses "inert by long-standing choice"
- (`bootstrap.go:183`), so it is ruling D4.
-- **The console** watches the `verify` scope with `ChangeWatch`, loads the
- changed boxes' records, and keeps the newest verdict per host in memory.
- It does not poll.
-- **Alerts (operator):** a failed verdict raises one at once, and so does
- an `unverified` result whose reason isn't the time budget, three runs in
- a row. Both go through the existing alert engine to operators. Owners
- see the verdict in the panel; drills are the operator's job.
+ holds it; on group boxes, its HRW box over serving(region), as
+ durability §5.2 says.
+- **The run (R1-8).** Drills run first, oldest first, inside a 45-minute
+ time budget. Exports (§5) then run inside their own capacity. 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
+ list on every box that holds sleeping hosts.
+- **Reading it (R1-12).** Each box's record is its own change-index scope,
+ `control/verify/<ref>` (a new `ChangeScope` arm). At start the console
+ lists `control/verify/` once and reads each record. After that it reads
+ a record only when that box's scope generation moves, with a
+ conditional GET. Every 6 hours it lists the prefix again, in case a
+ bump failed.
+- **Alerts (operator):** a failed verdict at once, and an `unverified` one
+ (other than the time budget) three runs in a row. Both go through the
+ existing alert engine.
### 4. The operator view
`/fleet/backups`, behind `operatorOnly`, with the same JSON for system
operators (`apiSystemOperator`). For each region it shows:
-- instances by class (replicated, not shown with each reason, no database)
+- instances by class, with "not shown" broken down by reason
- verdicts: passed in the last 7 days, failed, never tested, the oldest
- verdict's age, and hosts the time budget didn't reach
+ verdict's age, and hosts the budget didn't reach
- boxes whose drill is inert or hasn't published in 36 hours
-- the off-account copy's last finished pass, or "no record"
-- exports (§5): configured, succeeded last night, failing
+- the off-account copy's last finished pass for the region, labelled as
+ regional progress, or "no record"
+- exports: configured, finished last night, failing, deferred
-It reads only what §1, §3 and §5 already hold, so it adds no requests.
+It reads only what §1, §3 and §5 already hold.
### 5. A nightly copy to the owner's own bucket
-**Setting it up** (owner only):
+**Setting it up** (owner only; D3):
```
carlos backups export set --app shop \
@@ -245,98 +255,125 @@ carlos backups export set --app shop \
[--prefix carlos/] [--age-recipient age1...]
```
-The key ID and secret are read from a prompt or stdin, never argv.
-
-- **The CLI tests the destination before saving.** It holds the
- plaintext, so it writes one small object
- (`<prefix>.carlos-export-check/<time>`) and reports the provider's own
- error if that fails. Owners get an answer in seconds, not the next
- morning. The test object is left in place, because the export never
- deletes.
-- **The CLI seals the credential** to the deployment's public key with the
- v2 envelope bound to account and app (`sealKeyFor`, `sealkey.go:99`;
- `internal/appconfig/crypto.go`), as app secrets are. The console stores
- ciphertext plus the non-secret fields and never sees the secret. Boxes
- open it as they open app secrets. A console form waits for console
- secrets slice 2's browser sealing.
-- **The scope is per app.** Every exportable instance of the app is
- exported. `carlos backups export show|off --app shop`.
-- **Plan:** a new `Limits` field, `OwnerExport bool`
- (`internal/plans/catalog.go`), checked with `EffectiveLimits`
- (`planlimits.go:136`) at set time and at each run. On a downgrade the
- export stops, the config is kept, and the panel says why. Ruling D1.
-
-**Running it:**
-
-- It runs in the same nightly pass as §3, on the box that tests the host.
- Exporting hosts go first and are outside the time budget, so an owner
- who pays for a nightly copy gets one each night. **Each export is also
- that night's restore test**: one restore serves both.
-- Steps: restore the replica into scratch on the box's data disk (not a
- RAM-backed `/tmp`), run `integrity_check`, then stream the file,
- age-encrypted if a recipient is set, to
- `<prefix><app>/<host>/<YYYY-MM-DD>/<host>.sqlite3[.age]`, followed by
- `manifest.json`: TXID, header time, plaintext SHA-256 and size, platform
- version, and `"files": "not_included"`.
-- Writes use `If-None-Match: *` where the provider honours it
- (`internal/s3compat` knows the quirks), and multipart above the
- provider's single-PUT size. There is no list and no delete (refusal 1).
-- **Disk check:** if free space is under twice the size `PlanRestore`
- reports, the host is deferred with a reason, and operators are alerted.
-- **Retention is the owner's.** Their bucket's lifecycle rules and object
- lock decide what stays. The docs say so and show a recipe.
-- **The verdict** goes in the same per-box record as §3, under `export`:
- result, time, the object key, the TXID, and an error class
- (`credentials_refused`, `bucket_missing`, `unreachable`, `too_large`,
- `restore_failed`, `deferred`). The console shows it in the panel.
-- **Owner alerts:** 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 alert operators too.
-- **Files:** when durability step 6 publishes files for every host, the
- export adds `files.tar` (age-encrypted if a recipient is set) and the
- manifest says `"files": "included"`. Until then the panel says files
- aren't in the copy.
-
-**Encryption** (ruling D2): optional, to an age recipient only the owner
-holds, so owners decrypt with the standard `age` tool, not with CARLOS.
-That needs `filippo.io/age` added to `go.mod`. Our own envelope would
-force owners to use CARLOS to decrypt, which defeats the purpose of the
-copy.
+The key ID and secret come from a prompt or stdin, never argv.
+
+- **The CLI tests the destination first.** It holds the plaintext, so it
+ writes `<prefix>.carlos-export-check/<random>` with `If-None-Match: *`,
+ then tries again with the same key and expects a 412. Any failure shows
+ the provider's own error; a second write that succeeds refuses the
+ destination (refusal 2). The check objects stay, because the export
+ never deletes.
+- **Its own envelope (R1-2).** The CLI seals the credential to the
+ deployment's public key in a new envelope version whose associated data
+ binds a purpose string (`export-credential`), the account, the app, the
+ endpoint, bucket, region, prefix and age recipient. App-secret readers
+ (`materialize.go:50`) refuse that version, and the export opener refuses
+ every app-secret version. A test seals each kind and proves the other
+ reader refuses it. Changing any destination field needs a fresh seal.
+- **The console's trust (R1-2).** The console decides who may set an
+ export (the owner check) and stores the envelope. Because the public
+ key is public, a compromised console could point an app's export at its
+ own bucket. It can already read every replica, so this adds no reach
+ over data. It does add a quiet channel, so every `set`, change and `off`
+ emails every owner of the account, and the panel shows the destination
+ to every member. The box checks again that the envelope's bound account
+ and app match the host's record.
+- **Per app.** Every exportable instance of the app is exported.
+ `carlos backups export show|off --app shop`.
+- **Plan (D1).** A new `Limits` field, `OwnerExport bool`
+ (`internal/plans/catalog.go`), true for Personal and up, checked with
+ `EffectiveLimits` (`planlimits.go:136`) at set time and on the box at
+ each run. On a downgrade the export stops, the config is kept, and the
+ panel says why.
+
+**The destination client (R1-3).** It is a separate S3 client built only
+from the owner's sealed fields. It never applies `s3compat.Options()`,
+whose endpoint is process-wide (`s3compat.go:66`); quirks are chosen by
+the destination host explicitly. HTTPS only. Redirects are refused, and
+proxy environment variables are ignored. Its dialer resolves the name and
+refuses, on every connection, any address in the classes `egressaddr`
+refuses for every tenant (loopback, unspecified, link-local, metadata,
+multicast, reserved, NAT64) and in the instance fence
+(`egressaddr.FenceDeny`), which covers private ranges. So DNS changes made
+after setup are caught at connect time. A self-hoster who wants a LAN
+destination is refused in this design (follow-up F2).
+
+**Running it (D5: one nightly window).** The export runs on the box that
+tests the host, after that night's drills. **Each export is also that
+host's restore test for the night**: one restore serves both, and the
+verdict says so.
+
+1. Plan with `PlanRestore` and **pin that TXID**; the restore targets it,
+ not "latest" (R1-9).
+2. Reserve the plan's input bytes plus its restored size, plus a floor of
+ 5 GiB or 10% of the disk, whichever is larger, on the box's data disk
+ (never a RAM-backed `/tmp`). If that isn't free, the host is
+ `deferred` and operators are alerted. Byte limits are enforced during
+ download and restore, following `dbreads/read.go:189` (R1-9).
+3. Restore, then `integrity_check`. On failure, upload nothing; the
+ verdict is `restore_failed`, which alerts operators.
+4. Upload, create-only, to a fresh attempt directory
+ `<prefix><app>/<host>/<YYYY-MM-DD>/<attempt>/`, where `<attempt>` is
+ the start time plus a random suffix: first `db.sqlite3` (`.age` when a
+ recipient is set), then `manifest.json` last (R1-10). The manifest
+ holds the TXID, header time, plaintext SHA-256 and size, platform
+ version, and `"files": "not_included"`. **An attempt without a
+ manifest is incomplete**; the docs say so. A retry, or a PUT whose
+ outcome is unknown, always starts a new attempt. The export never
+ reads the destination.
+5. **Bounds (R1-8):** each export has a 30-minute deadline and at most
+ one retry. A box gives exports at most 3 hours a night. A host that
+ doesn't fit is `deferred` with the reason, and operators are alerted,
+ because that is a capacity problem.
+
+**Verdicts and alerts.** The export's result goes in the same per-box
+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.
+
+**Retention is the owner's.** Their bucket's lifecycle rules and object
+lock decide what stays (refusal 1). The docs give a recipe.
+
+**Encryption (D2).** Optional, to an age recipient only the owner holds,
+so owners decrypt with the standard `age` tool. Adds `filippo.io/age` to
+`go.mod`.
### 6. Public targets (later)
Once durability steps 5 and 7 are live, a docs page states durability
-§2's RPO/RTO table and each region's coverage (offsite copy yes or no,
-drill pass rate over 30 days), generated from §4's data. Recorded here so
-§4 keeps that data in a publishable shape. Not in this design's slices.
+§2's RPO/RTO table and each region's coverage, generated from §4's data.
+Not in this design's slices.
### 7. Order
| Slice | What | Needs | Size |
|---|---|---|---|
-| 1 | §1 door (with #893), §2 tab and CLI, the "get a copy" command; restore-test line reads "not shown yet" | nothing | small |
-| 2 | §3 per-box verdicts, arming (D4), console reader, the test line, §4 operator view, operator alerts | slice 1 | medium |
-| 3 | §5 owner export, database only; plan field; owner alerts | slice 2, D1-D3 | medium |
-| 4 | files in the export; browser download design; §6 page | durability steps 5-7 | later |
+| 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 |
+| 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 spec review, plan, build, Astra review (three
-rounds at most), release and roll, dev first.
+Each slice goes through plan, build, Astra review (three rounds at most),
+release and roll, dev first.
## 8. Draft copy (all through copy review before any build)
Panel lines (times in the viewer's zone):
- "Copied up to 14:02 today."
-- "You can restore to any point since 4 Nov, 09:10."
+- "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."
- "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."
- "Restore tests aren't shown here yet."
-- "Files this app keeps on disk aren't copied yet. Only the database is."
-- "Files on disk last copied at 14:00."
-- "Copy outside our hosting provider: last finished 40 minutes ago."
-- "No copy outside our hosting provider is shown 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."
+- "Backups for instances in London aren't shown here yet."
- "Get a copy on your own computer:" followed by the command.
Export:
@@ -346,74 +383,100 @@ Export:
- "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."
+- Email: "The nightly copy of shop now goes to my-backups at
+ s3.example.com. It was set by <person> at 16:40."
+- CLI refusal: "This bucket let us overwrite a file we asked it not to.
+ Copies there could be replaced, so we won't use it."
## 9. Request budget
-- **Panel and door:** on request only, cached 5 minutes per host. One
- LIST per Litestream level present (typically 3-4), one ranged GET of a
- header, and for born-HA hosts one GET of the files manifest. No loop.
-- **Verdicts:** one PUT per box per drill run, plus a change-index bump.
- The console reads changed records only.
-- **Export:** the restore it needs is the same restore the drill does,
- so for exporting hosts the drill's cost moves rather than grows. A
- restore lists the levels and GETs the LTX files in the plan, tens of
- requests per host. At 1,000 exporting instances that is in the order of
- 50,000 GETs a night, about $0.02 at S3 GET pricing. The writes go to the
- owner's bucket and cost us nothing.
-- **Box CPU and disk:** one restore per exporting host per night, inside
- the nightly pass, spread across boxes by the same choice as §3.
+- **Door:** on request only. A cache miss is ten level LISTs (more if a
+ level spans pages) plus one or two ranged GETs, bounded by §1's deadline
+ and file cap; hits are free for 5 minutes. At S3 list pricing that is
+ about $0.00005 a miss.
+- **Verdicts:** one PUT per box every 10 minutes during the nightly run,
+ plus its change-index bump. The console: one LIST and N GETs at start,
+ one conditional GET per changed box, and one LIST every 6 hours.
+- **Export:** for exporting hosts the restore replaces the drill's, so
+ the drill's cost moves rather than grows. A restore lists the levels and
+ GETs the planned LTX files, tens of requests per host. At 1,000
+ exporting instances that is about 50,000 GETs a night, around $0.02.
+ Writes go to the owner's bucket and cost us nothing.
+- **Box CPU and disk:** bounded by §5's reservation, deadlines and the
+ 3-hour nightly capacity.
## 10. Provider boundary
Everything is core. The owner's destination is any S3-compatible store
-through `internal/s3compat`; the source is the deployment's own store.
-Email goes through `s.deliver` (Keymail first; SES is its existing AWS
-adapter). A deployment with no AWS loses nothing in this design. The
-off-account line depends on durability's copier, which is itself
-provider-neutral.
-
-## 11. Decisions for Paul (recommendation first)
-
-- **D1 plans.** The panel and `db pull` for every plan; the nightly export
- for Personal and up. Alternative: export on every plan.
-- **D2 encryption.** An optional age recipient, adding `filippo.io/age`.
- Alternatives: always required; or no encryption (the owner's bucket,
- the owner's problem).
-- **D3 who.** Members see the panel and can pull, as today. Only owners
- set up or stop the export.
-- **D4 arming.** `hibernate-verify` armed by default wherever sleeping
- hosts live, with a time budget instead of the 25 cap.
-- **D5 schedule.** One nightly window per region in v1, not an
- owner-chosen hour.
-- **D6 #893.** Absorbed into slice 1's door.
+through the destination client (§5), which is separate from the
+deployment's own store client. Email goes through `s.deliver` (Keymail
+first; SES is its existing AWS adapter). A deployment with no AWS loses
+nothing in this design.
+
+## 11. Rulings (Paul, 2026-11-11)
+
+- **D1.** The panel and `db pull` on every plan; the nightly export for
+ Personal and up.
+- **D2.** An optional age recipient; `filippo.io/age` added.
+- **D3.** Members see the panel and can pull, as today. Only owners set up
+ or stop the export. (Recommended; not separately asked.)
+- **D4.** `hibernate-verify` armed by default wherever sleeping hosts
+ live, with a time budget instead of the 25 cap.
+- **D5.** One nightly window per region; owners don't pick the hour.
+- **D6.** #893 absorbed into slice 1's door. (Recommended; not separately
+ asked.)
## 12. Test plan (for the builder)
-- **One classification table.** Every refusal reason in `ClassRefusal`
- and `resolveReplica` maps to exactly one class; the door, `db pull` and
- the export share the function. A table test walks every reason.
-- **The export never lists, deletes or overwrites.** A recording fake
- store is the destination. A seeded simulation over random failures
- (restore errors, integrity failures, provider 403s and 5xx, short disk,
- plan downgrade mid-run) checks the invariants after each run: no
- non-list/delete op was ever sent, nothing was uploaded for a copy that
- failed integrity, every host has exactly one verdict per run, and no
- instance was woken.
-- **Verdicts survive several boxes.** Two or more boxes publish; the
- console's merged view holds every host's newest verdict.
+- **One classification function**, walked by a table test over every
+ refusal reason; the door, `db pull` and the export share it.
+- **One history boundary function**, shared by the door and the restore,
+ with tests at a snapshot's exact upload second and a transaction-1 file.
+- **Envelopes don't cross.** An export envelope is refused by the
+ app-secret reader, and every app-secret version by the export opener.
+ Changing any bound field fails to open.
+- **The destination client** refuses each address class, plain HTTP,
+ redirects and proxy variables, including a name that resolves public at
+ setup and private at connect.
+- **Export invariants.** A recording fake store is the destination. A
+ seeded simulation over random failures (restore errors, integrity
+ failures, provider 403s, 5xx and timeouts, short disk, deadline hits, a
+ plan downgrade mid-run, a box restart mid-run) checks after each run:
+ no list, delete or unconditional PUT was ever sent; no PUT reused an
+ attempt key; every manifest's objects exist in its own attempt; nothing
+ was uploaded for a copy that failed integrity; drills got their budget;
+ the published record holds every finished host; no instance woke.
+- **Verdict validity.** Several boxes publish; a move, a restore, a
+ deletion and a box leaving the roster each hide the old verdict.
- **Production-wired witnesses:** the door through the real router and
- gate; the export through the real nightly pass against MinIO in CI
- (`TestDeliveredContractMinio`'s setup), restored and opened by plain
- `sqlite3` and decrypted by `age` in the test.
-- **Dev check after each slice's roll:** slice 1, the tab on a dev
- instance matches `db pull`; slice 2, the test line appears within a
- day; slice 3, a MinIO or Hetzner bucket on dev receives a copy that
- opens.
+ gate; the export through the real nightly run against MinIO in CI,
+ restored and opened with plain `sqlite3` and decrypted with `age`.
+- **Dev check after each slice's roll:** slice 1, the tab matches
+ `db pull`; slice 2, the test line appears within a day and hides after
+ a move; slice 3, a Hetzner bucket on dev receives a copy that opens.
## 13. Left to the builder
-- The exact time budget, and the cache lifetime.
-- Whether `history_from` needs its own listing or can share
- `PlanRestore`'s.
-- The tab's layout, using the console mockup kit (5b6d5374).
+- The file cap for the planner, and the exact budgets (45 minutes, 3
+ hours, 30 minutes are starting points).
- Multipart thresholds per provider.
+- The tab's layout, using the console mockup kit.
+
+## 14. Astra round 1: dispositions
+
+| # | Sev | Finding | Disposition |
+|---|---|---|---|
+| R1-1 | P1 | put-only does not make copies immutable | Accepted: create-only required and tested (refusal 2), unique attempt keys, the tamper-proof claim left to the owner's object lock (refusal 1) |
+| R1-2 | P1 | export credential needs its own purpose | Accepted: new envelope version binding purpose and every destination field; console trust stated; owners emailed on every change |
+| R1-3 | P1 | owner endpoints open an outbound path from boxes | Accepted: separate destination client, HTTPS, no redirects or proxies, `egressaddr` classes and fence checked at each connect; LAN destinations refused (F2) |
+| R1-4 | P2 | files manifest can't prove time or completeness | Accepted by cutting: no files line until durability step 6 publishes per-host evidence (refusal 8) |
+| R1-5 | P2 | per-box verdicts lack move and deletion invalidation | Accepted: verdicts bound to their copy, `copy_since`, whole-contribution replace, `RemoveVerifyEntry` migrated |
+| R1-6 | P2 | the drill box may not hold the live database | Accepted: counters compared only on the lease holder; otherwise unknown |
+| R1-7 | P2 | `history_from` isn't a valid restore boundary | Accepted: one boundary function shared with the restore |
+| R1-8 | P2 | exports can starve drills | Accepted: drills first in their budget; export deadlines, one retry, 3-hour capacity; publish every 10 minutes |
+| R1-9 | P2 | the disk check doesn't bound the work | Accepted: pinned TXID, full reservation plus floor, enforced byte limits |
+| R1-10 | P2 | partial uploads have no retry contract | Accepted: attempt directories, manifest last, retries never reuse |
+| R1-11 | P2 | forwarding has no metadata-only operation | Accepted by cutting: other regions "not shown" in slice 1 (refusal 7); F1 follows |
+| R1-12 | P2 | one scope can't say which box changed | Accepted: per-box scopes, initial list, conditional reads, 6-hour relist |
+| R1-13 | P2 | the planner's listing cost is understated | Accepted: ten levels budgeted, deadline, file cap, singleflight |
+| R1-14 | P2 | a regional pass isn't an instance's copy | Accepted by cutting: off-account shown only as regional progress in the operator view (refusal 8) |