spec rev 2: agent login by link (Astra round 1 fixes)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/specs/2026-11-07-agent-login-link-design.md+115 −56docs/superpowers/specs/CODEX-FINDINGS-agent-login-link.md+85 −0docs/superpowers/specs/CODEX-REVIEW-BRIEF-agent-login-link-R2.md+80 −0
CI failed — run details
Intent
<task-notification> <task-id>bhve4win6</task-id> <tool-use-id>toolu_01MDUg2ZmnNSnNqECZFifkZY</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/a1de5273-c148-49b8-8267-3dee9d49c9c1/tasks/bhve4win6.output</output-file> <status>completed</status> <summary>Background command "Run Astra spec review" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 20.5 g CO₂e (2,423,533 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-agent-login-link, 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/2026-11-07-agent-login-link-design.md b/docs/superpowers/specs/2026-11-07-agent-login-link-design.md| index 30c89b270..beaeffd5f 100644 |
| --- a/docs/superpowers/specs/2026-11-07-agent-login-link-design.md |
| +++ b/docs/superpowers/specs/2026-11-07-agent-login-link-design.md |
| @@ -1,6 +1,8 @@ |
| # Agent login by link |
| -Status: draft for Paul, 2026-11-07. First slice of "agent-first onboarding |
| +Status: rev 2 for Paul, 2026-11-07 (rev 1 reviewed by Astra: |
| +`CODEX-FINDINGS-agent-login-link.md`; accepted findings are marked |
| +**(codex N)**; none declined). First slice of "agent-first onboarding |
| and console parity"; the later slices are listed under Non-goals. |
| ## Why |
| @@ -102,9 +104,15 @@ Plain `carlos auth login` keeps today's behaviour (print, then wait). |
| The pending file records the console origin, the device code, its expiry |
| and the label, so `--wait` polls the console that started it whatever |
| -`--console` or default is in force later. A second `--no-wait` replaces it |
| -(newest wins); a plain `carlos auth login`, a successful `--wait`, and an |
| -expired login delete it. My calls; the file name is the builder's. |
| +`--console` or default is in force later. It is written with the |
| +credential store's atomic 0600 pattern (auth.go credentialFile.save). A second |
| +`--no-wait` replaces it (newest wins). `--wait` deletes the file only if it |
| +still holds the attempt that `--wait` just finished (compare the device |
| +code under the same lock or rename discipline), so finishing an old |
| +attempt never erases its replacement **(codex 7)**. Approved, denied, |
| +unknown and expired all end the attempt and delete its file on the same |
| +compare; a transient network failure keeps it. A plain `carlos auth login` |
| +leaves a pending file alone. The file name is the builder's. |
| ### 3. The approval page acts on the code in the link |
| @@ -113,66 +121,108 @@ expired login delete it. My calls; the file name is the builder's. |
| - The code is resolved (it is no longer only echoed). A live, pending |
| request renders the description that today appears only after typing: |
| the code, large; the label with its "supplied by the machine asking" |
| - caveat; where it dialled from (IP, plus city and country from the |
| - platform GeoIP feed the console already answers from, as handleAPIGeo |
| - does; IP alone when there is no answer); how long ago it started; |
| - when it expires. Then: Approve, and "That wasn't me". |
| + caveat; where it dialled from (IP, plus country and subdivision from the |
| + platform GeoIP answer, as handleAPIGeo gives them; the answer has no |
| + city; IP alone when there is no answer) **(codex 8)**; how long ago it |
| + started; when it expires. Then: Approve, and "That wasn't me". |
| - The question on the page is the check R1 depends on, in plain words: |
| "Does your agent show this code?" plus "If you didn't just ask an agent |
| or terminal to log in, press That wasn't me." |
| - Unknown, expired or already-decided codes say so and show the typed-code |
| box as today (it stays as the fallback for a code read off a screen). |
| -- Lookups count against the existing wrong-code limiters (per address, |
| - per IP) exactly like typed codes, so the page is no better an oracle |
| - than the form. |
| +- Resolving on GET changes no state: it reads the request row and renders. |
| + Approve and Deny stay POSTs with the session's CSRF token. |
| +- Guess budget checked BEFORE any resolution **(codex 4)**. Today |
| + handleCLIApprove resolves first and counts only failures (authcli.go |
| + ~1666, ~1688), so a caller past the limit still learns whether a code is |
| + live. The fix applies to the new GET and the existing POST alike: a |
| + shared, concurrency-safe budget (per signed-in address and per IP) is |
| + consulted first; past it, every answer is the same 429 whatever the |
| + code; a lookup that finds nothing then spends one unit. A test proves a |
| + VALID code is refused once the budget is spent. |
| `GET /auth/cli?code=X`, signed out: unchanged. The front page asks the |
| -person to sign in with next=/auth/cli?code=X. Both the Keymail callback |
| -and the email link and code already carry next, and since v0.34.21 land |
| -via `/?next=`, so whichever browser finishes signing in arrives on the |
| -approval page with the code. |
| +person to sign in with next=/auth/cli?code=X. The email link and code |
| +carry next on the challenge row and, since v0.34.21, land via `/?next=`, |
| +so whichever browser opens the email link (or takes the code, section 4) |
| +arrives on the approval page with the code. Keymail is narrower |
| +**(codex 6)**: its ceremony keeps next in a cookie and must finish in the |
| +browser that started it (state and PKCE live there, server.go ~4020), and |
| +an ordinary Keymail sign-in records no step-up, so a Keymail person gets |
| +one passkey confirmation on Approve. Both stay as they are in this slice. |
| Approve stays a POST with the session's CSRF token and the step-up gate. |
| -Deny stays ungated. A person who signed in just now is fresh and is not |
| -asked again. An older session gets today's step-up. For an email session |
| -that is a confirmation email whose link only works in the browser that |
| -asked, but whose code can be typed on the waiting page. Making step-up |
| -links work in any browser is out of scope for this slice (my call); the |
| -code box is the path. |
| +Deny stays ungated. A person who signed in by email just now is fresh and |
| +is not asked again (email sign-in records a step-up at use). An older |
| +email session gets today's step-up: a confirmation email whose link only |
| +works in the browser that asked, but whose code can be typed on the |
| +waiting page. Making step-up links work in any browser is out of scope |
| +for this slice (my call); the code box is the path. |
| ### 4. Email codes work in any browser (R2) |
| -`POST /auth/email/code` checks the code against this browser's flow first |
| -(today's rule). When this browser's flow has no live sign-in challenge, it |
| -checks the newest live sign-in challenge for the address the form carries. |
| -Everything else stands: 5 wrong codes burn a challenge |
| -(emailCodeAttempts), 10 wrong codes per address per day, 30 per IP per |
| -hour, a right code ends the address's other sign-in challenges, and the |
| -reply still never says whether an address has a challenge. |
| - |
| -Edges (my calls, from the builder check): |
| - |
| -- When the form's address differs from the address on this browser's own |
| - live challenge, the form's address wins: the code is checked against |
| - that address's live challenges. |
| -- A code is accepted when it matches ANY live sign-in challenge for the |
| - address, counted as one guess. Asking twice and opening the older email |
| - is the normal phone case (the first email can arrive late). The send |
| - caps (5 per address per hour) bound how many challenges are live, so |
| - the odds per guess rise by at most 5x, against 10 wrong guesses per |
| - address per day. |
| -- Wrong codes count against the address only when that address has a live |
| - sign-in challenge; otherwise they count against the IP alone. The reply |
| - is the same either way, and attacker-chosen addresses never create |
| - per-address limiter entries. |
| - |
| -The check page already carries the address. A browser that never asked |
| -needs a way to reach a code box for an address: the front page's "Check |
| -your email" step is reached by asking for an email, which sends a new |
| -one. Builder's call: add "I already have a code" to the front page form |
| -(address + code), or rely on the check page plus the any-browser link |
| -only. My call: add it, because a mail app that opens links in its own |
| -viewer is exactly where the link fails and the code is the fallback. |
| +Today a code is checked only against the newest live sign-in challenge of |
| +the browser's own flow (emailsignin.go handleEmailCode): another browser |
| +cannot use it, and the flow cookie is also the code path's login-CSRF |
| +fallback. Issuing a new challenge in a flow deletes that flow's earlier |
| +ones (CreateEmailChallenge), and a right code ends that flow's challenges. |
| + |
| +Rev 2 keeps every protection that binding gave and adds a cross-browser |
| +path that cannot be used to widen the search, destroy a link, or sign a |
| +victim's browser into someone else's account. |
| + |
| +**Browser-bound form nonce (codex 3).** Every page with a code box (the |
| +check page, and the front page's "I already have a code") sets a random |
| +nonce cookie and puts the same value in the form, exactly as the email |
| +link's confirm page does with linkConfirmCookie. `POST /auth/email/code` |
| +refuses, before anything is looked up or counted, unless the request is |
| +same-origin by sameOrigin's rules AND carries the cookie equal to the |
| +form's nonce. A cross-site auto-submit has no such cookie, so it cannot |
| +sign a victim's browser into the attacker's address. The nonce is not tied |
| +to any challenge, so it does not reintroduce the flow binding R2 removes. |
| + |
| +**Which challenges a code can match (codex 1, codex 5).** |
| + |
| +1. Same browser first: if this browser's flow has a live sign-in |
| + challenge for the form's address, the code is checked against it, |
| + exactly as today (attempts, burn, everything). |
| +2. Otherwise, cross-browser: the candidates are the address's live, |
| + SENT sign-in challenges, newest first, at most 3. A refused send's |
| + held row (HoldEmailChallenge) is never a candidate: the row needs a |
| + marker saying it was emailed, set only once the send succeeds. Since a |
| + flow keeps only its newest challenge, the candidates are the newest |
| + email from each of at most 3 browsers that asked. |
| +3. A right code against any candidate signs in and, in one transaction, |
| + ends EVERY live sign-in challenge for that address (all flows), not |
| + just this flow's. A wrong code is one guess however many candidates |
| + were checked. |
| + |
| +Same-flow replacement is unchanged: asking again in the same browser |
| +still kills that browser's earlier email (link and code). The "older |
| +email arrives late" case is handled by its link, which works in any |
| +browser, and by asking from the browser that will read the newest email. |
| + |
| +**Cross-browser guesses never burn a challenge (codex 2).** A wrong code |
| +on path 2 does not touch any candidate's attempts counter, so knowing an |
| +address never lets anyone destroy its holder's link or same-browser code. |
| +Path 2 is bounded instead by limits consulted BEFORE the lookup: wrong |
| +codes per address per day (10, today's wrongCodesPerAddrDay) and per IP |
| +per hour (30), plus a path-2-only cap of 3 wrong codes per address per |
| +hour. Past any of them the answer is today's throttled reply and nothing |
| +is checked. The per-address count is keyed only when the address has a |
| +live sent challenge; otherwise only the IP pays, the reply is identical, |
| +and attacker-chosen addresses create no per-address entries. The odds |
| +per address are at most 3 candidates x 10 guesses per day against a |
| +6-digit code (3 in 100,000 per day), and the emailed link, which is the |
| +high-entropy credential, is never reachable by guessing. |
| + |
| +Path 1 keeps today's per-challenge burn (5 wrong codes): only the browser |
| +that asked can spend it. |
| + |
| +**Front page.** "I already have a code" on the front page takes address |
| +plus code (with its nonce) and goes down the same two paths. My call: a |
| +mail app that opens links in its own viewer is exactly where the link |
| +fails and the code is the fallback. |
| ### 5. Words |
| @@ -207,8 +257,16 @@ Drafts only; every string goes through copy review when built. |
| - Wrong or stale codes in the link count against the limiters; the page |
| answers unknown and expired codes the same way the form does. |
| - Any-browser email code: a browser with no flow signs in with address + |
| - code; wrong codes count per address and per IP; the per-challenge burn |
| - still applies; a browser with its own flow still checks its own first. |
| + code; a request without the matching nonce cookie is refused before any |
| + lookup; a held (unsent) challenge never matches cross-browser; path-2 |
| + wrong codes never burn a challenge and the victim's link still works |
| + after them; path-2 caps refuse a VALID code once spent; a right code |
| + ends every sign-in challenge for the address; a browser with its own |
| + flow still checks its own first and keeps the 5-guess burn. |
| +- CLI approval: a VALID code is refused (same 429) once the guess budget |
| + is spent, on GET and POST. |
| +- CLI pending file: an old `--wait` finishing after a newer `--no-wait` |
| + leaves the newer file in place. |
| - CLI: `--no-wait` exits at once with the link and stores the pending |
| login; `--wait` completes it; plain login unchanged; labels under |
| CLAUDECODE=1. |
| @@ -220,5 +278,6 @@ Drafts only; every string goes through copy review when built. |
| File names, flag spellings beyond `--no-wait` and `--wait`, how the GeoIP |
| place is formatted, and test structure. Marked "my call" above: the |
| pending-login file's contents and lifecycle; the any-browser code's edges |
| -(form address wins, any live challenge matches, limiter keying); step-up |
| -links stay same-browser; "I already have a code" on the front page. |
| +(two paths, at most 3 sent candidates, no cross-browser burn, limiter |
| +keying); step-up links stay same-browser; "I already have a code" on the |
| +front page; same-flow replacement unchanged. |
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-agent-login-link.md b/docs/superpowers/specs/CODEX-FINDINGS-agent-login-link.md| new file mode 100644 |
| index 000000000..4dc5da3ea |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-agent-login-link.md |
| @@ -0,0 +1,85 @@ |
| +Reviewed `5128198f710f6083bbcab604b8ad3084fc844c03`, round 1. The referenced implementation matches `origin/main`. No files changed or test suites run. |
| + |
| +1. **P1 — §4: unsent challenges defeat the claimed five-code bound.** |
| + |
| + The spec says send limits bound address-wide matching to five live codes. However, refused sends create ordinary challenges with random, redeemable codes: [server.go:3935](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/server.go:3935), [emailsignin_store.go:151](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin_store.go:151), and [emailsignin_store.go:204](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin_store.go:204). |
| + |
| + An attacker can create fresh flows for a victim’s address, accumulating unsent challenges beyond the five-email limit. Under “ANY live challenge,” each submitted guess tests all those codes. Additional IPs multiply the candidate set without increasing the address’s guess count. |
| + |
| + **Fix:** distinguish refused-send placeholders from redeemable challenges, exclude placeholders from successful matching, and enforce an explicit address-wide candidate bound. Preserve indistinguishable failure responses. |
| + |
| + **Invariant:** a refused send must not expand the authentication search space. |
| + |
| +2. **P1 — §4: another browser can burn the victim’s emailed link.** |
| + |
| + Keeping “five wrong codes burn a challenge” while selecting challenges by a supplied address exposes another browser’s challenge to destructive guesses. The fifth failure deletes the entire row, including its link: [emailsignin_store.go:332](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin_store.go:332). Today the lookup is restricted to the requester’s flow: [emailsignin.go:453](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin.go:453). |
| + |
| + With one live challenge for the victim, an attacker submits five wrong codes using that address. Both the victim’s code and emailed link stop working. This breaks the retained protection that other browsers’ links survive guessing, stated in the email-sign-in authority at [line 204](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/docs/superpowers/specs/2026-10-21-console-email-signin-design.md:204). |
| + |
| + **Fix:** separate code exhaustion from link validity. Address-wide failures may exhaust the code budget, but must leave the high-entropy link redeemable. Specify attempt accounting across multiple candidate rows. |
| + |
| + **Invariant:** knowing an address does not authorize destroying its mailbox holder’s sign-in link. |
| + |
| +3. **P1 — §4: removing flow binding removes the fallback login-CSRF protection.** |
| + |
| + `sameOrigin` deliberately accepts requests carrying neither `Origin` nor `Sec-Fetch-Site`: [emailsignin.go:70](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin.go:70). The existing code handler then requires the browser’s challenge-bearing flow. The earlier design explicitly relies on that cookie for CSRF protection: [email-signin design:229](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/docs/superpowers/specs/2026-10-21-console-email-signin-design.md:229). |
| + |
| + In a supported browser that omits both headers, an attacker can auto-submit their own address and valid emailed code into the victim’s browser. The proposed fallback accepts it without a flow cookie and signs the victim into the attacker’s account. |
| + |
| + **Fix:** require a browser-bound form nonce for every code submission, including “I already have a code.” The nonce can be independent of the challenge, preserving R2. |
| + |
| + **Invariant:** possession of a valid code does not authorize signing an unrelated browser into that identity. |
| + |
| +4. **P2 — §3: the existing CLI limiter does not actually bound lookups.** |
| + |
| + The current handler resolves the code first and increments the limiter only after failure: [authcli.go:1688](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/authcli.go:1688). Approval and denial have the same ordering at [line 1666](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/authcli.go:1666). |
| + |
| + After exhausting the budget, a caller can continue probing: misses return 429, while a live code still produces its description or succeeds. Copying this mechanism onto GET preserves an unlimited oracle, despite the spec’s reliance on a guessing bound. This defect already exists in the POST path. |
| + |
| + **Fix:** require a shared budget check before resolution or decision, with concurrency-safe accounting. Test a valid code after exhausting the budget, rather than merely checking that wrong codes eventually return 429. |
| + |
| + **Invariant:** exhausted guessing budgets prevent further code validation. |
| + |
| +5. **P2 — §4: challenge replacement and successful cleanup are described incorrectly.** |
| + |
| + The spec presents address-wide cleanup as existing behaviour and motivates older-email acceptance by asking twice. Today, creating another challenge deletes earlier challenges in the same flow, and successful redemption clears that flow—not the address: [emailsignin_store.go:128](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin_store.go:128), [emailsignin_store.go:185](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin_store.go:185), and [emailsignin_store.go:349](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin_store.go:349). |
| + |
| + A second successful request in the same browser therefore makes the older email unusable before the proposed matching runs. Keeping today’s redemption code also leaves other flows’ challenges alive. |
| + |
| + **Fix:** explicitly specify the required storage changes, whether older same-flow emails remain valid, and atomic address-wide invalidation on success. Reconcile “own flow first,” “newest,” and “ANY” into one algorithm. |
| + |
| + **Invariant:** issuance, matching and consumption must agree on which challenges remain valid. |
| + |
| +6. **P2 — §3: the Keymail promises exceed current behaviour.** |
| + |
| + Keymail carries `next`, including `?code=`, when its ceremony stays in one browser. A callback in another browser fails without the original state/PKCE cookie: [server.go:4020](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/server.go:4020). |
| + |
| + Also, an ordinary fresh Keymail sign-in does not establish step-up freshness. Only the special fresh ceremony supplies `authTime`; email sign-in records freshness automatically: [server.go:4053](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/server.go:4053), [emailsignin.go:335](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/emailsignin.go:335). |
| + |
| + **Failure scenario:** moving the OAuth callback between browsers fails; completing ordinary Keymail sign-in still requires another confirmation on Approve. |
| + |
| + **Fix:** qualify both promises, or explicitly extend the validated fresh-Keymail ceremony to CLI sign-in. Do not infer freshness merely from session creation. |
| + |
| + **Invariant:** browser continuity and fresh authentication require their respective proofs. |
| + |
| +7. **P2 — §2: pending-file cleanup can violate “newest wins.”** |
| + |
| + The spec allows replacement while a previous `--wait` may still be running, then instructs successful waits to delete the pending file. |
| + |
| + **Failure scenario:** wait A reads login A; another command saves login B; A succeeds and deletes B. B then cannot be collected. Denied and unknown terminal states also lack an explicit cleanup rule; both exist today at [auth.go:762](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/auth.go:762). |
| + |
| + **Fix:** serialize pending-file updates and delete only when the stored attempt still matches the completing attempt. Specify terminal-state cleanup and retention on transient failures. Reuse the credential store’s atomic 0600 write pattern at [auth.go:174](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/auth.go:174). |
| + |
| + **Invariant:** completion of an older attempt cannot erase its replacement. |
| + |
| +8. **P2 — §3: the existing GeoIP answer has no city.** |
| + |
| + The cited API supplies country, subdivision and coordinates, not city: [apigeo.go:16](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/console/apigeo.go:16). The underlying answer likewise has no city field: [answer.go:39](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/internal/geoip/answer.go:39). |
| + |
| + **Failure scenario:** the builder cannot render the promised city from the specified interface. |
| + |
| + **Fix:** specify country/subdivision with IP fallback and required source attribution, or explicitly scope the additional city-data work. |
| + |
| + **Invariant:** displayed location must be supported by the available data. |
| + |
| +**NOT READY** |
| \ No newline at end of file |
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-agent-login-link-R2.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-agent-login-link-R2.md| new file mode 100644 |
| index 000000000..90f041d2b |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-agent-login-link-R2.md |
| @@ -0,0 +1,80 @@ |
| +# Review brief: spec "Agent login by link", round 2 of 3 |
| + |
| +Repo carlos/platform, branch `design-agent-login-link`, commit: the commit |
| +that adds this file. |
| +Under review: `docs/superpowers/specs/2026-11-07-agent-login-link-design.md`. |
| +Authorities: main's code (internal/console/authcli.go, emailsignin.go, |
| +emailsignin_store.go, emailsignin_limits.go, stepup.go, |
| +templates/cli_approve.html, the module-root auth.go) and |
| +`docs/superpowers/specs/2026-10-21-console-email-signin-design.md`. |
| + |
| +You are an independent reviewer. Read the document, then the code it |
| +names, and check every claim against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul's rulings R1 (approve by link after checking the code), R2 (email |
| + code in any browser with per-address limits), R3 (secrets: the person's |
| + choice, later slice), recorded in the spec's "Why". Report only |
| + mechanisms that fail to honour them, or that weaken a control the spec |
| + says it keeps. |
| + |
| +## What to check |
| + |
| +1. Device-code phishing after R1: with the typed code gone, do the kept |
| + controls (session, CSRF, step-up on Approve, issuance notice, deny, |
| + 10-minute TTL, the page's "does your agent show this code?") still do |
| + what the spec claims? Is anything that today depends on typing (e.g. |
| + the wrong-code limiters as an oracle bound, the "describe before |
| + approve" step) silently lost? Is resolving the code on GET a new |
| + oracle or a CSRF-able state change? |
| +2. R2 edges as specified (form address wins, any live challenge matches |
| + as one guess, limiter keying only when a live challenge exists): any |
| + enumeration oracle (timing, limiter behaviour, different replies), any |
| + way to burn or lock out someone else's challenge, any conflict with |
| + the email sign-in spec's flow-cookie reasons (throttle oracles, the |
| + double-click race). |
| +3. The next= path: signed out at /auth/cli?code=X, sign in by email link or |
| + code or Keymail in another browser, land on the approval page. Does |
| + main's code (v0.34.21: sign-in redirects to /?next=, handleHome |
| + honours next) actually carry ?code= through safeNext, the challenge |
| + row's next, and the Keymail next cookie? |
| +4. CLI `--no-wait` / `--wait`: is the pending-file design sound |
| + (permissions, stale/expired handling, wrong console), and does it fit |
| + how auth.go stores credentials today? |
| +5. Anything the spec claims about current code that is false. |
| + |
| +## Severity |
| + |
| +- **P1**: unsafe, would not work, or contradicts the code. Blocks approval. |
| +- **P2**: wrong or missing. Fixed without reopening this review. |
| +- **P3**: clarity or polish. 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 section, the problem, the |
| +evidence (file:line, verified), the failure scenario, a concrete fix and |
| +the invariant or trust boundary it breaks. 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. |
| + |
| +## Round 2 |
| + |
| +Earlier rounds: `docs/superpowers/specs/CODEX-FINDINGS-agent-login-link.md` |
| +(round 1: P1 x3, P2 x5, all accepted; marked **(codex N)** in the spec). |
| + |
| +First give one line per round-1 P1 and P2: resolved, partly, or not. Carry |
| +every unresolved or partly resolved finding forward at its current |
| +severity, then add new findings. The three P1s were one fault family |
| +(R2's address-wide matching); say whether rev 2's section 4 closes that |
| +family or whether a fourth fix would be needed (in which case recommend |
| +refusing the case up front or cutting the any-browser code instead). |