carlos / platform Public

plans: P1b-3b Opus review round 3 (READY AFTER FIXES)

0 P1, 3 P2 (proof credential boundary, proof bucket, proof-absence
cache), 3 P3. N-HA16/N-HA17 close R2 P1-A/P1-B; R2 P2s addressed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev c8b978492ce6680ea893a68321f6a1a17e5d25a6 parent e457d2c
1 file changed, +56 −0
  • docs/superpowers/plans/REVIEW-REGION-HA-P1B3B-R3.md +56 −0
diff --git a/docs/superpowers/plans/REVIEW-REGION-HA-P1B3B-R3.md b/docs/superpowers/plans/REVIEW-REGION-HA-P1B3B-R3.md
new file mode 100644
index 000000000..45ecf5527
--- /dev/null
+++ b/docs/superpowers/plans/REVIEW-REGION-HA-P1B3B-R3.md
@@ -0,0 +1,56 @@
+# Review: region HA P1b-3b plan, round 3 of 3 (final)
+
+Reviewer: Claude Opus 5.5, independent. Plan rev 3 (59d034af), implementing Paul's N-HA15/N-HA16/N-HA17 (#421) after round 2's rule-2 stop. Code at origin/main (c6304f2d or later; no cited file changed).
+
+**Verdict: READY AFTER FIXES** (0 P1, 3 P2, 3 P3). Under stopping rule 1, apply the P2s without another round. P3s go on the branch follow-up list. Round 3 found no new P1 and no recurrence of either round-2 family.
+
+## 1. Do N-HA16 and N-HA17 close P1-A and P1-B?
+
+**P1-A: CLOSED.** The finalizer's take (§"Adoption completion rule" step 2) and every visitor or due acquire now use the durable proof through the one `OwnerTerminated` adapter (§"Sole authority consumer"). The proof does not expire. A fresh process can recover +48h later with no Describe and no positive cache. The only open case is "no initial live confirmation before EC2 forgets", which Paul's ruling scopes out. The witnesses (`TestTerminationProofDurability`, kill after proof PUT, forget EC2, fresh registry) and the mutations (`proof-needs-live-ec2`, `proof-before-expiry`) test the right things.
+
+Misuse questions:
+- **Used outside acquire?** No. The plan states it in one place ("only acquire may consume it as authority") and lists what it cannot certify: import, keep, completion, deletion, duty start, P3 admission. Enqueue's "locates the existing exact proof" schedules a scan only. A scan grants nothing until the finalizer's acquire, so this is safe. P3-1 covers a wording conflict with N-HA16's "grants no scan".
+- **Before expiry?** No. The proof is read only when `now > ExpiresAt`, after classification, and `DecideAcquire` plus the conditional PUT remain the fence. Equality counts as held.
+- **Replayed against another box or lifetime?** No. The key is account/region/iid/`box_lifetime`, where `box_lifetime` is the SHA-256 of the immutable `control/boxes/<ref>.json` bytes, which are create-only (`internal/boxid/record.go:36-52`). The adapter closes over the classified owner's ref/iid and rebinds on each CAS round, so a proof for D cannot authorize E. Host-record lifetime is bound separately. EC2 never reuses iids.
+- **Forged by a tenant?** Tenant processes have no box-role credentials, and store users are confined to their own bucket (`infra/modules/region-host/main.tf:672-690` boundary, narrowed by each user's inline policy). The audit the plan requires should confirm both. See P2-1 for the box agent.
+- **Change-index side effects?** `control/terminations/` falls in no change scope (`internal/release/changeindex.go:68-74` handles only certs, edges and app-policy), so writing a proof bumps nothing.
+
+**P1-B: CLOSED.** Started/Running/Done are plain lifecycle facts (§"The independent start/cancel acknowledgment"). There is no coverage gate, suspension or rearm. Completion is a full lock rescan over the complete pre-filter inventory with zero D owner/releaser matches and no unresolved entries (§"Completion rescan"). A partial-pool receiver acks once a peer's finalizations make the rescan clean, which closes R1 P2-4 without attributing completion to another box. A tenant sidecar now blocks only the departures in its scope (paging once per departure per hour per receiver, last-page time persisted), not the consumer or P3 admission. The P3 conflicts from R2 (hapair-only group boxes, the Done/latch contradiction) are gone: "coverage never changes either fact", and P3 keeps its own latch.
+
+## 2. R2 P2s
+
+- **P2-1 (rearm): ADDRESSED.** The rearm state is removed. Blocked departures retry automatically when inventory or policy changes (`TestDepartureCoverageIsolation`).
+- **P2-2 (startup bound): ADDRESSED.** Before Started there are zero inventory reads and passes. The bound is 5 s local plus a 25 s Receive deadline, so Started arrives within 30 s, and a missed deadline is an error, never a fabricated start (`TestTerminationConsumerStartupBound`, mutation `started-waits-for-inventory`).
+
+## 3. New findings
+
+### P2
+
+**P2-1 — The proof's credential boundary is unbuildable as written.** §"Writer and ordering" says the writer is "the shared trusted root-side confirmer, using the existing `rootaws` credential boundary (`internal/host/hatakeover.go:37`)". §"The proof prefix must be writable only by that trusted confirmer credential … unwritable by … unprivileged box-agent credentials". The code contradicts both:
+- The agent runs as `User=carlos` (`internal/host/units/carlos-edge.service:28`).
+- `rootaws.LoadDefaultConfig` changes behaviour only when euid is 0 and otherwise keeps the SDK chain (`internal/rootaws/config.go`). The confirmer therefore uses the same box-role credentials as every other agent component.
+- That box role already has `s3:PutObject` on `${deployment_bucket_arn}/*` and the data bucket (`main.tf:163-169`), the same power that writes every lock.
+
+No distinct confirmer credential exists, and the plan requires effective-policy denial witnesses "before activation". As written, activation can never pass, or someone will invent a new credential path that has not been designed.
+Fix: state the real trust boundary. The box role is trusted, equally with lock writes: a box agent that can forge a proof can already overwrite any lock, so the proof adds no I1 exposure. Keep the audit and denial witnesses for **tenant/app and object-store-user credentials** only. Remove "root-side" and the box-agent denial requirement.
+
+**P2-2 — The proof's bucket is ambiguous.** §"Object" says "in the configured deployment/data bucket". The writer (Enqueue), the finalizer and the visitor acquire must all derive the same bucket. The lock acquire works in the data bucket and its region (`lease.AcquireHA(ctx, bucket, prefix, region, …)`, `internal/lease/ha.go:59`), while the deployment bucket can sit in a different region. Name exactly one, and give its region and client path. The data bucket of the lock's region keeps acquire on its existing client, and the IAM for it exists at `main.tf:166`. Make the witnesses use that bucket.
+
+**P2-3 — Proof lookups happen at visitor rate while a hung or S3-lost box is not yet terminated (budget; "no request-time membership reads").** §"S3, SQS and EC2 request budget", row "Ordinary duty acquire … Expired peer: +1G for uncached proof". An expired lock whose owner is alive but hung, or a box that has lost S3 (spec §9.5: held until an operator terminates it, possibly hours), makes every acquire attempt on its hosts GET a proof that does not exist. Only `Confirmer`'s 10 s negative cache bounds the Describe; nothing bounds the proof GET.
+Fix: cache proof absence per (iid, box_lifetime) for the confirmer's negative TTL (10 s) and serve valid proofs from an in-process immutable cache. Then lookups cost at most 1 GET per iid per 10 s per box, plus one per departure once present, not one per host per request. Add the row and a counting witness (a hung peer with 20 visitor requests).
+
+### P3
+
+- **P3-1:** N-HA16 says the proof "grants no scan", but Enqueue lets a located proof schedule a scan (§"Enqueue"). The behaviour is safe, but align the wording: discovery may *schedule* work, and only acquire consumes the proof as authority.
+- **P3-2:** budget variable F counts "≤32 cold proof GETs" per adoption page, yet one departure has one immutable proof. With the in-process cache from P2-3, F is about 1 per departure per process. Correct the 1,120 G figure.
+- **P3-3:** dev activation: N-HA17 makes any legacy native sidecar in the home scope hold *every* departure open, with hourly pages per receiver and the SQS message kept for 14 days (`main.tf:837`). That is Paul's ruling, so it is not a finding against it. The card should inventory dev's home-scope sidecars and state the expected pages and evidence retention before the drill.
+
+## Round summary
+
+| Round | Verdict | P1 / P2 / P3 |
+|---|---|---|
+| 1 | NOT READY | 2 / 7 / 7 |
+| 2 | NOT READY (rule 2: I3 evidence-ageing family recurred; new P1-B) | 2 / 2 / 4 |
+| 3 | READY AFTER FIXES | 0 / 3 / 3 |
+
+Apply P2-1..P2-3 without another round (rule 1). The census and a review of the changed termination/production-storage behaviour still apply to the P2 diff and the implementation.