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. 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.
openai / gpt-6-astra / medium / medium effort answer
## Conclusion
Direct, independent review of all 20 supplied files found **five source-proven issues**. No tools, tests, runtime checks, or edits were performed.
Evidence is limited to packet `sha256:d44ebc3ebabfab1c97f69230cb62766b52edc2ac299c211c46c8eb0ba17fcb67`, bound to commit `9dab4e99d3bfadf995dbaa031b9b6a365970e1e3`. This does not establish runtime behavior or production readiness.
## Findings
### 1. Standard navigation offers server-excluded modules
**Severity: Medium · Confidence: 0.99**
- `[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:332–343` constructs Standard navigation from the entire fixed registry, without checking `workspace.modules`.
- `[REDACTED: private project name]/frontend/src/lib/navRegistry.ts:184–189` includes Map & Pipes and Plans & Reports unconditionally.
- `[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:200–214` rejects an unavailable server-backed module and redirects to the default landing.
**Impact:** When the resolved workspace excludes Reports, the shell still supplies a Reports navigation item whose handler leads back to another page. Workspace-specific navigation is inconsistent with module eligibility.
**Recommendation:** Derive Standard items from resolved modules plus the intentional client-only allowlist.
**Boundary:** The supplied code proves the incompatible navigation inputs and handler behavior; actual rendering by the excluded `V3Sidebar` is unverified. This is not evidence of backend authorization bypass.
### 2. Legacy workspace hamburger changes state that its shell never renders
**Severity: Medium · Confidence: 0.99**
- `[REDACTED: private project name]/frontend/src/components/layout/TopBar.tsx:23–30` toggles `sidebarDrawerOpen` below 1280px.
- `[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:368–392` renders the legacy sidebar using only `sidebarCollapsed`.
- Its complete legacy return, lines **368–689**, contains no drawer.
- `[REDACTED: private project name]/frontend/src/hooks/useV3Shell.ts:43–50` supports selecting this legacy branch.
**Impact:** In legacy workspace mode below 1280px, the hamburger announces opening/closing the menu but cannot change the rendered sidebar. The expanded sidebar continues consuming 240px.
**Recommendation:** Connect the legacy workspace branch to a drawer or give its hamburger a supported collapse action.
### 3. Workspace switching leaves existing workspace reads able to overwrite optimistic state
**Severity: Medium · Confidence: 0.92**
- `[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:119–124` maintains an active workspace query.
- The switch handler at **226–276** overwrites its cache and starts the PATCH without cancelling an existing query.
- Only the newly requested invalidation is sequenced after PATCH success, at **254–257**.
- Canonical navigation immediately follows whatever workspace occupies that cache, at **213–214**.
**Impact:** If a workspace GET is already in flight when a switch occurs, its old response can replace the optimistic target and redirect the user back before the post-PATCH refetch corrects it. Sequencing the new refetch does not protect against the existing read.
**Recommendation:** Cancel outstanding workspace queries before the optimistic update and protect overlapping switches from stale completion/rollback.
**Boundary:** This identifies a source-level race under the stated request ordering, not an observed runtime occurrence.
### 4. Focused navigation tests exercise copies rather than the implementation
**Severity: Medium · Confidence: 1.00**
- `[REDACTED: private project name]/frontend/src/__tests__/WorkspaceShell.multinav.test.tsx:189–202` defines its own switch handler; **199–200** patch and immediately invalidate.
- The actual handler defers invalidation until success: `[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:251–258`.
- The test also uses `['userWorkspace']` at line **192**, whereas the real key is `['user-workspace']` in `[REDACTED: private project name]/frontend/src/api/queryKeys.ts:662–664`.
- `[REDACTED: private project name]/frontend/src/__tests__/PlatformWorkspacesPage.test.tsx:89–100` invokes a locally created mock directly and asserts that same invocation, without exercising a production handler.
**Impact:** These tests cannot catch removal or breakage of the actual switch/save behavior. The switch test specifically preserves the immediate-invalidation sequence that production code intentionally avoids.
**Recommendation:** Exercise exported production logic or mounted handlers, including PATCH settlement and rollback, rather than inline mirrors.
### 5. Standard smoke assertions require routes that the current resolver deliberately redirects
**Severity: Medium · Confidence: 1.00**
- `[REDACTED: private project name]/frontend/tests/app-layout/v3-shell-smoke.spec.ts:209–214` includes `/inspections` and `/repairs`.
- Lines **238–243** require those route segments to survive navigation.
- `[REDACTED: private project name]/frontend/src/lib/workspaceModules.ts:215–230` excludes both from the client-only allowlist.
- The smoke workspace fixture at **69–73** also excludes them from server modules.
- `[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:200–214` therefore resolves both to the fixture’s default landing.
**Impact:** The assertions contradict the supplied resolver and fixture. Successful rendering of the intended fallback would fail these tests.
**Recommendation:** Assert the intended redirects or replace the removed destinations with supported routes.
Additional coverage limits: the Pro suite is explicitly skipped at `[REDACTED: private project name]/frontend/tests/app-layout/v3-shell-smoke.spec.ts:138`; its purported nonblank assertion accepts zero characters at **178**. Neither establishes working Pro layout.
## Discarded or unproven hypotheses
- Client-only Uploads bypasses workspace-module filtering intentionally (`[REDACTED: private project name]/frontend/src/lib/workspaceModules.ts:117–122`); excluded module/backend implementations prevent any authorization-bypass conclusion.
- Frontend role values matching the test’s hardcoded list does not prove backend enum parity.
- Drawer accessibility, breakpoint coordination in V3 chrome, feature enforcement inside modules, and tenant isolation cannot be established from the supplied shell alone.
## Explicit excluded boundaries
All files outside the declared 20-file packet are excluded. Specifically, the listed direct dependencies below were **not reviewed**. Paths are relative to `[REDACTED: private project name]/frontend/src/`, retaining the packet’s dependency names:
- **API/auth:** `api/client.js`, `api/superAdmin.js`, `api/auth.js`, `api/dashboard.js`, `auth/AuthContext.js`.
- **Configuration/hooks:** `config/features.js`, `hooks/useMediaQuery.js`, `hooks/usePermissions.js`, `hooks/useCommandCenter.js`.
- **Supporting logic:** `lib/roleLabels.js`, `lib/clientToServerMigration.js`, `lib/useUserPreferencesQueue.js`, `components/review-tabs/playbackSpeeds.js`.
- **Chrome:** `components/layout/OrgSwitcher.js`, `components/layout/SurfaceSwitcher.js`, `components/layout/OffboardingBanner.js`, `components/layout/SidebarDrawer.js`, `components/layout/TrustStrip.js`, `components/layout/V3Sidebar.js`, `components/layout/V3TopBar.js`.
- **Other components:** `components/alerts/AlertDropdown.js`, `components/assistant/AssistantBubble.js`, `components/assistant/assistantBubbleVisibility.js`, `components/chat/ChatPanel.js`, `components/common/ErrorBoundary.js`, `components/common/Toast.js`, `components/consultant/CommandCenter.js`, `components/media/ProcessingIndicator.js`, `components/v3-review/V3ProDevToggle.js`.
- **Stores:** `store/useAIStore.js`, `store/useExplorerStore.js`, `store/useLayerStore.js`, `store/useMapRailUIStore.js`, `store/useMonitorUIStore.js`, `store/useProfileBankFilterStore.js`, `store/useViewUIStore.js`, `store/useWorkspaceProModeStore.js`, `stores/useV3SessionStore.js`.
- **Module bodies:** `components/workspace/modules/MunicipalExplorerModule.js`, `components/workspace/modules/MunicipalReportsModule.js`, `components/workspace/modules/MunicipalUploadsModule.js`, `components/workspace/modules/V3InspectionsModule.js`, `components/workspace/modules/V3RepairsModule.js`, `components/workspace/modules/V3TodayModule.js`, `pages/v3/V3InspectionReview.js`.
Also excluded: route mounting and guards; platform workspace editor implementation; backend resolver, schemas, role enum, persistence and authorization; global CSS and tooling configuration; dependency implementations; live services, databases and customer data; browser rendering, assistive-technology behavior, actual network ordering, test execution and deployment state.
**Next useful action:** Correct the navigation/state mismatches and align focused test contracts with production behavior in a separately authorized implementation task.
MATERIAL_EVIDENCE_CONFLICT: `[REDACTED: private project name]/frontend/tests/app-layout/v3-shell-smoke.spec.ts:238–243` requires inspections/repairs URLs to remain, while `[REDACTED: private project name]/frontend/src/lib/workspaceModules.ts:225–229` removes their routability and `[REDACTED: private project name]/frontend/src/components/workspace/WorkspaceShell.tsx:200–214` redirects them.
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`.Primary judge's stated reason
B receives a slight forced preference because its treatment of intentional exceptions better helps readers separate actionable source mismatches from unverified product or authorization concerns. A's broader useful observations counterbalance that benefit. This is not an established material quality difference; an independent review could reasonably prefer A's coverage.
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_38f19329f31699dce4891b85de348f70f0ade3df78be67dc0fca329f0d53c1d4. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.