openai / gpt-6-astra / medium / medium effort preferred over xai / grok-4.7-efficient / xhigh / xhigh 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 / xhigh / xhigh effort answer
The sign-in redirect gate does not enforce the Pro policy it documents. Two other journey defects are proven in the supplied source: post-login workspace resolution is unlocked and silent, and every login failure is shown as a bad password.
## Findings
### 1. `?next` Pro gate is a raw prefix check and does not cover the documented Pro surface
Confidence: 0.93 (hash and pass-through); 0.78 (`/dashboard` contract); 0.74 (dot-segment); 0.72 (relative)
`LoginPage.tsx:14-17` only treats `/explorer` and `/amp` as Pro, and only for an exact match, a `/` child, or a `?` query:
```14:17:[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx
const PRO_ROUTE_PREFIXES = ['/explorer', '/amp']
function isProRoute(path: string): boolean {
return PRO_ROUTE_PREFIXES.some((p) => path === p || path.startsWith(`${p}/`) || path.startsWith(`${p}?`))
}
```
`LoginPage.tsx:77-88` then sends every non-match straight to `navigate(next, { replace: true })`. The comment at `LoginPage.tsx:67-70` says a Pro `?next` must be ignored when `can_use_pro_surface` is false so admin policy cannot be bypassed. These values fail `isProRoute` and are not dropped:
- `/explorer#…` and `/amp#…` (`#` is not a checked delimiter; `?` is). `navigate` receives an absolute Pro path.
- `/dashboard`, `/dashboard/…`, and `/dashboard?…`. `[REDACTED: private project name]/frontend/src/api/workspace.ts:48-53` documents the Pro surface as `/explorer`, `/amp`, and `/dashboard`, and says the login redirect gates on `can_use_pro_surface`. The prefix list and the comment at `LoginPage.tsx:67-70` omit `/dashboard`.
- Relative forms `explorer`, `amp`, `explorer/…`, `amp/…`. They do not start with `/explorer` or `/amp`. `useNavigate` resolves a non-absolute `To` against the current `/login` location (router package source is not in this packet).
- Dot-segments such as `/foo/../explorer`, `/./explorer`, and `/../amp`. The predicate does not canonicalize; URL resolution removes `.` and `..`.
The same missing canonicalization over-blocks the inverse: `/explorer/../w/municipal/map` starts with `/explorer/`, so a denied user loses a non-Pro deep link and falls through to the default landing (`LoginPage.tsx:79-94`).
Impact: a user with `can_use_pro_surface: false` is still redirected to a Pro URL the gate was written to suppress. Whether a later route guard bounces them is not in this packet. The focused tests only pin exact `next=/explorer` (`LoginPage.workspaceRedirect.test.tsx:181-210`) and would still pass with these holes. The harness route `/dashboard` (`LoginPage.workspaceRedirect.test.tsx:87`) is never gated.
### 2. After credentials succeed, the form looks idle and can be submitted again
Confidence: 0.91
`login.isPending` covers only `mutateAsync` (`LoginPage.tsx:37`, `LoginPage.tsx:336-343`). The following `fetchQuery` (`LoginPage.tsx:44-48`) is outside that flag. There is no local in-flight lock. When the mutation resolves, the button returns to “Sign in” and is enabled while workspace resolution is still running. Enter or a second click starts another login and another `navigate`. Those navigations can race (workspace URL vs `/` vs `?next`).
Impact: on a slow `/user/workspace`, sign-in looks stuck or failed, and a second submit can leave the user on the wrong screen.
### 3. Every login failure is shown as “Invalid email or password”
Confidence: 0.90
`useLogin` does not classify errors (`[REDACTED: private project name]/frontend/src/api/auth.ts:13-16`). The page catch is empty (`LoginPage.tsx:98-100`). The only UI is `login.isError` with a fixed string (`LoginPage.tsx:325-332`). `login.error` is never read. `AUTHENTICATION.md:301-305` says an inactive org is blocked from authenticating; that case is not distinguished, and neither are network, 429, or 5xx failures. Credentials are also submitted untrimmed (`LoginPage.tsx:34-35`), so a pasted trailing space fails the same way. `noValidate` (`LoginPage.tsx:276`) disables the `required` / `type="email"` checks, so empty or malformed submits hit the same alert.
Impact: outages and lockouts look like a wrong password. Users retry instead of waiting or reporting a server failure.
### 4. Any non-blocked `?next` is honored, including a return to the sign-in screen
Confidence: 0.80
There is no allowlist and no denial of auth routes. `?next=/login` is not a Pro prefix, so `LoginPage.tsx:86-88` `navigate`s back to the sign-in form after a successful login. The session is already established (`auth.ts:29-37` plus the cookie comment at `auth.ts:17-21`). The page never checks an existing session and redirects away.
Impact: a successful sign-in can land on the login form again. External/`//` open-redirect success is not proven here; react-router’s absolute-URL behavior is outside the packet.
## Alternatives and discarded hypotheses
- Silent drop of a matched Pro `?next` (`LoginPage.tsx:79-85`) is documented (“Silently drop”) and is not a logic bug. It is inconsistent with the workspace-failure toast (`LoginPage.tsx:57-61`). Treat a user-facing denial message as a product choice, not a proven defect.
- Stale `['user-workspace']` on login is not proven for current entry paths. `fetchQuery` uses a 5-minute `staleTime` (`LoginPage.tsx:47`) and `useLogin` never invalidates `queryKeys.userWorkspace.all` (`auth.ts:37` vs `queryKeys.ts:662-664`). Documented returns to `/login` are full reloads (`auth.ts:50-53`, `auth.ts:138`), which drop the in-memory cache. This becomes real only if `/login` is reached by client navigation without `queryClient.clear()`.
- Cookie-only login leaving a previous `localStorage` `access_token` is conditional. `auth.ts:29-30` writes tokens only when the body includes them and does not clear them otherwise. Body shape is not in this packet. Logout does clear them (`auth.ts:110-111`).
- Inline `queryKey: ['me']` (`auth.ts:37`, `auth.ts:65`) matches `queryKeys.users.me` (`queryKeys.ts:186`). Convention drift, not a cache split.
- `?next=%2Fexplorer` is decoded by `URLSearchParams` and is gated. Not a bypass.
- Default workspace landing does not send Pro users to `/explorer` even when `last_surface` is `pro` (`LoginPage.tsx:74-76`, `LoginPage.tsx:92-94`). The tests at `LoginPage.workspaceRedirect.test.tsx:157-178` match that. `useUserPreferencesHydration` is not in this packet, so later in-place Pro restore is unverified, not a LoginPage defect.
- Native GET password leak from a form with no `method` (`LoginPage.tsx:276`) needs the submit handler not to run. SSR/no-JS behavior is outside the packet.
- `Sentry.captureException(wsError)` (`LoginPage.tsx:56`) might include request headers if `apiClient` errors are unsanitized. `client.js` and Sentry scrubbing are outside the packet.
- `fetchQuery` does not set `retry: false`, unlike `useMe` (`auth.ts:71`). App `QueryClient` defaults are outside the packet.
## Excluded boundaries
This is a source reading of the supplied packet only. No tests were run. It does not verify runtime or production behavior and is not a production-readiness judgment.
Outside the packet, named only as limits:
- Direct imports not supplied: `[REDACTED: private project name]/frontend/src/api/client.js`, `[REDACTED: private project name]/frontend/src/api/csrf.js`, `[REDACTED: private project name]/frontend/src/api/mediaTokens.js`, `[REDACTED: private project name]/frontend/src/lib/resetRegistry.js`. Cookie attachment, 401 refresh/logout, CSRF priming, and cross-tab reset are unverified.
- Referenced but not included: `lib/workspaceModules.ts` (canonical `proRoute` list, `LoginPage.tsx:12`), AuthProvider / AuthGuard / RoleGuard / PostAuthRedirect, `useUserPreferencesHydration`, toaster mount, backend `/auth/login` and `/user/workspace`, cookie flags, and the react-router version.
- So: end-to-end Pro enforcement after `navigate`, toast visibility after redirect, and whether `/` loops or restores Pro are not established.
## Next useful action
Canonicalize `next` (resolve against `/login`, drop dot-segments, split hash) and deny unless the path is an internal non-auth path. Gate the documented Pro set, including `/dashboard` and hash forms, on `can_use_pro_surface`. Hold the submit control from `mutateAsync` through `fetchQuery`. Map non-401 failures to a distinct message. Extend the focused test beyond exact `next=/explorer`.
MATERIAL_EVIDENCE_CONFLICT: workspace.ts:48-53 documents the login redirect Pro gate as covering `/explorer`, `/amp`, and `/dashboard`; LoginPage.tsx:14-17 and LoginPage.tsx:67-70 implement and describe that gate for `/explorer` and `/amp` only.Primary judge's stated reason
A receives a weak, forced preference because its narrower findings better preserve the source-only evidentiary boundary and reduce the chance of treating unverified framework behavior as established audit evidence. B's broader, useful coverage counterbalances this advantage; no material overall quality gap is established, 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_f8e33cf1673998f68ab5b888afd7a8e18d90b60ac6ae241025620f785d795850. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.