carlos / platform Public

review brief: nearest-region-followups round 1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 1bc9b1c4098e51770114d224ee3bcd0a558d9255 parent 6bb0c1f
1 file changed, +110 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-nearest-region-followups.md +110 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-nearest-region-followups.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-nearest-region-followups.md
new file mode 100644
index 000000000..e9f779eb3
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-nearest-region-followups.md
@@ -0,0 +1,110 @@
+# Review brief: branch nearest-region-followups (#441, #442), round 1 of 3
+
+Repo carlos/platform, branch `nearest-region-followups`, commit 6bb0c1f25dca88a9744f36a57368ddf9c0908a20.
+Under review: the diff `origin/main..6bb0c1f2` (base bf55f29e), plus this brief's own commit.
+Authorities: spec `docs/superpowers/specs/2026-10-26-nearest-region-without-claims-design.md`,
+plan `docs/superpowers/plans/2026-10-26-nearest-region-never-reuse.md`, the README sections
+"Releasing the platform" and "The hostname history" (all on main). The two issues are amadan
+discussions #441 and #442 on carlos/platform; their text is summarised below. Do not review
+against unmerged branches; if this work needs one, say so as a P1 and stop.
+
+You are an independent reviewer. Read the diff, then the code it touches and calls, and check
+every claim in the comments, the commit message and this brief against that code.
+
+## The two fixes
+
+- **#442.** `console hosts-used activate` writes `control/hosts-used/@floor` as
+ `{version, commit}`. The commit came only from Go's `vcs.revision`, which release builds
+ (from a linked worktree, `-buildvcs=false`) don't carry, so dev's floor reads
+ `{"version":"v0.28.28","commit":""}`. carloku-infrastructure `scripts/roll-console.sh`
+ (merged 5953f04, not in this repo) refuses a floor with no commit, so after flagship activation
+ every flagship console roll would be refused. Paul chose: release builds stamp their commit.
+ The branch adds `version.Commit` (set by `-ldflags -X`) and `version.Revision()` (Commit, else
+ vcs.revision); `HostsFloorNow()` and the CLI's `accounts migrate` floor check use it; the
+ Makefile stamps `COMMIT` and `build-console` refuses an empty one; `HostsActivation.Activate`
+ refuses a floor commit that is not 40 or 64 lowercase hex before reading or writing anything
+ (C13); `provision.WriteHostsFloor` refuses an empty commit. roll-console.sh accepts
+ `^[0-9a-f]{4,64}$` and resolves it with git in the platform checkout.
+- **#441.** With the history active on dev (`CONSOLE_HOME_REGION=ie`, home boxes publish
+ placement `""`, activation examined `region:` and `region:uk`), `carlos sidecars create
+ -region ie` was refused with S4 because the sidecar door kept `ie` raw and `hostsTargetRefusal`
+ looked up `region:ie`. The instance door has normalised the home's name with `homeRegionIn`
+ since #346. The branch normalises in the sidecar door the same way, before the allow-list,
+ S4, the leftover rail and the record write, and names the home by its name in the allow-list
+ refusal.
+
+## Fixed: do not re-argue
+
+- Paul's direction on #442: release builds stamp their commit, so the floor always names one
+ (not resolving tags in roll-console.sh). Dev's existing floor is left as it is.
+- The manifest allow-list keeps the instance door's existing semantics: it is checked against
+ the normalised code, so a list that names the home's name does not admit the home. This is
+ pinned on main by `TestAppRegionRefusalsAdvertiseOnlyWhatPasses` (C17) and
+ `TestRunningPooledPlacementLines`; the sidecar door now matches it. A different allow-list
+ rule is out of scope.
+- Census owner rulings: the reviewer decides; nothing goes to Paul (AGENTS.md, "The census").
+- Copy (C13, MK1, README lines) is approved by a delegated Luna pass; report a copy problem only
+ if a sentence is false.
+
+## What to check
+
+1. **Floor commit, end to end.** A console built by `make build-console` from a linked worktree
+ with `GOFLAGS=-buildvcs=false` writes a floor whose commit is the checkout's full HEAD, and one
+ built without the stamp refuses activation before any mark, floor or mode write. Check
+ `Activate`'s ordering, `HostsFloorNow`, `cmd/console/hostsused.go` wiring, the Makefile
+ (including `-trimpath`, `SHA` vs `COMMIT`, `make build` for the CLI), and the tests in
+ `cmd/console/servelock_test.go` and `cmd/console/main_test.go`.
+2. **Compatibility.** Can anything now refuse that worked before and should still work: an
+ existing floor (dev's, commit ""), `carlos accounts migrate`'s `buildMeetsFloor`, the
+ status line, roll-console.sh's reading of a floor this branch writes, a SHA-256 repo?
+3. **Sidecar door.** Every use of `region` in `handleAPISidecarCreate` after the change
+ (allow-list, ValidRegion, ValidateSidecarShape, S4 `hostsTargetRefusal(rec.Region)`, the
+ leftover rail's `leftoverCheckApplies(region, …)` against `cfg.Region`, the claim branch's
+ `claimPlacementRegion`, the stored record). Is a home-coded sidecar now stored and served as
+ a home sidecar on the box (`internal/provision/sidecar_reconcile.go` region scope)? Is any
+ other data-kind create door (seed, import, run, lifetimes create, app region set, moves) still
+ passing a home's name raw into S4 (`gateDataCreate`, `hostsTargetRefusal`)?
+4. **Witnesses.** `internal/console/hostsused_homecode_test.go` goes through the HTTP doors
+ after a real `Activate`, lifetimes off and on. Does it model dev faithfully (home placement
+ `""`, `cfg.Region` `""`, `HomeRegion` `ie`), and would it fail without the fix?
+5. **Census card.** `docs/superpowers/notes/census-proposal-nearest-region-followups.md`: no
+ unit changed; envelopes `.`, `internal/provision` and `internal/version` re-pinned. Give a
+ verdict for each envelope: does the change let root open, run, query or follow anything new
+ from a path or input a tenant, app or box agent can create, write or name, or weaken any check
+ root relies on? Also check the record-write census re-digest of `WriteHostsFloor` in
+ `internal/provision/nearest_region_a_census_test.go`.
+6. **README recipe.** Step 2 and "The history's floor": true against the code?
+
+## 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). Then the census verdicts (approve or escalate, per envelope, citing the lines read).
+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.