carlos / platform Public

Regional domains (#447): Astra round 3 findings on spec rev 3 (NOT READY, 2 P1, 4 P2; last round, work stops)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 1db58695173bd58116a3052323ca35186c496d8a parent 52123e4
1 file changed, +80 −0
  • docs/superpowers/specs/CODEX-FINDINGS-regional-domains-447-R3.md +80 −0

CI passed — run details

Intent

Human

<task-notification> <task-id>af17d5e1dbe1fd0b0</task-id> <tool-use-id>toolu_01Gr4QGZEDnFw4fiPxJxwZkX</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>Astra round 3 is running with reasoning effort high and its log is growing. I'll read the findings when the waiter reports that it has finished.</result> <usage><subagent_tokens>159528</subagent_tokens><tool_uses>17</tool_uses><duration_ms>1230283</duration_ms></usage> </task-notification>

Attributed to this commit: 8.36 g CO₂e (1,057,289 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on regional-domains-447, 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/specs/CODEX-FINDINGS-regional-domains-447-R3.md b/docs/superpowers/specs/CODEX-FINDINGS-regional-domains-447-R3.md
new file mode 100644
index 000000000..0690c3f48
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-FINDINGS-regional-domains-447-R3.md
@@ -0,0 +1,80 @@
+| Round 2 finding | Round 3 assessment |
+|---|---|
+| P1-1: persisted ordinary serving state | **Partly resolved.** Conversion is refused, but failed alias reads can admit a fresh box with retained ordinary state. See R3-P1-1. |
+| P1-2: inherited paths erase the marker | **Resolved.** Clearing paths and the regional early return preserve the marker, including login re-resolution. The mutation witness needs correction. |
+| P1-3: ordinary wildcard fallback | **Partly resolved.** Console overlap checks are specified, but the hand-route exception also affects current binaries. See R3-P1-2. |
+| P1-4: retained target replacement | **Resolved.** The shared predicate checks the same route snapshot used to build upstreams; its proposed imports introduce no cycle. |
+| P2-1: route-collision refusal | **Partly resolved.** The owner exemption and incomplete fold are removed, but declared routes awaiting provisioning remain undetected. See R3-P2-1. |
+| P2-2: request budget | **Partly resolved.** Update checks and record reads are counted, but `heldElsewhere` still introduces another deployment-wide read. See R3-P2-2. |
+
+Reviewed at `52123e458a0a58c8cbb29c7ee9346854f276ac76`. No files changed, tests run, or subagents spawned. The accepted stale-box/old-binary limit is not itself a finding.
+
+**R3-P1-1 — §§6.2, 8, 10.4: failed alias reads count as proof that ordinary serving state is absent**
+
+The PUT rejects missing `metrics`, but an existing metrics object does not establish that its alias inventory was read successfully. Section 8 explicitly accepts the missing alias map.
+
+Evidence: [agent.go:4480](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/agent.go:4480) logs a failed `ListAliases` and continues publishing the heartbeat. [snapshot.go:1119](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/status/snapshot.go:1119) creates `Metrics` from the release field alone, among other independent inputs. [fleet.go:303](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/status/fleet.go:303) accepts that valid JSON as a complete heartbeat. The edges file supplies no backstop for an unpublished alias: [edgesfile.go:648](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/edgesfile.go:648) omits aliases whose DNS status is not `pointing`, while [edge.go:1071](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1071) serves them without that condition.
+
+Failure scenario: a fresh, current box retains an ordinary alias after its claim is detached. Its alias read fails, so its heartbeat names the current release but omits that alias; its edges file also omits the alias. The PUT accepts a regional claim. Another failed alias read after creation satisfies the GET’s timestamp condition without exposing the retained row. The box can continue serving its old upstream—including an ordinary TCP upstream in another region—while readiness is reported. No stale box or old binary is required.
+
+Fix: distinguish a successful empty alias inventory from a failed read, and require successful evidence in both admission and readiness. Add a witness with retained, unpublished ordinary state and a failed alias probe; it must refuse admission/readiness.
+
+Fault family: **ordinary-state exclusion and cross-region isolation**, carried from R2-P1-1.
+
+**R3-P1-2 — §§6.7, 7.3, 10.5: a hand route can replace the regional wildcard on a current binary**
+
+Section 10.5’s exact-precedence argument works for a regional apex beneath a parent wildcard. It does not work when the hand route occupies the regional wildcard’s own key.
+
+Evidence: [spec:474](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/docs/superpowers/specs/2026-10-28-regional-domains-447-design.md:474) explicitly preserves a real route over a regional entry at the same key. [cli.go:1432](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/cli.go:1432) does not refuse wildcard hosts; [cli.go:318](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/cli.go:318) constructs the ready route. [edge.go:1370](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1370) resolves a child through that wildcard, and [edge.go:855](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:855) permits a TCP upstream.
+
+Failure scenario: `shop.example.com` has a regional catch-all. After activation, a root hand route creates `*.shop.example.com` on the UK box, pointing at an Irish TCP backend. Reload retains the real route and skips the regional star entry. A request for `alice.shop.example.com` resolves to an unmarked upstream, so `regionalGate` does nothing and traffic leaves the region. Adoption of a current binary does not remove this route or change the specified precedence.
+
+Fix: enforce regional policy when a real route collides with the regional wildcard key, or refuse that hand-route creation on current binaries. Alternatively, cut regional catch-alls from this slice. Add a current-binary witness for this exact-key collision.
+
+Fault family: **cross-region isolation through covering routes**, carried from R2-P1-3. This case lies outside the accepted stale-box/old-binary limit.
+
+**R3-P2-1 — §§6.2–6.3, 7.3: collision admission misses routes declared but not yet published**
+
+The unconditional snapshot check fixes the original helper problem, but publication is not the complete set of routes that can subsequently appear.
+
+Evidence: [apiinstances.go:1507](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apiinstances.go:1507) checks the domain claim before creating the instance record; the record write occurs later at [apiinstances.go:2101](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apiinstances.go:2101). Provisioning subsequently mints the route at [reconcile.go:1737](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/provision/reconcile.go:1737). The proposed PUT checks published routes, while its instance-record listing validates binding targets only.
+
+Failure scenario: create an instance at X, then create a regional claim at X before provisioning or edges publication catches up. Neither the claim nor the snapshot reports a collision. The already-declared instance later becomes a real route, which the specified Reload gives precedence over the regional entry. A concurrent create can produce the same result.
+
+Fix: include declared instance ownership in collision admission and serialize the relevant create check/write with regional admission. Cover a committed record awaiting provisioning, as well as concurrent creation. Do not rely solely on published serving state.
+
+Fault family: **route-collision precedence**. Carried at R2’s P2 severity.
+
+**R3-P2-2 — §§6.2 step 4, 11: `heldElsewhere` still exceeds the one-snapshot budget**
+
+Evidence: step 4 explicitly calls `heldElsewhere`. [domaincatchall.go:146](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/domaincatchall.go:146) calls `deploymentRouteTaken`, which invokes `DeploymentRoutes` at [apidomains.go:1575](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:1575). That independently loads heartbeats and edges files at [fold.go:151](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edgesfile/fold.go:151). `heldElsewhere` also performs the instance-catch-all claim lookup.
+
+Failure scenario: implementing the named helpers directly performs another deployment-wide fold before step 5’s shared snapshot, exceeding §11’s stated request budget.
+
+Fix: specify a snapshot-consuming variant, or replace this call with the necessary reservation checks using the overlap evidence already read. Count any remaining claim or record reads explicitly. The separate preflight/promotion accounting is otherwise corrected.
+
+Fault family: **request-cost contract**, carried from R2-P2-2.
+
+**R3-P2-3 — §13/W1: the path-map mutation cannot produce its required failure**
+
+Evidence: [spec:713](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/docs/superpowers/specs/2026-10-28-regional-domains-447-design.md:713) requires retaining the target’s path map to make leg (g) execute Tother. But [spec:487](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/docs/superpowers/specs/2026-10-28-regional-domains-447-design.md:487) independently requires `lookupUpstreamPath` to return immediately whenever `up.regional != 0`, at the existing check in [edge.go:1448](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1448).
+
+Failure scenario: retain the path map as instructed. The regional early return still preserves the marker, and the signed hop still receives 503. The required mutation result cannot be observed.
+
+Fix: assert the nil path map directly, and make the end-to-end mutation explicitly restore both inherited paths and path resolution for regional entries. Keep the signed-hop assertion through production wiring.
+
+Fault family: **witness validity for receiving-hop refusal**.
+
+**R3-P2-4 — §6.7: the parent-depth shortcut skips a valid `*.X` claim**
+
+Evidence: [spec:376](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/docs/superpowers/specs/2026-10-28-regional-domains-447-design.md:376) skips all three overlap GETs when P has no interior dot. For X=`example.com`, P=`com`, but `domains/*.example.com.json` remains a valid instance-catch-all key. Its creation and storage are shown at [claims.go:303](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:303).
+
+Failure scenario: detach the parent claim while leaving its instance-catch-all claim. A regional PUT for `example.com` skips the `*.example.com` read, contrary to the table’s unconditional refusal of that claim in any state. An unreadable object at that key is skipped too.
+
+Fix: skip only the P-dependent checks when P is invalid; always inspect `*.X`. Add the two-label apex case to W5. The proposed regional-parent derivation refusal limits the serving consequence, so this remains P2.
+
+Fault family: **complete overlap admission**.
+
+This is round 3 of 3; the outstanding P1s stop the work. They share the structural assumption that ordinary serving authority cannot coexist with regional policy, but have different immediate causes: incomplete alias evidence and wildcard collision precedence. Refusing incomplete activation evidence addresses the first; cutting regional catch-alls removes the second demonstrated case. Cutting catch-alls alone does not remove both. No fourth round is authorized.
+
+NOT READY
\ No newline at end of file