xai / grok-4.7-efficient / xhigh / xhigh 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. 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`.xai / grok-4.7-efficient / medium / medium effort answer
Source review only. The default shell’s navigation is not workspace- or role-aware, and the focused tests pin copies of behavior the shell no longer implements. This does not establish runtime or production readiness.
## Findings
1. **Default V3 nav is a fixed municipal list; server module and role gates are ignored.** Confidence: 0.93.
`useV3Shell()` is on unless `?v3shell=0` or `pp.v3_shell=0` (`useV3Shell.ts:57-61`). On that path `WorkspaceShell` always passes `V3_STANDARD_NAV` (`today`, `municipal.explorer`, `municipal.reports-amp`, `municipal.uploads`) and never passes `sidebarModules` (`WorkspaceShell.tsx:294-300`, `332-353`; `navRegistry.ts:180-190`). `WorkspaceShell` does not read the user role (auth hook removed at `WorkspaceShell.tsx:28`).
Impact: after a switch to a non-municipal workspace (the multinav tests use `consultant` / `consultant.client-list`), the task nav stays municipal. Server-omitted keys silently bounce to `default_landing` with no toast (`WorkspaceShell.tsx:200-214`). `today` and `municipal.uploads` are client-only, so they render inside any workspace, including one whose `workspace.modules` omitted them (`workspaceModules.ts:117-127`, `215-230`, `239-240`). Uploads is a write surface with no role filter in this packet. Legacy `?v3shell=0` still injects icon-bearing client-only modules into every workspace (`WorkspaceShell.tsx:294-300`; `getClientSidebarModules` at `workspaceModules.ts:253-261`).
2. **A URL for an accessible but non-active workspace is rewritten with no explanation.** Confidence: 0.9.
Any `workspace.key !== workspaceKey` becomes `<Navigate replace>` to the server-active key (`WorkspaceShell.tsx:213-214`). The info toast runs only when the URL key is absent from `accessible_workspaces` (`WorkspaceShell.tsx:177-189`). The multinav mirror documents the same split (`WorkspaceShell.multinav.test.tsx:140-147`).
Impact: bookmarks and shared `/w/{other-accessible-workspace}/…` links snap back to the persisted workspace. Multi-workspace URLs are not selectable entry points.
3. **Gated or dormant module clicks fail silently.** Confidence: 0.92.
Same redirect (`WorkspaceShell.tsx:200-214`) covers `municipal.reports-amp` / `municipal.explorer` when missing from `workspace.modules`, and `/w/:ws/inspections` and `/repairs` after those keys were removed from `CLIENT_ONLY_MODULE_KEYS` (`workspaceModules.ts:225-229`) while remaining in `MODULE_REGISTRY` (`workspaceModules.ts:139-148`) and in the smoke route list (`v3-shell-smoke.spec.ts:209-214`, `242-243`). No module-level toast exists.
Impact: nav clicks and those two URLs look like no-ops or unexplained jumps to `default_landing`.
4. **Focused nav tests do not lock the shell.** Confidence: 0.95.
Both vitest files state they do not mount React (`PlatformWorkspacesPage.test.tsx:5-8`; `WorkspaceShell.multinav.test.tsx:5-10`) and assert in-file copies. The switch copy expects `setQueryData` → `patch` → `invalidate` → `navigate` and uses `['userWorkspace']` (`WorkspaceShell.multinav.test.tsx:163-211`). Production calls `mutate`, navigates immediately, and invalidates only in `onSuccess` under `queryKeys.userWorkspace.all` = `['user-workspace']` (`WorkspaceShell.tsx:245-276`; `queryKeys.ts:662-663`). `onError` cache restore (`WorkspaceShell.tsx:259-270`) is untested. Role tests reimplement `toggle` / `orderedSelection` locally (`PlatformWorkspacesPage.test.tsx:53-100`) and do not import a page. The smoke spec’s “Standard routes below DO run green” comment (`v3-shell-smoke.spec.ts:137-137`) disagrees with finding 3; its Pro `<main>` length check is `>= 0` inside a skipped suite (`v3-shell-smoke.spec.ts:138`, `178`).
Impact: CI can stay green while switch order, query key, rollback, role payload, and inspections/repairs routing drift.
5. **Layout chrome does not match loading or lazy module states.** Confidence: 0.88.
`isLoading` returns `WorkspaceShellSkeleton` before the V3 branch (`WorkspaceShell.tsx:192` vs `332`), so the default shell is replaced by a fake 48px header plus 192px sidebar (`WorkspaceShell.tsx:39-59`). The same skeleton is the Suspense fallback inside the real main (`WorkspaceShell.tsx:356-361`, `678-685`). `key={resolvedModuleKey}` remounts the lazy module on every switch (`WorkspaceShell.tsx:358`, `681`).
Impact: full-page skeleton, then V3 chrome, then a nested fake header/sidebar inside `<main>` on chunk load.
6. **Role-removed empty state is not on the default shell.** Confidence: 0.84.
“No workspaces assigned” renders only in the legacy return (`WorkspaceShell.tsx:425-445`). The V3 return (`WorkspaceShell.tsx:345-364`) happens first and only passes `sidebarWorkspaces`, which still prepends a synthetic active row (`WorkspaceShell.tsx:306-319`). Whether `V3Sidebar` repeats that notice is outside this packet.
Impact: on the default shell, a mid-session role strip can leave modules visible via the synthetic row with no administrator notice.
7. **View-as banner can ignore an explicit server “not view-as”.** Confidence: 0.74.
`isServerViewAs` is true only when both ids are non-null and differ (`ContextBanner.tsx:44-45`). Otherwise `activeOrgName` falls through to `getActiveOrgName()` (`ContextBanner.tsx:46-47`), and `isViewAs = !!activeOrgName` (`ContextBanner.tsx:53`). A server home-org result does not clear a leftover legacy name. `getActiveOrgName()` itself is outside the packet, so whether that helper is null at home is unverified.
Impact: possible false “ACTING AS … any changes affect this client” ribbon (`ContextBanner.tsx:177-178`) on a compliance banner.
8. **Stacked context ribbon can clip its unwind controls.** Confidence: 0.8.
Impersonation plus view-as uses `flex-wrap` inside `height: 32` (`ContextBanner.tsx:86-92`) with two buttons (`ContextBanner.tsx:105-127`). View-as-only is `height: 40` and does not wrap (`ContextBanner.tsx:167-173`).
Impact: on a narrow viewport the End Impersonation / Return Home controls can clip or overflow. Neither impersonation ribbon has `aria-live`; only the view-as ribbon does (`ContextBanner.tsx:174`).
## Discarded or not treated as defects
- Immediate `invalidateQueries` before PATCH is not the current handler bug. Production intentionally invalidates inside `onSuccess` (`WorkspaceShell.tsx:245-257`). The defect is the stale test contract (finding 4).
- Optimistic `setQueryData` leaves `can_use_pro_surface` / `effective_capabilities` from the previous payload (`WorkspaceShell.tsx:234-243`). Comments describe Pro access as org-level (`workspace.ts:42-54`). No in-packet shell control reads those fields during the switch window.
- Shared `sidebarCollapsed` across Pro and workspace is documented (`WorkspaceShell.tsx:380-383`), not an accidental mismatch.
- `aria-current="page"` on both the active workspace and the active module (`WorkspaceShell.tsx:464`, `521`, `557`, `613`) is a legacy-only a11y defect; the default path does not render that `<nav>`.
- Tooltip `aria-describedby` is set while the tooltip node exists only when visible (`Tooltip.tsx:103-107`, `129`). Real, but secondary to navigation.
## Excluded boundaries
Not in this packet, so not reviewed and not assumed: `client.js` (`getActiveOrgName`, `switchActiveOrg`), `AuthContext`, `superAdmin`, `features`, `usePermissions`, `useMediaQuery`, `roleLabels`, `useAIStore`, `V3Sidebar`, `V3TopBar`, `SidebarDrawer`, `TrustStrip`, `OffboardingBanner`, `SurfaceSwitcher`, `OrgSwitcher`, dashboard/command-center/assistant modules, preference stores and `clientToServerMigration`, all `workspaceModules` lazy targets, backend `Role` enum and `workspace_resolver.py`, and `PlatformWorkspacesPage` (tests name it; source is absent). No tests were run. No production or runtime behavior was verified. Commit binding `9dab4e99d3bfadf995dbaa031b9b6a365970e1e3` is the packet identity only.
## Next useful action
Filter `standardItems` through `workspace.modules` plus an explicit client-only allowlist before passing them to `V3AppShell`, and toast when a URL module is dropped to `default_landing`. Point the multinav and smoke specs at those real branches instead of local mirrors.
MATERIAL_EVIDENCE_CONFLICT: v3-shell-smoke.spec.ts:242-243 expects `/inspections` and `/repairs` to stay on those URLs, but workspaceModules.ts:225-229 removed them from `CLIENT_ONLY_MODULE_KEYS` and WorkspaceShell.tsx:200-214 redirects unknown module keys to `default_landing`; WorkspaceShell.multinav.test.tsx:163-211 requires synchronous invalidate before navigate on key `['userWorkspace']`, but WorkspaceShell.tsx:251-276 invalidates only in patch `onSuccess` and navigates immediately via `queryKeys.userWorkspace.all` (`['user-workspace']`, queryKeys.ts:662-663).Primary judge's stated reason
A offers a modest practical coverage benefit by exposing a directly traceable navigation-control mismatch that B does not report. This is a weak forced preference, not an established material quality difference; the extensive shared findings and conditional claims leave room for an independent review to prefer B.
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_bc1d230a849643aead2d6a8105af218f88100c581cc29141f526c918da78c572. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.