carlos / platform Public

member backups: 1b plan round 3 findings; Paul: strict prefix, no 4th round (#898)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4f72db520907e1cab20334e0fb48a12ce1258ebd parent 3f2d81e
2 files changed, +99 −0
  • docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b-R3.md +43 −0
  • docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b-R3.md +56 −0

CI cancelled — superseded by a newer push — run details

Intent

Human

<task-notification> <task-id>b32qslbh9</task-id> <tool-use-id>toolu_01WRVarxfCgPwAHXme94QH15</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/b32qslbh9.output</output-file> <status>completed</status> <summary>Background command "Fable scoped re-review of the drill fix" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>b2klsnkxz</task-id> <tool-use-id>toolu_01379w1ffxkZAg544XHD9tmT</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/b2klsnkxz.output</output-file> <status>completed</status> <summary>Background command "Fable 1b plan round 3" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bsv4h1qi2</task-id> <tool-use-id>toolu_01PtAm5xkaXYA6R5fsqYNM59</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/bsv4h1qi2.output</output-file> <status>completed</status> <summary>Background command "Astra census round 2 after 09:41Z, then wait for CI" completed (exit code 0)</summary> </task-notification>

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

diff --git a/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b-R3.md b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b-R3.md
new file mode 100644
index 000000000..77b615102
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/CODEX-FINDINGS-plan-1b-R3.md
@@ -0,0 +1,43 @@
+| Round 2 finding | Round 3 assessment |
+|---|---|
+| Astra P1-1 — lifecycle installation | **Partly:** opt-in and plan-time refusal are specified, but accepted prefixes can still resolve into `downloads/`; finding 1. |
+| Astra P1-2 — task dependencies | **Resolved:** all existing constructor/helper callers are covered; the adapter test moved to Task 9. |
+| Astra P1-3 — browser disconnect prevents dispatch | **Resolved:** audit, publication and failure writes use one bounded detached context; the witness exercises the real activity helper. |
+| Astra P2-4 — plain reload does not reconcile | **Resolved:** Task 10 reconciles after binding validation and tests page-only completion and expiry. |
+| Fable P2-1 — latency ignores a running tick | **Resolved in the plan:** Task 1 requires measurements before building and stops for a ruling if ticks are too slow. Measurements remain outstanding. |
+| Fable P2-2 — no later pass after transient refusal | **Partly:** the completion pass is specified, but completion does not establish admission readiness; finding 3. |
+
+Reviewed rev 4 at `3f2d81e583528337d54b8218309d45566b67ae2e`, round **3 of 3**. No files changed, tests run or models spawned. `GOCACHE` is unset. The dependency table agrees with the revised symbol order; I found no further forward dependency.
+
+1. **P1 — The installation gate accepts prefixes that resolve into the deletion namespace.**
+ **Invariant: download expiration must never reach production replicas.**
+
+ [Task 1:75](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:75) refuses empty prefixes, leading slashes and a first segment of `downloads`. It accepts `instances/../downloads`. However, [`HibernatePrefix`:166](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/activator/activator.go:166) uses `path.Join`, so that prefix places an instance’s replica under `downloads/<host>`. Applying the lifecycle rules then expires its current replica objects. The runtime checks in Tasks 6 and 8 use the same insufficient first-segment rule.
+
+ **Concrete resolution:** make the up-front refusal cover every noncanonical prefix: require a nonempty relative path, no `.` or `..` segments, no surrounding whitespace, and a first segment other than `downloads`. Apply that contract before either Terraform mutation or `mc` invocation, and at runtime. Include `instances/../downloads`, `.`, and `instances/..` in the refusal witnesses.
+
+ This is the repeated lifecycle-isolation family. Under stopping rule 2, choose that explicit restricted-input contract or cut shared-bucket download expiration; another narrow spelling patch is insufficient.
+
+2. **P2 — CI never exercises the MinIO installation refusal test.**
+ **Invariant: an unsafe replica prefix must be rejected before any storage mutation.**
+
+ [Task 1:83](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:83) runs `scripts/downloads-ilm_test.sh` locally and explicitly says these tests do not run in CI. [Task 11:323](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:323) invokes the installer with a safe fixture prefix, exercising only its success path.
+
+ The existing [`10-gate`:52](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/.amadan/ci.d/10-gate:52) runs the Go build and `make test`; neither supplies an automatic shell-test discovery mechanism. The proposed CI changes contain no invocation of this refusal test. CI can therefore remain green after the installation gate stops refusing unsafe prefixes.
+
+ **Fix:** explicitly run `sh scripts/downloads-ilm_test.sh` in `30-minio-contract`, before lifecycle installation, with a nonzero exit failing the step. Preserve the stub assertion that refused inputs never invoke `mc`.
+
+3. **P2 — The one completion pass can run while admission still refuses new work.**
+ **Invariant: completion-triggered pickup must occur after admission becomes usable.**
+
+ [Task 3:131](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/docs/superpowers/plans/2026-11-12-member-backups-slice1b.md:131) sends `passAgain` after writing the result. But [`serve`:25](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbreads/read.go:25) releases the running slot through a deferred `adm.finish`. The pass can race ahead of that release.
+
+ Ordering the send after `finish` alone is insufficient: [`reconcileLocked`:46](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbreads/admission.go:46) still refuses while the finished worker’s unit is deactivating. The existing [admission test:98](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbreads/admission_test.go:98) demonstrates this exact case. Once that sole pass returns, unit shutdown triggers no further queue pass.
+
+ **Concrete resolution:** centralize completion-triggered pickup at a bounded admission-readiness check: release the running slot, wait for the existing orphan-unit condition to clear, then request the single queue pass. This need not add idle queue polling. Extend `TestExportSharesReadSlots` using the existing [`inProcWorkers.linger`:39](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups/internal/dbreads/fixture_test.go:39) seam and force the release-order race.
+
+ This repeats the round 2 pickup-progress family. Under stopping rule 2, choose that single readiness invariant or explicitly cut the automatic pickup-after-completion promise.
+
+The sole P1 has one cause: the refusal checks a different prefix representation from the replica writer. A strict up-front refusal removes it; cutting shared-bucket expiration also removes it. Round 3 exhausts the review budget; a fourth round requires Paul’s go.
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b-R3.md b/docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b-R3.md
new file mode 100644
index 000000000..819617655
--- /dev/null
+++ b/docs/superpowers/notes/reviews/member-backups/FABLE-FINDINGS-plan-1b-R3.md
@@ -0,0 +1,56 @@
+**Verdict: READY AFTER FIXES.** No P1, four P2, five P3 on plan rev 4. Read-only: no files changed, no tests run, no other models used, and I wrote no plan file despite plan mode, since you said to change nothing.
+
+## Round 2 P1/P2s
+
+**Astra R2**
+- P1-1 lifecycle installed unconditionally: **partly**. The opt-in variable, plan-time refusal and script gate are right; see new P2-1 and P2-2.
+- P1-2 caller migrations and adapter test order: **resolved**. A grep finds exactly the callers the plan lists (`host/dbreads.go:151`, `fixture_test.go:248`, `dbreadstest.go:61`, `dbreads_rootrunner_linux_test.go:623,641`, `edgesfile.go:1381`, `dbreads_test.go:74,77`). Smaller ordering slips remain (P2-4, P3-1, P3-2).
+- P1-3 disconnect after insert: **resolved**. `RecordActivityContext` (`store.go:3314`) runs on the detached context; see P3-4.
+- P2-4 plain reload doesn't reconcile: **resolved**.
+
+**Fable R2**
+- P2-1 latency bound: **resolved** as a measure-then-rule step; see P3-5.
+- P2-2 transient exits drop jobs: **partly**. The after-export pass exists but fires too early; see P2-3.
+
+## New P2
+
+**1. The prefix refusal checks a different string from the one the box uses.**
+- **Evidence:** the box trims spaces and slashes (`activator.go:141`) and then `path.Join` cleans the result (`activator.go:166`). The tofu validation, the script and both `downloadsPrefixSafe` copies compare only the raw first segment.
+- **Consequence:** `./downloads`, `x/../downloads` and ` downloads` all pass, the rule installs, and replicas land under `downloads/<host>/` and expire after a day.
+- **Fix:** accept only a canonical prefix in all four places: segments of `[A-Za-z0-9][A-Za-z0-9_-]*` joined by single `/`, first segment not `downloads`. Add those three values to every refusal table.
+- **Limit to state in the operator docs:** the variable is a declaration. Tofu cannot see `host.env`, so a wrong declaration still installs the rule.
+
+**2. The refusal tests run nowhere in CI.**
+- **Evidence:** `10-gate` is `go build` plus `make test`, which is the Go gate only. Nothing runs `scripts/*_test.sh` or `tofu test`, and Task 1 Step 2 says so for tofu. Task 11 runs `downloads-ilm.sh` only with a safe prefix.
+- **Consequence:** the proof that an unsafe configuration cannot install is hand-run only.
+- **Fix:** in `30-minio-contract`, run `sh scripts/downloads-ilm_test.sh`. Then run the real script with `downloads` against the fixture bucket, and require exit 2 and an empty `mc ilm export`. Keep tofu local, with its output pasted into the task report.
+
+**3. The after-export pass runs before the box can admit anything.**
+- **Evidence:** `serve` releases its slot in a deferred `adm.finish` (`read.go:24`), after the result is written. `admitRead` also refuses with `errOrphans` while the finished worker's unit is still stopping (`admission.go:46`), which is why `Run` has `probeRetry` and retries call `settle`.
+- **Consequence:** the single pass can be refused, and nothing passes again, so the third export still ends `not_picked`. `TestExportSharesReadSlots` uses `inProcWorkers`, which has no units, so it cannot see this.
+- **Fix:** after `serve` returns, wait on `adm.settle` (local, no store calls) bounded by the pickup window, then send `passAgain`. Add a test with a `Units` stub that reports one lingering unit for a few polls.
+
+**4. A `busy` or `daily` refusal never reaches the page.**
+- **Evidence:** start answers a 303 with no carrier for the why. `downloadSectionFor` takes only `downloadAvail`, whose why is `off` or `moving`.
+- **Consequence:** the person presses, lands back on the same enabled button, and sees no reason.
+- **Fix:** `instanceBackups` reads the account's open count and the instance's 24-hour starts, and sets the why before any press. Add both to `TestDownloadSectionFor`.
+- **Related ordering slip:** Task 9's `TestDBDownloadStartRefusals` asserts "the page's why", but the page section is Task 10's. Assert the returned why and no job row in Task 9, and the page line in Task 10.
+
+## New P3
+
+1. **Hello advertises export two tasks early.** Task 2 lists `OpExport` in the hello, but the worker serves it from Task 4, so Task 4's `TestWorkerHelloListsOps` cannot fail first. Add it to the hello in Task 4; Task 3's tests stub the hello.
+2. **The prefix pin test cannot be written.** The host's `downloadsPrefixSafe` is unexported and the console does not import `internal/host`. Use one exported `dbreads.DownloadsPrefixSafe`, which both already import, and drop the duplicate.
+3. **Census scope is short.** Every `.sh` and `go.mod` is a census unit (`plan14_root_reads_test.go:252`). Add `scripts/downloads-ilm.sh`, its test, `go.mod` and `internal/dbdoor/plan_from.go` to the Global Constraints line and Task 12's claims.
+4. **Failure writes share the spent context.** If a store call uses the whole 30 s, `MoveDBDownload(queued→failed)` runs on an expired context. Reconcile heals it at 2 minutes, but give the failure writes a fresh short bound.
+5. **Step 0 reads a partial log.** The `took` lines are per leg and only over 5 s (`agent.go:3191`, `changeindex.go:404`, `agent.go:3357`), and the restart, wake and schedule legs are untimed. Record the sum of legs per tick, and treat "no lines" as under about 10 s, not zero.
+
+## The three checks you asked for
+
+- **Opt-in variable and plan-time refusal:** sound in shape. `null` installs nothing, and validation runs before any bucket change. The existing whole-bucket `expire-noncurrent` rule (`deployment-buckets/main.tf:106`, `region-remote-host/main.tf:48`) retains no versions, so it will not trip the verifier. Nothing else in the tree uses a `downloads/` key. Open items are P2-1 and P2-2.
+- **`scripts/downloads-ilm.sh` and CI:** the happy path would run in CI through Task 11; the refusal test runs nowhere (P2-2).
+- **Dependency table:** the symbol order holds. Three rows are wrong:
+ - Task 6's `downloadsPrefixSafe` is first needed by Task 8, not Task 11.
+ - Task 0's audit strings are used in Tasks 8 and 9 but land in `instancecopy.go` in Task 10, so say where they live until then.
+ - Task 9 has a test that depends on Task 10 (P2-4).
+
+Every line citation in the plan that I checked matches the code; I did not check `parity_test.go:48`.