carlos / platform Public

Regional domains (#447): Astra findings Tasks 2+3 round 1 (NOT READY, 1 P1 team scope race)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 422a90bfef5772d3b4ca3656a5322662d4a56ee4 parent 8c5a83e
1 file changed, +25 −0
  • docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-T2T3-R1.md +25 −0

Intent

Attributed to this commit: 14.2 g CO₂e (1,825,564 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/reviews/regional-domains-447/CODEX-FINDINGS-T2T3-R1.md b/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-T2T3-R1.md
new file mode 100644
index 000000000..8db114253
--- /dev/null
+++ b/docs/superpowers/reviews/regional-domains-447/CODEX-FINDINGS-T2T3-R1.md
@@ -0,0 +1,25 @@
+Reviewed `fb65398a..0c3f6d5c` at worktree HEAD `f2f9b28c`, Tasks 2+3, round 1 of 3.
+
+**P1 — A team request can delete a regional claim after passing scope checking on its predecessor**
+
+**Location:** [teamdoors.go:236](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/teamdoors.go:236).
+
+**Evidence:** `inScopeClaim` rejects regional claims, but middleware discards the authorized claim and invokes the handler afterward ([teamdoors.go:396](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/teamdoors.go:396), [teamdoors.go:93](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/teamdoors.go:93)). Detach acquires its locks later, only with lifetimes enabled, and does not repeat team scope checking before calling `detachDomainClaim` ([apidomains.go:1046](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:1046), [apidomains.go:1085](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:1085)). The writer checks account/app ownership, then unconditionally deletes a non-instance-catchall claim ([claims.go:813](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:813), [claims.go:826](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/domains/claims.go:826)).
+
+**Failure scenario:**
+
+1. A team DELETE passes scope checking on a pending ordinary claim targeting its instance.
+2. The member replaces that pending claim with a regional claim for the same app—an explicitly permitted §6.2 transition.
+3. DELETE resumes, reads the regional claim, and deletes it because account/app still match.
+
+The lifetime lock does not prevent this ordering: authorization occurred before acquiring it. The GET handlers have the same stale-authorization problem: their later claim reads check ownership but not regional team scope ([apidomains.go:1410](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apidomains.go:1410), [apiplacements.go:92](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447/internal/console/apiplacements.go:92)).
+
+**Fix:** Revalidate team scope inside detach’s app-then-host critical section in both lifetime modes, and delete only the authorized claim revision using its ETag. Read handlers must authorize the actual claim snapshot they return. Add deterministic race tests that pause after scope checking, replace the pending claim through `SetClaimPlacements`, then resume; require neutral refusal and unchanged regional claim bytes.
+
+**Fault family:** Team credential scope—authorization must cover the claim revision read or mutated.
+
+No P2 or P3 findings.
+
+Validation was by code inspection. Targeted domains tests could not start because the read-only sandbox prevented Go from creating its work directory; `GOCACHE` was unset. No files were edited, no subagents were spawned, and no full suites were run.
+
+NOT READY
\ No newline at end of file