carlos / platform Public

Regional domains (#447): Astra census R1 (approve, 1 P2 card text) and whole-branch R1 (READY AFTER FIXES, 3 P2 1 P3) findings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev e33311b46f55d35ddc43d62b81f3c92f52f17117 parent 91b222f
2 files changed, +112 −0
  • docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-BRANCH-R1.md +51 −0
  • docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-T13-CENSUS-R1.md +61 −0

Intent

Human

<task-notification> <task-id>af17d5e1dbe1fd0b0</task-id> <tool-use-id>toolu_01HCaduVEm9DpXQqb6NRRViz</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/c2acaf22-306d-491b-b2b6-addbf33b8e87/tasks/af17d5e1dbe1fd0b0.output</output-file> <status>completed</status> <summary>Agent "Controller: build regional domains #447" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>The census and whole-branch Astra reviews are running in parallel, and CI is running on 91b222f3. I'll pick up their results when the waiter reports back.</result> <usage><subagent_tokens>396257</subagent_tokens><tool_uses>6</tool_uses><duration_ms>637281</duration_ms></usage> </task-notification>

diff --git a/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-BRANCH-R1.md b/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-BRANCH-R1.md
new file mode 100644
index 000000000..ca0fb5132
--- /dev/null
+++ b/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-BRANCH-R1.md
@@ -0,0 +1,51 @@
+Reviewed `91b222f3146b6e0dc3823f122d7eb0c6782b447e` against `origin/main`, whole-branch round 1 of 3. Rulings 1–9 and §10.5’s accepted residual were preserved. Census approval is excluded.
+
+**P1: None found.** No new finding is in the covering-routes family.
+
+1. **P2 — Both documented write examples are rejected by the CLI.**
+
+ **Location and verified evidence:** [cli.md:1316](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/docs/site/cli.md:1316) places the hostname before `--set`, as does the following catch-all example. [domains_cli.go:494](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/domains_cli.go:494) uses Go’s flag parser, which stops at that hostname. The subsequent `NArg() > 1` check rejects the remaining arguments.
+
+ **Failure scenario:** Copying either write example prints usage and exits before sending the PUT. Existing CLI tests put flags before the hostname and miss this mismatch.
+
+ **Concrete fix:** Move the hostname after all flags in both examples and the corresponding design examples. Exercise the published argument order in a CLI test.
+
+ **Fault family:** Documented CLI contract.
+
+2. **P2 — Regional domains remain in “checking” indefinitely.**
+
+ **Location and verified evidence:** [apidomains.go:1444](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:1444) and [appsettings.go:762](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/appsettings.go:762) apply ordinary `claimState` to regional claims. Regional derivation deliberately creates no ordinary alias row ([aliases.go:434](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:434)). Heartbeat hostname readings come from routes and ordinary aliases, so the regional apex receives none. With no reading, [domainstate.go:109](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/domainstate.go:109) returns `checking` and promises that checks should settle shortly.
+
+ **Failure scenario:** A regional domain serves successfully and its placements GET reports ready, while the list, per-host GET, and settings page continue reporting transient checking forever.
+
+ **Concrete fix:** Give regional claims an explicit state/detail directing readers to placements, shared by these surfaces. Preserve the existing request budget rather than adding placement reads per list row.
+
+ **Fault family:** Regional lifecycle observability.
+
+3. **P2 — Regional DNS advice drops the required wildcard delegation record.**
+
+ **Location and verified evidence:** The regional branch at [apidomains.go:1451](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:1451) skips `domainRecords` entirely. That helper supplies both ordinary traffic records and the independent, required ACME delegation CNAME ([domainstate.go:226](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/domainstate.go:226)). The later delegation check can report `missing`, but no corrective record accompanies it.
+
+ **Failure scenario:** A regional wildcard’s delegation disappears. The domain read reports missing delegation and directs the member to placements, whose response contains addresses but no delegation record. The normal structured repair instruction has been lost.
+
+ **Concrete fix:** Continue omitting ordinary traffic A/CNAME records for regional claims, but retain the required `_acme-challenge` CNAME. Cover a regional wildcard with missing delegation; the current no-records test covers only a claim without wildcard.
+
+ **Fault family:** DNS repair information completeness.
+
+4. **P3 — The floor comment describes the opposite old-reader behaviour.**
+
+ **Location and verified evidence:** [layoutintent.go:249](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/release/layoutintent.go:249) says a below-floor box serves the regional claim as an ordinary alias. Schema 2 specifically prevents that; `TestTodaysReaderRuleSkipsSchema2` pins the exclusion.
+
+ **Failure scenario:** A maintainer diagnosing rollback receives an incorrect explanation of the floor’s purpose.
+
+ **Concrete fix:** Explain that old readers skip schema-2 claims and that the barrier requires capable boxes before creation.
+
+ **Fault family:** Floor documentation accuracy.
+
+Of the ledger’s deferred minors, perpetual checking and the missing delegation record require correction before merge. The remaining listed minors can stay as follow-ups.
+
+Source review covered admission, derivation, edge dispatch, readiness, CLI handling, remote registry transactions, certificate retention, rollback gates, request accounting, and the provider boundary. Changed Go files pass `gofmt` checking. The targeted release test could not start because the read-only sandbox blocked Go’s build directory; runtime and cross-compile results were not independently verified. No files changed, no subagents ran, no full suites ran, and `GOCACHE` remained unset.
+
+With no P1, this review stops. Apply the P2 fixes without another round, retaining the required census and security checks.
+
+READY AFTER FIXES
\ No newline at end of file
diff --git a/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-T13-CENSUS-R1.md b/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-T13-CENSUS-R1.md
new file mode 100644
index 000000000..70199c788
--- /dev/null
+++ b/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-T13-CENSUS-R1.md
@@ -0,0 +1,61 @@
+| Item | Decision | Lines read and basis |
+|---|---|---|
+| `cli.go:runAdd` — body | APPROVE | [197–437](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/cli.go:197); helper at 154–190. One claim GET; the result only adds a refusal. |
+| `deriveInstanceAliases` — body | APPROVE | [aliases.go:129–246](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:129). Regional parents add an inert-case refusal. |
+| `Edge.serveAssetFar` — body | APPROVE | [assetcatch.go:1046–1167](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/assetcatch.go:1046). Only the nil production observation hook was added. |
+| `Edge.ServeHTTP` — body | APPROVE | [edge.go:1694–1771](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1694). Regional refusal precedes outbound arms; the second refusal protects deny entries after the exact-home exception. |
+| `statusTick` — body | APPROVE | [agent.go:4471–4516](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/agent.go:4471). Resets `AliasesRead`; sets it only after successful `ListAliases`. |
+| `CollectBox` — body | APPROVE | [snapshot.go:958–1190](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/status/snapshot.go:958). Carries the boolean and includes successful empty reads in Metrics. |
+| `Registry.Fingerprint` — sites | APPROVE | [registry.go:3754–3992](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/registry.go:3754). Fixed SELECT on the existing database; marker appears only with regional rows. |
+| `Registry.migrate` — sites | APPROVE | [registry.go:736–864](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/registry.go:736). Adds one literal `CREATE TABLE`; existing statements remain unchanged. |
+| `deriveRegional` — new | APPROVE | [aliases.go:858–878](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:858). Normalizes the routing key and applies the shared target predicate to held routes. |
+| `regionalSetEqual` — new | APPROVE | [aliases.go:931–946](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:931). Pure comparison of held rows. |
+| `writeRegional` — new | APPROVE | [aliases.go:890–926](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:890). Groups each claim’s keys and uses only `ReplaceRegionalSet`; unread claims retain their rows. |
+| `Edge.foldRegional` — new | APPROVE | [regional.go:110–145](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/regional.go:110). Rechecks held targets, clears paths and installs deny entries over colliding real routes. |
+| `Registry.ListRegional` — new | APPROVE | [registry.go:3503–3523](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/registry.go:3503). Fixed query or existing remote transport; no data-derived filesystem path. |
+| `Registry.ReplaceRegionalSet` — new | APPROVE | [registry.go:3541–3584](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/registry.go:3541). Validates claim-key membership and duplicates; all changes commit in one transaction. |
+| `RegionalTarget` — new | APPROVE | [regionaltarget.go:17–37](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/release/regionaltarget.go:17). Pure eligibility predicate; no additional IO. |
+| `ReconcileAliasesReport` — reads | APPROVE | [aliases.go:380–841](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:380). Adds the regional-row read and service-user derivation; preserves qualifying unread-claim wildcard parents. |
+| `Edge.Reload` — reads | APPROVE | [edge.go:720–1165](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:720). Reads regional rows after aliases and judges targets against the same reload’s routes. |
+| `Registry.dispatchRemote` — reads | APPROVE | [remote_dispatch.go:136–394](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/remote_dispatch.go:136). New arms call the validated local methods; retains `hint/E2`. |
+| Registry schema — other, `@fields` | APPROVE | [registry.go:788–800, 3489–3500](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/registry.go:788), [remote_dispatch.go:85, 128](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/remote_dispatch.go:85). Only the regional table/type and its transport fields; field inventory adds `RDs` and `Regional`, removes nothing. |
+| Envelope `.` | APPROVE | Unit above, plus [apimode.go:4660–4768](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/apimode.go:4660), [domains_cli.go:89–116, 477–640](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/domains_cli.go:89), [system.go:293–355, 578–605](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/system.go:293). API operations and override plumbing add no root filesystem authority. |
+| Envelope `internal/domains` | APPROVE | Alias units above; [claims.go:123–270, 603–631, 685–859, 917–929, 999–1249](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:123). Schema handling, owner-gated refusals, conditional deletion and claim writers preserve the reviewed boundaries. |
+| Envelope `internal/edge` | APPROVE | Units above; [regional.go:1–145](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/regional.go:1), [edge.go:1462–1468, 3424–3428](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1462), [homemap.go:985–1005](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/homemap.go:985). Regional paths bypass prefix selection; observation hooks are inert in production. |
+| Envelope `internal/host` | APPROVE | Status unit above; [agent.go:1172–1186, 3888–3895](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/agent.go:1172), [changeindex.go:330–337](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/changeindex.go:330). Both alias-pass callers supply `cfg.Region`. |
+| Envelope `internal/provision` | APPROVE | [recordhost.go:1–45](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/provision/recordhost.go:1). Console-only caller; strict listing and key parsing, no record write. |
+| Envelope `internal/registry` | APPROVE | Registry units and schema rows above; [remote.go:233–294](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/registry/remote.go:233). Worker refuses root; read-only method restrictions remain intact. |
+| Envelope `internal/release` | APPROVE | Target unit above; [layoutintent.go:252–306](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/release/layoutintent.go:252), [systempointer.go:36–50, 265–280, 318–319, 375–386](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/release/systempointer.go:36). Adds floor logic and signed override plumbing without changing root execution authority. |
+| Envelope `internal/status` | APPROVE | Collection unit above; [snapshot.go:144–155, 646–651](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/status/snapshot.go:144). Additive probe and private metrics fields. |
+| Record inventory: `claimRawSetClaimPlacements` — new, nonrecord | APPROVE | [claims.go:242–270](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:242). Its sole Put targets `ClaimKey(next.Host)`. |
+| Record inventory: `setClaimCapabilitiesAt` — new, nonrecord | APPROVE | [claims.go:1033–1065](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:1033). Its sole Put targets `ClaimKey(host)`, with owner and ETag checks. |
+| Record inventory: `RecordHostDeclared` — new, key-site | APPROVE | [recordhost.go:24–45](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/provision/recordhost.go:24). Lists and parses keys; writes nothing. |
+| Record inventory: `claimRawSetClaimPaths` — re-pin, nonrecord | APPROVE | [claims.go:1129–1183](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:1129). Regional refusal follows ownership check; existing claim-key Put remains. |
+| Record inventory: `claimRawAttachInstanceCatchall` — re-pin, nonrecord | APPROVE | [claims.go:448–499](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:448). Regional-parent refusal follows ownership check; writes only the claim key. |
+| Record inventory: `AttachClaimProven` — re-pin, nonrecord | APPROVE | [claims.go:685–791](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:685). Regional claims return before convergence; existing Puts target claim keys. |
+| Record inventory: `Server.createRecordMarked` — re-pin, record-writer | APPROVE | [hostsused.go:562–592](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/hostsused.go:562). Rechecks under hostname exclusion; writes through `provision.CreateRecord`. |
+| Record inventory: `Server.createRecordWithLifetimeLocked` — re-pin, key-site | APPROVE | [lifetimes_create.go:63–151](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/lifetimes_create.go:63). Regional refusal precedes allocation; no direct record Put added. |
+| Record inventory: `Server.handleAPIDomainAttach` — re-pin, key-site | APPROVE | [apidomains.go:293–640](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:293). Adds error mapping; no direct record write. |
+| Record inventory: `Server.registerCLIRoutes` — re-pin, key-site | APPROVE | [authcli.go:505–1113](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/authcli.go:505). Adds placements routes; existing record-path literals remain registration only. |
+| Record inventory: `claimRawSetClaimCapabilities` — removed entry | APPROVE | [claims.go:999–1016](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:999). Delegates to `setClaimCapabilitiesAt`; has no Put of its own. |
+| Card: Branch context | REJECT | [census-proposal:53–58](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/docs/superpowers/notes/census-proposal-regional-domains-447.md:53). Incorrectly includes the floor judge among claim writers; P2 below. |
+
+Reviewed commit `91b222f3146b6e0dc3823f122d7eb0c6782b447e` against `origin/main...HEAD`, census round 1 of 3. The seven new units’ `legacy/accepted-legacy` dispositions are appropriate. No production root pass calls the regional table’s list or replacement methods. The record-writing paths retain `WriteRecord` or typed writers.
+
+**P1:** None.
+
+**P2 — Branch context incorrectly identifies the floor judge as a claim writer.**
+
+- **Unit/problem:** The card’s Branch context lists “the floor judge” inside its claim-writer description.
+- **Evidence:** [Card lines 55–56](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/docs/superpowers/notes/census-proposal-regional-domains-447.md:55). [regionalFloorJudge, lines 66–90](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/regionalfloor.go:66) only reads claims, decides, logs or returns an error.
+- **Failure scenario:** A reviewer using the card as the authority map would incorrectly attribute claim mutation to the downgrade gate. This is a documentation defect; no runtime failure was found.
+- **Fix:** Remove the floor judge from the claim-writer list and describe it separately as a claim reader used to judge system-channel downgrades.
+- **Fault family:** Census descriptions must accurately distinguish readers from writers.
+
+**P3:** None.
+
+All 18 root-read unit hashes and 10 active changed record-write hashes matched the source on independent recomputation. Targeted census tests and Go dependency listing could not start because the read-only environment prevents build-work and cache writes. No full suites ran; `GOCACHE` remained unset. No files were edited.
+
+Apply the P2 correction without reopening review, under the stopping rule.
+
+READY AFTER FIXES
\ No newline at end of file