review brief: signin-first-run-mobile round 1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+79
−0
docs/superpowers/reviews/CODEX-REVIEW-BRIEF-signin-first-run-mobile.md+79 −0
CI failed — run details
Intent
Attributed to this commit: 144 g CO₂e (17,010,690 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on signin-first-run-mobile, 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/CODEX-REVIEW-BRIEF-signin-first-run-mobile.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-signin-first-run-mobile.md| new file mode 100644 |
| index 000000000..ed12c4c5c |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-signin-first-run-mobile.md |
| @@ -0,0 +1,79 @@ |
| +# Review brief: branch signin-first-run-mobile, round 1 of 3 |
| + |
| +Repo carlos/platform, branch `signin-first-run-mobile`, commit: the commit |
| +that adds this file (its parent is 2f089741ad10c3974e39523cf7a73d00ac8941a4). |
| +Under review: the diff `origin/main...HEAD`. |
| +Authorities: `docs/superpowers/specs/2026-10-21-console-email-signin-design.md` |
| +(email sign-in), AGENTS.md (stopping rules, census). |
| + |
| +You are an independent reviewer. Read the diff, then the code it reaches, |
| +and check every claim in the commit message against that code. |
| + |
| +## Background |
| + |
| +Flagship 2026-11-07: a brand-new person's POST /auth/email/link spent the |
| +link, opened a session, then minted their personal account inside the same |
| +request (NextAccountID read ~100 manifests serially, ~3 s). The browser |
| +dropped the request (a re-tap), the mint's S3 read failed with context |
| +canceled, the 500 went nowhere, and the retry saw a spent link. Twice. |
| + |
| +## What to check |
| + |
| +1. `finishSignin` (internal/console/emailsignin.go) now redirects to `/` or |
| + `/?next=<safe>` instead of resolving the account. Every caller: email link, |
| + email code, Keymail callback (server.go ~4021), demo claim |
| + (demo_claim_auth.go, demo_claim_page.go). Does any door depend on the |
| + account existing before its next page loads, or on the old Location? |
| + Is `next` still only ever a `safeNext` local path at both hops (no open |
| + redirect via `/?next=`)? Is the 303 -> 302 chain right for a POST? |
| +2. `handleHome` (server.go) with a session now honours `next`. Any page that |
| + sends a signed-in person to `/?next=...` today and expects the account |
| + landing instead? Any loop (a next that itself redirects to `/?next=`)? |
| +3. `currentAccount`: per-person striped lock, membership re-check under the |
| + lock, mint under `context.WithoutCancel` with a 30 s timeout. Deadlocks |
| + (callers that already hold a landing or flow lock?), holding a lock across |
| + S3 calls, the address key (normalised the same way everywhere?), and |
| + whether a detached mint can now outlive a request in a way that matters |
| + (shutdown, tests). |
| +4. `NextAccountID` (internal/domains/mint.go): 16 concurrent Gets. Same |
| + answer as before for every bucket state, including disagreeing manifests, |
| + unparseable ones, and an unreadable one (must still fail). Goroutine |
| + leaks on early error? Any caller running it with a store that is not safe |
| + for concurrent use? |
| +5. Templates: `data-busy` on the sign-in, code, "send a new link" and link |
| + confirm buttons (layout.html's script delays submit 650 ms and blocks a |
| + second submit). Does any of these forms need the submitter's name/value, |
| + or break with JS off? CSS: `@media (pointer: coarse)` 16px fields and the |
| + `max-width: 40rem` full-width sign-in form; anything else using |
| + `form.signin` that this breaks? |
| +6. Census: `docs/superpowers/notes/census-proposal-signin-first-run-mobile.md` |
| + re-pins the `internal/domains` envelope. Read every changed function in |
| + that package and what it reaches, and give the census verdict the card |
| + asks for (approve or reject, with reasons). |
| + |
| +## 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. |
| +- **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 problem, the evidence |
| +(file:line, verified), the failure scenario, a concrete fix and the |
| +invariant or trust boundary it breaks. Then the census verdict for the |
| +`internal/domains` envelope. 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. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of |
| +your own. Do not run the full test suites; targeted `go test -run` on the |
| +touched packages is fine (leave GOCACHE at its default). |