openai / gpt-6-astra / medium / medium effort preferred over xai / grok-4.7-efficient / medium / medium effort · close win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
MVP source audit; taskCategory=ux; module category=ux, difficulty=high, expectedTests=none. Sign-in and workspace redirect journey across the login screen, its auth/client callers and focused tests. Source review only; no tests run. Use only exact supplied files and cite file plus original line. Do not run tests, use shell/globs/root traversal, live services, databases, customer data, or edit source. Report concrete source-proven issues with impact and confidence, otherwise state no findings. Identify every excluded boundary explicitly; do not infer production readiness. This source-only audit packet is bound to verified merged main commit 9dab4e99d3bfadf995dbaa031b9b6a365970e1e3; it does not verify runtime or production behavior.
openai / gpt-6-astra / medium / medium effort answer
## Conclusion
Direct, independent review of all nine supplied files found **three source-proven UX issues**. Findings apply only to the packet bound to commit `9dab4e99d3bfadf995dbaa031b9b6a365970e1e3`. No tests or external actions were performed.
### 1. Sign-in becomes available again before workspace resolution finishes
**Severity: Medium · Confidence: High**
- Authentication completes at `[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx:37`; workspace resolution is a separate awaited operation at lines **44–48**.
- The submit button’s disabled state and “Signing in…” label depend exclusively on `login.isPending` at lines **336–343**.
- `useLogin` does not include workspace resolution in its mutation lifecycle (`[REDACTED: private project name]/frontend/src/api/auth.ts:12–38`).
**Impact:** During a slow workspace fetch, the page returns to an apparently idle “Sign in” state despite an unfinished redirect journey. Users can submit another login, generating overlapping authentication and redirect attempts.
**Recommendation:** Track the entire submission-to-navigation operation as busy, and guard duplicate submissions until workspace resolution or fallback completes.
### 2. Every login failure is presented as incorrect credentials
**Severity: Medium · Confidence: High**
- The mutation directly awaits the login request without classifying failures (`[REDACTED: private project name]/frontend/src/api/auth.ts:13–15`).
- Any `login.isError` renders the literal “Invalid email or password” (`[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx:325–332`).
**Impact:** A rejected request caused by connectivity or server failure receives the same credential-blaming message as an authentication rejection. Users receive misleading recovery guidance and may unnecessarily change or repeatedly re-enter valid credentials.
**Recommendation:** Distinguish credential rejection from unavailable-service/network errors, with an appropriate retry message.
**Boundary:** Exact HTTP-client interception behavior is excluded; this finding concerns any non-credential rejection that reaches the mutation.
### 3. Fragment-bearing Pro destinations escape the login redirect gate
**Severity: Medium · Confidence: High**
- `isProRoute` recognizes exact paths, slash descendants, and query-string variants, but not fragment variants (`[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx:14–18`).
- Consequently, `next=/explorer#section` or `next=/amp#section` fails that check and reaches `navigate(next)` even when `can_use_pro_surface` is false (lines **77–88**).
**Impact:** The login page sends a user to a Pro destination it otherwise suppresses, rather than their resolved workspace. This breaks the local redirect policy and can introduce an avoidable downstream denial or additional redirect.
**Recommendation:** Parse and normalize the destination’s pathname before checking Pro-route eligibility.
**Boundary:** This proves a login-gate mismatch, **not** unauthorized access; downstream route enforcement is outside the packet.
## Focused-test evidence
The supplied tests mock authentication as immediately successful with `isPending: false` and `isError: false` (`[REDACTED: private project name]/frontend/tests/auth/LoginPage.workspaceRedirect.test.tsx:45–51`). They therefore do not exercise the first two findings. The denied-Pro test supplies only the exact `/explorer` path (lines **193–210**), leaving fragment variants uncovered. Tests were reviewed, not executed.
## Discarded or unconfirmed hypotheses
- **Cross-session stale workspace:** The workspace query has five-minute freshness (`LoginPage.tsx:44–48`) and a shared key (`queryKeys.ts:662–664`), but complete reset/invalidation behavior is excluded. No cross-user leak is established.
- **External open redirect:** Passing `next` directly to navigation is visible, but external-navigation behavior is not established by the supplied router evidence.
- **Missing `/dashboard` gate:** `workspace.ts:49–53` describes `/dashboard` as Pro, while `LoginPage.tsx:14` excludes it. Without the route definitions, whether that documentation reflects the current destination is unresolved.
- No additional concrete journey defects were established in the copy, toast store, or authentication documentation.
## Excluded boundaries
- Supplied missing-dependency paths: `[REDACTED: private project name]/frontend/src/lib/resetRegistry.js`, `[REDACTED: private project name]/frontend/src/api/client.js`, `[REDACTED: private project name]/frontend/src/api/csrf.js`, and `[REDACTED: private project name]/frontend/src/api/mediaTokens.js`. Their reset, interception, storage, CSRF, and media-token behavior is unverified.
- All other source outside the nine declared files, including route configuration/guards, auth providers, workspace shells/resolvers, preference hydration, toast rendering, backend endpoints/schemas, and cookie handling.
- Installed dependency versions and actual framework behavior; browser rendering, responsive layout, assistive-technology behavior, assets, and computed styling.
- Test execution, builds, shell/filesystem inspection, live services, databases, customer data, deployment configuration, and runtime or production behavior.
**Next useful action:** Address the three local UX defects and extend the focused test source to cover delayed workspace resolution, non-credential failures, and fragment-bearing destinations. This audit makes no production-readiness determination.
xai / grok-4.7-efficient / medium / medium effort answer
The sign-in redirect gate is not fail-closed. `?next` is honored unless a narrow string check classifies it as Pro, and that check misses hash-form Pro paths and `/dashboard`.
## Findings
### 1. Pro `?next` gate misses hash-form `/explorer` and `/amp` paths
**Impact:** A user with `can_use_pro_surface === false` is still sent to a Pro URL the login gate says it must drop.
**Confidence:** 0.90 that the gate misclassifies and calls `navigate`; whether a later route guard bounces them is outside this packet.
`isProRoute` only treats exact match, `/`, or `?` as Pro (`[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx:14-18`). `?` is special-cased, `#` is not. `searchParams.get('next')` decodes once, then the same string is passed to `navigate` (`LoginPage.tsx:77-88`).
For `?next=/explorer%23x` (value `/explorer#x`) or `?next=/amp%23x`:
- `isProRoute` is false, so the `!allowPro` drop at `LoginPage.tsx:79-85` does not run.
- The else branch calls `navigate(next, { replace: true })` (`LoginPage.tsx:86-88`).
The same hole is `/explorer#…` and `/amp#…`. The focused test only pins `next=/explorer` (`[REDACTED: private project name]/frontend/tests/auth/LoginPage.workspaceRedirect.test.tsx:181-210`), so this bypass is untested.
### 2. Login Pro allowlist omits `/dashboard` while the workspace contract includes it
**Impact:** `?next=/dashboard` (also `/dashboard/…` and `/dashboard?…`) is never treated as Pro, so a Pro-denied user is navigated there.
**Confidence:** 0.74. The in-packet contract is explicit; the canonical `proRoute` list is not in the packet.
`ResolvedWorkspace.can_use_pro_surface` says the login redirect gates `/explorer`, `/amp`, and `/dashboard` on this field (`[REDACTED: private project name]/frontend/src/api/workspace.ts:48-54`). `PRO_ROUTE_PREFIXES` is only `['/explorer', '/amp']` (`LoginPage.tsx:11-14`). The test router even mounts `/dashboard` (`LoginPage.workspaceRedirect.test.tsx:87`) and never asserts it is dropped when Pro is disabled.
### 3. `?next` is not restricted to a same-origin relative path
**Impact:** Any truthy `next` that fails the incomplete Pro check is passed to `navigate` (`LoginPage.tsx:77-88`), including protocol-relative (`//…`), backslash, and absolute URL strings. This is an auth redirect sink with no allowlist. External navigation is not proven here (router/history source is outside the packet). In-app impact is proven: the caller does not reject those strings before navigation.
**Confidence:** 0.93 missing control; 0.55 external open-redirect exploitability.
This applies even when Pro is allowed, because the else branch is “not a blocked Pro path,” not “known-safe internal path.”
### 4. Sign-in pending state ends before workspace fetch and redirect
**Impact:** After credentials succeed, the button re-enables and reads “Sign in” for the whole `fetchQuery` (`LoginPage.tsx:37-48`, `334-343`). A second submit can start another login and another `navigate`. The two redirects can race (workspace URL vs `/` on failure).
**Confidence:** 0.88.
There is no local in-flight lock around the handler. `disabled` follows only `login.isPending`.
### 5. Every login failure is shown as “Invalid email or password”
**Impact:** Network, 5xx, and inactive-org failures (docs: inactive orgs are blocked from auth, `[REDACTED: private project name]/docs/AUTHENTICATION.md:301-305`) look like a bad password. `noValidate` (`LoginPage.tsx:276`) disables the `required` constraints (`LoginPage.tsx:298`, `322`), so an empty submit takes the same path. The outer `catch` (`LoginPage.tsx:98-100`) does not classify the error; the alert is a fixed string (`LoginPage.tsx:325-331`).
**Confidence:** 0.92.
## Discarded
- Ignoring `last_surface` and silently dropping a detected Pro `?next` are intentional (`LoginPage.tsx:67-85`; tests at `LoginPage.workspaceRedirect.test.tsx:169-210`).
- `localStorage` token writes are documented as transitional (`[REDACTED: private project name]/frontend/src/api/auth.ts:17-30`), not an accidental redirect bug.
- Inline `['me']` matches `queryKeys.users.me` (`auth.ts:37`, `65`; `[REDACTED: private project name]/frontend/src/api/queryKeys.ts:184-187`). Convention drift only; no key mismatch on this journey.
- Stale `user-workspace` after login (`fetchQuery` `staleTime` 5 minutes at `LoginPage.tsx:44-48`, no workspace invalidation in `auth.ts:17-38`) is not reachable on the in-packet logout path: `useLogout` clears the client and assigns `window.location.href = '/login'` (`auth.ts:125-138`). Exploitability depends on excluded redirect-to-login code that might keep the SPA cache.
- `useMe`’s `enabled` flag is a render-time `localStorage`/cookie read (`auth.ts:61-70`). A post-login bounce would require `AuthProvider` not to re-render. That component is not in the packet.
- Copy split via `replace('A clearer next step.', '')` (`LoginPage.tsx:176-177`) matches `loginEvidenceCopy.ts:3` and the test at `LoginPage.workspaceRedirect.test.tsx:119-127`.
## Excluded boundaries (not verified)
- `[REDACTED: private project name]/frontend/src/api/client.js` (`apiClient`, `setActiveOrgId`, credentials, 401 refresh/redirect) — imported by `auth.ts` and `workspace.ts`.
- `[REDACTED: private project name]/frontend/src/api/csrf.js` (`primeCsrfToken`, `clearCsrfToken`).
- `[REDACTED: private project name]/frontend/src/api/mediaTokens.js`.
- `[REDACTED: private project name]/frontend/src/lib/resetRegistry.js` (logout only).
- `lib/workspaceModules.ts` (comment at `LoginPage.tsx:12-13`; not imported here).
- `AuthProvider`, `AuthGuard`, `PostAuthRedirect`, `useUserPreferencesHydration` — named in `AUTHENTICATION.md:324-344` and `LoginPage.tsx:72-76`, source not in the packet.
- Backend login/cookies/`/user/workspace`, react-router `navigate` resolution, toast renderer, app `QueryClient` defaults.
- Tests were not run. This does not establish runtime or production behavior. Snapshot commit `9dab4e99d3bfadf995dbaa031b9b6a365970e1e3` only.
## Next action
Add focused cases for `next=/explorer#x`, `next=/amp#x`, and `next=/dashboard` with `can_use_pro_surface: false`, plus protocol-relative `next`, and cover the button staying disabled until redirect. Parse `next` to a same-origin pathname before the Pro check, and include `/dashboard` only if the excluded `proRoute` list still treats it as Pro.
MATERIAL_EVIDENCE_CONFLICT: `[REDACTED: private project name]/frontend/src/api/workspace.ts:48-52` says the login redirect gates `/explorer`, `/amp`, and `/dashboard` on `can_use_pro_surface`, while `[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx:14-18` gates only `/explorer` and `/amp`; `[REDACTED: private project name]/docs/AUTHENTICATION.md:311-321` describes localStorage Bearer tokens and a 401 interceptor redirect, while `[REDACTED: private project name]/frontend/src/api/auth.ts:17-28` and `50-54` describe cookie `Set-Cookie` as primary and a csrf-cookie gate to avoid a `/login` refresh loop.Primary judge's stated reason
A receives a forced, weak preference because its actionable findings more consistently distinguish demonstrated local UX consequences from unverified redirect risks, reducing the chance of treating defensive hardening as an established defect. B provides useful additional contract analysis. This is not an established material quality gap, and an independent review could reasonably prefer B.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 2404a44a-5062-4389-9cb8-9be07b60db79. Pair: brp1_de932890c17942faa3fa38e3ba48f1c86c259b979564d3338a333eb8abd7a959. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.