carlos / platform Public

member backups: plans for slices 1 and 2a, plan review brief (#898)

Slice 1: backups door, instance-page section, carlos instances backups.
Slice 2a: per-box restore-test records with the identity bracket,
pinned restores, a time budget, arming, and operator alerts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 725d1c6bde8b7b2f44658a9fbc2c781171823942 parent ebb1d3b
3 files changed, +361 −0
  • docs/superpowers/notes/reviews/member-backups/CODEX-REVIEW-BRIEF-member-backups-plans.md +27 −0
  • docs/superpowers/plans/2026-11-11-member-backups-slice1.md +155 −0
  • docs/superpowers/plans/2026-11-11-member-backups-slice2a.md +179 −0

CI failed — run details

Intent

Human

Go ahead

Human

<task-notification> <task-id>a9961bf33f38291a7</task-id> <tool-use-id>toolu_01KvwPrBvXLmc1rgATRx3xhr</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/a9961bf33f38291a7.output</output-file> <status>completed</status> <summary>Agent "Signatures for slice 1 plan" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>I've checked all ten items. Your two starting pointers are slightly off: doors are declared in `internal/console/routedecls.go` (not `authcli.go`), and the instance page has no tab bar. All paths below are under `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/`. ## 1. Route registration - **Where:** each door is one entry in `var routeDecls []routeDecl` in `internal/console/routedecls.go`. The `routeDecl` struct is at :67-90 (fields `Pattern`, `Kind`, `Gate`, `Allow svcrole.Set`, `Target`, `Refused`, `Handler func(*Server, http.ResponseWriter, *http.Request)`, `Build`). - **Dispatch:** `func (s *Server) registerDecls(match func(routeDecl) bool)` at :1221 sends `kindCLI` entries to `func (s *Server) cliRoute(d routeDecl, h http.HandlerFunc)` (`authcli.go:448`). - **Roles:** `svcrole.Allow(roles ...Role) Set` (`internal/svcrole/svcrole.go:125`) always adds Admin, so `Allow(svcrole.Deploy, svcrole.Operate)` means deploy, operate and admin. `svcrole.Set{}` admits people only. - **Who is calling:** `cliGateRefused` (`authcli.go:~486`) resolves `s.store.CLIPrincipal`. People skip the role gate; a service credential must have its role in `Allow`. The handler then calls `principalFrom(ctx) (Principal, bool)` (`authcli.go:422`). `Principal` (`svcprincipal.go:58`) has `Kind` (`PrincipalUser`/`PrincipalService`), `Address`, `AccountID`, `App`, `Role`, `Name`, `Rungs`. - **Account and app check:** `s.instanceGate(w, r) (actor string, *Account, app string, ok bool)` (`apiinstances.go:105`), built on `apiAccountApp` (`apicli.go:46`). It does membership or credential binding (byte-identical 404), the `cli.instances` rate limit, and a 503 when there is no bucket. - **Pattern to copy:** no door uses exactly deploy+operate. The closest per-host door is `{Pattern: "POST /api/cli/apps/{account}/{app}/instances/{host}/gate-pass", Kind: kindCLI, Allow: svcrole.Allow(svcrole.Instance, svcrole.Deploy), Handler: (*Server).handleAPIInstanceGatePass}` at :690 (handler in `apigatepass.go:48`). It shows instanceGate, then `principalFrom`, then `ValidHostShape`, then `s.readRecord(ctx, acct.Sqid, app, host)` (`lifetimes_read.go:23`). The read-only examples are `handleAPIAvailability` (`apierrors.go:72`, `Allow(Instance, Operate)`) and `.../assets` at :681. - **Tables a new door must join** (otherwise tests fail): - `linkedpolicy.go` map, checked by `TestLinkedPolicyCoversEveryAppRoute` (`apilinks_test.go:455`). - `claimFixtures` (`claim_invariant_fixtures_test.go:733`, add a `claimRead("…")`) and `testdata/claim-routes.txt`, checked by `TestClaimConsoleRouteCensus`. - `deploydoors_test.go` want list, checked by `TestDeployReachesExactlyItsDoors`. - Probably the team list in `teamdoors_test.go`. - `TestEveryCLIDoorNamesItsRoles` (`svcroutes_test.go:431`). ## 2. apidb.go - `func (s *Server) dbGate(w, r) (dbRequest, bool)` (:110) is **person-only** (`p.Kind != PrincipalUser` gets a 404) and uses the `cli.db` budget. So the new door should not call it. Call `resolveDBSource` directly instead. `dbRequest{claim hostclaim.Observed; acct *Account; actor, app, host, prefix string; rd replicaReader}` (:94). - `func (s *Server) resolveDBSource(ctx, acct *Account, actor, app, host string) (dbSource, error)` (:203) does no authorisation. It checks shape (`ErrBadHost`), reads the record (`os.ErrNotExist`), runs `dbClassRefusal` (`errSourceClass`), then `resolveReplica`, then the claim when `cfg.HostClaim` is on (`errSourceClaim`, and the prefix becomes `claim.Holder.Location`). It returns `dbSource{rec, prefix, claim, claimErr}`. - `func (s *Server) resolveReplica(rec provision.Record, host string) (string, error)` (:54) refuses in this order: 1. bad host gives `ErrBadHost`; 2. `rec.Pool != ""` gives `ErrPooled`; 3. `registry.FleetPlacement(rec.Region)` gives `ErrResidency` (fleet); 4. `rec.Region != s.cfg.Region` gives `ErrResidency` (other region). It returns `activator.HibernatePrefix(s.cfg.HibernatePrefix, host)`. **Fleet and other region share one sentinel error**, so your classifier must call `registry.FleetPlacement` again to tell them apart (as `dbResidencyRefusal` does at :251). - **Region name for the copy:** `regionlabel.ForCode(rec.Region, s.regionHome(), s.regionNames()).Text` (`apidbforward.go:148`), or `s.dbRegionName` (:259). - **Getting a reader:** use the seam `s.dbReplica func(ctx, prefix string) (replicaReader, error)` (`server.go:1184`; production is `cachedReadReplica`, `apidb.go:490`). `replicaReader` matches `dbdoor.ReplicaReader`. If you need a `*dbdoor.Client`, `dbdoor.NewClient(replicaDoer(rd))` (`seeddoer.go:28`) is what the seed door does (`apiinstanceseed.go:286-292`). That door also calls `s.dbReplica(src.prefix)` after `resolveDBSource` even with HostClaim on, which is your precedent. The HostClaim db door itself lists through `listDBVersions`/genselect instead. ## 3. Classification - **`dbreads.ClassRefusal(rec provision.Record) string`** (`internal/dbreads/class.go:14`) returns one of: - `"%s is a %s route. The platform keeps a database copy only for instances."` when `Kind` is neither `""` nor `"instance"`; - `"%s is served from its own address, so the platform does not manage its database."` when `Addr` or `Addrs` is set; - `"%s does not sleep, so the platform does not keep a copy of its database."` when `!HibernateOrDefault()`; - `""` otherwise. - The console wrapper `dbClassRefusal` (`apidb.go:242`) adds `rec.Demo != nil` and returns `demoCopy["DEMO-DATA"]`. - **Pool and fleet are not classified anywhere as a value.** They exist only as errors in `resolveReplica`, and inline at `dbreads/agent.go:218-222` (`rec.Pool != "", fleet, rec.Region != a.cfg.Region`). - **There is no `Stateless` field on `provision.Record`.** "No database" is exactly `ClassRefusal != ""`. - **Unit-backed is not checked:** `Unit` (`provision.go:147`) appears in neither `ClassRefusal` nor `resolveReplica`, though refusal 6 names it. - A single classifier would order the checks: `ClassRefusal`, then demo, then `Pool`, then `FleetPlacement`, then region. It needs `cfg.Region` as an input. ## 4. dbdoor - `func PlanRestore(ctx, c *Client, target uint64) (RestorePlan, error)` (`plan.go:44`). - `RestorePlan{TXID uint64; LTXBytes, RestoredBytes int64; Files int; Target uint64; Planned []LTXFile; At time.Time}`. `At` is the last file's header time, i.e. `copied_to`. - **Better fit on the console side:** `func PlanFrom(ctx, rd ReplicaReader, at time.Time) (RestorePlan, error)` (`plan_from.go:110`). It works on the reader directly, with no HTTP client. - **Earliest restorable time**, implemented twice with the same logic: - CLI: `recorder.LTXFiles` (`restore.go:259-288`) records `oldest` from snapshot-level files or files with `MinTXID == 1`. Then `restoreAt` (`restore.go:183`) returns `&amp;BeforeHistoryError{Oldest: oldest.Truncate(time.Second).Add(time.Second)}`. - Console and box: `listing.LTXFiles` (`plan_from.go:69-89`) and `PlanFrom` (:130). - **`HistoryFrom` can be extracted.** Make a `listing{rd, asOf: true}`, run `CalcRestorePlan(ctx, l, 0, time.Time{})` (the same listing PlanFrom's newest plan does), then apply the `oldest.Truncate(s).Add(s)` rule. One wrinkle: `asOf: true` also makes a listing without times fail with `ErrNoTimes`. A good signature is `HistoryFrom(ctx, rd ReplicaReader) (time.Time, bool, error)`, or have `PlanFrom` return `oldest`. - `EarliestAsOf` is at `restore.go:45`. - **How levels are listed:** `ListLevel(ctx, rd, level)` (`plan_from.go:30`); `MaxLevel` and paths are in `coords.go`. The listing has no cap on file count, so the spec's file cap means wrapping the `ReplicaReader`. ## 5. Caching - `golang.org/x/sync` is only `// indirect` (`go.mod:78`) and nothing imports singleflight. - The pattern to copy is `analyticsMemo` (`analyticsview.go:290-395`): mutex, map of `{at, value}`, an `inflight map[string]*analyticsMemoCall{done chan struct{}}` for concurrent misses, `load(ctx, key, now, read)`, a TTL, and oldest-first eviction at a size limit. ## 6. Instance page - **There are no per-instance tabs and no per-instance GET sub-page.** `AppLinks()` (`mobilenav.go:60-95`) holds app-level tabs only. `appnav.html` loops over them. `handleAppInstance` (`instancepage.go:245`) calls `s.appPage(w, r, "instances")` (`server.go:4273`, returns `(page, *Account, bool)`), fills `p.InstanceDetail *instanceDetail` (`instancepage.go:18`), and renders `"app_instance"`. - `templates/app_instance.html` (63 lines) shows extra content as sections, e.g. `&lt;section class="updates"&gt;` at :38. So "Backups" is either a new `&lt;section&gt;` (`instanceDetail.Backups`) or a new route `GET /a/{sqid}/apps/{app}/instances/{host}/backups` plus a new instance-level tab bar. Remote instances (`selected.remote`) skip the box joins. - **Copy files:** - `instancecopy.go`: an `instanceCopyStrings` struct exposed through `page.InstanceCopy()`; - `*_copy.go` constants (e.g. `opactivity_copy.go`); - `page.UpdatesText(id)`. - **Copy enforcement:** the repo-root `approved_*_copy_test.go` files call `checkApprovedCopy(t, raw, ".", ids, fragments)` (`approved_copy_test.go:71`) against a JSON record in `docs/superpowers/plans/` with a pinned ID list. A new feature adds its own record and test. - **Mockup kit and drift check (5b6d5374):** `TestConsoleStyleguideClassesExist` (`internal/console/styleguide_test.go:75`) only checks that the classes in `docs/console-styleguide.md` exist in the CSS. `TestConsoleMockupKit` is skipped unless `CONSOLE_MOCKUP_KIT_DIR` is set. Neither checks new templates. ## 7. CLI - **Dispatch:** `instancesCommand()` (`cli.go:581`) is a `clireg.Node` with `raw("retry", cust, runInstancesRetry)` children. Add `raw("backups", cust, runInstancesBackups)`, then run `make parity-doc`, or `TestCLIProjection` fails on `parity/cli.tsv`. - **Template:** `runGeo` (`geo_cmd.go:35`) shows the flow: - `requireAPISession(verb, consoleFlag)` (`instances_cli.go:297`); - `resolvedAccount(sess, acctRaw, acctIDRaw)`; - `resolvedApp(sess, acct, *app, usage)`; - `sess.getJSON(ctx, apiPath(acct, app, tail)) (int, []byte, error)` (`apimode.go:835`, `apiPath` at :468); - `apiErrorFromBody(status, body)` (:818). - **`--json`:** `fs.Bool("json", false, "print the console's answer as JSON")`, then `stdout.Write(body)` and `fmt.Fprintln(stdout)`. - **When `--instance` is left out:** `resolveDBInstance(ctx, sess, acct, app, host) (string, error)` (`db.go:176`) picks the only instance or refuses and names them. - **Tests:** an `httptest.NewServer` fake plus `newTestSession(ts.URL)` (`apimode_test.go:212`), as in `instances_retry_test.go:12`. Printers are tested directly into a `bytes.Buffer` (`geo_cmd_test.go`). ## 8. Census - `TestPlan14RootReadCensus` (`internal/provision/plan14_root_reads_test.go:700`) covers every file of `go list -deps .` (the root binary). - **Console-only changes do not trigger it** (AGENTS.md:303-330; `TestCensusRebaseProofConsoleAndTemplateEditsPass`). - **Root CLI files, `internal/dbdoor/*` and `internal/dbreads/*` are in scope.** Both packages are listed in `testdata/census-base-scope.txt`. So `HistoryFrom` in dbdoor, a classifier in dbreads, and the CLI each need `make census-card` / `census-propose` plus a reviewer's approval. ## 9. Test helpers (console) - `instanceFixture(t, code string) (*consoleFixture, string)` (`apiinstances_test.go:102`): titogo plus a member token for alice. - `dbFixture(t) *dbFx` (`apidb_test.go:150`) stubs `fx.srv.dbReplica` with `lsfile`. Also `putDBRecord(t, fx, provision.Record)` (:167) and `(fx *dbFx) replicate(t, host, batches) string` (`dbdoortest.Replicate`). - `serviceToken(t, st *Store, accountID int64, name, app string, role svcrole.Role) string` (`svcfixture_test.go:15`). - `getRaw(t, u, bearer) (int, string)` (`apicli_test.go:41`) and `rawReq(t, method, u, bearer, body) (int, http.Header, string)` (`apiinstances_test.go:43`). - Browser pages: `newConsoleFixture(t)` (`server_test.go:45`) and `signInAs(t, fx, address, code) (*http.Client, string)` (`svcpage_test.go:59`). - For the shape of a role table test, see `TestAPIDBRefusesEveryServicePrincipalTheSameWay` (`apidb_test.go:358`). ## 10. Audit - Helpers (`server.go`): `func (s *Server) audit(acct *Account, app, addr, action, detail string)` (:5117) and `auditActivity(acct, app, addr string, Activity)` (:5125). - **db reads:** only a served file is audited, `dbAuditAction = "db-read"` (`apidb.go:91`, written at :406). Listings are not audited, and neither are metadata GETs (instance get, availability, logs). - **The new door:** by that precedent, a metadata door should not write an audit row.</result> <usage><subagent_tokens>145145</subagent_tokens><tool_uses>63</tool_uses><duration_ms>402713</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>ab03750033ba332c4</task-id> <tool-use-id>toolu_01QPojJCT58QNi8UKyATkzK1</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/ab03750033ba332c4.output</output-file> <status>completed</status> <summary>Agent "Signatures for slice 2a plan" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>I've answered all ten items below. Five findings change the plan: - **Box ref:** `boxLabel()` is the hostname, not the box ref, and `internal/ops` cannot import `internal/host`. - **Restore output:** `VerifyReplica` returns no TXID, header time or size, all of which the spec wants in each verdict. - **Memory is out of date:** the census now has a generator, `make census-propose`. - **Record-write census:** a second census, separate from the root-read one, pins `dbverify.Publish` and `RemoveHost` by digest. - **Mutation classifier:** the hostops classifier only knows the old key, so `control/verify/` needs an entry there too. ## 1. `internal/dbverify/dbverify.go` - `Key = "control/restore-verify.json"` at :28. - `Verdict` (:32): `OK bool "ok"`, `Unverified bool "unverified,omitempty"`, `VerifiedAt time.Time "verified_at"`, `Detail string "detail,omitempty"`. There are no identity, TXID, size or reason-code fields. - `Record` (:48): `V int` (1), `Box string`, `CheckedAt time.Time`, `Hosts map[string]Verdict`. - `func Merge(prior *Record, box string, now time.Time, fleet []string, results map[string]Verdict) *Record` at :65. It keeps unvisited hosts and drops hosts not in `fleet`. - `(*Record).Failures() int` at :91 and `Unverified() int` at :102. - `func Load(ctx, s release.Store) (*Record, error)` at :114. A missing record returns `(nil, nil)`. There is no `Read`. - `func RemoveHost(ctx, s release.Store, host string) error` at :135: get, delete the host, put with CAS, 3 tries. - `func Publish(ctx, s release.Store, rec *Record) error` at :167: CAS overwrite, 3 tries. - Callers: - `ops.go:324` (Load), `:342` (Merge), `:352` (Publish), `:325/:355` (Key) - `host/movespass.go:576` (RemoveHost) - Tests: `movesland_test.go:420,655` (`dbverify.Load`) - Other references to the old key that must move: - `internal/hostops/mutation_classifier.go:64` has `{exact: "control/restore-verify.json"}` in `nonAppFamilies`. It needs a `{prefix: "control/verify/"}` row. - `internal/moves/offline.go:72` names the old key in text. ## 2. The hibernate-verify command - `defaultHibernateMax = 25` at `ops.go:271`. `runHibernateVerify` starts at :281. - Flags: `-registry`, `-data`, `-max` (0 means no cap). - Flow: 1. `activator.ConfigFromEnv()` gives `Bucket`/`Region`/`Prefix` (the `CARLOS_HIBERNATE_*` vars). If it returns nil, the command exits 0. 2. `registry.Open(&lt;data&gt;/registry.db)`, then `HibernatingHosts(reg)`. 3. `openDeployStore(ctx)` at :321 (defined at :393): `CARLOS_DEPLOYMENT_BUCKET` gives `NewDeploymentS3Store`, which has the change index on; `CARLOS_DEPLOYMENT_DIR` gives `DirStore` with `EnableChangeIndex`. 4. `dbverify.Load`, `MkdirTemp`, then `VerifyHibernating(ctx, cfg, OldestFirst(hosts, prior), *max, now, tmp)` at :337. 5. Merge at :342 using `boxLabel()`, Publish at :352. The run fails only if `rec.Failures() &gt; 0` (:359). - **Box ref problem:** `boxLabel()` (:380) is `os.Hostname()`, not the box ref. Today the ref comes from `host.metricsBoxLabel` (`metrics_loop.go:838`) or the exported `host.BoxLabel()` (:856), which use group ref via IMDS, then fleet identity, then `status.Label(machine-id)`. `ops` cannot import `host`: `internal/host/forward_readers_test.go` (package `host`) imports `ops`, so the test build would form a cycle. The plan needs one of: move that label logic to a leaf package, pass the ref in, or have the agent write it to a local file. - `HibernatingRoute` (`hibernate_verify.go:37`) has only `Host` and `DBPath`. It carries no account, app, region or CreatedAt. `registry.Route` has `Account` (registry.go:393), `App`, `Region` and `CreatedAt int64` (:479). But `CreatedAt` is when the row was inserted, not the record's, so the incarnation must come from `provision.GetRecord`. - `HibernatingHosts(reg *registry.Registry) ([]HibernatingRoute, error)` at :45. It takes routes that are not `BackingUnit`, not `Stateless`, are `ActivatorLeased()` and have a `DBPath`. - `func VerifyHibernating(ctx, cfg *activator.Config, hosts []HibernatingRoute, max int, now time.Time, tmpDir string) map[string]dbverify.Verdict` at :83. - Each host goes through `verifyOne` (:69, which is `lease.VerifyReplica`, `lease/check.go:88`: `(ctx, bucket, prefix, region, dir) (uint32 counter, error)`). Inside, it restores, runs `CheckDB` (:37), then `ChangeCounter`. - The prefix is `activator.HibernatePrefix(cfg.Prefix, host)`. - It does **not** return the restored TXID, header time or size. - `hibernateFreshness(dbPath string, restoredCounter uint32) (freshness, string)` at :136. It uses `rt.DBPath` from the registry and calls `replicaFreshnessCounter` (`freshness.go:97`) and `sourceModTime` (:120). Stale or missing-source results become a failed verdict today. - `OldestFirst(hosts, prior *dbverify.Record) []HibernatingRoute` at :147. Hosts never verified come first, then oldest `VerifiedAt`. ## 3. Identity bracket - `func (a *Agent) check(ctx, req Request) (provision.Record, string, error)` at `agent.go:209`. It uses only `a.cfg.Store` (`release.Store`), `a.cfg.Region` (`CARLOS_REGION`) and `req.{Account, App, Host, Incarnation}`. It calls: - `provision.GetRecord(ctx, s, acct, app, host)` (`provision.go:3037`) - `provision.Incarnation(account, app, host string, created time.Time) (string, error)` (`incarnation.go:23`) - `registry.FleetPlacement(region)` (`fleets.go:736`) - `provision.ValidHostShape` and `ClassRefusal(rec)` (`class.go:14`) - It returns `CodeRecordChanged = "record-changed"` (also for a missing record) or `CodeMoving = "moving"` (`result.go:29-30`). - Check A runs at `read.go:162` and check B at `read.go:~249`. `afterCheckB` is at :126. - Extraction is straightforward: something like `func CheckIdentity(ctx, s release.Store, region string, want Identity) (provision.Record, string, error)`, with `Agent.check` calling it. For check A the drill has no expected incarnation yet, so it needs either a "capture" variant or a split into `Capture(...) (Identity, rec, code, err)` plus a compare step. - Note that `CARLOS_REGION` is not the same as `cfg.Region` (`CARLOS_HIBERNATE_REGION`, the bucket's region). - **No import cycle:** `go list -deps ./internal/dbreads` contains no `internal/ops`, and `ops` already imports `provision`, `registry` and `activator`. ## 4. Live lease - The lock is at `&lt;hibernate bucket&gt;/&lt;Prefix&gt;/&lt;host&gt;/lock.json`. The activator writes it for every activator-leased host, HA or not (`activator/hawake.go:286-300`, `lease.Acquire`). A sleeping host's lock is released (deleted) or a release marker. - `lease.LockState(ctx, bucket, location, region string) (held bool, owner string, expires time.Time, err error)` at `lease/lockstate.go:47`. `location` is `activator.HibernatePrefix(cfg.Prefix, host)`, the same as `movesoffline_land.go:610-611`. - `hafresh.ParseOwner(s string) (Owner{Ref, IID, PID, Boot, HA}, bool)` at `owner.go:61`. The owner format is `box/v1;ref=…[;iid=…];pid=…[;boot=…|;ha=1]`. - `lease.CurrentSelf()` (`self.go:25`) is only set in the agent, so it is empty in the oneshot. - There is **no "held by box X" helper**; the plan should write `held &amp;&amp; ok &amp;&amp; o.Ref == selfRef`. The agent's lease `Ref` equals `metricsBoxLabel` (`haself.go:29`). A lock written before `SetSelf` has a legacy `host:pid` owner, which `ParseOwner` rejects, so freshness stays unknown. ## 5. Change index - `ChangeScope(key string) (string, bool)` at `changeindex.go:55`. Add to the `case "control":` arm (:71): `parts[1]=="verify" &amp;&amp; len(parts)==3`, then strip `.json` from `parts[2]` and return `"control/verify/"+ref`. - Bumping is automatic. Store `Put`/`Delete` calls `bumpAfterMutation` (:184) when the change index is enabled, which it is in both `openDeployStore` cases. `BumpChangeIndex(ctx, s, key)` (:203) gives confirmed delivery. - Tests: `TestChangeScope` (`changeindex_test.go:10`, cases plus a negative list), `TestSystemManagedChangeScope` (:190), `TestDemoMovedChangeScope` (:200), and `TestRoleScopeBudget` (`boxroles_test.go:5`) as a model. ## 6. Arming and units - `inertUnits` at `bootstrap.go:186`. It only feeds `bootstrapPlan.Inert` (:217); nothing acts on it. - Arming means moving `carlos-hibernate-verify.timer` into `enabledUnits` (:166). `armedUnits` (:226) starts `.timer` units automatically. - Tests that pin it: - `TestBootstrapPlanJSONNamesWhatALiveRunArms` (`host_test.go:1331`; the inert check is at :1352, and the want-map just above it) - the unit list at `host_test.go:50` - `TestVerifyDrillsRestoreToDiskNotTmpfs` (:1704) - `units_isolation_test.go:66` - The timer is `OnCalendar=*-*-* 03:00:00`, `RandomizedDelaySec=30min`, `Persistent=true`. - The service is `Type=oneshot` with **no `TimeoutStartSec` or `RuntimeMaxSec`**. Systemd turns the start timeout off for oneshot by default, so a 45-minute budget fits. Other settings: `MemoryMax=512M`, `User=carlos`, `ReadWritePaths=/data`, `RestrictAddressFamilies=AF_INET AF_INET6`. The header comment names `control/restore-verify.json` and needs updating. ## 7. RemoveVerifyEntry - The field is `RemoveVerifyEntry func(ctx context.Context, s release.Store, host string) error` at `movespass.go:902`, on the same struct as `Box string` (:780), which is set at :336 to `metricsBoxLabel(...)`. - It is wired at :576. It is called once, at the landing's `landStepVerify` journal step (`movesinstall.go:905-912`), with `ir.s`, and is required to be non-nil by `movesland.go:154`. - To switch to the box's own record: change `RemoveHost` to `(ctx, s, box, host)` and wire it as `func(ctx, s, h) error { return dbverify.RemoveHost(ctx, s, cfg.Box, h) }`. - **A gap to settle in the plan:** landing runs on the destination box. The source box's stale verdict leaves its record only when its own next run's `Merge` drops hosts not in its fleet. - Test stubs to update: `movesland_test.go:420,1727`, `movescutguard_test.go:78`, `movesinstall_test.go:230`. ## 8. Alerts - Box rules live in `metrics.Evaluate` (`internal/metrics/alert.go:227`) over an `Observation` (:101). The per-subject model is `Restarts map[string]UnitRestarts` with `RuleFor`/`SplitRule` (:151, :155), evaluated at :421-463. - The agent builds the `Observation` in `alertTick` (`host/metrics_loop.go:533-545`) from `alertReadings` (:604). It publishes `alerts/boxes/&lt;box&gt;.json`, and the console's alert engine picks rules up from there. `boxSinkRule` (`disktrend.go:103`) limits box-side paging to `disk` and `engine_silent`. - The rule text and levels must be registered in: - `alerting.BoxRuleText` (`internal/alerting/ruletext.go:28`) - `alertRuleLevels` (`console/alertsignals.go:447`) - the notify copy keys (`console/alertnotify.go:~197`) - `alertRuleOrder`, whose test is `alertpages_test.go:549` - The cleanest route: hibernate-verify writes a small local state file under `/data`, and the agent reads it each tick into a new `Observation` field. That field would feed `verify_failed@&lt;host&gt;`, `verify_unverified@&lt;host&gt;` (3 runs in a row) and `verify_coverage` (oldest verdict over 7 days). ## 9. Census - `TestPlan14RootReadCensus` is at `internal/provision/plan14_root_reads_test.go:700`. Its scope is all of `go list -deps .` plus `internal/host/units`. `census-base-scope.txt` lists `internal/ops/*`, `internal/dbverify/dbverify.go` and `internal/dbreads/*`, so all of 2a's files trigger it. - **There is a generator now:** 1. `make census-card` 2. Write a CLAIMS file. 3. `make census-propose NAME=&lt;branch&gt; CLAIMS=&lt;file&gt;`. It writes `testdata/plan14-root-reads-&lt;NAME&gt;.tsv`, a line in `testdata/plan14-root-reads-chain.tsv`, and `docs/superpowers/notes/census-proposal-&lt;NAME&gt;.md` (AGENTS.md:303-399). 4. The other-family reviewer approves. - **The second census:** `TestPlan9B8RecordWriteCensus` (`plan9_b8_census_test.go:360`) uses `linkedDeploymentsSlice1WriteCensusInventory()`. It pins `dbverify.RemoveHost` and `Publish` by digest (:745-746). Changing them needs a layered inventory function, following the pattern in `instance_restore_658_census_test.go`. ## 10. Tests to extend - `internal/dbverify/dbverify_test.go`: `TestMergeKeepsUnvisitedHostsWithTheirOldTimestamp`, `TestMergeDropsHostsNoLongerInTheFleet`, `TestUnverifiedIsNeitherPassNorFailure`, `TestLoadPublishRoundTrip`, `TestRemoveHostDeletesInsideTheCAS`. - `internal/ops/hibernate_verify_test.go`: `TestHibernatingHostsIsTheComplementOfFleetDBs`, `TestVerifyHibernatingVerdicts`, `TestVerifyHibernatingUsesTheActivatorsPrefix`, `TestVerifyHibernatingHonoursTheCap`, `TestOldestFirstPutsNeverVerifiedThenStalest`, `TestVerifyHibernatingCatchesAStaleReplica`. - `internal/dbreads/agent_test.go` and `read_test.go` for the extracted bracket. - `movesland_test.go:655` reads the old record.</result> <usage><subagent_tokens>142142</subagent_tokens><tool_uses>78</tool_uses><duration_ms>457430</duration_ms></usage> </task-notification>

Attributed to this commit: 24.8 g CO₂e (2,165,822 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-REVIEW-BRIEF-member-backups-plans.md b/docs/superpowers/notes/reviews/member-backups/CODEX-REVIEW-BRIEF-member-backups-plans.md
new file mode 100644
index 000000000..c3aa35f82
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/CODEX-REVIEW-BRIEF-member-backups-plans.md
@@ -0,0 +1,27 @@
+# Plan review brief: member backups slices 1 and 2a
+
+Plans:
+- `docs/superpowers/plans/2026-11-11-member-backups-slice1.md`
+- `docs/superpowers/plans/2026-11-11-member-backups-slice2a.md`
+
+Spec: `docs/superpowers/specs/2026-11-11-member-backups-design.md` rev 4.1,
+approved by Paul. Do not re-review the spec; review whether the plans
+implement it correctly and buildably against this repository.
+
+Check, verifying every file:line and name you rely on:
+1. Every spec requirement for slice 1 (§1, §2, §8, refusals 6-8, §12) and
+ slice 2a (§3 except the console reader, copy_since and the test line)
+ has a task, and nothing in the plans contradicts the spec.
+2. Each named function, type, file, test helper and route table exists as
+ the plan says, or the plan creates it. Flag wrong signatures.
+3. Interfaces between tasks are consistent (names, types, order).
+4. Missing tests for an invariant the spec states (identity bracket,
+ no-contents door, other-region forwarding preserved, budget,
+ per-box record isolation, freshness only on the lease holder).
+5. Census and route-table obligations are complete.
+6. Anything that would fail CI or a cross-compile (darwin, windows).
+
+Output: numbered findings with severity (P1 blocks building, P2 must fix
+before building, P3 worth fixing), plan and task, evidence, concrete fix.
+End with one line per plan: READY, READY AFTER FIXES, or NOT READY. Round
+1 of at most three. Do not spawn other models or reviewers.
diff --git a/docs/superpowers/plans/2026-11-11-member-backups-slice1.md b/docs/superpowers/plans/2026-11-11-member-backups-slice1.md
new file mode 100644
index 000000000..d1b82b5ba
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-11-member-backups-slice1.md
@@ -0,0 +1,155 @@
+# Member backups, slice 1: the backups door, section and CLI — Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** Owners, members and release automation can read, for one instance, the last change saved to its copy, how far back history reaches, and what isn't copied, through a console door, a section on the instance page and `carlos instances backups`.
+
+**Architecture:** One console classifier decides what is known about an instance's copy. One door, `GET /api/cli/apps/{account}/{app}/instances/{host}/backups`, answers a fixed, contents-free schema built from `dbdoor.PlanFrom` and a new `dbdoor.HistoryFrom`, bounded and memoised. The instance page calls the same function in-process; the CLI prints the door's answer.
+
+**Tech Stack:** Go; `internal/console` (doors, templates, copy), `internal/dbdoor` (Litestream planning), the root CLI (`clireg`).
+
+**Spec:** `docs/superpowers/specs/2026-11-11-member-backups-design.md` rev 4.1 (approved by Paul 2026-11-11): §1, §2, §8, refusals 6-8, §12. Read it first. Discussion #898.
+
+## Global Constraints
+
+- The door returns no database contents: no rows, schema, file bytes or sizes beyond what §1 lists.
+- Admitted: any account member (person), and service credentials with `deploy` or `operate` (`svcrole.Allow(svcrole.Deploy, svcrole.Operate)`; admin is implied). `db query` and `db pull` gates are unchanged.
+- No "backed up", "up to date", "current" or tick anywhere. Known gaps say "no copy" / "aren't copied"; unknowns say "not shown".
+- Other-region instances: the door answers `not_shown`/`other_region`; the page still shows the `db pull` command; `db pull` forwarding is untouched.
+- Planner bounds: 10-second deadline, at most 20,000 LTX files listed per host, concurrent misses share one load, results memoised 5 minutes per host.
+- The instance page has no tab bar (`instancepage.go:245`, `templates/app_instance.html`), so spec §2's "Backups tab" is a `<section>` on the instance page; layout is the builder's (spec §13).
+- Not announced as "backups" anywhere outside the section itself (no release-note headline, no docs page in this slice).
+- Copy: only strings approved in Task 0, verbatim. No em dashes in copy.
+- Local verification: changed packages only, with `-run`. CI runs the full suite.
+- `internal/dbdoor` and the root CLI are in the root binary's census scope: Task 6 runs `make census-card` and asks for approval on #280 (`census-ruling-member-backups-1`).
+- Commit subjects under 80 characters, body after a blank line, ending `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. One amadan task per plan task on the build branch.
+
+## Review Focus
+
+1. **A replica with nothing in it yet** (an instance created a minute ago): expect `not_shown`/`nothing_replicated`, never an error page. Test in Task 3.
+2. **A sleeping instance whose snapshots were pruned while awake, then slept for weeks**: `history_from` must still equal the earliest `--at` the CLI would accept. Oracle test in Task 1.
+3. **A service credential bound to a different app, or an app-less `deploy` token**: byte-identical 404 as other doors. Test in Task 3 (role table).
+4. **A replica listing over the file cap or past the deadline**: `not_shown`/`too_large_to_plan`, and a second concurrent request does not start a second listing. Test in Task 2.
+5. **A demo instance and a pooled instance**: demo says no copy, pooled says not shown, and neither reads the bucket. Test in Task 2.
+
+---
+
+### Task 0: Copy review
+
+**Files:**
+- Create: `docs/superpowers/plans/member-backups-slice1-copy.json` (approved record)
+- Create: `approved_member_backups_copy_test.go` (repo root)
+
+- [ ] **Step 1:** Extract these strings (spec §8, slice 1 subset) with IDs `MB1-C1`..: section heading "Backups"; "Last change saved: {time}."; "You can go back as far as {date}. 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."; "Restore tests aren't shown here yet."; "Files this app keeps on disk aren't copied yet. Only the database is."; "Copies of files on disk aren't shown here yet." (born HA); "This instance doesn't sleep, and we don't keep a copy of its database yet."; "This instance is served from its own address, so we don't keep a copy of its database."; "{host} isn't an instance, so it has no database for us to copy."; "This is a demo instance. Its data isn't kept."; "Backups for pooled instances aren't shown here yet."; "Backups for instances on your own servers aren't shown here yet." (fleet); "Backups for instances in {region} aren't shown here yet."; "Nothing has been copied yet. Check back in a minute."; "This copy is too large to show here. You can still get a copy:"; "Get a copy on your own computer:"; the CLI's labels for the same lines.
+- [ ] **Step 2:** Run the copy-review skill on them; apply Paul's edits verbatim into the JSON record.
+- [ ] **Step 3:** Write `TestApprovedMemberBackupsCopy` calling `checkApprovedCopy(t, raw, ".", ids, fragments)` (`approved_copy_test.go:71`) against the record, pinning every ID. Run: `go test . -run TestApprovedMemberBackupsCopy` → FAIL until Tasks 4-5 land the strings; mark it `t.Skip` with a note until Task 5, then remove the skip there.
+- [ ] **Step 4:** Commit.
+
+### Task 1: `dbdoor.HistoryFrom`
+
+**Files:**
+- Modify: `internal/dbdoor/plan_from.go`
+- Test: `internal/dbdoor/plan_from_test.go`
+
+**Interfaces:**
+- Produces: `func HistoryFrom(ctx context.Context, rd ReplicaReader) (time.Time, bool, error)`. Returns the earliest instant an `--at` restore accepts (the oldest snapshot-level or `MinTXID == 1` file's time, `Truncate(time.Second).Add(time.Second)`, the same rule as `restore.go:183` and `plan_from.go:130`); `ok=false` when it cannot be decided (no files, or listing times absent: `ErrNoTimes`). `ErrNothingReplicated` passes through.
+
+- [ ] **Step 1: Failing tests.**
+ - `TestHistoryFromMatchesRestoreBoundary`: replicate with `dbdoortest.Replicate` across several batches and a snapshot; assert `HistoryFrom` equals the `Oldest` of the `*BeforeHistoryError` that `restoreAt` returns for an `--at` one hour before the first batch (the CLI path), and that `PlanFrom(ctx, rd, got)` succeeds while `PlanFrom(ctx, rd, got.Add(-time.Second))` returns the before-history error.
+ - `TestHistoryFromTxidOneFileBeforeSnapshot`: a replica with only L0 files starting at TXID 1 and no snapshot gives `ok=true` at that file's time rule.
+ - `TestHistoryFromEmpty`: returns `ErrNothingReplicated`.
+- [ ] **Step 2:** `go test ./internal/dbdoor -run TestHistoryFrom` → FAIL (undefined).
+- [ ] **Step 3:** Implement by sharing `PlanFrom`'s `listing{rd, asOf: true}` and `CalcRestorePlan(ctx, l, 0, time.Time{})`; factor the oldest-time rule into one unexported helper used by both `PlanFrom` and `HistoryFrom`. Don't touch `restore.go`.
+- [ ] **Step 4:** Tests PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 2: The classifier and the bounded, memoised read
+
+**Files:**
+- Create: `internal/console/backups.go`
+- Test: `internal/console/backups_test.go`
+
+**Interfaces:**
+- Consumes: `dbdoor.PlanFrom`, `dbdoor.HistoryFrom` (Task 1); `dbreads.ClassRefusal`; `registry.FleetPlacement`; `s.dbReplica`; `regionlabel.ForCode`.
+- Produces:
+ - `type backupClass string` with `backupReplicated = "replicated"`, `backupNoCopy = "no_copy"`, `backupNotShown = "not_shown"`.
+ - `func classifyBackups(rec provision.Record, consoleRegion string) (backupClass, string /*reason*/)`. Order: `ClassRefusal` (reasons `not_instance`, `own_address`, `no_sleep`, from exactly the record fields `ClassRefusal` reads: `Kind`, `Addr`/`Addrs`, `HibernateOrDefault`; `Unit` alone is not a refusal, as in `db pull`), then `rec.Demo != nil` (`no_copy`, `demo`), then `Pool` (`not_shown`, `pooled`), then `FleetPlacement` (`not_shown`, `fleet`), then region (`not_shown`, `other_region`). Otherwise `replicated`, `""`.
+ - `type backupsView struct { Class backupClass; Reason, Region string; CopiedTo *backupsPosition; HistoryFrom *time.Time; HABorn bool }` and `type backupsPosition struct { Transaction uint64; WrittenAt time.Time }`, JSON tags as spec §1 (`class`, `reason`, `region`, `copied_to{transaction, written_at}`, `history_from`, plus `files: "not_copied"|"not_shown"`).
+ - `func (s *Server) backupsFor(ctx context.Context, rec provision.Record) backupsView`, memoised per host for 5 minutes with an in-flight map (copy `analyticsMemo`, `analyticsview.go:290-395`), 10-second deadline, a `ReplicaReader` wrapper that fails with `errTooManyFiles` past 20,000 listed files. `ErrNothingReplicated` → `not_shown`/`nothing_replicated`; cap or deadline → `not_shown`/`too_large_to_plan`; any other error → `not_shown`/`unavailable` (logged).
+
+- [ ] **Step 1: Failing tests.**
+ - `TestClassifyBackupsTable`: one row per reason above, plus a Unit-only record (expects `replicated`, matching `db pull`) and a fleet record in the console's region.
+ - `TestClassifyBackupsAgreesWithResolveDBSource`: for every table row, `classifyBackups` says `replicated` exactly when `s.resolveDBSource` returns no error (the oracle that keeps the door and `db pull` in agreement, spec §1 R2-2: only intrinsic classes must agree; `other_region` rows assert `resolveDBSource` returns `ErrResidency`).
+ - `TestBackupsForReadsPositionAndHistory`: `dbFixture` + `fx.replicate`; `CopiedTo` equals `PlanFrom(...).TXID`/`.At`, `HistoryFrom` matches Task 1.
+ - `TestBackupsForNotShownNeverReadsBucket`: demo, pooled, fleet and other-region rows: the stubbed `dbReplica` is never called.
+ - `TestBackupsForBounds`: a reader listing 20,001 files gives `too_large_to_plan`; a reader that blocks gives it after the deadline (inject the deadline); two concurrent calls on one host call `dbReplica` once; a second call within 5 minutes reads nothing.
+ - `TestBackupsForNothingReplicated`.
+- [ ] **Step 2:** Run `go test ./internal/console -run 'TestClassifyBackups|TestBackupsFor'` → FAIL.
+- [ ] **Step 3:** Implement as the Interfaces block says. `HABorn` is `rec.HA`; `files` is `not_shown` when `HABorn`, else `not_copied`.
+- [ ] **Step 4:** PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 3: The door
+
+**Files:**
+- Modify: `internal/console/routedecls.go` (one `routeDecl`)
+- Create: `internal/console/apibackups.go`
+- Modify: `internal/console/linkedpolicy.go`, `internal/console/testdata/claim-routes.txt`, `internal/console/claim_invariant_fixtures_test.go`, `internal/console/deploydoors_test.go`, `internal/console/teamdoors_test.go` (as their tests demand)
+- Test: `internal/console/apibackups_test.go`
+
+**Interfaces:**
+- Consumes: `backupsFor`, `classifyBackups` (Task 2).
+- Produces: `{Pattern: "GET /api/cli/apps/{account}/{app}/instances/{host}/backups", Kind: kindCLI, Allow: svcrole.Allow(svcrole.Deploy, svcrole.Operate), Handler: (*Server).handleAPIInstanceBackups}`; JSON body = `backupsView`.
+
+- [ ] **Step 1: Failing tests.**
+ - `TestAPIInstanceBackupsMember`: member token, replicated host → 200 with `class`, `copied_to`, `history_from`; the body has no other keys (decode into `map[string]any` and compare key set).
+ - `TestAPIInstanceBackupsRoles`: table over every `svcrole` role, in the style of `TestAPIDBRefusesEveryServicePrincipalTheSameWay` (`apidb_test.go:358`): deploy, operate, admin → 200; every other role, a token for another app, and another account's member → the same 404 bytes as the gate-pass door.
+ - `TestAPIInstanceBackupsBadHostAndMissing`: bad shape and unknown host → the instance gate's standard 400/404.
+ - `TestAPIInstanceBackupsOtherRegion`: `not_shown`/`other_region` with the region label; and `db pull`'s forward for the same host still admits (call the existing forward door and assert it is not refused).
+- [ ] **Step 2:** `go test ./internal/console -run TestAPIInstanceBackups` → FAIL.
+- [ ] **Step 3:** Handler: `s.instanceGate` → `principalFrom` → `provision.ValidHostShape` → `s.readRecord(ctx, acct.Sqid, app, host)` → `s.backupsFor` → JSON. No audit row (metadata, as other GET doors). Add the door to every route table the census tests name.
+- [ ] **Step 4:** Run `go test ./internal/console -run 'TestAPIInstanceBackups|TestLinkedPolicyCoversEveryAppRoute|TestClaimConsoleRouteCensus|TestDeployReachesExactlyItsDoors|TestEveryCLIDoorNamesItsRoles|TestTeam'` → PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 4: The section on the instance page
+
+**Files:**
+- Modify: `internal/console/instancepage.go` (`instanceDetail` gains `Backups *backupsView`; filled in `handleAppInstance`)
+- Modify: `internal/console/templates/app_instance.html` (a `<section class="backups">` after `updates`)
+- Modify: `internal/console/instancecopy.go` (Task 0's strings)
+- Test: `internal/console/instancepage_test.go`
+
+**Interfaces:**
+- Consumes: `backupsFor`, `classifyBackups`.
+
+- [ ] **Step 1: Failing tests** (browser fixture `newConsoleFixture` + `signInAs`):
+ - `TestInstancePageBackupsReplicated`: shows "Last change saved", the history line, the 7-day line, "Restore tests aren't shown here yet.", the files line, and the `carlos db pull --app {app} --instance {host}` command plus an `--at` example whose time is inside the history.
+ - `TestInstancePageBackupsKnownGaps`: no-sleep, own-address and demo show their "no copy" lines and no command.
+ - `TestInstancePageBackupsOtherRegion`: the other-region line and still the command.
+ - `TestInstancePageBackupsNoForbiddenWords`: across every class, the rendered section contains none of "backed up", "up to date", "current", "✓".
+- [ ] **Step 2:** Run → FAIL.
+- [ ] **Step 3:** Implement. Times in the viewer's zone as the page already formats them. Use existing styleguide classes only (`docs/console-styleguide.md`); no left-border accents.
+- [ ] **Step 4:** PASS, plus `go test ./internal/console -run TestConsoleStyleguideClassesExist`.
+- [ ] **Step 5:** Commit.
+
+### Task 5: `carlos instances backups`
+
+**Files:**
+- Create: `instances_backups.go`, `instances_backups_test.go` (repo root)
+- Modify: `cli.go` (`instancesCommand()` gains `raw("backups", cust, runInstancesBackups)`), `parity/cli.tsv` via `make parity-doc`
+- Modify: `approved_member_backups_copy_test.go` (remove the Task 0 skip)
+
+**Interfaces:**
+- Produces: `func runInstancesBackups(args []string, stdout, stderr io.Writer) int` and `func printBackups(w io.Writer, app, host string, v backupsJSON)` (a CLI-side mirror of `backupsView`).
+
+- [ ] **Step 1: Failing tests:** `TestInstancesBackupsPrintsLines` (each class into a `bytes.Buffer`, the approved labels); `TestInstancesBackupsJSON` (`--json` writes the body verbatim plus newline); `TestInstancesBackupsPicksOnlyInstance` (no `--instance`, one instance → uses it; several → refuses naming them, via `resolveDBInstance`); a fake console with `httptest.NewServer` + `newTestSession`.
+- [ ] **Step 2:** `go test . -run 'TestInstancesBackups|TestApprovedMemberBackupsCopy'` → FAIL.
+- [ ] **Step 3:** Implement following `runGeo` (`geo_cmd.go:35`): `requireAPISession`, `resolvedAccount`, `resolvedApp`, `sess.getJSON(ctx, apiPath(acct, app, "instances/"+host+"/backups"))`, `apiErrorFromBody`.
+- [ ] **Step 4:** `make parity-doc`; `go test . -run 'TestInstancesBackups|TestApprovedMemberBackupsCopy|TestCLIProjection'` → PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 6: Census and branch close
+
+- [ ] **Step 1:** `make census-card`; `make census-propose` naming `census-ruling-member-backups-1`; post the card on #280 and wait for the reviewer's approval. Commit the overlay.
+- [ ] **Step 2:** Changed packages only: `go test ./internal/dbdoor ./internal/console . -run 'HistoryFrom|Backups|ClassifyBackups|InstancePageBackups|InstancesBackups|ApprovedMemberBackups|LinkedPolicy|ClaimConsoleRoute|DeployReaches|EveryCLIDoor|CLIProjection|Plan14'`. Push; `amadan ci status -branch <name>` green.
+- [ ] **Step 3:** Whole-branch Astra review (three rounds at most). Then release, roll dev first, and the dev check (spec §12: the section on a dev instance matches `carlos db pull`'s position line). Reply on #898 and #893 (close #893 as absorbed).
diff --git a/docs/superpowers/plans/2026-11-11-member-backups-slice2a.md b/docs/superpowers/plans/2026-11-11-member-backups-slice2a.md
new file mode 100644
index 000000000..7929fab45
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-11-member-backups-slice2a.md
@@ -0,0 +1,179 @@
+# Member backups, slice 2a: restore tests published per box — Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** Every box with sleeping instances runs the restore drill nightly and publishes its own record, `control/verify/<ref>.json`, whose verdicts are bound to the instance identity they tested, and operators are alerted when a test fails, keeps being unverified, or falls more than 7 days behind.
+
+**Architecture:** `hibernate-verify` stops sharing one deployment-wide key. Each run opens the `dbreads` identity bracket per host, plans with `dbdoor.PlanFrom`, restores pinned to that TXID, closes the bracket, and records a v2 verdict. It works oldest first inside a 45-minute budget, publishes every 10 minutes, and leaves a local copy the box agent turns into alert rules. Freshness is compared only when this box holds the host's live lease.
+
+**Tech Stack:** Go; `internal/dbverify`, `internal/ops`, `internal/dbreads`, `internal/lease`, `internal/host` (bootstrap, agent, moves, units), `internal/metrics` + `internal/alerting` + console alert registration, `internal/release` (change index), `internal/hostops`.
+
+**Spec:** `docs/superpowers/specs/2026-11-11-member-backups-design.md` rev 4.1 (approved by Paul 2026-11-11): §3 (all bullets except the console reader, `copy_since` and the test line, which are slice 2b) and §7's 2a row. Rulings D4. Discussion #898.
+
+## Global Constraints
+
+- Record key: `control/verify/<ref>.json`, one per box, written only by that box. `<ref>` is the box's lease reference (the agent's `metricsBoxLabel`), never `os.Hostname()`.
+- `control/restore-verify.json` is no longer written or read by any code; its text mentions move to the new key.
+- Verdicts never say "current". `stale` only when proved, and only on a box that holds the host's live lease (`lease.LockState` + `hafresh.ParseOwner`, `Ref == self`); otherwise freshness is `unknown` and is not a failure.
+- Budget: drills oldest first (never verified, then stalest `VerifiedAt`), 45 minutes per run by default (`-budget`), `-max` default 0 (no count cap). Publish every 10 minutes and at the end.
+- The bracket: identity captured before planning, confirmed after the last replica byte; any difference discards the restore and records `unverified` with reason `record_changed` or `moving`.
+- Scratch stays on disk (`TMPDIR=%C/carlos-verify`, `TestVerifyDrillsRestoreToDiskNotTmpfs`).
+- Alert thresholds: `verify_failed@<host>` on a failed verdict; `verify_unverified@<host>` after 3 consecutive unverified runs for any reason except `not_reached`; `verify_coverage` when any host's last decided verdict (passed or failed) is older than 7 days, or it has none and was first seen more than 7 days ago.
+- Copy: only strings approved in Task 0, verbatim; no em dashes.
+- Census: the root-read census (`TestPlan14RootReadCensus`) and the record-write census (`TestPlan9B8RecordWriteCensus`) both cover this slice; Task 9 handles both. Overlay name `member-backups-2a`.
+- Local verification: changed packages only, `-run`. CI runs the full suite.
+- Commit subjects under 80 characters, body after a blank line, ending `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. One amadan task per plan task.
+
+## Review Focus
+
+1. **A host moved off this box since the last run**: its verdict leaves this box's record on the next run (Merge drops hosts not in the fleet) and no verdict for it is written mid-move. Test in Task 5.
+2. **A host deleted and recreated with the same name during a drill**: the new incarnation gets no verdict from the old copy. Test in Task 5.
+3. **Two boxes running at once**: neither changes the other's record (CAS on each box's own key). Test in Task 4.
+4. **A box whose agent hasn't written its self label yet (fresh boot)**: the run publishes nothing and exits non-zero with a clear log line, rather than publishing under the hostname. Test in Task 5.
+5. **A run killed at 30 minutes**: everything verified up to the last 10-minute publish is in the bucket. Test in Task 5.
+
+---
+
+### Task 0: Copy review
+
+**Files:** Create `docs/superpowers/plans/member-backups-slice2a-copy.json`; create `approved_member_backups_2a_copy_test.go` (repo root).
+
+- [ ] **Step 1:** Draft the operator-facing strings with IDs `MB2A-C1`..: rule texts for `verify_failed` ("A restore test failed for {host}."), `verify_unverified` ("A restore test couldn't run for {host} three nights in a row: {reason}."), `verify_coverage` ("Restore tests on {box} are more than 7 days behind."), their notify subjects, and the reason labels (`record_changed`, `moving`, `not_reached`, `nothing_replicated`, `restore_error`, `no_lease_holder`).
+- [ ] **Step 2:** Run the copy-review skill; apply Paul's edits verbatim to the JSON record.
+- [ ] **Step 3:** `TestApprovedMemberBackups2aCopy` via `checkApprovedCopy` (`approved_copy_test.go:71`), skipped until Task 8 lands the strings.
+- [ ] **Step 4:** Commit.
+
+### Task 1: The identity bracket as a shared function
+
+**Files:** Create `internal/dbreads/identity.go`; modify `internal/dbreads/agent.go:209` (`check` calls it); test `internal/dbreads/identity_test.go`.
+
+**Interfaces:**
+- Produces:
+ - `type Identity struct { Account, App, Host, Region, Incarnation string }`
+ - `func CaptureIdentity(ctx context.Context, s release.Store, region, account, app, host string) (Identity, provision.Record, string /*code*/, error)`: the record read fresh; code `CodeRecordChanged` when missing, wrong region, pooled, fleet-placed, `ClassRefusal != ""` or a bad shape; `CodeMoving` when `rec.Move != nil`; `""` otherwise.
+ - `func ConfirmIdentity(ctx context.Context, s release.Store, want Identity) (provision.Record, string, error)`: `CaptureIdentity` again, then `CodeRecordChanged` unless the identity is equal.
+- `Agent.check` becomes `ConfirmIdentity(ctx, a.cfg.Store, Identity{req.Account, req.App, req.Host, a.cfg.Region, req.Incarnation})`, with no behaviour change.
+
+- [ ] **Step 1: Failing tests:** `TestCaptureIdentityRefusals` (one row per code path above); `TestConfirmIdentityDetectsRecreate` (same name, same and another account, new `CreatedAt` → `record-changed`); `TestConfirmIdentityDetectsMove`.
+- [ ] **Step 2:** `go test ./internal/dbreads -run 'Identity'` → FAIL.
+- [ ] **Step 3:** Implement; refactor `check`.
+- [ ] **Step 4:** `go test ./internal/dbreads -run 'Identity|Agent|Read'` → PASS (the existing `agent_test.go:31` recreation cases unchanged).
+- [ ] **Step 5:** Commit.
+
+### Task 2: The box's own reference, readable by the drill
+
+**Files:** Create `internal/boxself/boxself.go` (leaf package) and test; modify the agent start in `internal/host` where `haSelfNow` is applied (`lease.SetSelf`) to also call `boxself.Write`.
+
+**Interfaces:**
+- Produces: `func Write(dataDir, ref string) error` (atomic write of `<dataDir>/monitor/self.json` `{"v":1,"ref":...}`, mode 0644) and `func Read(dataDir string) (string, error)` (`os.ErrNotExist` when absent; refuses an empty or invalid ref).
+
+- [ ] **Step 1: Failing tests:** `TestBoxSelfRoundTrip`, `TestBoxSelfReadMissing`, `TestBoxSelfRefusesEmpty`; in `internal/host`, `TestAgentWritesSelfRefEqualToLeaseRef` (the written ref equals `haSelfNow(...).Ref` for a fixed box and a group box fixture).
+- [ ] **Step 2:** Run → FAIL.
+- [ ] **Step 3:** Implement. Write after the group-reference wait, alongside `lease.SetSelf`.
+- [ ] **Step 4:** `go test ./internal/boxself ./internal/host -run 'BoxSelf|SelfRef'` → PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 3: Restore pinned to a planned transaction
+
+**Files:** Modify `internal/lease/check.go:88`; test `internal/lease/check_test.go`.
+
+**Interfaces:**
+- Produces: `func VerifyReplicaAt(ctx context.Context, bucket, prefix, region, dir string, txid uint64) (uint32, error)`: restores exactly through `txid` (Litestream restore options' TXID), runs `CheckDB`, returns the change counter, removes the file before returning as today. `VerifyReplica` becomes `VerifyReplicaAt(..., 0)` (0 = latest), unchanged for its callers.
+
+- [ ] **Step 1: Failing test:** `TestVerifyReplicaAtStopsAtTheTarget` (replicate three batches; pin to the second batch's TXID; the restored counter equals a restore of batch two, not three).
+- [ ] **Step 2:** `go test ./internal/lease -run VerifyReplica` → FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** PASS, existing `VerifyReplica` tests included.
+- [ ] **Step 5:** Commit.
+
+### Task 4: `dbverify` v2: one record per box
+
+**Files:** Modify `internal/dbverify/dbverify.go` and its tests; `internal/release/changeindex.go:71` (+ `changeindex_test.go`); `internal/hostops/mutation_classifier.go:64`; `internal/moves/offline.go:72` (text only).
+
+**Interfaces:**
+- Produces:
+ - `func KeyFor(ref string) string` → `"control/verify/" + ref + ".json"`; refuses an invalid ref. The old `Key` constant is removed.
+ - `Verdict` v2 fields: `Result string` (`passed|failed|unverified`), `Reason string`, `Identity Identity` (a struct in `dbverify` mirroring `dbreads.Identity` field for field, so the leaf package imports nothing new; Task 5 converts), `Prefix string`, `BracketOpenedAt, VerifiedAt time.Time`, `TXID uint64`, `WrittenAt time.Time`, `RestoredBytes int64`, `Freshness string` (`stale|unknown|not_stale`), `UnverifiedRuns int`, `FirstSeen time.Time`. `OK`/`Unverified` stay as derived accessors for `Failures()`/`Unverified()`.
+ - `Record{V: 2, Box: ref, CheckedAt, Hosts map[string]Verdict}`.
+ - `func Merge(prior *Record, ref string, now time.Time, fleet []string, results map[string]Verdict) *Record`: keeps unvisited fleet hosts, drops hosts not in the fleet, adds never-seen fleet hosts as `unverified`/`not_reached` with `FirstSeen = now`, carries `FirstSeen`, and sets `UnverifiedRuns` to prior+1 for an unverified result (except `not_reached`), else 0.
+ - `func Load(ctx, s release.Store, ref string) (*Record, error)`, `func Publish(ctx, s release.Store, rec *Record) error` (CAS on `KeyFor(rec.Box)`), `func RemoveHost(ctx, s release.Store, ref, host string) error`.
+ - `ChangeScope("control/verify/<ref>.json")` → `"control/verify/<ref>", true`; anything deeper or without `.json` → false.
+ - The mutation classifier gains `{prefix: "control/verify/"}` in place of the old exact row.
+
+- [ ] **Step 1: Failing tests:** extend `TestMerge*` for `FirstSeen`, `UnverifiedRuns` (three unverified runs → 3; a pass resets; `not_reached` doesn't count); `TestPublishWritesOnlyItsOwnKey` (two refs, interleaved publishes, each record intact); `TestRemoveHostOwnRecordOnly`; `TestChangeScope` cases for `control/verify/`; the classifier's table test.
+- [ ] **Step 2:** `go test ./internal/dbverify ./internal/release ./internal/hostops -run 'Merge|Publish|RemoveHost|ChangeScope|Classif'` → FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 5: The nightly run
+
+**Files:** Modify `internal/ops/ops.go:260-380` (`runHibernateVerify`), `internal/ops/hibernate_verify.go`; tests in `internal/ops/hibernate_verify_test.go`.
+
+**Interfaces:**
+- Consumes: Tasks 1-4.
+- Produces:
+ - `HibernatingRoute` gains `Account, App string` (from `registry.Route`).
+ - `func VerifyHibernating(ctx context.Context, d Drill, hosts []HibernatingRoute, now func() time.Time, publish func(map[string]dbverify.Verdict)) map[string]dbverify.Verdict`, where `type Drill struct { Cfg *activator.Config; Store release.Store; Region, SelfRef, TmpDir string; Budget time.Duration; Max int; PublishEvery time.Duration }`.
+ - Flags: `-budget` (default `45m`), `-max` (default 0), `-publish-every` (default `10m`, hidden).
+ - The local alert copy: after each publish, the record is also written atomically to `<data>/monitor/verify.json`.
+
+Per host, in order: `CaptureIdentity` (on a code: `unverified` with that reason, next host) → `PlanFrom(ctx, rd, time.Time{})` (`ErrNothingReplicated` → `unverified`/`nothing_replicated`) → `VerifyReplicaAt(..., plan.TXID)` → `ConfirmIdentity` (on a code: discard, `unverified`) → freshness: `lease.LockState`, `hafresh.ParseOwner`, and if `Ref == SelfRef` the existing `hibernateFreshness`, else `unknown` → verdict with the plan's `TXID`, `At`, `RestoredBytes`. A restore or integrity error → `failed`/`restore_error`; a proved stale replica → `failed`/`stale`. Stop starting hosts when the budget is spent; record the rest as `not_reached` through `Merge`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestVerifyHibernatingBindsIdentity` (verdict carries identity, prefix, TXID, `WrittenAt`, bytes, bracket time).
+ - `TestVerifyHibernatingRecreateDuringRestore` and `TestVerifyHibernatingMoveDuringRestore` (inject the change between plan and confirm → `unverified`, no pass).
+ - `TestVerifyHibernatingFreshnessOnlyOnLeaseHolder` (lock owned by another ref: no local source read, `unknown`, not failed; owned by self: stale detected as today).
+ - `TestVerifyHibernatingBudget` (fake clock; budget reached after N hosts; the rest `not_reached`; oldest first kept).
+ - `TestVerifyHibernatingPublishesPeriodically` (publish called at each 10-minute mark and at the end with everything finished so far).
+ - `TestRunHibernateVerifyRefusesWithoutSelfRef` (no `self.json`: no publish, non-zero exit, log names the file).
+ - `TestRunHibernateVerifyWritesLocalAlertCopy`.
+ - Update `TestVerifyHibernatingHonoursTheCap` for `-max` default 0.
+- [ ] **Step 2:** `go test ./internal/ops -run 'Hibernat'` → FAIL.
+- [ ] **Step 3:** Implement. The self ref comes from `boxself.Read(dataDir)`; the region from `CARLOS_REGION` (the unit loads `/etc/carlos/host.env`).
+- [ ] **Step 4:** PASS, including `TestVerifyDrillsRestoreToDiskNotTmpfs`.
+- [ ] **Step 5:** Commit.
+
+### Task 6: Arm the drill
+
+**Files:** Modify `internal/host/bootstrap.go:166-217` (move `carlos-hibernate-verify.timer` from `inertUnits` to `enabledUnits`), `internal/host/units/carlos-hibernate-verify.service` (header comment names the new key), `internal/host/host_test.go:50,1331-1352`, `internal/host/units_isolation_test.go:66` as needed.
+
+- [ ] **Step 1: Failing test:** update `TestBootstrapPlanJSONNamesWhatALiveRunArms` so the timer is armed and only `carlos-restore-verify.timer` stays inert.
+- [ ] **Step 2:** `go test ./internal/host -run 'TestBootstrapPlan|Units'` → FAIL.
+- [ ] **Step 3:** Implement. A box with no sleeping hosts runs, finds none, publishes nothing, and exits 0.
+- [ ] **Step 4:** PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 7: Move landing uses the box's own record
+
+**Files:** Modify `internal/host/movespass.go:576` (wire `func(ctx, s, h) error { return dbverify.RemoveHost(ctx, s, cfg.Box, h) }`), test stubs at `movesland_test.go:420,655,1727`, `movescutguard_test.go:78`, `movesinstall_test.go:230`.
+
+The landing box clears any verdict for the host from its own record (one left from an earlier stay). The source box's verdict leaves at that box's next run, because `Merge` drops hosts no longer in its fleet; 2b's `copy_since` hides it from the console in between.
+
+- [ ] **Step 1: Failing test:** `TestLandingRemovesHostFromOwnVerifyRecord` (seed this box's record with the host; land; the host is gone from `KeyFor(cfg.Box)` and no other key was written).
+- [ ] **Step 2:** `go test ./internal/host -run 'Landing|MovesLand|MovesInstall|MovesCut'` → FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 8: Operator alerts
+
+**Files:** Modify `internal/metrics/alert.go` (`Observation` gains `Verify *VerifyReading`; three rules in `Evaluate`), `internal/host/metrics_loop.go:533-545,604` (read `<data>/monitor/verify.json` into the observation each tick), `internal/alerting/ruletext.go:28`, `internal/console/alertsignals.go:447`, `internal/console/alertnotify.go` (copy keys), the `alertRuleOrder` list; remove Task 0's test skip.
+
+**Interfaces:**
+- Produces: `type VerifyReading struct { Failed []string; UnverifiedStreak map[string]int; UnverifiedReason map[string]string; Behind []string /*hosts past 7 days*/; Box string }`, built by `func ReadVerify(path string, now time.Time) (*VerifyReading, error)` in `internal/metrics` (missing file → nil, no rules).
+- Rules: `verify_failed@<host>`, `verify_unverified@<host>` (streak ≥ 3), `verify_coverage` (`len(Behind) > 0`), using `RuleFor`/`SplitRule` (`alert.go:151,155`) like `restarts@<unit>`.
+
+- [ ] **Step 1: Failing tests:** `TestEvaluateVerifyRules` (each rule fires and clears; `not_reached` never counts toward the streak; a missing reading fires nothing); `TestReadVerifyBehind` (7-day boundary, never-verified with `FirstSeen` older than 7 days); `TestAlertRuleOrderCoversVerify` (the existing order test extended); `TestApprovedMemberBackups2aCopy`.
+- [ ] **Step 2:** `go test ./internal/metrics ./internal/host ./internal/console ./internal/alerting . -run 'Verify|AlertRuleOrder|ApprovedMemberBackups2a'` → FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** PASS.
+- [ ] **Step 5:** Commit.
+
+### Task 9: Census and branch close
+
+- [ ] **Step 1:** Root-read census: `make census-card`; write the CLAIMS file; `make census-propose NAME=member-backups-2a CLAIMS=<file>`; post the proposal on #280; wait for the other-family reviewer's approval. Commit the overlay and chain line.
+- [ ] **Step 2:** Record-write census: add a layered inventory function for the new `dbverify.Publish`/`RemoveHost` digests following `instance_restore_658_census_test.go`; `go test ./internal/... -run TestPlan9B8RecordWriteCensus` → PASS.
+- [ ] **Step 3:** Changed packages only with `-run` for every test named above; push; `amadan ci status -branch <name>` green.
+- [ ] **Step 4:** Whole-branch review: Astra, plus Fable (this arms a nightly job on every box). Three rounds at most.
+- [ ] **Step 5:** Release and roll, dev first. Dev check: after one night every dev box with sleeping hosts has `control/verify/<ref>.json`, `control/restore-verify.json` is untouched since the roll, a move of a dev instance clears it from the landing box's record, and no alert fired spuriously. Report on #898. Then ask Paul before the flagship roll.