carlos / platform Public

member backups: 2b plan rev 2 after Astra round 1; 1b plan findings (#898)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 9cf6ddc659a7752b28f1e2f5f0678835c86f09f2 parent b331ddc
4 files changed, +175 −19
  • docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b.md +45 −0
  • docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-2b.md +38 −0
  • docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b.md +50 −0
  • docs/superpowers/plans/2026-11-12-member-backups-slice2b.md +42 −19

CI cancelled — superseded by a newer push — run details

Intent

Human

<task-notification> <task-id>a3f8adc202e230fa3</task-id> <tool-use-id>toolu_01FhDWUj9Vp725RWiZqFTuwQ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/a3f8adc202e230fa3.output</output-file> <status>completed</status> <summary>Agent "Fix 2a drill landing + read-only restore" 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>Status: DONE_WITH_CONCERNS. R1b is fixed and committed. I did not write report.md: the harness blocked that file write, and a Bash heredoc would just route around the block. So the full report is pasted below, as your fallback allows. Commits: 4a9f46b4 R2, 2a6daefa R1, 06f609fe R3, d8f9824a R1b, b6dd6e23 + 445ed3be census. Nothing pushed. Tests: RED was captured for every item and the touched tests now pass; gofmt and vet are clean; the linux, darwin and windows builds pass. Census: re-proposed under the same NAME, seal b130b2d6 → 45c6afd0. Both census tests pass. Reviewer approval on #280 is still owed. Concerns: leftover staging keeps a host `moving` every night (the alert is the right signal); `moves/` listing permission is untested live; a harmless `packed-refs.lock` warning on every commit. --- # Slice 2a landing fixes: report (R1, R2, R3, R1b) Branch member-backups-2a-landing, base 178dcfe5 (= main), not pushed. Every `go` command ran at `nice -n 19` with the sandbox off, because the Go cache is read-only inside it. GOCACHE stays at its default. | Commit | What | |---|---| | 4a9f46b4 | R2: restore read-only through the planner's listing | | 2a6daefa | R1: don't test a replica that a landed move's copy will replace | | 06f609fe | R3: run on home-region boxes, matching region "" exactly | | d8f9824a | R1b: a move that closes inside a host's test is `moving` | | b6dd6e23, 445ed3be | census proposal, then re-proposal (seal b130b2d6 → 45c6afd0) | ## R1: landed, awaiting promotion **What the drill trusts.** The first-wake promotion (`promoteStagedReplica`, activator/backend_exec.go) trusts one thing: a listing of `moves/&lt;host&gt;/` in the box's own data bucket. That is `b.Cfg.Bucket`, the same bucket the drill reads. If anything is there, under any name, it is mirrored over `instances/&lt;host&gt;/` before the restore ("staging wins"). The staged keys are deleted only after the wake's restore succeeds. Neither the record nor the registry can say "awaiting promotion": - the record's `Move` is already nil once the move lands; - the registry row is created at landing, before the promotion. So the drill uses the promotion's own test. That test is also what the console's restore check (`hostHasStaging`, #658) uses: a one-key `ListPage` with a trailing slash, and the returned key checked against the prefix. Nothing here was ambiguous. The one conservative rule I added is that a listing error never counts as "nothing staged". **Changes** (internal/ops/hibernate_verify.go): - A new `openStaging` seam opens the bucket once per run (`lease.NewFilesStore` as a `release.PageLister`). The new `Drill.stagedCopy` makes one bounded listing per call. - **At the bracket's open** (after the record capture, before scratch, plan or restore): - staging present: unverified/`moving`, with the existing detail "the instance was moving when the test began"; - listing error: unverified/`storage_unavailable`, and no restore. - **At the close** (after `confirmDrillIdentity`): - staging present: unverified/`moving` ("the instance changed during the test, so its result was discarded"); - listing error: unverified/`storage_unavailable`. - A run that ends during either listing abandons the host, as before. - No new reason and no new copy. `Detail` is not rendered in the console or on the metrics page. **Tests** (hibernate_verify_staging_test.go). The staged copy is a real replica's objects, written at `activator.MovesPrefix(host)` plus the source's relative keys. The bucket is a `DirStore` behind a spy that records every listing and rejects any listing that is not one key from the start. - `TestDrillLandedCopyAwaitingPromotionIsMoving`: an old orphan copy that restores clean through the production restore, with staging present, gives `moving`. It is never planned or restored, and staging is listed once. A control host with the same orphan copy and no staging passes. - `TestDrillStagedCopyArrivingDuringTheTestIsMoving`: the copy lands during the restore or during planning, and the restore reports either damage or a clean copy. Every case gives `moving`; none gives failed or passed. - `TestDrillPromotedCopyIsUnchanged`: after promotion the host passes at the planned TXID, with two bounded listings. - `TestDrillStagingIsPerHost`: staging for `a.example.com` does not affect `a.example.co`. - `TestDrillStagingUnreadableIsNeverAPass`: - listing error at the open gives `storage_unavailable` with no restore; - listing error at the close, after a clean or a damaged restore, gives `storage_unavailable`; - a bucket that cannot be opened gives `storage_unavailable` for every host, with no restores. **RED.** With the seam in place but not called, `go test ./internal/ops -run 'TestDrillLanded|TestDrillStaged|TestDrillPromoted|TestDrillStaging'` gave: - `landed host: verdict {Result:passed ... TXID:3}, want unverified/moving`, which is the stale pass; - `mixed_lineage_reads_as_damage: verdict {Result:failed Reason:restore_error}, want unverified/moving`, which is the false failed; - `old_lineage_restores_clean: passed`; - `staging listed 0 times, want twice`; - per-host and unreadable cases failing. **GREEN.** `go test ./internal/ops -run 'TestDrill|TestVerifyHibernating|TestRunHibernateVerify|TestOldestFirst|TestHibernat'` gives `ok internal/ops`. ## R2: read-only restore over the planner's listing **Changes:** - `dbdoor.PlanListed(ctx, rd) (RestorePlan, ReplicaReader, error)` plans exactly as `PlanFrom(ctx, rd, time.Time{})` does. It returns the plan's own cached listing wrapped in `listedReader`, which has only `LTXFiles` and `OpenLTXFile`, so no type assertion can reach a write. - `lease.ReplicaReader` (list and open only) and `lease.VerifyReaderAt(ctx, rd, prefix, dir, txid)`. The latter is `VerifyClientAt` over `readOnlyClient`: its `WriteLTXFile`, `DeleteLTXFiles` and `DeleteAll` only return `lease.ErrReadOnly`, and it is not a `ReplicaClientV3`. - The drill's `plan` now returns the listed reader, and `verifyAt` (= `lease.VerifyReaderAt`) restores through it. - Unchanged: the pinned TXID, `CheckDBContext`, damage marking, cleanup on every path, and the replan on `os.ErrNotExist` or `ErrTxNotAvailable` (a replan builds a fresh listing). - `VerifyReplicaAt` stays for other callers. **Tests:** - lease `TestVerifyReaderAt`: restores the pinned position through a list/open reader over a client that traps writes; no write is called. The three writes return `ErrReadOnly`, and the client is not a v0.3 client. - lease `TestVerifyReaderAtMissingObject`: a missing object still surfaces as `os.ErrNotExist`. - dbdoor `TestPlanListedRestoresThroughItsListing`: the plan equals `PlanFrom`'s, the returned reader is not a `litestream.ReplicaClient`, and across plan plus restore each level is listed exactly once. `TestPlanListedAnEmptyReplica` was also added. - ops `TestVerifyHibernatingListsEachLevelOncePerHost`: two hosts through the production `verifyAt`, with a counting reader whose real type is a full file client with write traps. Levels 0 to 9 are each listed exactly once per host, and both hosts pass. - `ReplansAMissingObject` (all 4 cases) and `RealCorruptionFails` now run through the production restore. **RED.** First a compile failure (`undefined: VerifyReaderAt`, `undefined: PlanListed`, and the old `verifyAt` signature). Then a behavioural RED: with the old double listing put back, `TestVerifyHibernatingListsEachLevelOncePerHost` fails with "level 0 listed 2 times, want once", and the same for levels 1 to 9. **GREEN:** - `go test ./internal/lease -run 'TestVerifyReaderAt|TestVerifyClientAt|TestVerifyReplica'`: 13 PASS. - `go test ./internal/dbdoor -run 'TestPlanListed|TestPlanFrom|TestPositionAndHistory'`: 11 PASS. - The ops set is green. **Cost.** A host now costs 12 LIST + (F+4) GET, down from 20 LIST: R2 removes 10 LISTs and R1 adds 2 one-key LISTs. That is about 2,400 LISTs a night across the fleet instead of about 4,000, roughly $0.40 a month instead of $0.62. ## R3: home-region boxes **Cause.** Home boxes have `CARLOS_REGION` empty. The gate at ops.go:478 refused them, so every night they logged "NOT RUN: CARLOS_REGION \"\" is not a region" and exited 1. **Change.** The gate is now `r.Region != "" &amp;&amp; !ValidRegion &amp;&amp; !fleet`. The bracket already compares regions exactly, so a home box matches only records whose region is "". I checked every other place in the drill path for the same empty-region problem: - Assignment (`selectHosts`, verifyassign.go, boxself) never reads the region. - Publishing (`PublishOver`, keyed by ref) never reads it. - Freshness uses `Cfg.Region`, the bucket's AWS region, not `CARLOS_REGION`. - dbverify treats an identity with region "" and an incarnation as known. - The unit passes host.env through. **Tests** (hibernate_verify_home_test.go): - `TestRunHibernateVerifyHomeBoxDrillsHomeInstances`: the real run path with Region "" and the production restore. It exits 0, publishes the home instance as passed with identity region "", and records a "uk" record on the same box as `no_record`. - `TestDrillHomeRegionMatchesExactly`: a "uk" box with a home record gives `no_record`; a home record that leaves for "uk" during the test gives `record_changed`. - `TestRunHibernateVerifyRefusesAMalformedRegion`: " ", "UK", "eu west", "fleet/", "uk/" and "-uk" each exit 1, log "is not a region", restore nothing and publish nothing. **RED.** "a home box exited 1: hibernate-verify: NOT RUN: CARLOS_REGION "" is not a region". The other two tests already passed before the fix; they pin down what must not loosen. **GREEN.** All pass. ## R1b: a whole move inside one host's test **Change** (drillidentity.go). The bracket now captures a drill-only `drillIdentity`: the published `dbreads.Identity` plus a `lastMove` stamp. The stamp is `moveStamp(rec.LastMove)`, built from ID, Outcome, `At` and `OfflineS`, and is "" when there is none. `LastMove` is written at every move's close (online done, offline finish, rolled_back, aborted), so it identifies the latest completed move. `confirmDrillIdentity` decides the close like this: - a changed identity is still `record_changed`, which outranks a move; - the same identity with a different stamp is `CodeMoving`, which gives unverified/`moving`. It reads only the record the bracket already fetches, so there are no new requests. Sidecar records carry no `LastMove`, so their stamp is "" on both sides. The published identity is unchanged. **Tests:** - New case "a move completed" in `TestVerifyHibernatingBracket`: `LastMove` set during planning or during download, under every restore outcome (restored, empty plan, restore error, integrity failure), always gives unverified/`moving` with no findings kept. - New `TestDrillBracketSeesACompletedMove`: - an old `LastMove` already present at the open still passes; - another move closing ("done") or rolling back during the test gives `moving`; - the published identity carries no stamp. **RED.** `TestDrillBracketSeesACompletedMove/another_move_closed: verdict passed/, want unverified/moving`, the same for `a_move_rolled_back`, and `TestVerifyHibernatingBracket/a_move_completed/...` failing. 11 failures in all. **GREEN.** The full ops drill set gives `ok`, and the two bracket tests pass all 40 subtests. ## Checks and census - gofmt clean. `go vet` on `internal/ops`, `internal/lease` and `internal/dbdoor` passes. - `go build ./...` passes for linux, `GOOS=darwin` and `GOOS=windows`. - `make census-propose NAME=member-backups-2a-landing CLAIMS=&lt;file&gt;` was rerun in place: one chain line replaced, not duplicated. It covers: - unit `internal/ops/ops.go hibernateRun.run` (body only, reads unchanged, same disposition); - re-pinned envelopes `internal/ops`, `internal/lease` and `internal/dbdoor`. - Seal b130b2d6 → 45c6afd0. The card is `docs/superpowers/notes/census-proposal-member-backups-2a-landing.md`. - `go test ./internal/provision -run 'TestPlan14RootReadCensus$|TestPlan9B8RecordWriteCensus$'`: both PASS. - **The independent reviewer's approval on #280 is still owed.** I did not dispatch a reviewer. ## Concerns 1. **Leftover staging.** `dropStagedReplica` is best-effort. If it leaves keys behind, the host stays `moving` every night and the 3-run unverified alert fires. I think that alert is right: a later cold wake would promote the leftover again over newer data, which is an existing activator hazard the drill now surfaces. 2. **IAM.** The drill lists `moves/&lt;host&gt;/` in its own data bucket with the instance role. The activator already lists that prefix under the same role, and the `s3:prefix "moves/*"` conditions in infra apply only to sibling staging buckets. Still, I did not test it live. 3. **Phase1 boxes** don't promote staging. The drill still says `moving` when staging is present there, which errs on the safe side. 4. **R1b relies on every move close writing `LastMove`.** It does today (done, offline finish, rolled_back, aborted). A future kind of move that closed without writing it would be invisible again. 5. **Git warnings.** Each commit printed "Unable to create .git/packed-refs.lock: File exists". The commits and the branch ref were written correctly. The lock belongs to another session, so I left it alone.</result> <usage><subagent_tokens>268954</subagent_tokens><tool_uses>12</tool_uses><duration_ms>222376</duration_ms></usage> </task-notification>

diff --git a/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b.md b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b.md
new file mode 100644
index 000000000..a6ec565b1
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b.md
@@ -0,0 +1,45 @@
+Round 1 of 3: **5 P1, 2 P2**. Reviewed against the current code and spec rev 6.1. No files changed or tests run; `GOCACHE` remains unset.
+
+1. **P1 — Task 8 can verify cleanup that does not meet the retention requirement.**
+ **Fault family: bounded retention of database contents.**
+ [Plan:215](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:215) cannot represent `NewerNoncurrentVersions`, which retains a specified number of old versions ([SDK definition:3403](/home/paulca/go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/s3@v1.105.0/types/types.go:3403)). A one-day rule retaining one noncurrent version can therefore pass while keeping the database indefinitely. Separately, line 217 waives multipart expiry for every `CARLOS_S3_ENDPOINT`, although that variable accepts arbitrary endpoints ([s3compat.go:40](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/s3compat/s3compat.go:40)). MinIO documentation cannot establish another provider’s cleanup.
+
+ **Fix:** reject version-retaining rules; require present, positive expiry values; require multipart expiry unless a specific provider’s equivalent cleanup is independently verified. Add adapter-through-verifier tests for retained versions, absent expiry fields and an unknown compatible provider without multipart cleanup.
+
+2. **P1 — Tasks 7–8 let abandoned jobs block subsequent starts.**
+ **Fault family: durable job completion and admission.**
+ [Plan:197](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:197) counts persisted `queued`/`preparing` rows. [Task 8:223](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:223) performs no reconciliation before admission; reconciliation runs on status requests and once at startup. Start two jobs, close both tabs, and let both fail or expire: a start for another instance remains “busy” until someone revisits the old jobs, restarts the console, or seven-day pruning removes them. Restarting before completion has the same gap.
+
+ **Fix:** reconcile the account’s existing jobs before admission, including deadline and expiry transitions. Keep admission atomic afterward. Add a test that closes both tabs, advances beyond their deadlines, and successfully starts another job without restarting or polling the old jobs. This needs no new background polling.
+
+3. **P1 — Task 3 requires an interface that Task 6 creates.**
+ **Fault family: executable task dependencies.**
+ [Task 3:120](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:120) requires an `ExportOnly` agent to reject a valid regional query before election. That field and guard are introduced only at [Task 6:177](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:177). Neither exists in today’s [AgentConfig:27](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbreads/agent.go:27) or `consider`. Task 3 cannot pass its required tests before its reviews.
+
+ **Fix:** move `AgentConfig.ExportOnly`, its pre-election guard, host wiring and home read-capability suppression into Task 3. Review that complete boundary together.
+
+4. **P1 — Task 9 omits mandatory parity registration.**
+ **Fault family: route inventory completeness.**
+ [Task 9:247](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:247) adds three browser routes but no task updates `parity/parity.tsv`. [TestParityTableCoversConsoleRoutes:48](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/parity_test.go:48) rejects every uncovered browser route, so the planned final CI gate fails.
+
+ **Fix:** add all three routes to the parity table in Task 9, run `make parity-doc`, and include the parity checks in its verification.
+
+5. **P1 — Task 9’s selected helpers cannot produce its required refusals.**
+ **Fault family: indistinguishable authorization failures.**
+ [Plan:253](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:253) calls `s.account` and `refuseLinkedPage`, while line 263 requires a service-token request to receive the same 404 as an unknown host. Without a browser session, [`s.account`:3077](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/server.go:3077) returns a 302. [`refuseLinkedPage`:302](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/linkedpolicy.go:302) renders a separate refusal page, rather than the promised byte-identical 404.
+
+ **Fix:** specify a download gate that checks the session and membership without redirecting, and converts linked-app refusals into `http.NotFound`. Test status, body and absence of `Location` across all three doors.
+
+6. **P2 — Starting after recreation can return the previous incarnation’s job.**
+ **Fault family: job-to-instance identity binding.**
+ [StartDBDownload:197](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:197) returns an existing open row using account/app/host alone. The incarnation and region checks belong to [downloadJob:254](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:254), which the start path does not call. After recreation, start can reuse an old ready job that status and link correctly refuse.
+
+ **Fix:** compare the existing row’s full binding before reuse. Atomically retire an obsolete row, cancel its attempt if necessary, and admit a fresh job. Extend the recreation witness to cover start, not only status and link.
+
+7. **P2 — Task 7 explicitly excludes ready jobs from the account’s open-job cap.**
+ **Fault family: account resource bounds.**
+ [Global constraints:29](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:29) define unexpired `ready` jobs as open and cap open jobs at two per account. Yet [Task 7:202](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:202) requires that “a ready one doesn’t count.” An account can accumulate ready copies across arbitrarily many instances.
+
+ **Fix:** count unexpired ready jobs and expire eligible rows across the account before counting. Change the test to refuse a third instance while two ready jobs remain open.
+
+NOT READY
\ No newline at end of file
diff --git a/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-2b.md b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-2b.md
new file mode 100644
index 000000000..da354a10f
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-2b.md
@@ -0,0 +1,38 @@
+Round 1: **one P1 and six P2 findings**. Static review only; no files changed, no tests run, and `GOCACHE` left unset.
+
+1. **P1 — Task 7’s gate test cannot pass through the specified router.**
+ [Plan:208](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md:208) expects anonymous callers and service credentials to receive 404. Before `apiSystemRoller` runs, `cliGateRefused` returns 401 for missing authentication and 403 for a service credential at an empty-role door ([authcli.go:504](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/authcli.go:504), [authcli.go:532](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/authcli.go:532)).
+ **Fix:** retain the existing gate and test 401 anonymous, 403 service, 404 authenticated non-operator, and 200 admitted operator.
+ **Fault family:** router and authorization-test contract.
+
+2. **P2 — Task 2 introduces one-minute requests after failures.**
+ [Plan:85](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md:85) retries `start` every tick until loaded and passes failed reads to `ReadGate.Mark`. A failed mark remains due on every subsequent tick ([changewatch.go:233](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/release/changewatch.go:233)). Deleted records are another case: their change-index entries remain permanently ([changeindex.go:33](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/release/changeindex.go:33)), so they keep appearing as unknown refs. This contradicts the stated request budget.
+ **Fix:** specify attempt scheduling independently of successful reads; retain negative observations for deleted refs until generation movement or the scheduled relist. Add counting tests for failed initial LIST, persistent GET failure and deletion with a retained index scope.
+ **Fault family:** bounded background requests.
+
+3. **P2 — Task 6’s loader hides boxes before the quiet-box threshold.**
+ [Plan:174](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md:174) selects `status.LoadBoxesComplete`. Its underlying listing excludes status objects older than 24 hours ([fleet.go:258](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/status/fleet.go:258), [fleet.go:270](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/status/fleet.go:270)). A box whose agent and drill stopped 37 hours ago disappears before the proposed 36-hour warning can identify it.
+ **Fix:** use a bounded inventory that retains known boxes across the warning horizon, distinguishing stale status from retirement. Test with both status and verify records 37 hours old.
+ **Fault family:** missing evidence must remain visible.
+
+4. **P2 — B-7 cannot establish “not reached last run.”**
+ The 12-hour inference at [plan:23](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md:23) fails when runs occur closer together. A host passed at 02:00, then was skipped during a budget-exhausted 03:00 run: `Merge` preserves its earlier verdict ([dbverify.go:225](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbverify/dbverify.go:225)), and the proposed count incorrectly excludes it. `CheckedAt` is also updated during intermediate publishes, without a run identifier or completion marker.
+ **Fix:** cut the exact last-run count from this console-only slice and show it as unavailable. An exact count needs explicit producer evidence.
+ **Fault family:** operator counts must follow recorded evidence.
+
+5. **P2 — `verifyAlertsReach` can claim alerting when delivery is unconfigured.**
+ [Plan:141](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md:141) checks connector flags but omits delivery prerequisites. A confirmed email connector can exist with neither sender configured; delivery then fails ([delivery.go:41](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/delivery.go:41), [delivery.go:70](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/delivery.go:70)). Likewise, an otherwise eligible webhook is held when its seal key is unavailable ([alertnotify.go:704](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/alertnotify.go:704)).
+ **Fix:** include configured sender and usable sealed-target prerequisites, without sending probes. Add negative tests for both cases; omit the assurance whenever availability is unknown.
+ **Fault family:** truthful alert-delivery assurance.
+
+6. **P2 — Task 3’s path inventory misses existing record-construction syntax.**
+ [Plan:126](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md:126) scans assignments whose left side is a record field. The ordinary create path initializes `CreatedAt` inside a composite literal ([apiinstances.go:2165](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/console/apiinstances.go:2165)), which that scan does not cover. New constructors or whole-record replacements can therefore escape the promised inventory.
+ **Fix:** include composite literals and whole-record replacements, and pin the record-writing entry points. Add negative fixtures proving each form is detected.
+ **Fault family:** complete copy-change path coverage.
+
+7. **P2 — The review schedule contradicts the repository’s stopping rules.**
+ [Plan:7](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md:7) requires Astra review for every task. [AGENTS.md:65](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/AGENTS.md:65) restricts individual reviews to specified risk areas; [AGENTS.md:43](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/AGENTS.md:43) requires stopping at the first round without P1.
+ **Fix:** identify which tasks qualify, leave the others to whole-branch review, and explicitly carry the stopping rules and round history into each brief.
+ **Fault family:** bounded review process.
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b.md b/docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b.md
new file mode 100644
index 000000000..6d225ac12
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b.md
@@ -0,0 +1,50 @@
+**Verdict: READY AFTER FIXES.** One P1, four P2, four P3. The export-only scope holds on the points you asked about, but Task 3 as written adds idle S3 polling on every home box. Read-only review: no files changed, nothing run, no other models used.
+
+## Your questions
+
+- **Can a home-scope request become a query or pull? No.** The op is inside the root-signed payload, and `valid()` runs in both `Sign` and `Verify` (`envelope.go:51`, `:82`, `:101`), so `Region ""` with any op but export is refused at both ends. Regional agents refuse it too, because `Verify` requires `req.Region == region` (`envelope.go:101`). Between Tasks 2 and 5 an elected export ends `failed/interrupted`, since `read()` begins with `ParseReplyKey` on an empty reply key (`read.go`). The `ExportOnly` second check is not in Task 3, though (P2-4).
+- **Can it reach another account's data? No.** Checks A and B go through `ConfirmIdentity` with region `""` (`agent.go:208`), which refuses on account, app, host, incarnation, pool, fleet or region mismatch (`identity.go:40-43`). The object key comes from a 128-bit job id minted on the server.
+- **Can it be forged or replayed? Not beyond what reads already allow.**
+ - Old boxes refuse the new `job` field, because `strictCanonicalJSON` disallows unknown fields (`rootenvelope.go:74`), and `omitempty` keeps query and pull bytes identical.
+ - A replay needs the same id inside 60 s, and `picked` is a conditional create (`agent.go:228`).
+ - `picked` and `result.json` are unsigned, and every host role can write the whole deployment bucket (`region-host/main.tf:187-191`). A rogue regional box can therefore fail a home job, as it can fail a read today. It cannot make one `ready` without an object of the exact size in the home data bucket.
+- **Does Task 3 change non-home boxes? No.** The queue helpers have two outside callers, both passing a real region (`apidbforward.go:434`, `:481`). Tasks 5 and 6 do change regional boxes (P3-6).
+
+## P1
+
+**1. Task 3 puts every home box on a 30-second S3 poll.**
+- **Evidence:** `Run` calls `Pass` every `ListEvery` (`agent.go:331`), and `Pass` lists two hour prefixes (`agent.go:353-354`). That is 5,760 LISTs per home box per day with nothing happening. Home boxes are most of the fleet.
+- **Why it blocks:** it breaks your standing rule of no new per-box polling. The plan states no request budget and has no store-call-count test. Task 8 leans on the poll ("boxes list the queue every 30 s anyway").
+- **Fix:** an export-only agent passes on the nudge only; the serial pass already nudges (`changeindex.go:444`). Drop `TestStartDBDownloadBumpLost`; a lost bump ends `not_picked` at 2 minutes and the person presses again. Add the budget (0 requests per box per day idle) and a counting test to Task 3.
+- **Open point:** I did not check how fast a box notices a serial bump. If that can exceed the 60 s pickup window, the builder needs a costed alternative from you.
+
+## P2
+
+**2. A recreated instance is stuck behind the old job for up to 24 hours.**
+- **Evidence:** the open-job key is `(account_id, app, host)`, and `StartDBDownload` returns any open row without comparing incarnation (Task 7). `downloadJob` then 404s it (Task 9), while the page reads `DBDownloadFor` directly and shows the old file as ready (Task 10).
+- **Fix:** `StartDBDownload` takes the fresh incarnation and region. In the same transaction it retires an open row that differs (`ready` to `expired`; `queued` or `preparing` to `failed/changed` plus the cancel), then inserts. The page goes through `downloadJob`. Add this to Review Focus 2's test.
+
+**3. An export can run with no audit row.**
+- **Evidence:** Task 9 writes `db-download` after `startDBDownload` has already published. Forwarding writes the row first and refuses the read if it cannot (`apidbforward.go:441-470`).
+- **Fix:** write the activity row inside `StartDBDownload`'s transaction, since both live in `console.db`.
+
+**4. Task 3 is not self-contained, so its security review sees the wrong state.**
+- **Evidence:** `TestHomeScopeNeverQueryOrPull` needs `AgentConfig.ExportOnly`, which Task 6 produces. Until Task 6, an armed home box also publishes `db-read-1` (`edgesfile.go:1381`, `host/dbreads.go:112`).
+- **Fix:** move `ExportOnly`, the `consider` refusal and `withDBReadCapabilities` (home never publishes `db-read-1`) into Task 3.
+
+**5. The `downloads/` expiry rule can delete replicas on a deployment with an unusual prefix.**
+- **Evidence:** replicas live at `<CARLOS_HIBERNATE_PREFIX>/<host>/` (`activator.go:166`). An empty prefix is legal (`hosts-used-scan-aws.sh:23`), and a bare label such as `downloads` is a valid host (`launchctx/controlname/names.go:18-27`). Production uses `instances`, so this is a guard, not a live risk.
+- **Fix:** `armDBReads` leaves `Downloads` nil, and `VerifyDownloads` refuses, when the prefix is empty or its first segment is `downloads`. Add a test and a line in the infra README.
+
+## P3
+
+- **6. Regional boxes gain an op nobody sends.** Tasks 5 and 6 make them `db-export-1` capable. Cut: pass `Downloads` only when `exportOnly`, until a regional console exists.
+- **7. The gate is not uniformly 404.** `refuseLinkedPage` renders a 409 page (`linkedpolicy.go:302-308`), and an ambiguous account segment renders a picker on GET (`server.go:3100-3107`). Use `linkedAppRefusal != nil` to answer `NotFound`, or drop "byte-identical" for those cases.
+- **8. Capability evidence ignores the box's bucket.** It matches placement and capability only. A placement-`""` box on another data bucket would win elections and fail jobs (fail-safe, no leak). I did not confirm such boxes exist. Either state the assumption or also match `DataBucket` (`edgesfile.go:339`).
+- **9. Reference and wording slips.**
+ - The region refusal is `host/dbreads.go:56`, not `:52`.
+ - `valid()`'s region check is `envelope.go:52`, not `:49`.
+ - Physical deletion is "two to four days" (`deployment-buckets/main.tf:57`), not "about two".
+ - The lifecycle read-back runs only at console start; say so in the operator section.
+
+The lifecycle design is otherwise sound: the two-rule split mirrors `db-reads-expire`, and the existing whole-bucket rule already removes delete markers (`deployment-buckets/main.tf:108-116`). The console has no `form-action` policy to block the 303 to the signed URL (`securityheaders.go:6`). Any member may already `db pull` (`apidb.go:116`), so downloads grant no new authority.
diff --git a/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md b/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md
index 8967b4550..d83b8a635 100644
--- a/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md
+++ b/docs/superpowers/plans/2026-11-12-member-backups-slice2b.md
@@ -4,7 +4,7 @@
**Goal:** The console reads every box's `control/verify/<ref>.json`, shows an instance's last accepted restore test in the Backups section's third tile, in the door's `last_test` and in `carlos instances backups`, and gives operators `/fleet/backups` (and its JSON) with the fleet's restore-test evidence per region.
-**Plan rev 1** (2026-11-12), not yet reviewed. Opus implements; Astra reviews each task (three rounds at most); whole-branch Astra review at the end.
+**Plan rev 2** (2026-11-12): Astra plan round 1 (`docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-2b.md`, NOT READY, 1 P1 + 6 P2) applied; findings marked **(R1-N)**, dispositions at the end. Under AGENTS.md "Stopping rules", round 2 is the next and stops at the first round with no P1; its P2s are fixed without reopening. Opus implements. Per-task review (rule 3, R1-7) only for Tasks 2 and 6 (caches over production storage), 4 (a cache beside a door) and 7 (a security gate); the rest is covered by the whole-branch review. Every review brief carries the round history and the stopping rules.
**Architecture:** One in-memory reader in the console (`verifyReader`) lists `control/verify/` at start, then re-reads a box's record only when its change-index scope `control/verify/<ref>` moves, through a `release.ReadGate` with a 6-hour maximum age, and relists every 6 hours. One acceptance rule decides whether a verdict may be shown for an instance: the verdict's identity equals the instance's current identity, its bracket opened after the instance's `copy_since`, and its box hasn't left the roster for 7 days. The door, the instance page, the CLI and the operator view all go through that rule. Nothing on boxes changes.
@@ -20,14 +20,14 @@
- **B-4 `last_test` gains `operators_alerted`** (true only for `failed` when the deployment would deliver `verify_failed`), so the CLI prints the page's "We've been alerted" line from the door alone.
- **B-5 The roster** is `status/boxes/<ref>.json` (the same label as the verify ref, `metricsBoxLabel`), read by one `ListMod` per relist. A box's last-seen time is the later of that object's modified time and its record's `CheckedAt`; a record whose box was last seen over 7 days ago is dropped. Fleet boxes, whose status lives under `fleets/<name>/`, fall back to `CheckedAt` alone.
- **B-6 Seeding (2a note F2-7)** is the reader's in-memory `seen` map: per host, the newest decided verdict it has read and the box it came from. It covers a group host reassigned to another box between the old box dropping it and the new box drilling it. It is re-checked by the acceptance rule on every use and is lost on restart (the new box drills a never-verified host first, so the gap is one night at most). The box-side coverage clock restarting on reassignment is not fixable from the console and stays as 2a left it.
-- **B-7 Not reached.** 2a's record has no "not reached" count. The operator view counts a host as not reached in its box's last run when its verdict is `unverified`/`not_reached`, or its `VerifiedAt` is more than 12 hours before the record's `CheckedAt` (a run's budget is 45 minutes by default; 12 hours is safe for any budget under that).
-- **B-8 §4's "drill is inert"** has no box-side signal (the box status carries no timer state for `carlos-hibernate-verify`). The operator view lists **boxes with sleeping instances** (`status.Box.Routes.Hibernating > 0`) **whose record is missing or older than 36 hours**, which includes every inert box. A true inert flag would need a box status field and the root census; not in 2b.
+- **B-7 Not reached is not shown (R1-4).** 2a's record has no run identifier, no completion marker and no "not reached" count, and `Merge` keeps an unreached host's earlier verdict unchanged, so the console can't tell which hosts the last run skipped. The operator view shows that figure as not available (Task 0 decides how; the JSON has no field). An exact count needs the drill to publish it (a run id and a reached count in the record), a follow-up for the producer.
+- **B-8 §4's "drill is inert"** has no box-side signal (the box status carries no timer state for `carlos-hibernate-verify`). The operator view lists **boxes with sleeping instances** (`status.Box.Routes.Hibernating > 0`) **whose record is missing or older than 36 hours**, which includes every inert box. Its box inventory is its own (R1-3): `status.LoadBoxesComplete` drops status objects older than 24 hours (`internal/status/fleet.go:258-277`), which would hide a box dark for 37 hours, so the view lists `status/boxes/` with `ListMod`, keeps every key modified within 7 days (the roster window of B-5), and reads those bodies. A box whose status is stale (`status.BoxStale`) is shown as such; one not seen for 7 days has left. A true inert flag would need a box status field and the root census; not in 2b.
- **B-9 §4's off-account row** shows "No record" for every region: `control/offsite.json` has no writer and no schema yet (durability §5.5). The exports row waits for 3b.
## Global Constraints
- The console only reads. No box, unit, provision transition or bucket record changes. No new per-box poll, no loop that lists replicas.
-- Request budget (spec §9): at start one LIST of `control/verify/` and one GET per record; then one conditional GET per moved scope; every relist (at most every 6 hours) one LIST of `control/verify/`, one `ListMod` of `status/boxes/` and up to N conditional GETs (N = known records). With no change index (`CARLOS_CHANGE_INDEX` unset) or a watch that cannot vouch, only the start read and the relists run: never a per-minute read.
+- Request budget (spec §9): at start one LIST of `control/verify/` and one GET per record; then one conditional GET per moved scope; every relist (at most every 6 hours) one LIST of `control/verify/`, one `ListMod` of `status/boxes/` and up to N conditional GETs (N = known records). With no change index (`CARLOS_CHANGE_INDEX` unset) or a watch that cannot vouch, only the start read and the relists run: never a per-minute read. **Failures back off to the maximum age (R1-2):** a failed start LIST is next tried at the next relist time; a failed record read is next tried 6 hours later (or at the relist, whichever is first), whatever the gate says; there is no fast retry. A ref found absent (a deleted record whose index scope stays, `changeindex.go:33-37`) is remembered with the generation it was absent at and read again only when that generation moves; the relist's LIST is its only other check.
- `ReadGate` maximum age: exactly 6 hours. Relist period: 6 hours minus up to 10% jitter (never more than 6 hours).
- Acceptance (one function, `acceptVerdict`, used by every surface): `Result` is `passed` or `failed`; `Identity` equals the instance's current identity on all five fields, none empty; `BracketOpenedAt` is non-zero and strictly after `copySince(rec)`; `rec.Move == nil`; for an instance in the console's own region, `Prefix == activator.HibernatePrefix(s.cfg.HibernatePrefix, host)`; the box was last seen within 7 days; `VerifiedAt` no more than 5 minutes ahead of now. Among accepted verdicts the newest `VerifiedAt` wins; on a tie, `failed` wins.
- A record is ignored (logged once per etag) when it is over 4 MiB, does not parse, has `V != 2`, or its `Box` is not the ref in its key.
@@ -48,7 +48,7 @@
## Not in this slice
-The exports row (3b); a box-side inert flag (B-8); the off-account record's reader (B-9); the 2a follow-up "bare number on the metrics page; all-snoozed message" (Fable T8, its own small change).
+The exports row (3b); a box-side inert flag (B-8); a not-reached count, which needs the drill to publish a run id and a reached count (B-7); the off-account record's reader (B-9); the 2a follow-up "bare number on the metrics page; all-snoozed message" (Fable T8, its own small change).
---
@@ -58,7 +58,7 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
- [ ] **Step 1:** Copy `docs/console-mockup-kit/shell.html` (README there) and mock the instance page's Backups section with the third tile in each state: passed today; passed on an earlier date; failed with "We've been alerted"; failed without it; no accepted test (slice 1's "not shown yet"); and the sections where slice 1 hides the tiles (other region, too large, unavailable). Decide whether the test tile shows when the other two tiles don't; Task 4 implements what you decide. Draft wording from spec §8; the tile leads with the state (one or two words as the value), the date and time as the detail, the "using the copy up to" time only if it reads at a glance.
- [ ] **Step 2:** Mock the `carlos instances backups` output for the same states, as terminal text.
-- [ ] **Step 3:** Mock `/fleet/backups` from the operator shell's components (`docs/console-styleguide.md`: `.pagehead`, stat tiles, tables, chips): per region, restore-test tiles (passed in the last 7 days, failed, never tested, oldest test's age, not reached last run), a short instances-by-class table with "not shown" reasons, the boxes not publishing tests (B-8) with their last record's age, the off-account row (B-9). States: a healthy region, a region with failures and a quiet box, a partial read (some records unreadable), evidence not loaded yet, no records at all. Failures and quiet boxes show as chips or tile tone, not sentences.
+- [ ] **Step 3:** Mock `/fleet/backups` from the operator shell's components (`docs/console-styleguide.md`: `.pagehead`, stat tiles, tables, chips): per region, restore-test tiles (passed in the last 7 days, failed, never tested, oldest test's age, and "not reached last run" in its not-available state, B-7), a short instances-by-class table with "not shown" reasons, the boxes not publishing tests (B-8) with their last record's age, the off-account row (B-9). States: a healthy region, a region with failures and a quiet box, a partial read (some records unreadable), evidence not loaded yet, no records at all. Failures and quiet boxes show as chips or tile tone, not sentences.
- [ ] **Step 4:** Shoot each at 390 px and 1280 px, light and dark (README step 3). Run the `impeccable` skill's critique and distill passes on them; fix what reads badly, wraps or overflows. The bar: the state is the first thing seen, about a dozen words to understand the screen.
- [ ] **Step 5:** Keep the final HTML for Task 1's preview. Record the layout decisions (which states, tile values, tones, what shows where) as a short list at the top of Task 1's copy JSON (`"layout"` field).
@@ -82,7 +82,8 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
- `type boxVerdict struct { Box string; LastSeen time.Time; V dbverify.Verdict }`
- `func newVerifyReader(store release.Store, watch *release.ChangeWatch, now func() time.Time) *verifyReader`
- `func (r *verifyReader) start(ctx context.Context) error`: LIST `control/verify/`, GET each `<ref>.json` whose ref passes `boxself.ValidRef`, `ListMod("status/boxes/")`; sets loaded only on a successful LIST.
- - `func (r *verifyReader) tick(ctx context.Context, now time.Time)`: if not loaded, `start`; if the watch is non-nil and `Usable()`, for every known ref and every `control/verify/<ref>` scope in `watch.Observed()` not yet known, `gate.Due(scope, now)` and, when due, one conditional read (`GetIfChanged` with the held ETag; plain `Get` when the store isn't a `ConditionalGetter`), then `gate.Mark(scope, gen, now, ok)`; when the relist is due, `relist`.
+ - Attempt scheduling is the reader's own, beside the gate (R1-2): `nextTry map[string]time.Time` per scope and `nextStart time.Time`; `absentAt map[string]uint64` for refs read as absent. A read is attempted only when `gate.Due` says so **and** `now >= nextTry[scope]`; a failed read sets `nextTry[scope] = min(now + verifyReadMaxAge, nextRelist)` and marks the gate `ok=false`; a successful read, a record skipped as bad (its ETag kept, so the next conditional GET is a 304) and an absent answer all mark `ok=true`. A scope in `absentAt` is attempted only when its observed generation differs from the stored one.
+ - `func (r *verifyReader) tick(ctx context.Context, now time.Time)`: if not loaded and `now >= nextStart`, `start` (failure: `nextStart = nextRelist`); if the watch is non-nil and `Usable()`, for every known ref and every `control/verify/<ref>` scope in `watch.Observed()` not yet known, `gate.Due(scope, now)` and, when due, one conditional read (`GetIfChanged` with the held ETag; plain `Get` when the store isn't a `ConditionalGetter`), then `gate.Mark(scope, gen, now, ok)`; when the relist is due, `relist`.
- `func (r *verifyReader) relist(ctx context.Context, now time.Time)`: LIST, drop refs no longer listed, conditional-read every listed ref (marking the gate), refresh the roster, prune `seen` entries whose `VerifiedAt` is over 30 days old, draw the next relist time.
- `func (r *verifyReader) Loaded() bool`, `func (r *verifyReader) For(host string) []boxVerdict` (every box's verdict for host plus the `seen` entry, B-6), `func (r *verifyReader) Boxes() []verifyBox` (a copy, for the operator view).
- `func (s *Server) RunVerifyReader(ctx context.Context, watch *release.ChangeWatch)`: no-op when `s.cfg.Releases == nil` or `s.cfg.HostClaim`; else sets `s.verify`, then `tick` every `verifyTick` under `instanceStoreTimeout` until ctx ends.
@@ -98,6 +99,9 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
- `TestVerifyReaderSkipsBadRecords` (Review Focus 2): oversize, v1, unparseable, and `Box` mismatching the key: each skipped with `Err` set in `Boxes()`, the good records still served.
- `TestVerifyReaderSeedsReassignedHost` (B-6): box A's record has a pass for H; A's next record drops H; `For(H)` still returns A's pass from `seen`; after B publishes a newer verdict, B's wins in Task 3's selection.
- `TestVerifyReaderRelistNeverLaterThanSixHours`: 1,000 drawn relist periods all in (5h24m, 6h].
+ - `TestVerifyReaderFailedStartBacksOff` (R1-2): the first LIST fails; 5 hours of one-minute ticks make no further request; the next relist time retries and loads.
+ - `TestVerifyReaderFailedGetBacksOff` (R1-2): one record's GET fails on every try while its scope keeps moving; over 12 hours of ticks it is tried at most three times (start, then 6-hour spacing), and other boxes' moved scopes are still read.
+ - `TestVerifyReaderDeletedScopeNotPolled` (R1-2): a record deleted after its scope was bumped (the index keeps the entry); one GET finds it absent; 12 hours of ticks with an unchanged generation make no GET for it; a later bump of that scope reads it once.
- [ ] **Step 2:** `go test ./internal/console -run 'VerifyReader'` → FAIL.
- [ ] **Step 3:** Implement. Wire `go srv.RunVerifyReader(context.Background(), edgesWatch)` in `cmd/console/main.go` after `RunRegionNames`.
- [ ] **Step 4:** `go test ./internal/console ./cmd/console -run 'VerifyReader'` → PASS.
@@ -123,8 +127,9 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
- `TestMoveThereAndBackHidesOldVerdict` (Review Focus 4).
- `TestRestoreIsNewIdentity`: a record recreated through the create path's `CreatedAt = now` (#658) refuses the old incarnation's verdict.
- `TestPickTestNewestWins` (Review Focus 3): fail at T1 and pass at T2 on two boxes shows the pass; a tie shows the fail; a seen-only verdict loses to a newer record verdict.
- - `TestCopySincePathInventory` (spec §3, "a test that fails when a new one appears"): with `golang.org/x/tools/go/packages` (as `recordcreators_guard_test.go` does), load the module's non-test packages and find every assignment, tuple assignments included, whose left side is a field `LastMove`, `Region`, `CreatedAt`, `Account`, `App` or `Host` of a `provision.Record` value or pointer. Pin `map[field]map[enclosing func]count`, each entry with a comment saying why it needs no new `copy_since` source (it is a move close writing `LastMove`, a move flip of `Region`, a create, or not a copy change). A new site fails with its position and asks the author to classify it and extend `copySince` if it starts a new copy.
-- [ ] **Step 2:** `go test ./internal/console -run 'VerifyIdentity|AcceptVerdict|CopySince|MoveThereAndBack|RestoreIsNewIdentity|PickTest'` → FAIL.
+ - `TestCopySincePathInventory` (spec §3, "a test that fails when a new one appears"; R1-6): with `golang.org/x/tools/go/packages` (as `recordcreators_guard_test.go` does), load the module's non-test packages and run `scanCopyPaths(pkgs) map[string]map[string]int` (kind -> enclosing func -> count), which finds four kinds of site: (1) `field`: an assignment, tuple assignments included, whose left side is a field `LastMove`, `Region`, `CreatedAt`, `Account`, `App` or `Host` of a `provision.Record` value or pointer; (2) `literal`: every composite literal of type `provision.Record`, keyed or not, by value or `&` (the create path's `apiinstances.go:2165` is one); (3) `whole`: every assignment whose left side has type `provision.Record` (`*rec = x`, `rec = other`); (4) `write`: every call of `provision.WriteRecord`, `provision.UpdateRecord`, `provision.CreateRecord` and `provision.CreateRecordReplica`, the record-writing entry points. Pin the result, each entry with a comment saying why it needs no new `copy_since` source (a move close writing `LastMove`, a move flip of `Region`, a create that gives a new `CreatedAt`, or not a copy change). A new site fails with its position and asks the author to classify it and extend `copySince` if it starts a new copy.
+ - `TestScanCopyPathsFindsEveryForm` (R1-6): a fixture package supplied through `packages.Config.Overlay` (never on disk) holds one site of each kind (a field write, a tuple write, a keyed and an unkeyed literal, `&provision.Record{}`, a whole-record assignment through a pointer, a `WriteRecord` call); `scanCopyPaths` reports each exactly once.
+- [ ] **Step 2:** `go test ./internal/console -run 'VerifyIdentity|AcceptVerdict|CopySince|ScanCopyPaths|MoveThereAndBack|RestoreIsNewIdentity|PickTest'` → FAIL.
- [ ] **Step 3:** Implement. Build the inventory by running the test once and classifying every site it prints; none may be pinned unclassified.
- [ ] **Step 4:** Same command → PASS.
- [ ] **Step 5:** Commit.
@@ -138,16 +143,17 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
- Produces:
- `type backupsTest struct { Result string; At time.Time; CopyWrittenAt *time.Time; OperatorsAlerted bool }`, JSON keys `result`, `at`, `copy_written_at` (omitempty), `operators_alerted` (omitempty); `backupsView.LastTest *backupsTest`, key `last_test` (omitempty). `At` is `VerifiedAt`, `CopyWrittenAt` is `WrittenAt` when non-zero.
- `backupsFor` fills `LastTest` after the memo load, never inside it (the memo keeps only the position), for every record `replicaIntrinsic` calls replicated, in any region.
- - `func (s *Server) verifyAlertsReach() bool`: the `verify_failed` rule's effective setting in `alertScopeFleet` is enabled and `alertRuleConnectors` leaves at least one connector that is also not suspended, not needing re-entry and not unsubscribed; cached for one minute.
+ - `func (s *Server) verifyAlertsReach() bool` (R1-5): true only when the alert engine runs here (`!s.cfg.HostClaim`, `s.cfg.Releases != nil`), the `verify_failed` rule's effective setting in `alertScopeFleet` is enabled, and `alertRuleConnectors` leaves at least one connector that is also not suspended, not needing re-entry, not unsubscribed, **and deliverable**: an email connector only when a sender exists (`s.sendFederated != nil || s.consoleMail != nil`, the two paths `deliver` uses, `delivery.go:41-77`); a Slack or webhook connector only when `s.alertSeal.Load() != nil` (`alertTarget` holds it otherwise, `alertnotify.go:696-711`). No probe and no `alertTarget` call (it marks connectors). Any store error, or anything unknown, is false. Cached for one minute.
- `backupswords.Input.Test *TestInput` with `type TestInput struct { Result string; At time.Time; CopyWrittenAt *time.Time; Alerted bool }`; `Display` gains `TestValue, TestDetail, TestNote string; TestGap bool` (TestGap: failed, warning tone). No test: `TestValue` is the unknown dash and `TestDetail` is `TestNone`, as today. Whether the tile shows without the other two is Task 0's decision, carried as a `Display` field Show sets.
- Constants for Task 1's `backups.test.*` strings in `words.go`.
- [ ] **Step 1: Failing tests:**
+ - `TestVerifyAlertsReach` (R1-5): false with a confirmed email connector but no sender; false with only a webhook connector and no seal key; false with the rule disabled, with a suspended or unsubscribed connector, and on a store error; true with a confirmed email connector and `consoleMail` set.
- `TestShowRestoreTest` (backupswords): passed today, passed on an earlier date and an earlier year, failed with and without `Alerted`, no test; values, details, note and tone per Task 1; the forbidden-words loop of `TestShowEveryClassAndReason` extended to every new field.
- - `TestAPIInstanceBackupsLastTest` (console, through the real router and gate, spec §12): a published passing record gives `last_test` with `result`, `at`, `copy_written_at`; a failing one adds `operators_alerted` only with a reachable connector; no record or an unaccepted verdict omits the key; pooled and fleet records never carry it.
+ - `TestAPIInstanceBackupsLastTest` (console, through the real router and gate, spec §12): a published passing record gives `last_test` with `result`, `at`, `copy_written_at`; a failing one adds `operators_alerted` only with a deliverable connector; no record or an unaccepted verdict omits the key; pooled and fleet records never carry it.
- `TestBackupsLastTestNotMemoised`: a door call, then a new record read by the reader, then a second call within 5 minutes: the second shows the new test.
- `TestInstancePageBackupsRestoreTest`: the rendered section shows each state; Review Focus 1's no-records case shows the slice-1 "not shown yet"; the section contains no forbidden word.
-- [ ] **Step 2:** `go test ./internal/backupswords ./internal/console -run 'ShowRestoreTest|ShowEvery|APIInstanceBackups|BackupsLastTest|InstancePageBackups'` → FAIL.
+- [ ] **Step 2:** `go test ./internal/backupswords ./internal/console -run 'ShowRestoreTest|ShowEvery|APIInstanceBackups|BackupsLastTest|InstancePageBackups|VerifyAlertsReach'` → FAIL.
- [ ] **Step 3:** Implement. Styleguide classes only; the failed tone is the existing warning chip or tile class Task 0 chose.
- [ ] **Step 4:** Same command plus `TestConsoleStyleguideClassesExist` → PASS.
- [ ] **Step 5:** Commit.
@@ -171,20 +177,22 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
**Files:** Create `internal/console/fleetbackups.go`, `internal/console/fleetbackups_test.go`.
**Interfaces:**
-- Consumes: `replicaIntrinsic` (slice 1), `acceptVerdict`/`pickTest` (Task 3), `verifyReader.Boxes`/`Loaded` (Task 2), `s.recordWalkStore` + `provision.ListAllRecordsTolerant`, `status.LoadBoxesComplete`, `regionlabel.ForCode`.
+- Consumes: `replicaIntrinsic` (slice 1), `acceptVerdict`/`pickTest` (Task 3), `verifyReader.Boxes`/`Loaded` (Task 2), `s.recordWalkStore` + `provision.ListAllRecordsTolerant`, `release.ModLister` and `status.Box`/`status.BoxStale` (B-8), `regionlabel.ForCode`.
- Produces:
- `type fleetBackupsView struct { GeneratedAt time.Time; Loaded, Complete bool; Regions []fleetBackupsRegion }`
- `type fleetBackupsRegion struct { Region, Label string; Classes fleetBackupsClasses; Tests fleetBackupsTests; QuietBoxes []fleetBackupsBox; UnreadableBoxes []string; Offsite string /*"no_record", B-9*/ }`
- `type fleetBackupsClasses struct { Replicated int; NoCopy, NotShown map[string]int /*reason -> count*/ }`
- - `type fleetBackupsTests struct { PassedWeek, Failed, NeverTested, NotReached int; OldestAt *time.Time }`, over replicated instances only; `Failed` and `PassedWeek` from each host's picked test; `NeverTested` is no picked test; `OldestAt` the oldest picked test's `VerifiedAt`; `NotReached` per B-7 over each box's record, counted once per host.
- - `type fleetBackupsBox struct { Box, Name string; LastRecord *time.Time }`: B-8.
+ - `type fleetBackupsTests struct { PassedWeek, Failed, NeverTested int; OldestAt *time.Time }`, over replicated instances only; `Failed` and `PassedWeek` from each host's picked test; `NeverTested` is no picked test; `OldestAt` the oldest picked test's `VerifiedAt`. No not-reached count (B-7).
+ - `func loadBoxInventory(ctx context.Context, s release.Store, now time.Time) (boxes []status.Box, complete bool, err error)` (R1-3): `ListMod("status/boxes/")`, keep keys modified within 7 days, newest first, at most 200 (more: `complete` false), each body at most 1 MiB and parsed as `status.Box`; a failed or skipped read sets `complete` false. A store that isn't a `ModLister` falls back to `List` and keeps every key.
+ - `type fleetBackupsBox struct { Box, Name string; LastRecord *time.Time; StatusStale bool }`: B-8; `StatusStale` is `status.BoxStale(b, now, status.SnapshotPeriod)`.
- `func (s *Server) fleetBackups(ctx context.Context, now time.Time) (fleetBackupsView, error)`, memoised 5 minutes (one build in flight; the `backupsMemo` shape).
- JSON keys are the field names in snake case (`generated_at`, `passed_week`, `oldest_at` omitempty, `quiet_boxes`, `last_record`), since the system door serves this struct as is.
- Regions: an instance's `rec.Region`, a box's `status.Box.Region`, a verdict's `Identity.Region`; labels through `regionlabel.ForCode(code, s.regionHome(), s.regionNames())`.
- [ ] **Step 1: Failing tests:**
- - `TestFleetBackupsCountsPerRegion`: two regions; records of every class and reason; verdicts passed (3 days old), passed (9 days old), failed, unverified, and none; expect the counts, `OldestAt`, and a not-reached host per B-7 (including a `not_reached` verdict and one whose `VerifiedAt` is 13 hours before `CheckedAt`).
+ - `TestFleetBackupsCountsPerRegion`: two regions; records of every class and reason; verdicts passed (3 days old), passed (9 days old), failed, unverified, and none; expect the counts and `OldestAt`; the JSON has no not-reached key.
- `TestFleetBackupsQuietBoxes`: four boxes: sleeping instances and a 37-hour-old record; sleeping instances and no record; sleeping instances and a fresh record; no sleeping instances and no record. Only the first two are listed, with `LastRecord` set for the first and nil for the second.
+ - `TestFleetBackupsDarkBoxStillListed` (R1-3): a box whose status object and verify record are both 37 hours old, with sleeping instances, is listed with `StatusStale` true; one whose status object is 8 days old is not.
- `TestFleetBackupsNoRecordsYet` (Review Focus 1): reader loaded, no records: every replicated instance is never tested; `Loaded` true.
- `TestFleetBackupsNotLoaded`: reader not loaded: `Loaded` false and no test counts.
- `TestFleetBackupsPartial`: an unreadable record, a failed status read or an incomplete record walk sets `Complete` false and names the unreadable box.
@@ -205,7 +213,7 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
- [ ] **Step 1: Failing tests:**
- `TestFleetBackupsPageOperatorOnly`: a member gets what `operatorOnly` gives every non-operator; an operator gets 200.
- `TestFleetBackupsPageStates`: healthy, failures with a quiet box, partial, not loaded, no records: each shows Task 0's layout and Task 1's strings; the page's `<main>` content contains no forbidden word (scan only inside `<main>`: the shell has `aria-current`).
- - `TestAPISystemBackupsGate`: a system operator and an ops owner get the JSON; a member, a service credential and an anonymous caller get 404.
+ - `TestAPISystemBackupsGate` (R1-1, through the real router, so `cliGateRefused` runs first, `authcli.go:504-545`): anonymous 401; a service credential 403 (the closed-door refusal); a signed-in person who is neither an ops owner nor a system operator 404; a system operator and an ops owner 200 with the JSON.
- `TestAPISystemBackupsMatchesPage`: the JSON is the view the page rendered.
- [ ] **Step 2:** `go test ./internal/console ./internal/parity . -run 'FleetBackupsPage|APISystemBackups|RouteDecls|EveryCLIDoor|ParityCLIPaths|CLIProjection|ApprovedMemberBackups2b'` → FAIL.
- [ ] **Step 3:** Implement. Add the door to any other route table those tests name.
@@ -215,6 +223,21 @@ The exports row (3b); a box-side inert flag (B-8); the off-account record's read
### Task 8: Census, branch close, release and dev check
- [ ] **Step 1:** Root census: `make census-card`; write `docs/superpowers/notes/census-claims-member-backups-2b.txt` (the `backupswords` display and words units, the CLI's `printBackups`/`backupsJSON`; no new reads); `make census-propose NAME=member-backups-2b CLAIMS=<file>`; post on #280; wait for the other-family reviewer's approval; commit the overlay, chain line and card. The record-write census is untouched (the console writes no record); confirm `go test ./internal/provision -run TestPlan9B8RecordWriteCensus` still passes.
-- [ ] **Step 2:** Changed packages only: `go test ./internal/backupswords ./internal/console ./internal/parity ./cmd/console . -run 'VerifyReader|VerifyIdentity|AcceptVerdict|CopySince|MoveThereAndBack|RestoreIsNewIdentity|PickTest|ShowRestoreTest|ShowEvery|APIInstanceBackups|BackupsLastTest|InstancePageBackups|InstancesBackups|CLIGolden|FleetBackups|APISystemBackups|RouteDecls|EveryCLIDoor|ParityCLIPaths|CLIProjection|ApprovedMemberBackups|StyleguideClasses|Plan14'`. Push; `amadan ci status -branch <name>` green.
-- [ ] **Step 3:** Whole-branch Astra review (three rounds at most).
+- [ ] **Step 2:** Changed packages only: `go test ./internal/backupswords ./internal/console ./internal/parity ./cmd/console . -run 'VerifyReader|VerifyIdentity|AcceptVerdict|CopySince|ScanCopyPaths|VerifyAlertsReach|MoveThereAndBack|RestoreIsNewIdentity|PickTest|ShowRestoreTest|ShowEvery|APIInstanceBackups|BackupsLastTest|InstancePageBackups|InstancesBackups|CLIGolden|FleetBackups|APISystemBackups|RouteDecls|EveryCLIDoor|ParityCLIPaths|CLIProjection|ApprovedMemberBackups|StyleguideClasses|Plan14'`. Push; `amadan ci status -branch <name>` green.
+- [ ] **Step 3:** Whole-branch Astra review under AGENTS.md "Stopping rules": it stops at the first round with no P1, whose P2s are fixed without reopening; a fourth round needs Paul. The brief carries the plan's round history (plan round 1 NOT READY, rev 2) and the per-task reviews' outcomes.
- [ ] **Step 4:** Release and roll, dev first, after 2a's release (2b reads what 2a writes). Dev check (spec §12): after one night, a dev instance on a box with sleeping hosts shows its restore test on the page, in the door and in the CLI, with the same time; `/fleet/backups` counts match the boxes' records; move a dev instance to another region and back: its tile shows "not shown yet" until the next night's test. Report on #898; ask Paul before the flagship roll.
+
+## Astra plan round 1: dispositions
+
+`docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-2b.md`, NOT READY. Every citation checked against the code before applying.
+
+| # | Sev | Finding (fault family) | Disposition |
+|---|---|---|---|
+| R1-1 | P1 | The system door's gate test expects 404 where `cliGateRefused` answers 401 and 403 first (router and authorization-test contract) | Accepted: `authcli.go:504-545` confirmed. Task 7's test expects 401 anonymous, 403 service, 404 non-operator person, 200 operator. |
+| R1-2 | P2 | Failed starts and failed reads retry every minute; deleted refs stay in the index forever (bounded background requests) | Accepted, with the controller's ruling: failures back off to the 6-hour maximum age, no fast retry. `changewatch.go:233` and `changeindex.go:33-37` confirmed. Reader keeps its own attempt schedule and absent-ref generations; three counting tests added (Task 2). |
+| R1-3 | P2 | `LoadBoxesComplete` drops status older than 24 hours, hiding a 37-hour-dark box (missing evidence must stay visible) | Accepted: `fleet.go:258-277` confirmed. Own 7-day `ListMod` inventory with a stale-status flag (B-8, Task 6), and a 37-hour test. |
+| R1-4 | P2 | The 12-hour not-reached inference is wrong when runs are close together (operator counts follow recorded evidence) | Accepted: `Merge` keeps unreached hosts' verdicts (`dbverify.go:213-228`) and the record has no run id. Count cut and shown as not available; producer follow-up listed (B-7). |
+| R1-5 | P2 | `verifyAlertsReach` ignores sender and seal-key prerequisites (truthful alert-delivery assurance) | Accepted: `delivery.go:41-77` and `alertnotify.go:696-711` confirmed. Deliverability per connector kind, no probes, unknown is false; negative tests (Task 4). |
+| R1-6 | P2 | The path inventory misses composite literals and whole-record writes (complete copy-change path coverage) | Accepted: `apiinstances.go:2165` confirmed. Inventory covers field writes, literals, whole-record assignments and the record-write entry points, with an overlay fixture proving each form is found (Task 3). |
+| R1-7 | P2 | Per-task review of every task contradicts the stopping rules (bounded review process) | Accepted: AGENTS.md rules 1 and 3 applied. Per-task review only for Tasks 2, 4, 6 and 7; round history and stopping rules carried in every brief (header, Task 8). |
+