← Model losses

Head-to-head comparison

xai / grok-4.7-efficient / xhigh / xhigh effort preferred over openai / gpt-6-luna / low / low 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. Workspace navigation, role-aware shell and layout state across the shell and its focused navigation 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.

xai / grok-4.7-efficient / xhigh / xhigh effort answer

Source review only, bound to commit 9dab4e99d3bfadf995dbaa031b9b6a365970e1e3. No tests were run. This does not establish runtime or production readiness. Default shell is V3 (`useV3Shell` returns true with no override).

## 1. Findings

**1. Workspace URLs are not a selector. Back, shared links, and deep links to another accessible workspace are rewritten.** Confidence: 0.93.

`WorkspaceShell` never adopts `:workspaceKey`. Any mismatch with the server-resolved key `replace`-navigates to that key, including when the URL key is in `accessible_workspaces`:

```213:215:[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx
  if (workspace.key !== workspaceKey || resolvedModuleKey !== activeModuleKey) {
    return <Navigate to={`/w/${workspace.key}/${resolvedModuleKey}`} replace />
  }
```

Inaccessible keys toast (lines 179–188). Accessible-but-not-active keys do not (same condition; mirrored as intentional at `WorkspaceShell.multinav.test.tsx` 140–147). After a successful switch, Back lands on the previous `/w/:key/...` entry and is immediately `replace`d back. The target drops the splat tail and query string, so `/w/other/municipal.inspection-review/55?…` becomes `/w/${active}/${module}` only. Module links work only when the workspace key already matches. Applies to both shells. Comments treat non-active keys as “stale”; that still breaks multi-workspace history and shareable URLs.

**2. Default V3 standard nav is not role- or module-aware. Gated items fail silently.** Confidence: 0.86 on the handler; visibility depends on excluded `V3Sidebar.js`.

`WorkspaceShell` does not read role, `effective_capabilities`, or `workspace.modules` when building V3 nav. It always passes fixed `V3_STANDARD_NAV` (`navRegistry.ts` 180–190), including `municipal.reports-amp` and `municipal.explorer`. Click always navigates:

```340:343:[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx
    const onNavigateStandard = (navKey: string) => {
      const def = V3_STANDARD_NAV.find((d) => d.key === navKey)
      const moduleKey = def?.moduleKey ?? navKey
      navigate(`/w/${workspace.key}/${moduleKey}`)
```

The resolver then refuses keys absent from `workspace.modules` and not in `CLIENT_ONLY_MODULE_KEYS` (lines 200–214). The file’s own comment (198–199) says that allowlist exists to stop URL bypass of tier-gated `municipal.reports-amp`. There is no module-level toast (177–190 only checks workspace key), so a click is a silent `replace` to `default_landing`, and the highlight follows the fallback (`standardNavKeyForModule`, line 337). Legacy nav does project `workspace.modules` (294–300). V3 does not, so it can advertise omitted modules and cannot show a server module outside the four-item list. `municipal.uploads` is the opposite hole: it is client-only (`workspaceModules.ts` 215–221, 117–122), so Uploads stays routable with no per-module grant. That bypass is commented as intentional; it is still ungated in both shells (`getClientSidebarModules`, 253–261).

**3. View-as / impersonation banner can be wrong or unusable on a narrow viewport.** Confidence: 0.88 logic, 0.84 narrow-layout. Hits both shells (`ContextBanner` is mounted by `WorkspaceShell` 374 and `V3AppShell` 168).

Server “not view-as” does not suppress the legacy name. Fallback was described for missing `/auth/me` fields (`ContextBanner.tsx` 38–40) but runs whenever `isServerViewAs` is false:

```44:53:[REDACTED: private project name]/frontend/src/components/layout/ContextBanner.tsx
  const isServerViewAs =
    serverActiveId !== null && serverHomeId !== null && serverActiveId !== serverHomeId
  const legacyActiveOrgName = getActiveOrgName()
  const activeOrgName = (isServerViewAs ? serverViewAsName : null) ?? legacyActiveOrgName
  const isViewAs = !!activeOrgName
```

If IDs are present and equal and `getActiveOrgName()` is still set, the orange “ACTING AS …” banner shows. Exit always `navigate('/consultant')` (58–60) with no pending guard (unlike impersonation, 79–80). Inverse: ID mismatch with both names empty hides the banner. Whether `getActiveOrgName()` still returns a name is outside this packet (`client.js`).

Layout: view-as ribbon is `height: 40` with no wrap (165–173); impersonation ribbon is `height: 32` with no wrap (132–141); stacked state is `height: 32` plus `flex-wrap` (86–92). Long copy and Exit / End Impersonation can overflow a phone width. Stacked wrap overflows the fixed 32px flex item over the next chrome row. No breakpoint styles in this file. `WorkspaceShell` 373 calls this banner compliance-critical.

**4. Rollback shell (`?v3shell=0`, sticky via `useV3Shell.ts` 43–45) does not control or explain navigation.** Confidence: 0.9. Non-default path.

Below 1280px, `TopBar` only toggles `sidebarDrawerOpen` (23–27). Legacy `WorkspaceShell` sizes `<nav>` from `sidebarCollapsed` only (102, 384–391) and never reads `sidebarDrawerOpen` or mounts `SidebarDrawer`. Expanded width stays 240px (`useAppStore.ts` 24, default false, persisted 43–44). The hamburger does not dismiss workspace nav on that branch. The legacy tree also never mounts `ToastContainer` (return starts at 368; V3 mounts it at `V3AppShell.tsx` 240), so inaccessible-workspace and switch-failure toasts have no outlet in the supplied legacy tree. `Toast.js` itself was not reviewed.

**5. Focused navigation tests do not execute production navigation, and one mirror encodes the race production avoided.** Confidence: 0.96.

`WorkspaceShell.multinav.test.tsx` 189–211 expects `setQueryData` → `patch` → immediate `invalidateQueries()` → `navigate`, on key `['userWorkspace']`. Production (`WorkspaceShell.tsx` 234–276) navigates immediately, invalidates only inside `patchUiState` `onSuccess`, and uses `queryKeys.userWorkspace.all` (`['user-workspace']`, `queryKeys.ts` 662–664). The test comment (156–161) says a refactor that drops that sequence should fail CI; the handler is inlined, so production can regress without failing. `PlatformWorkspacesPage.test.tsx` imports only `roles.ts` (19); save/toggle/invisible-warning cases reimplement local helpers (53–59, 89–100) and do not touch a page. `v3-shell-smoke.spec.ts` skips every Pro route (138). Its live Standard list expects `/inspections` and `/repairs` not to redirect (209–243). Production removed those keys from `CLIENT_ONLY_MODULE_KEYS` (`workspaceModules.ts` 225–229) so they fall through to `default_landing`. The skipped suite’s “exactly one nav” check is `toBeGreaterThan(0)` (167–169), and blank-main uses `length >= 0` (178), which cannot fail.

**6. Workspace fetch failure always recovers to `/dashboard`.** Confidence: 0.8.

Error effect toasts and `navigate('/dashboard', { replace: true })` (`WorkspaceShell.tsx` 136–141). Unknown module uses the same href (85, 360). `navRegistry.ts` 62 and 129–137 say Dashboard is feature-gated and `firstEnabledProRoute` exists so a missing feature does not land on the lock screen. The shell does not use that helper. Lock-screen behavior is not in this packet.

**7. Module Suspense fallback is a second full-page chrome skeleton.** Confidence: 0.9.

`WorkspaceShellSkeleton` is `min-h-screen` with a fake header and 192px sidebar (39–59). It is also the Suspense fallback inside the already-chromed module slot (356, 678). Module loads paint nested chrome and can overflow `h-full` / `overflow-hidden` main.

**8. Workspace switch has no in-flight guard.** Confidence: 0.74.

`handleSwitchWorkspace` (226–276) returns only when `target.key === workspace.key`. It does not check `patchUiState.isPending`. Overlapping clicks stack PATCHes; `onError` restores `previousWorkspace` captured at that click, which may already be an optimistic snapshot (`modules: []`). Impersonation stop in the same packet does guard `isPending` (`ContextBanner.tsx` 79–80).

**9. “No workspaces assigned” is legacy-only.** Confidence: 0.83 that V3 `WorkspaceShell` omits it; 0.5 that excluded `V3Sidebar.js` does not recreate it.

The status copy is only in the legacy branch (425–446), after the V3 return (365). V3 receives `sidebarWorkspaces` (synthetic active prepend, 306–319) but not that empty-role message. Collapsed legacy still mounts an empty padded status box (425–445) because the text, not the box, is hidden.

**10. Legacy `<main>` is an `aria-live="polite"` region for the whole module.** Confidence: 0.9. Rollback path only (`WorkspaceShell.tsx` 671–676). V3 main has `role="main"` only (`V3AppShell.tsx` 183). Map/grid text updates can be announced continuously. V3 does not have this.

## 2. Alternatives, discarded hypotheses, verified matches

Discarded as product defects: `/w/:ws/inspections` and `/repairs` redirecting to `default_landing` is explicit (`workspaceModules.ts` 225–229; `navRegistry.ts` 185–187). The smoke spec is stale; the redirect is not an accidental lockout. Optimistic `modules: []` and invalidate-inside-`onSuccess` match the race comments at `WorkspaceShell.tsx` 231–248; the defect is the untested/contradictory mirror, not that sequence. Shared `sidebarCollapsed` is a documented cross-surface trade-off (381–383). Refetch rehydration (`useUserPreferencesHydration.ts` 133–150) is documented cross-device sync; clobber of unsaved edits needs excluded stores. Unknown `isOrgScopedQueryKey` roots default to scoped (`queryKeys.ts` 846–849); that is the stated safe default, not a proven stale-tenant bug. `roles.ts` matches the in-packet expected list (`PlatformWorkspacesPage.test.tsx` 27–35); backend `Role` parity is not provable here.

Consultant `default_landing` of `consultant.client-list` (multinav test 73–77) is not in `MODULE_REGISTRY`. A real switch to that key would render `WorkspaceShellError` (279–280, 359–360). Treated as unverified: production workspace keys are not in this packet, and the test fixture may be synthetic.

`useUserPreferencesHydration.ts` 122–131 rewrites pro-mode on every `workspace` cache update, including optimistic switch. No supplied shell reads `useWorkspaceProModeStore`, so UI impact is not established.

Verified in-packet: production cache key is `queryKeys.userWorkspace.all`; V3 and legacy are mutually exclusive returns (no double TopBar); synthetic active prepend matches the test helper (306–319 vs test 44–55); client-only allowlist is what blocks URL bypass of server-gated modules; `user-workspace` is org-scoped (`queryKeys.ts` 809–810).

## 3. Excluded boundaries

Not reviewed, so none of these can be assumed to close a finding: `V3TopBar.js` (only candidate drawer opener; nothing in the V3 tree calls `setSidebarDrawerOpen`), `V3Sidebar.js` (whether `standardItems` are filtered, empty-role copy, Pro role nav, surface toggle), `SidebarDrawer.js` (`wideDesktop`, focus trap, closed-state DOM), `SurfaceSwitcher.js`, `OrgSwitcher.js`, `TrustStrip.js`, `OffboardingBanner.js`, `roleLabels.js`, `usePermissions.js`, `useMediaQuery.js`, `features.js`, `AuthContext.js`, `client.js` (`getActiveOrgName`, `switchActiveOrg`), `superAdmin.js`, `auth.js`, `dashboard.js`, `useCommandCenter.js`, `Toast.js`, `ErrorBoundary.js`, assistant/chat/command-center/processing/dev-toggle modules, preference migration/queue and all hydrated stores (`useExplorerStore.js`, `useLayerStore.js`, `useViewUIStore.js`, `useMonitorUIStore.js`, `useMapRailUIStore.js`, `useProfileBankFilterStore.js`, `useWorkspaceProModeStore.js`, `useV3SessionStore.js`, `playbackSpeeds.js`), and module bodies (`MunicipalExplorerModule.js`, `MunicipalReportsModule.js`, `MunicipalUploadsModule.js`, `V3TodayModule.js`, `V3InspectionsModule.js`, `V3RepairsModule.js`, `V3InspectionReview.js`).

Also absent: `PlatformWorkspacesPage` (tests do not cover it), `Sidebar.tsx` (claimed Pro-nav parity), `app/auth/roles.py`, `workspace_resolver.py`, route/auth guards, and `App.tsx`. Consequence: standard nav below 1440px (`V3AppShell.tsx` 176) has no supplied opener; Pro role gating is unreviewed; banner false-positive frequency depends on `getActiveOrgName()`; module-level write blocking for read-only Uploads is unreviewed. `Omitted JSON: []`.

## 4. Next useful action

Fix in the shell, then re-review with `V3Sidebar.js`, `V3TopBar.js`, and `SidebarDrawer.js`: make `:workspaceKey` selectable for accessible workspaces without eating Back; drive V3 items from `workspace.modules` plus the client-only allowlist and toast on a gated click; keep Exit on-screen and trust server view-as IDs when present. Replace inlined nav tests with imports of the real handler, or delete them so they cannot freeze the wrong sequence.

MATERIAL_EVIDENCE_CONFLICT: `v3-shell-smoke.spec.ts` 242–243 expects `/inspections` and `/repairs` to remain on the URL, but `workspaceModules.ts` 225–229 and `WorkspaceShell.tsx` 200–214 redirect those keys to `default_landing`; `WorkspaceShell.multinav.test.tsx` 163–211 requires immediate unkeyed `invalidateQueries` then `navigate` on `['userWorkspace']`, but `WorkspaceShell.tsx` 251–276 navigates immediately and invalidates `['user-workspace']` only in patch `onSuccess`.

openai / gpt-6-luna / low / low effort answer

**Finding — Standard uploads navigation bypasses server module access gating (high confidence).** `WorkspaceShell` unconditionally merges client-sidebar modules into the navigation (`[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:294–300`), and `municipal.uploads` is in the client-only allowlist (`[REDACTED: private project name]/frontend/src/lib/workspaceModules.ts:215–221`). The route resolver accepts every client-only key even when absent from `workspace.modules` (`[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:195–206`). The registry explicitly notes that uploads bypasses `workspace_profile.modules` gating (`[REDACTED: private project name]/frontend/src/lib/workspaceModules.ts:117–122`). Consequently, a user whose workspace excludes uploads at the module level can still see its navigation entry and access its route. This is a concrete role-aware navigation/access mismatch; server-side authorization for uploads is outside this packet, so I cannot conclude whether data access is also exposed.

**Alternatives / false positives:** The code says workspace-level role eligibility is still enforced (`workspaceModules.ts:119–122`); that does not establish per-module authorization. The synthetic active-workspace entry when no accessible workspace is listed is documented as defensive behavior (`WorkspaceShell.tsx:302–319`) and is not itself evidence of unauthorized switching.

**Limitations:** Source-only review; no tests run. The focused navigation tests are inline helper mirrors rather than component-mount tests (`src/__tests__/WorkspaceShell.multinav.test.tsx:5–10`), so they do not verify the uploads route or gating. Backend resolver, route guards, and uploads API authorization are excluded dependencies; runtime and production behavior are unverified. The supplied snapshot also excludes many shell dependencies listed in its missing-direct-dependencies manifest, so those implementations cannot be assessed.

**Next useful action:** Verify whether uploads requires per-module gating; if so, remove it from the client-only route/sidebar bypass and cover both direct navigation and route access with focused tests.

Primary judge's stated reason

B provides more actionable source-grounded assurance about the navigation tests and their disagreement with the implementation, while also addressing the required excluded boundaries. This supports a weak preference, not a proven material quality gap: B's tendency to present conditional risks as findings counterbalances its useful coverage, and an independent review could reject this preference.

This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.

Battle wave: 87604684-5410-4204-96bf-6143dab2c1dc. Pair: brp1_eb240d995644dbc6abae9e1317817cb66642558f89917365036a41d23c588fbb. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.