console: invariant probes expect sign-in to land via the front page
Astra round 1 P1: the callback and email-code probes still wanted /a/; both now want 303 -> /, prove the session, and follow the landing GET into an account. Both join claimSessionEnd, the entries allowed to name "/". Round 1 findings saved beside the brief.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/reviews/CODEX-FINDINGS-signin-first-run-mobile.md+19 −0internal/console/claim_invariant_probes_nonapp_test.go+10 −2internal/console/claim_invariant_probes_test.go+9 −3
CI cancelled — superseded by a newer push — run details
Intent
<task-notification> <task-id>bce1lccqo</task-id> <tool-use-id>toolu_011LvUnM9dYWjnXLiTwBXFB7</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/a1de5273-c148-49b8-8267-3dee9d49c9c1/tasks/bce1lccqo.output</output-file> <status>completed</status> <summary>Background command "Run Astra review of the branch" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>bngesitxu</task-id> <tool-use-id>toolu_01EM7QD2q54dLJhrc4RApQsA</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/a1de5273-c148-49b8-8267-3dee9d49c9c1/tasks/bngesitxu.output</output-file> <status>completed</status> <summary>Background command "Run invariant and landing tests" completed (exit code 0)</summary> </task-notification>
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-signin-first-run-mobile.md b/docs/superpowers/reviews/CODEX-FINDINGS-signin-first-run-mobile.md| new file mode 100644 |
| index 000000000..658d52ed0 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-signin-first-run-mobile.md |
| @@ -0,0 +1,19 @@ |
| +**P1 — The callback invariant probe still expects the old redirect.** |
| + |
| +At [emailsignin.go:291](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/signin-first-run-mobile/internal/console/emailsignin.go:291), successful sign-in now returns `303 Location: /`. But [claim_invariant_probes_nonapp_test.go:117](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/signin-first-run-mobile/internal/console/claim_invariant_probes_nonapp_test.go:117) still requires `/a/`. Its helper returns the callback response without following the landing hop. |
| + |
| +Consequently, `TestClaimConsoleMutationInvariant`’s callback probe will reject a successful sign-in as an “auth redirect” at [claim_invariant_probes_test.go:129](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/signin-first-run-mobile/internal/console/claim_invariant_probes_test.go:129). This is verified from the source; execution was blocked by the sandbox. |
| + |
| +**Fix:** Update the probe to expect `/`, retain its live-session assertion, and explicitly permit this successful callback in the probe census. Changing only the expected Location is insufficient: the census currently permits `/` only for signout. Add an assertion for the subsequent landing GET. |
| + |
| +**Invariant:** Every registered non-app mutation must have a passing probe that verifies its successful effect. |
| + |
| +**P2:** None. **P3:** None. |
| + |
| +Targeted console and domains tests could not start because Go could not create its build directory on the read-only filesystem. `git diff --check` passed. No files were changed. |
| + |
| +**Census verdict — APPROVE `internal/domains` envelope** at `71c3c5532a2a6c7653e95b64712ff1b1d364990c`. |
| + |
| +Reviewed [NextAccountID and its worker closure](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/signin-first-run-mobile/internal/domains/mint.go:141), the changed tests, and the reached parser, store implementations, reserved-ID logic, and mint caller. The change preserves manifest selection, claimed-ID handling, unreadable-manifest refusal, and create-only allocation. Reads are bounded to 16 concurrent operations and joined before return. It introduces no new root-readable paths or weaker validation. |
| + |
| +**NOT READY** |
| \ No newline at end of file |
diff --git a/internal/console/claim_invariant_probes_nonapp_test.go b/internal/console/claim_invariant_probes_nonapp_test.go| index ff22fcdb1..2614ce716 100644 |
| --- a/internal/console/claim_invariant_probes_nonapp_test.go |
| +++ b/internal/console/claim_invariant_probes_nonapp_test.go |
| @@ -114,11 +114,15 @@ func claimCallbackProbe() claimProbe { |
| c = newBrowser(t) |
| return cx.signInReply(t, c, "code-claim-callback-probe") |
| }, |
| - status: http.StatusSeeOther, loc: "/a/", |
| + status: http.StatusSeeOther, loc: "/", |
| effect: func(t *testing.T, cx *claimCase, r claimReply) string { |
| if !cx.signedInAs(c, claimFxOwner) { |
| return "no live session for " + claimFxOwner + " came out of the callback" |
| } |
| + // The front page's GET is where the session lands. |
| + if status, loc, _ := get(t, c, cx.ts.URL+"/"); status != http.StatusFound || !strings.HasPrefix(loc, "/a/") { |
| + return fmt.Sprintf("the landing after the callback = %d -> %q, want 302 into an account", status, loc) |
| + } |
| return "" |
| }, |
| } |
| @@ -209,11 +213,15 @@ func claimEmailCodeProbe() claimProbe { |
| status, loc, body := postForm(t, c, cx.ts.URL+"/auth/email/code", url.Values{"code": {cx.vars["code"]}}) |
| return cx.browserReply(c, status, loc, body) |
| }, |
| - status: http.StatusSeeOther, loc: "/a/", |
| + status: http.StatusSeeOther, loc: "/", |
| effect: func(t *testing.T, cx *claimCase, r claimReply) string { |
| if !cx.signedInAs(c, claimFxOwner) { |
| return "the emailed code opened no session" |
| } |
| + // The front page's GET is where the session lands. |
| + if status, loc, _ := get(t, c, cx.ts.URL+"/"); status != http.StatusFound || !strings.HasPrefix(loc, "/a/") { |
| + return fmt.Sprintf("the landing after the code = %d -> %q, want 302 into an account", status, loc) |
| + } |
| if _, ok := cx.st.LiveEmailChallenge(ChallengeSignIn, hashToken(cx.vars["flow"]), time.Now()); ok { |
| return "the challenge is still standing after its code was used" |
| } |
diff --git a/internal/console/claim_invariant_probes_test.go b/internal/console/claim_invariant_probes_test.go| index 5bdfc3939..aa814915c 100644 |
| --- a/internal/console/claim_invariant_probes_test.go |
| +++ b/internal/console/claim_invariant_probes_test.go |
| @@ -217,9 +217,15 @@ func claimTripwireProblems(t *testing.T, cx *claimCase, m int, before map[claimA |
| // claimSessionEnd are the entries whose success IS the redirect to the front |
| // page: ending a session sends the person there, and so does a request that |
| -// never had one. Their effect witness is the session itself, which is why a |
| -// probe of one of these may name "/" and no other probe may. |
| -var claimSessionEnd = map[string]bool{"route POST /auth/signout": true} |
| +// never had one; a sign-in sends the new session there too, where the GET |
| +// lands it (and mints a first account) so a re-tap cannot spend the sign-in |
| +// twice. Their effect witness is the session itself, which is why a probe of |
| +// one of these may name "/" and no other probe may. |
| +var claimSessionEnd = map[string]bool{ |
| + "route POST /auth/signout": true, |
| + "route GET /auth/callback": true, |
| + "route POST /auth/email/code": true, |
| +} |
| // claimProbeCensus checks the probe table against the fixture table, exactly: |
| // every read and nonApp entry has a probe, no other entry has one, a nonApp |