← Model losses

Head-to-head comparison

openai / gpt-6-astra / medium / medium effort preferred over cursor / composer-2.5 / Composer 2.5 default / unknown effort · clear 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.

cursor / composer-2.5 / Composer 2.5 default / unknown effort answer

# UX source audit: sign-in and workspace redirect

**Conclusion:** The login → workspace prefetch → redirect path is mostly coherent and fail-closed on `can_use_pro_surface`, but the `?next` Pro gate is **incomplete vs documented Pro surface** (`/dashboard` not gated), and **dropping a blocked `?next` is silent** (telemetry only). Documentation in `AUTHENTICATION.md` does not describe cookie/session gating or post-login workspace routing.

**Confidence (overall journey):** High for redirect order and workspace default landing; medium–high for the `/dashboard` `?next` gap; medium for silent Pro drop UX.

---

## Source-proven findings

### 1. `?next` Pro gate omits `/dashboard` (policy / UX mismatch)

| Field | Detail |
|--------|--------|
| **Impact** | After sign-in, `?next=/dashboard` (or `/dashboard/...`) is **not** treated as a Pro route. If `can_use_pro_surface` is false, the user can still be sent to dashboard via `?next`, while explicit `/explorer` and `/amp` deep links are dropped. Inconsistent with the Pro surface definition in the same feature area. |
| **Evidence** | `[REDACTED: private project name]/frontend/src/api/workspace.ts` 49–53 documents Pro as `/explorer`, `/amp`, **`/dashboard`**, with login redirect gating on `can_use_pro_surface`. `[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx` 11–17 only lists `PRO_ROUTE_PREFIXES = ['/explorer', '/amp']` and `isProRoute` never matches `/dashboard`. Redirect uses `isProRoute(next) && !allowPro` at 78–89; non-matching Pro paths go to `navigate(next)` at 87. |
| **Confidence** | **0.92** |

### 2. Blocked Pro `?next` is silent (no user-facing feedback)

| Field | Detail |
|--------|--------|
| **Impact** | User follows a bookmark or email link with `?next=/explorer` (or `/amp`) but org/user cannot use Pro: they land on `/w/{key}/{default_landing}` with **no toast or inline message** that the intended destination was denied. Only Sentry breadcrumbs (79–85). Expectation mismatch vs honoring `?next` when allowed (tested at `LoginPage.workspaceRedirect.test.tsx` 181–190). |
| **Evidence** | `[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx` 78–89: drop path logs breadcrumb and falls through to workspace default; contrast with workspace-fetch failure which calls `addToast` (57–60). |
| **Confidence** | **0.88** |

### 3. Workspace fetch failure: toast promises “home screen” but navigation is generic `/`

| Field | Detail |
|--------|--------|
| **Impact** | On `/user/workspace` failure after successful login, user sees error copy **“Redirecting to your home screen.”** and is sent to `'/'` (61). Whether `/` is a sensible “home” for an authenticated user depends on **excluded** routing (`PostAuthRedirect`, shells)—not verifiable in this packet. Risk: authenticated user on a generic root without workspace shell context. |
| **Evidence** | `[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx` 49–62; test asserts `navigate('/')` only (`LoginPage.workspaceRedirect.test.tsx` 212–220), not toast text (toast mocked 58–61). |
| **Confidence** | **0.75** (message vs destination alignment uncertain beyond `'/'`) |

### 4. Login failure UX is a single string for all mutation failures

| Field | Detail |
|--------|--------|
| **Impact** | Network outages, 5xx, or rate limits after submit show **“Invalid email or password”** (`login.isError`), same as wrong credentials. `catch` on submit swallows errors with comment “handled by mutation state” (98–100) with no branching. |
| **Evidence** | `[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx` 325–332, 98–100. |
| **Confidence** | **0.85** |

### 5. `AUTHENTICATION.md` frontend section stale vs in-packet auth implementation

| Field | Detail |
|--------|--------|
| **Impact** | Readers assume **localStorage-only** tokens and a simple AuthGuard sequence; supplied `auth.ts` describes **cookie + transitional localStorage**, `hasSessionCookie()` gate for `/login` loop prevention, and no mention of workspace redirect or Pro gating. Support/onboarding docs can mis-set expectations; not a direct runtime bug in supplied UI code. |
| **Evidence** | `[REDACTED: private project name]/docs/AUTHENTICATION.md` 311–344 vs `[REDACTED: private project name]/frontend/src/api/auth.ts` 17–37, 42–76. |
| **Confidence** | **0.90** |

### 6. `?next` is not validated beyond Pro gate (in-app open navigation)

| Field | Detail |
|--------|--------|
| **Impact** | Any `next` that is not a blocked Pro path is passed to `navigate(next, { replace: true })` (87). No same-origin, path-prefix, or allowlist check in packet. UX/abuse: post-login send user to arbitrary in-app route (e.g. admin) if they can craft URL—**authorization at route guards is outside packet**. |
| **Evidence** | `[REDACTED: private project name]/frontend/src/auth/LoginPage.tsx` 77–88. |
| **Confidence** | **0.70** (`needs_verification` for guard coverage) |

---

## Verified working (in supplied source)

- Post-login order: `mutateAsync` → `fetchQuery` workspace (throws on failure) → resolve `?next` / workspace URL / `'/'` (`LoginPage.tsx` 37–97).
- Default landing: **does not** use `last_surface`; tests seed `userPreferences` but behavior matches comment that LoginPage never routes to Pro from last surface (`LoginPage.tsx` 74–76; tests 169–178).
- Pro allowed: honors `?next=/explorer` (`LoginPage.workspaceRedirect.test.tsx` 181–190).
- Pro disallowed: drops `?next=/explorer`, lands workspace (`193–209`).
- `can_use_pro_surface` defaults false when workspace missing (`LoginPage.tsx` 65).
- Session presence gate for `useMe` documented to prevent `/login` refresh loop (`auth.ts` 50–54, 61–70).
- Login marketing copy and layout contract covered by test (`LoginPage.workspaceRedirect.test.tsx` 116–155; `loginEvidenceCopy.ts`).

---

## Alternatives / likely false positives

- **Duplicate “A clearer next step.”** Intentional split styling (`LoginPage.tsx` 176–177); test expects it (124–127). Not a defect.
- **`queryKeys` inline `['me']` in `useLogin` onSuccess** (`auth.ts` 37): matches `queryKeys.users.me` (`queryKeys.ts` 186) today; AGENTS.md prefers centralized keys—architecture nit, low UX impact unless keys diverge later.

---

## Excluded boundaries (explicit)

| Excluded | Consequence |
|----------|-------------|
| `[REDACTED: private project name]/frontend/src/api/client.js` | Cannot verify credentials, 401/refresh during workspace fetch, or redirect to `/login` on auth failure mid-journey. |
| `csrf.js`, `mediaTokens.js`, `resetRegistry.js` | CSRF priming, media token lifecycle, cross-tab logout not auditable here. |
| `lib/workspaceModules.ts` | Cannot confirm canonical Pro route list vs `PRO_ROUTE_PREFIXES` comment (12–13). |
| `AuthProvider`, `AuthGuard`, `PostAuthRedirect`, app router | Behavior of `'/'` after workspace failure and protected-route enforcement unknown. |
| Backend `user_workspace` resolver | `default_landing`, `can_use_pro_surface` correctness not verified. |
| Runtime, CI, browser, password managers beyond DOM read pattern | No execution; autofill path is source-intent only (`LoginPage.tsx` 31–35). |

**Not run:** tests (`expectedTests=none` for this task); test file listed only as evidence of intended contracts and gaps.

---

## Test coverage gaps (source-only, vs `LoginPage.tsx`)

- No case for `?next=/dashboard` with `can_use_pro_surface: false` (would expose finding 1 if behavior matches source).
- No assertion on toast when Pro `?next` dropped (finding 2).
- Workspace failure test does not assert error toast copy (finding 3).

---

## Next useful action

1. Align `PRO_ROUTE_PREFIXES` / `isProRoute` with documented Pro surface including `/dashboard` (or narrow `workspace.ts` docs if dashboard is not Pro-gated)—**source conflict between `workspace.ts` 50–52 and `LoginPage.tsx` 14–17**.
2. Add a brief user-visible notice when Pro `?next` is dropped (mirror workspace-fetch error pattern using `useToastStore`).
3. Update `AUTHENTICATION.md` frontend section for cookie transition, `hasSessionCookie`, and post-login workspace/`?next` behavior.

**Production readiness:** Not inferred; packet is bound to commit `9dab4e99…` and supplied files only.

Primary judge's stated reason

B provides a better-supported remediation target for duplicate submissions and inconsistent redirect filtering, while avoiding presenting an unknown root-route outcome as an established issue. This supports a clear comparative preference, not a claim of observed runtime failure or production impact.

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_06c5e6a02320b799d001516c25519aae91deb43a398c65dd1733666be32ab13e. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.