review brief: nearest-region-a Task 2, round 1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+78
−0
docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-nearest-region-a-task2.md+78 −0
CI failed — run details
diff --git a/docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-nearest-region-a-task2.md b/docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-nearest-region-a-task2.md| new file mode 100644 |
| index 000000000..d38a490a8 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-nearest-region-a-task2.md |
| @@ -0,0 +1,78 @@ |
| +# Review brief: nearest-region never-reuse, Task 2 (hostname history store, data-kind predicate, kind immutability), round 1 of 3 |
| + |
| +Repo carlos/platform, branch `nearest-region-a`, commit 9ceae022 (the brief's own commit follows it; review the code at that commit). |
| +Under review: the diff `b1d00ca7..b5660975` (one commit), that is: |
| +`internal/provision/hostsused.go` (new), `internal/provision/hostsused_test.go` (new), |
| +`internal/provision/record_sequence.go` (`WriteRecord`), and the census bookkeeping |
| +(`nearest_region_a_census_test.go`, `plan9_b8_census_test.go`, `testdata/plan14-root-reads-*`). |
| +Authorities: the accepted spec `docs/superpowers/specs/2026-10-26-nearest-region-without-claims-design.md` |
| +(rev 5, accepted by Paul 2026-10-26) and its plan `docs/superpowers/plans/2026-10-26-nearest-region-never-reuse.md`, |
| +Task 2. Both were reviewed and accepted on `design-nearest-region-199` and are carried unchanged on this |
| +branch (commit 9ceae022), so they land with this merge; treat them as fixed authorities, not as unmerged |
| +work. AGENTS.md on main ("Stopping rules", "The census"). |
| + |
| +You are an independent reviewer. Read the document, then the code it |
| +names, and check every claim against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul's rulings in the spec (§1-§5, §3a): marks are create-only and never deleted; data kinds are every |
| + record whose `KindOrDefault()` is not `static` or `service`, plus sidecars; an absent `@mode` means |
| + `incomplete`; one console process per deployment. Report only mechanisms that fail to honour them. |
| +- This is merge A: nothing reads `@floor` yet and no door writes `@mode` yet (Tasks 5-10 are merge B). |
| + Do not report missing merge-B behaviour. |
| + |
| +## What to check |
| + |
| +1. `MarkHostUsed` is create-only (`Put` with `ifMatch ""`), maps only `release.ErrCASConflict` to |
| + `(false, nil)`, and passes every other store error through. Check `release.Store` implementations |
| + (`DirStore`, `S3Store`, any wrapper the console uses) answer a create-only conflict with |
| + `ErrCASConflict` and nothing else, so an outage can never read as "already marked". |
| +2. `HostsUsedKey` returns `""` for anything `controlname.ValidHostShape` refuses, and no valid hostname |
| + can collide with `@mode` or `@floor`, or escape the prefix. |
| +3. `ReadHostsMode`: absent is `incomplete`; an unreadable or unknown body is an error and never a |
| + default. `WriteHostsMode` refuses unknown modes. |
| +4. Kind immutability in `WriteRecord` (`checkKindUnchanged`): an in-place write that changes a record's |
| + kind is refused with `ErrKindChange`; a create from `{}` may be any kind; `""` and `instance` are one |
| + kind. The tombstone exemption: `provision.TombstoneBody` keeps no `kind`, so without the exemption |
| + retiring a static record would be refused. Check the exemption cannot be used to turn a live exempt |
| + record into a live data-kind record (is there any writer that writes a non-tombstone body over a |
| + tombstone in place?), and that every existing `WriteRecord` caller (console lifetimes, hostops, |
| + `accounts_record_sequence.go`, `provision` update paths, the nested prepared-record path for store |
| + wrappers) still works: none of them may now be refused for a write that keeps the kind. |
| +5. `Record.DataKind` matches the spec's exemptions exactly (addr-backed `instance` is a data kind). |
| +6. The record-write census entries (`nearest_region_a_census_test.go`) classify the new `Put` sites |
| + correctly (`nonrecord`), and nothing in the diff weakens a census. |
| + |
| +## Severity |
| + |
| +- **P1**: unsafe, would not compile, a test fails, or it would not work. |
| + Blocks merge. |
| +- **P2**: wrong or missing. Fixed without reopening this review. (The |
| + census, and review of any newly changed security, root, termination |
| + or production-storage behaviour, still check the fix; see AGENTS.md, |
| + "Stopping rules".) |
| +- **P3**: clarity or polish. Goes on a follow-up list; never a reason for |
| + another round. |
| + |
| +A P1 states its failure scenario and the evidence (file:line). Do not |
| +raise a P2 to P1 to keep the review open. |
| + |
| +## Output |
| + |
| +Findings ranked P1, P2, P3. Each gives the section or task, the problem, |
| +the evidence (file:line, verified), the failure scenario, a concrete |
| +fix and the invariant or trust boundary it breaks (that is its fault |
| +family). End with exactly one verdict: |
| + |
| +- **READY**: no P1 and no P2. |
| +- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another |
| + round. |
| +- **NOT READY**: one or more P1s, listed. |
| + |
| +In round 3, a NOT READY also says whether the P1s share one cause, and |
| +whether refusing the case up front or cutting the feature would remove |
| +them. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of |
| +your own. Do not run the full test suites. |