carlos / platform Public

Regional domains (#447): Astra round 2 findings on spec rev 2 (NOT READY, 4 P1; stopping rule 2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 93db52932a4ae90e24211848bb71381702a04bbf parent 9a49716
1 file changed, +93 −0
  • docs/superpowers/specs/CODEX-FINDINGS-regional-domains-447-R2.md +93 −0

CI failed — run details

Intent

Attributed to this commit: 68.2 g CO₂e (1,679,287 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-R2.md b/docs/superpowers/specs/CODEX-FINDINGS-regional-domains-447-R2.md
new file mode 100644
index 000000000..2d7229db3
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-FINDINGS-regional-domains-447-R2.md
@@ -0,0 +1,93 @@
+| Round 1 finding | Round 2 assessment |
+|---|---|
+| P1-1: serving addresses | **Resolved.** The EIP, placement, region and heartbeat release fields exist. |
+| P1-2: old binaries | **Partly resolved.** The floor is specified, but schema rejection does not invalidate persisted serving state. See R2-P1-1. |
+| P2-1: route collision | **Partly resolved.** Reconcile retains the regional entry, but the proposed collision helper exempts the caller’s own claim. See R2-P2-1. |
+| P2-2: receiving hops | **Partly resolved.** The refusal is specified, but path resolution can remove the regional marker before it runs. See R2-P1-2. |
+| P2-3: apex certificates | **Resolved.** Exact deny entries qualify through `Allowed` and enter the housekeeper’s warm set. |
+| P2-4: team scope | **Resolved.** Explicitly excluding regional claims from `inScopeClaim` closes the authority expansion. |
+| P2-5: lifetime dependency | **Partly resolved.** The dependency is removed, but retained bindings lack the promised protection against foreign reuse. See R2-P1-4. |
+| P2-6: startup gate | **Partly resolved.** The deployment-wide startup gate is removed, but the replacement “no entry means no target” argument is false. See R2-P1-3. |
+| P2-7: mutation witness | **Resolved.** W1(d), using a signed hop to a serving regional entry, can execute the target when the guard is removed. |
+
+Reviewed at `9a49716cb29483561243cf2870629d221a51ee8c`, against this worktree’s code. No files changed, tests run, or subagents spawned.
+
+**R2-P1-1 — §§7.5, 8, 10.4: schema 2 does not make legacy serving state fail closed**
+
+The activation barrier checks binary releases. The GET checks whether boxes publish the *target instance*. Neither establishes that the old alias has been removed or that the regional policy has reached the edges.
+
+Evidence: [edge.go:479](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:479) performs `Reload` during construction; [edge.go:1067](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1067) loads persisted aliases without consulting claims. Schema rejection occurs separately at [claims.go:705](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:705). A successful old alias pass eventually deletes undesired rows at [aliases.go:686](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:686), but a failed claim listing returns before that cleanup at line 369.
+
+Failure scenario: convert an existing alias while both regional targets already publish healthy instance hosts. The GET can immediately report both regions ready although the old home still serves the ordinary alias and accepts cross-region hops. Separately, a stale box excluded from activation can return with an old binary and its persisted alias. It serves before reconciliation; a listing failure prolongs this state. The writer can also republish that alias through [edgesfile.go:641](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/edgesfile.go:641). Rejecting the schema does not undo any of this.
+
+Fix: specify an activation transition that establishes removal of legacy serving authority before reporting regional readiness, and admission that prevents returning old boxes from serving retained aliases. If that cannot fit this slice, cut live single-to-regional conversion and define a separate, initially unserved activation path. Add witnesses starting from a populated ordinary-alias registry, including an old restart with failed claim reads.
+
+Fault family: **old-binary exclusion and cross-region isolation**, recurring from R1-P1-2.
+
+**R2-P1-2 — §§6.2, 7.3: inherited paths erase the regional marker before the gate**
+
+Refusing `Paths` on the regional claim does not prevent its bound instance from having its own path map. Copying `m[target]` into the regional entry copies that map too.
+
+Evidence: [edge.go:999](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:999) installs path maps before aliases. `lookupUpstreamPath` resolves the inherited prefix and returns the target’s upstream wholesale at [edge.go:1528](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1528). That upstream has no regional marker. Existing path derivation requires the destination’s account and readiness, but permits another app and does not require a local socket backend: [aliases.go:536](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/aliases.go:536).
+
+Failure scenario: a bound instance has `/api` mapped to another ready route. A signed hop for `example.com/api/...` resolves to that ordinary upstream before `regionalGate`; the proposed “not regional” branch does nothing. The receiving box executes the request instead of returning 503. A tunnel-backed prefix target can also send an ordinary regional request off the box.
+
+Fix: clear inherited path maps on regional entries, consistent with the stated paths exclusion, or resolve regional policy from the original hostname independently of path selection. Cover prefixed requests, login re-resolution and signed hops in W1.
+
+Fault family: **cross-region isolation and receiving-hop refusal**, recurring from R1-P2-2. This is P1 because the specified lookup sequence bypasses the guard.
+
+**R2-P1-3 — §§7.1, 7.5, 10.4: an unpublished exact name can still match an ordinary wildcard**
+
+The absence of `shop.example.com` and `*.shop.example.com` from edges files does not imply that `Home("shop.example.com")` has no target. It can match `*.example.com`.
+
+Evidence: local lookup performs that fallback at [edge.go:1366](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:1366). Remote `Home` and `Owner` share wildcard-capable lookup at [homemap.go:1009](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/homemap.go:1009). Ordinary catch-alls publish a dial role at [edgesfile.go:752](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/edgesfile.go:752). The proposed PUT rejects exact route collisions, not an enclosing ordinary catch-all.
+
+Failure scenario: `example.com` has an ordinary catch-all, and `shop.example.com` becomes regional. A fresh box without the regional entry can backhaul through the parent’s wildcard. A rolled-back box can serve the parent’s ordinary local upstream for this regional name even after successfully skipping the schema-2 claim. The parent’s wildcard certificate also covers the request.
+
+Fix: either refuse these namespace overlaps in both directions—including later catch-all capability changes—or provide regional-name exclusion that remains effective before derivation and after rollback. Add a witness with an ordinary parent catch-all and a regional child. W1’s current apex fixture cannot detect this.
+
+Fault family: **cross-region isolation when regional policy is absent**, recurring from R1-P2-6’s replacement safety argument.
+
+**R2-P1-4 — §§7.2–7.3: retained rows can bind a replacement or remote upstream**
+
+Derivation validates tenancy, region and backend shape, but `Reload` is instructed to accept any present `m[target]`. Keeping a row during an unreadable claim preserves a hostname, not the properties previously checked for that hostname.
+
+Evidence: the spec retains unreadable claims’ rows at lines 253–255 and resolves them by target presence at lines 263–266. [edge.go:713](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:713) rebuilds upstreams from current route rows. Tunnel and fleet dispatch precede socket dispatch at [edge.go:798](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:798). Registry changes independently trigger reload through [edge.go:2638](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edge/edge.go:2638).
+
+Failure scenario: a regional row points to target T; its claim becomes unreadable; T is replaced under another owner or changed into a remote-backed route. The retained row resolves to T’s new upstream and receives `regionalServe`. The gate permits traffic despite the failed tenancy or locality condition. Even with readable claims, independent reconciliation and reload leave an intervening window.
+
+Fix: revalidate the target’s account, app, region, kind and effective local backend against the same route snapshot used by `Reload`. A failed check must produce a deny entry. Share the eligibility predicate with derivation and test replacement while the claim remains unreadable; lifetime binding is not required.
+
+Fault family: **binding identity and local-serving authority**, recurring from R1-P2-5. This is P1 because it permits foreign-owner or off-box dispatch.
+
+**R2-P2-1 — §6.2: `deploymentRouteTaken` cannot enforce the promised collision refusal**
+
+Evidence: [apidomains.go:1574](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:1574) explicitly returns false when the caller owns the claim, even when a real route exists. Every valid placements PUT has already established that ownership. Its underlying fold is also deliberately permissive on read failures: [fold.go:121](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edgesfile/fold.go:121).
+
+Failure scenario: an existing alias claim coexists with a real route at its apex. Conversion passes the proposed helper, and that route wins over the regional entry on its box. The requested placement is not enforced there.
+
+Fix: use a complete deployment-route snapshot with an unconditional exact collision test for the apex and applicable star. Do not inherit the ordinary reattach ownership exemption. W5 must exercise an already-owned claim with a real-route collision and incomplete evidence.
+
+Fault family: **route-collision precedence**, carried forward from R1-P2-1 at P2.
+
+**R2-P2-2 — §11: the request budget omits reads performed by the specified helpers**
+
+Evidence: each `deploymentRouteTaken` call invokes `DeploymentRoutes`; [fold.go:151](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/edgesfile/fold.go:151) loads heartbeats, and line 161 starts another edges listing and body reads. A catch-all PUT calls the helper twice, before its separate activation-barrier heartbeat load and response construction. Likewise, the update preflight and promotion-time floor checks are separate calls, and `ClaimCache` performs `ListMod` on each invocation at [claimcache.go:147](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claimcache.go:147).
+
+Failure scenario: implementing the named helpers directly exceeds the claimed one edges read and one heartbeat load per PUT, and one claim listing per system update.
+
+Fix: specify snapshot reuse across collision checking, activation and response construction; account separately for update preflight and final promotion checks. Include cold-cache claim GETs and instance-record body reads in the budget.
+
+Fault family: **request-cost contract**.
+
+**R2-P3-1 — §§7.1, 13/W2: “never published under any role” contradicts wildcard publication**
+
+The existing writer publishes the cert-only parent as the key `*.apex` with role `wildcard`: [edgesfile.go:723](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/host/edgesfile.go:723), line 765. Thus W2 cannot literally assert both “never `*.apex` under any role” and “parent only as wildcard.”
+
+Fix: state that the apex has no publication and the star has no **dial-capable** publication; explicitly permit its cert-only wildcard entry. This prevents an implementation or witness from deleting required certificate distribution.
+
+Fault family: **publication-contract clarity**. Follow-up only; no additional review round.
+
+Stopping rule 2 applies: mixed-version exclusion and cross-region isolation have findings in two consecutive rounds. Before another fix cycle, choose between refusing the unsupported transition/overlap cases up front, cutting those cases from the first slice, or replacing the structural absence argument with one explicit name-level invariant and guard tests covering these transitions. I recommend cutting live conversion and overlapping fallback namespaces unless their admission can be demonstrated safely.
+
+NOT READY
\ No newline at end of file