EnergyVenom commited on
Commit
fb43301
·
verified ·
1 Parent(s): 153376e

Tidy the web app: pages by area, CSS in load order, web/README.md (b2a039d)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. coworker/platform/patchcycle.py +1 -1
  2. docs/DESIGN_SYSTEM.md +7 -7
  3. docs/FRONTEND_AUDIT.md +1 -1
  4. web/README.md +114 -0
  5. web/src/App.tsx +30 -30
  6. web/src/account/AccessTokensCard.tsx +2 -2
  7. web/src/chat/AskChat.tsx +4 -4
  8. web/src/chat/ChatCards.tsx +4 -4
  9. web/src/chat/speaker.ts +1 -1
  10. web/src/components/AdminOnly.tsx +1 -1
  11. web/src/components/CommandPalette.tsx +3 -3
  12. web/src/components/CoworkerCard.tsx +2 -2
  13. web/src/components/ErrorPages.test.tsx +1 -1
  14. web/src/components/GraphView.tsx +1 -1
  15. web/src/components/Layout.tsx +2 -2
  16. web/src/components/ProcessFlow.tsx +2 -2
  17. web/src/components/common.tsx +2 -2
  18. web/src/components/components.test.tsx +7 -7
  19. web/src/{coworkers.css → components/coworkers.css} +0 -0
  20. web/src/{icons.tsx → components/icons.tsx} +0 -0
  21. web/src/components/shell/AppSidebar.tsx +6 -6
  22. web/src/components/shell/EnvSwitcher.tsx +1 -1
  23. web/src/components/shell/IconRail.tsx +2 -2
  24. web/src/components/shell/RunListItem.tsx +3 -3
  25. web/src/components/shell/SidePanel.tsx +1 -1
  26. web/src/components/shell/TopBar.tsx +1 -1
  27. web/src/components/shell/TopNav.tsx +2 -2
  28. web/src/components/shell/cockpit.tsx +1 -1
  29. web/src/components/shell/panelTabs.tsx +8 -8
  30. web/src/{shell.css → components/shell/shell.css} +0 -0
  31. web/src/components/shell/shell.test.tsx +1 -1
  32. web/src/components/ui/motion/alert.tsx +1 -1
  33. web/src/components/ui/motion/button/stateful.tsx +1 -1
  34. web/src/{agents.test.ts → domain/agents.test.ts} +0 -0
  35. web/src/{agents.ts → domain/agents.ts} +0 -0
  36. web/src/{coworkers.test.ts → domain/coworkers.test.ts} +0 -0
  37. web/src/{coworkers.ts → domain/coworkers.ts} +0 -0
  38. web/src/{desktop.ts → domain/desktop.ts} +0 -0
  39. web/src/{glossary.ts → domain/glossary.ts} +0 -0
  40. web/src/{podAreas.ts → domain/podAreas.ts} +1 -1
  41. web/src/{runName.ts → domain/runName.ts} +0 -0
  42. web/src/{waiting.ts → domain/waiting.ts} +1 -1
  43. web/src/main.tsx +13 -13
  44. web/src/notify/NotificationBell.tsx +2 -2
  45. web/src/notify/NotificationsSettings.tsx +1 -1
  46. web/src/notify/TelegramCard.tsx +1 -1
  47. web/src/notify/TelegramLinkCard.tsx +1 -1
  48. web/src/pages/{fixes.test.tsx → __tests__/fixes.test.tsx} +9 -9
  49. web/src/pages/{mustfix.test.tsx → __tests__/mustfix.test.tsx} +3 -3
  50. web/src/pages/{recovery.test.tsx → __tests__/recovery.test.tsx} +5 -5
coworker/platform/patchcycle.py CHANGED
@@ -1,6 +1,6 @@
1
  """Patch cycles: Oracle Fusion ships a quarterly update (named by year and quarter letter: 25D, 26A, 26B, 26C) and monthly
2
  updates between them. The patch name on a test run is free text; this module only reads it, so the app can say which
3
- cadence a patch belongs to and sort patches by how recently they were tested. web/src/runName.ts has the same rules."""
4
  from __future__ import annotations
5
 
6
  import re
 
1
  """Patch cycles: Oracle Fusion ships a quarterly update (named by year and quarter letter: 25D, 26A, 26B, 26C) and monthly
2
  updates between them. The patch name on a test run is free text; this module only reads it, so the app can say which
3
+ cadence a patch belongs to and sort patches by how recently they were tested. web/src/domain/runName.ts has the same rules."""
4
  from __future__ import annotations
5
 
6
  import re
docs/DESIGN_SYSTEM.md CHANGED
@@ -2,7 +2,7 @@
2
 
3
  **Audience:** anyone changing the web app's UI.
4
 
5
- **Source of truth:** [`web/src/tokens.css`](../web/src/tokens.css). All three styling layers read from it:
6
 
7
  | Layer | How it uses the tokens |
8
  |---|---|
@@ -89,7 +89,7 @@ Aliases for charts and 3D: `--status-pass`, `--status-fail`, `--status-wait` and
89
  **Family**
90
  - `--font-display`: Space Grotesk (titles, big numbers, caps labels, table headers). `--font`: Manrope, everywhere else: navigation, buttons, tabs, table headers, titles and reading text, always in sentence case. Hierarchy comes from size, weight and colour, never from capitals (`type.css`).
91
  - `--mono`: Geist Mono, for IDs, code and keyboard keys only.
92
- - Icons: Lucide (outline, 1.75 px stroke) through `web/src/icons.tsx`; brand logos stay Tabler's.
93
  - Wensity UI components (MIT, free tier) in `components/wensity/`: title blur reveal, count-up numbers, marker highlight, shimmer for live states, the activity grid; they read the app's tokens through `wensity.css`.
94
  - Mouse effects (`components/shell/CursorFx.tsx`): a follower ring, magnetic primary buttons and a soft title rise; mouse only, off with reduced motion, switchable in the account menu. The system cursor always stays.
95
  - `--font-display-mono` is an alias of `--font`, kept so older rules follow the one family.
@@ -183,7 +183,7 @@ Mantine `xs`, `sm`, `md`, `lg` and `xl` are 8, 12, 16, 24 and 32. Tailwind's spa
183
 
184
  There are no other shadows.
185
 
186
- ### Surface utilities (`web/src/surfaces.css`)
187
 
188
  | Class | Use |
189
  |---|---|
@@ -285,11 +285,11 @@ Motion is functional: it shows where something came from or that an action worke
285
 
286
  | File | What |
287
  |---|---|
288
- | `web/src/tokens.css` | Tokens (section 1 colour, 2 scales, 3 legacy aliases) |
289
  | `web/src/theme.ts` | The Mantine theme from the tokens, and component defaults |
290
- | `web/src/beui.css` | The Tailwind theme from the tokens; shadcn names for beUI parts |
291
- | `web/src/apple.css` | Base element styles and Mantine control styling |
292
- | `web/src/styles.css`, `apple-*.css` | Screen styles (rebuilt page by page in Step 4) |
293
 
294
  **Legacy names.** `--fpt-*`, `--pill-*`, `--r-xs` and `--r-2xl` still work as aliases (tokens.css section 3). Don't use them in new code. Step 4 removes each one when the last page using it is rebuilt.
295
 
 
2
 
3
  **Audience:** anyone changing the web app's UI.
4
 
5
+ **Source of truth:** [`web/src/styles/00-tokens.css`](../web/src/styles/00-tokens.css). All three styling layers read from it:
6
 
7
  | Layer | How it uses the tokens |
8
  |---|---|
 
89
  **Family**
90
  - `--font-display`: Space Grotesk (titles, big numbers, caps labels, table headers). `--font`: Manrope, everywhere else: navigation, buttons, tabs, table headers, titles and reading text, always in sentence case. Hierarchy comes from size, weight and colour, never from capitals (`type.css`).
91
  - `--mono`: Geist Mono, for IDs, code and keyboard keys only.
92
+ - Icons: Lucide (outline, 1.75 px stroke) through `web/src/components/icons.tsx`; brand logos stay Tabler's.
93
  - Wensity UI components (MIT, free tier) in `components/wensity/`: title blur reveal, count-up numbers, marker highlight, shimmer for live states, the activity grid; they read the app's tokens through `wensity.css`.
94
  - Mouse effects (`components/shell/CursorFx.tsx`): a follower ring, magnetic primary buttons and a soft title rise; mouse only, off with reduced motion, switchable in the account menu. The system cursor always stays.
95
  - `--font-display-mono` is an alias of `--font`, kept so older rules follow the one family.
 
183
 
184
  There are no other shadows.
185
 
186
+ ### Surface utilities (`web/src/styles/20-surfaces.css`)
187
 
188
  | Class | Use |
189
  |---|---|
 
285
 
286
  | File | What |
287
  |---|---|
288
+ | `web/src/styles/00-tokens.css` | Tokens (section 1 colour, 2 scales, 3 legacy aliases) |
289
  | `web/src/theme.ts` | The Mantine theme from the tokens, and component defaults |
290
+ | `web/src/styles/30-tailwind.css` | The Tailwind theme from the tokens; shadcn names for beUI parts |
291
+ | `web/src/styles/10-apple.css` | Base element styles and Mantine control styling |
292
+ | `web/src/styles/01-base.css`, `apple-*.css` | Screen styles (rebuilt page by page in Step 4) |
293
 
294
  **Legacy names.** `--fpt-*`, `--pill-*`, `--r-xs` and `--r-2xl` still work as aliases (tokens.css section 3). Don't use them in new code. Step 4 removes each one when the last page using it is rebuilt.
295
 
docs/FRONTEND_AUDIT.md CHANGED
@@ -165,7 +165,7 @@ What each row is based on: "Checked" means I looked at the screenshot. The axe a
165
 
166
  - **`console.*`.** Only `console.error` in `ErrorPages.tsx`, which is intentional (the error boundary reports). OK.
167
  - **TODO / FIXME / lorem.** None found.
168
- - **Unused file.** `web/src/pages/RunTriage.tsx` is not imported anywhere. **P2:** delete it in Step 4.
169
  - **Console errors at runtime.** 20 `401 Unauthorized` errors on the public pages. These come from the "who am I" check before sign-in. That is expected, but it is logged as an error in the browser console. **P2:** treat 401 as "signed out" quietly.
170
  - **Two parallel style sheets.** `styles.css` (1,100 lines, `--fpt-*`) and the `apple*.css` files (about 900 lines) both style the same components. The later file wins by load order (`main.tsx` imports 6 CSS files in sequence). This is the main source of the inconsistencies above. Step 2 resolves it.
171
 
 
165
 
166
  - **`console.*`.** Only `console.error` in `ErrorPages.tsx`, which is intentional (the error boundary reports). OK.
167
  - **TODO / FIXME / lorem.** None found.
168
+ - **Unused file.** `web/src/pages/run/RunTriage.tsx` is not imported anywhere. **P2:** delete it in Step 4.
169
  - **Console errors at runtime.** 20 `401 Unauthorized` errors on the public pages. These come from the "who am I" check before sign-in. That is expected, but it is logged as an error in the browser console. **P2:** treat 401 as "signed out" quietly.
170
  - **Two parallel style sheets.** `styles.css` (1,100 lines, `--fpt-*`) and the `apple*.css` files (about 900 lines) both style the same components. The later file wins by load order (`main.tsx` imports 6 CSS files in sequence). This is the main source of the inconsistencies above. Step 2 resolves it.
171
 
web/README.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Astra web app (frontend)
2
+
3
+ The browser app of Astra: React 18, TypeScript, Vite, Mantine 7 and Tailwind 4. The backend (`coworker/`, Python) serves
4
+ it at `/` and its API at `/api`. You need no Oracle pod and no secrets to work on the UI: the backend runs against the
5
+ practice pod (`mock-app/`) on your machine.
6
+
7
+ ## Run it
8
+
9
+ ```bash
10
+ # once
11
+ npm --prefix web ci
12
+ npm --prefix mock-app ci
13
+ python -m venv architecture/.venv && architecture/.venv/Scripts/pip install -r coworker/requirements.txt
14
+
15
+ # every time (three terminals)
16
+ node mock-app/server.js # the practice pod, :3100
17
+ architecture/.venv/Scripts/python -m coworker api # the API, :8800
18
+ npm --prefix web run dev # this app, http://127.0.0.1:5173 (proxies /api to :8800)
19
+ ```
20
+
21
+ Create a user once: `architecture/.venv/Scripts/python -m coworker create-user --username admin --role admin`. On Windows
22
+ `fpt.cmd setup` and `fpt.cmd up` do the same. Point the dev server at another API with `FPT_API_TARGET`.
23
+
24
+ ## Where things are
25
+
26
+ ```
27
+ web/
28
+ ├── index.html page shell: title, favicons
29
+ ├── public/ static files: astra-logo.png (the CES logo), favicons
30
+ ├── e2e/ Playwright end-to-end, accessibility and visual tests
31
+ ├── scripts/ gen-api.mjs (typed API client), lighthouse.mjs
32
+ └── src/
33
+ ├── main.tsx entry: loads the global styles (in order), Mantine, React Query, the router
34
+ ├── App.tsx the route table: which URL shows which page
35
+ ├── theme.ts Mantine theme: the brand colour ramp (CES blue), sizes, component defaults
36
+ ├── styles/ global CSS, numbered in load order (see "Styling")
37
+ ├── pages/ one folder per area of the app (see below)
38
+ ├── components/ shared building blocks
39
+ │ ├── shell/ the frame around every page: top bar, sidebar, icon rail, side panel
40
+ │ ├── ui/ small animated controls (motion buttons, inputs, checkbox, alert)
41
+ │ ├── three/ 3D scenes (three.js)
42
+ │ ├── wensity/ Wensity UI components on the app's tokens
43
+ │ └── icons.tsx every icon the app uses (import from '@/components/icons')
44
+ ├── api/ the API client and React Query hooks; schema.d.ts and openapi.json are GENERATED
45
+ ├── auth/ sign-in state (AuthContext)
46
+ ├── account/ account page parts (access tokens)
47
+ ├── chat/ the Ask assistant (chat cards, speakers)
48
+ ├── notify/ notifications: bell, Telegram link, settings
49
+ ├── domain/ the app's own knowledge in plain TypeScript: agents, coworkers, glossary, pod areas,
50
+ │ run names, what is waiting for a person, desktop notifications
51
+ ├── hooks/, lib/ small shared hooks and helpers
52
+ └── test/ test setup and helpers (render with providers, fake API responses)
53
+ ```
54
+
55
+ ### Pages
56
+
57
+ | Folder | Screens |
58
+ |---|---|
59
+ | `pages/auth/` | sign in, register, password reset; `AuthShell` is their shared frame, `login/` the brand mark and 3D scene |
60
+ | `pages/home/` | the home dashboard (`HomeBento`) and patch readiness |
61
+ | `pages/runs/` | the list of test runs, the new-run wizard, scheduled runs |
62
+ | `pages/run/` | everything inside one test run: `RunPage` → `RunWorkspace` (tabs) → `RunStages` (the four phases), scenarios (`ScenarioSplit`, `ScenarioReview`), failures (`FailureReview`, `FailedScreen`), the live browser (`LiveView`), report and sign-off (`RunReport`, `SignOffReport`), the agent team board |
63
+ | `pages/library/` | the scenario library and importing test cases |
64
+ | `pages/setup/` | test environments (`PodsPage`), Oracle AI Agent Studio, AI monitoring, integrations, settings, admin |
65
+ | `pages/insights/` | defects and queues, reports, the assistant, the agent team |
66
+ | `pages/account/` | your account |
67
+ | `pages/dev/` | fixtures for local development only |
68
+ | `pages/__tests__/` | tests that cover several pages at once |
69
+
70
+ A page's own CSS sits next to it (`pages/run/cockpit.css` is imported by the run page). Tests sit next to the code they
71
+ test (`TeamBoard.test.tsx` beside `TeamBoard.tsx`).
72
+
73
+ ## Styling
74
+
75
+ 1. **Colours, sizes and fonts come from tokens:** `styles/00-tokens.css` (CSS variables for light and dark) and
76
+ `theme.ts` (Mantine). Change a colour there and it changes everywhere. The brand accent is the CES blue
77
+ (`--accent`, `--ember`, `--accent-grad` for the gradient); status colours (green passed, red failed, amber waiting)
78
+ mean a state and are never used as decoration.
79
+ 2. **Global CSS loads in the order of its number** (`main.tsx`); a later file wins over an earlier one:
80
+
81
+ | File | What it does |
82
+ |---|---|
83
+ | `00-tokens.css` | design tokens: light and dark |
84
+ | `01-base.css` | base element styles |
85
+ | `10-14 apple*.css` | the first design layer: components, screens, the run page, other pages |
86
+ | `20-surfaces.css`, `21-type.css` | shared surfaces (cards, stat cards, pills, tables) and type |
87
+ | `30-tailwind.css` | Tailwind 4 theme and utilities on the tokens; its `@source` lines list the files that use Tailwind classes |
88
+ | `40-layout.css` | layout across screen sizes |
89
+ | `50-run-polish.css` | the reviewed design of the test run page |
90
+ | `90-theme.css` | the current look (Astra, CES blue): loaded last |
91
+
92
+ 3. **Prefer Mantine components and the tokens.** Use Tailwind classes only in the files listed under `@source` in
93
+ `30-tailwind.css`; add a file there before using Tailwind in it.
94
+ 4. **Older names you will meet:** class prefixes `pw-`, `fpt-`, `trio-` and the colour names `ember` and `trio` come from
95
+ earlier designs (the product was called Patchwise). They still work; new code can use plain names.
96
+
97
+ ## Conventions
98
+
99
+ - **Imports:** `@/` means `src/` (`import { IconX } from '@/components/icons'`).
100
+ - **API types:** never edit `src/api/schema.d.ts` or `openapi.json`. After a backend change run `npm --prefix web run gen:api`.
101
+ - **Accessibility:** every control has a label, focus is visible, colour is never the only signal. `npm --prefix web run test:a11y`.
102
+ - **Light and dark:** check both (the moon or sun button in the top bar).
103
+ - **Screens never show secrets:** the live browser view masks sign-in pages; do not add passwords, tokens or keys to the UI.
104
+
105
+ ## Checks before a pull request
106
+
107
+ | What | Command |
108
+ |---|---|
109
+ | Type check, lint, build | `npm --prefix web run build` and `npm --prefix web run lint` |
110
+ | Unit tests (Vitest) | `npm --prefix web test` |
111
+ | End-to-end (Playwright) | `npm --prefix web run e2e` |
112
+ | Visual snapshots | `npm --prefix web run test:visual` (update with `test:visual:update` when a change is intended) |
113
+
114
+ See also `docs/DESIGN_SYSTEM.md` (design rules), `docs/FRONTEND_AUDIT.md` and the root `README.md` (the whole product).
web/src/App.tsx CHANGED
@@ -1,48 +1,48 @@
1
  import { Center, Loader } from '@mantine/core';
2
  import { lazy, Suspense, type ReactNode } from 'react';
3
  import { Navigate, Route, Routes, useLocation, useSearchParams } from 'react-router-dom';
4
- import { AssistantPage } from './pages/AssistantPage';
5
  import { AuthProvider, useAuth } from './auth/AuthContext';
6
  import { Layout } from './components/Layout';
7
  import { AdminOnly } from './components/AdminOnly';
8
  import { NotFoundPage } from './components/ErrorPages';
9
- import { PodsPage } from './pages/PodsPage';
10
- import { ReadinessPage } from './pages/ReadinessPage';
11
- import { TicketsPage } from './pages/QueuesPages';
12
- import { RunWorkspace } from './pages/RunWorkspace';
13
- import { RunsPage } from './pages/RunsPage';
14
 
15
  // Pages opened less often load on demand, so the first visit downloads less (Home, test runs, environments and defects
16
  // stay in the main bundle: they are the daily path).
17
  const named = <T extends Record<string, unknown>>(load: () => Promise<T>, name: keyof T) =>
18
  lazy(() => load().then((m) => ({ default: m[name] as React.ComponentType })));
19
- const AgentTeamPage = named(() => import('./pages/AgentTeamPage'), 'AgentTeamPage');
20
- const SettingsPage = named(() => import('./pages/SettingsPage'), 'SettingsPage');
21
- const AutonomyPage = named(() => import('./pages/AdminPages'), 'AutonomyPage');
22
- const KillSwitchPage = named(() => import('./pages/AdminPages'), 'KillSwitchPage');
23
- const SchedulerPage = named(() => import('./pages/AdminPages'), 'SchedulerPage');
24
- const UsersPage = named(() => import('./pages/AdminPages'), 'UsersPage');
25
- const AuditPage = named(() => import('./pages/InsightPages'), 'AuditPage');
26
- const LearnerPage = named(() => import('./pages/InsightPages'), 'LearnerPage');
27
- const ReportsPage = named(() => import('./pages/LibraryPages'), 'ReportsPage');
28
- const ScenarioDetailPage = named(() => import('./pages/LibraryPages'), 'ScenarioDetailPage');
29
- const ScenariosLibraryPage = named(() => import('./pages/LibraryPages'), 'ScenariosLibraryPage');
30
- const HealPage = named(() => import('./pages/QueuesPages'), 'HealPage');
31
- const ScriptsPage = named(() => import('./pages/QueuesPages'), 'ScriptsPage');
32
- const AccountPage = named(() => import('./pages/AccountPage'), 'AccountPage');
33
- const IntegrationsPage = named(() => import('./pages/IntegrationsPage'), 'IntegrationsPage');
34
- const AgentStudioPage = named(() => import('./pages/AgentStudioPage'), 'AgentStudioPage');
35
- const AiMonitoringPage = named(() => import('./pages/AiMonitoringPage'), 'AiMonitoringPage');
36
- const ImportCasesPage = named(() => import('./pages/ImportCasesPage'), 'ImportCasesPage');
37
  // the sign-in page carries the beUI animation library: only people who sign in download it
38
- const LoginPage = named(() => import('./pages/LoginPage'), 'LoginPage');
39
- const RegisterPage = named(() => import('./pages/RegisterPage'), 'RegisterPage');
40
- const ForgotPage = named(() => import('./pages/PasswordPages'), 'ForgotPage');
41
- const ResetPage = named(() => import('./pages/PasswordPages'), 'ResetPage');
42
 
43
  // Dev-only fixture screens for design review; the branch is removed from the production build.
44
- const DevFixtures = import.meta.env.DEV ? lazy(() => import('./pages/DevFixtures').then((m) => ({ default: m.DevFixtures }))) : null;
45
- const DevApprovalFixtures = import.meta.env.DEV ? lazy(() => import('./pages/DevFixtures').then((m) => ({ default: m.DevApprovalFixtures }))) : null;
46
  /** The fixture routes this build registers (none outside dev builds). */
47
  export const DEV_FIXTURE_PATHS: string[] = import.meta.env.DEV ? ['/dev/board-fixture', '/dev/approval-fixture'] : [];
48
 
 
1
  import { Center, Loader } from '@mantine/core';
2
  import { lazy, Suspense, type ReactNode } from 'react';
3
  import { Navigate, Route, Routes, useLocation, useSearchParams } from 'react-router-dom';
4
+ import { AssistantPage } from './pages/insights/AssistantPage';
5
  import { AuthProvider, useAuth } from './auth/AuthContext';
6
  import { Layout } from './components/Layout';
7
  import { AdminOnly } from './components/AdminOnly';
8
  import { NotFoundPage } from './components/ErrorPages';
9
+ import { PodsPage } from './pages/setup/PodsPage';
10
+ import { ReadinessPage } from './pages/home/ReadinessPage';
11
+ import { TicketsPage } from './pages/insights/QueuesPages';
12
+ import { RunWorkspace } from './pages/run/RunWorkspace';
13
+ import { RunsPage } from './pages/runs/RunsPage';
14
 
15
  // Pages opened less often load on demand, so the first visit downloads less (Home, test runs, environments and defects
16
  // stay in the main bundle: they are the daily path).
17
  const named = <T extends Record<string, unknown>>(load: () => Promise<T>, name: keyof T) =>
18
  lazy(() => load().then((m) => ({ default: m[name] as React.ComponentType })));
19
+ const AgentTeamPage = named(() => import('./pages/insights/AgentTeamPage'), 'AgentTeamPage');
20
+ const SettingsPage = named(() => import('./pages/setup/SettingsPage'), 'SettingsPage');
21
+ const AutonomyPage = named(() => import('./pages/setup/AdminPages'), 'AutonomyPage');
22
+ const KillSwitchPage = named(() => import('./pages/setup/AdminPages'), 'KillSwitchPage');
23
+ const SchedulerPage = named(() => import('./pages/setup/AdminPages'), 'SchedulerPage');
24
+ const UsersPage = named(() => import('./pages/setup/AdminPages'), 'UsersPage');
25
+ const AuditPage = named(() => import('./pages/insights/InsightPages'), 'AuditPage');
26
+ const LearnerPage = named(() => import('./pages/insights/InsightPages'), 'LearnerPage');
27
+ const ReportsPage = named(() => import('./pages/library/LibraryPages'), 'ReportsPage');
28
+ const ScenarioDetailPage = named(() => import('./pages/library/LibraryPages'), 'ScenarioDetailPage');
29
+ const ScenariosLibraryPage = named(() => import('./pages/library/LibraryPages'), 'ScenariosLibraryPage');
30
+ const HealPage = named(() => import('./pages/insights/QueuesPages'), 'HealPage');
31
+ const ScriptsPage = named(() => import('./pages/insights/QueuesPages'), 'ScriptsPage');
32
+ const AccountPage = named(() => import('./pages/account/AccountPage'), 'AccountPage');
33
+ const IntegrationsPage = named(() => import('./pages/setup/IntegrationsPage'), 'IntegrationsPage');
34
+ const AgentStudioPage = named(() => import('./pages/setup/AgentStudioPage'), 'AgentStudioPage');
35
+ const AiMonitoringPage = named(() => import('./pages/setup/AiMonitoringPage'), 'AiMonitoringPage');
36
+ const ImportCasesPage = named(() => import('./pages/library/ImportCasesPage'), 'ImportCasesPage');
37
  // the sign-in page carries the beUI animation library: only people who sign in download it
38
+ const LoginPage = named(() => import('./pages/auth/LoginPage'), 'LoginPage');
39
+ const RegisterPage = named(() => import('./pages/auth/RegisterPage'), 'RegisterPage');
40
+ const ForgotPage = named(() => import('./pages/auth/PasswordPages'), 'ForgotPage');
41
+ const ResetPage = named(() => import('./pages/auth/PasswordPages'), 'ResetPage');
42
 
43
  // Dev-only fixture screens for design review; the branch is removed from the production build.
44
+ const DevFixtures = import.meta.env.DEV ? lazy(() => import('./pages/dev/DevFixtures').then((m) => ({ default: m.DevFixtures }))) : null;
45
+ const DevApprovalFixtures = import.meta.env.DEV ? lazy(() => import('./pages/dev/DevFixtures').then((m) => ({ default: m.DevApprovalFixtures }))) : null;
46
  /** The fixture routes this build registers (none outside dev builds). */
47
  export const DEV_FIXTURE_PATHS: string[] = import.meta.env.DEV ? ['/dev/board-fixture', '/dev/approval-fixture'] : [];
48
 
web/src/account/AccessTokensCard.tsx CHANGED
@@ -1,11 +1,11 @@
1
  import { Button, CopyButton, Group, Radio, Stack, Text, TextInput } from '@mantine/core';
2
- import { IconCheck, IconCopy, IconKey } from '@/icons';
3
  import { useMutation, useQueryClient } from '@tanstack/react-query';
4
  import { useEffect, useRef, useState, type FormEvent } from 'react';
5
  import { useLocation } from 'react-router-dom';
6
  import { sendJson } from '../api/client';
7
  import { ErrorAlert, fmtTs } from '../components/common';
8
- import { shortWhen } from '../runName';
9
  import { isActive, scopeWords, TOKENS_KEY, useAccessTokens, type AccessToken, type CreatedToken } from './useAccessTokens';
10
  import './account-tokens.css';
11
 
 
1
  import { Button, CopyButton, Group, Radio, Stack, Text, TextInput } from '@mantine/core';
2
+ import { IconCheck, IconCopy, IconKey } from '@/components/icons';
3
  import { useMutation, useQueryClient } from '@tanstack/react-query';
4
  import { useEffect, useRef, useState, type FormEvent } from 'react';
5
  import { useLocation } from 'react-router-dom';
6
  import { sendJson } from '../api/client';
7
  import { ErrorAlert, fmtTs } from '../components/common';
8
+ import { shortWhen } from '../domain/runName';
9
  import { isActive, scopeWords, TOKENS_KEY, useAccessTokens, type AccessToken, type CreatedToken } from './useAccessTokens';
10
  import './account-tokens.css';
11
 
web/src/chat/AskChat.tsx CHANGED
@@ -1,22 +1,22 @@
1
  import { ActionIcon, Button, Drawer, Text, Textarea } from '@mantine/core';
2
- import { IconArrowUp, IconMessages, IconPlus, IconShieldLock, IconTrash, IconX } from '@/icons';
3
  import { useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { useCallback, useEffect, useRef, useState, type FormEvent, type KeyboardEvent as ReactKeyboardEvent } from 'react';
5
  import { Link, useLocation, useNavigate, useParams, useSearchParams } from 'react-router-dom';
6
- import { MODULE_NAMES } from '../agents';
7
  import { errorMessage } from '../api/client';
8
  import { askErrorWords, useAssistantAsk, useAssistantStatus, useRun } from '../api/hooks';
9
  import { useShell } from '../components/shell/prefs';
10
  import { TopBar } from '../components/shell/TopBar';
11
  import { QueryState } from '../components/states';
12
- import { runTitle, shortWhen } from '../runName';
13
  import { AnswerCard, ConfirmCard, ScreenLinks, Sources } from './ChatCards';
14
  import {
15
  createConversation, deleteConversation, getConversation, listConversations, sendMessage,
16
  type ChatAction, type ChatContext, type ChatMessage, type ChatResult, type ConversationSummary,
17
  } from './api';
18
  import { CoworkerAvatar } from '../components/CoworkerAvatar';
19
- import { COWORKERS } from '../coworkers';
20
  import { speakerFor, type Speaker } from './speaker';
21
  import type { AskArrival } from './useAsk';
22
  import './ask.css';
 
1
  import { ActionIcon, Button, Drawer, Text, Textarea } from '@mantine/core';
2
+ import { IconArrowUp, IconMessages, IconPlus, IconShieldLock, IconTrash, IconX } from '@/components/icons';
3
  import { useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { useCallback, useEffect, useRef, useState, type FormEvent, type KeyboardEvent as ReactKeyboardEvent } from 'react';
5
  import { Link, useLocation, useNavigate, useParams, useSearchParams } from 'react-router-dom';
6
+ import { MODULE_NAMES } from '../domain/agents';
7
  import { errorMessage } from '../api/client';
8
  import { askErrorWords, useAssistantAsk, useAssistantStatus, useRun } from '../api/hooks';
9
  import { useShell } from '../components/shell/prefs';
10
  import { TopBar } from '../components/shell/TopBar';
11
  import { QueryState } from '../components/states';
12
+ import { runTitle, shortWhen } from '../domain/runName';
13
  import { AnswerCard, ConfirmCard, ScreenLinks, Sources } from './ChatCards';
14
  import {
15
  createConversation, deleteConversation, getConversation, listConversations, sendMessage,
16
  type ChatAction, type ChatContext, type ChatMessage, type ChatResult, type ConversationSummary,
17
  } from './api';
18
  import { CoworkerAvatar } from '../components/CoworkerAvatar';
19
+ import { COWORKERS } from '../domain/coworkers';
20
  import { speakerFor, type Speaker } from './speaker';
21
  import type { AskArrival } from './useAsk';
22
  import './ask.css';
web/src/chat/ChatCards.tsx CHANGED
@@ -1,14 +1,14 @@
1
  import { Button, Group, Stack, Text } from '@mantine/core';
2
- import { IconCheck, IconExternalLink } from '@/icons';
3
  import { useEffect, useRef, useState } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { errorMessage } from '../api/client';
6
  import { useRun, useRunReadiness } from '../api/hooks';
7
  import { Pill } from '../components/common';
8
  import { ProcessFlow } from '../components/ProcessFlow';
9
- import { RUN_STATUS_WORDS, VERDICT_TONE } from '../glossary';
10
- import { ScenarioCard } from '../pages/ScenarioReview';
11
- import { runTitle } from '../runName';
12
  import { cancelAction, confirmAction, type ChatAction, type ChatCard, type ChatLink, type ChatSource } from './api';
13
 
14
  const hhmm = (iso?: string | null) => {
 
1
  import { Button, Group, Stack, Text } from '@mantine/core';
2
+ import { IconCheck, IconExternalLink } from '@/components/icons';
3
  import { useEffect, useRef, useState } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { errorMessage } from '../api/client';
6
  import { useRun, useRunReadiness } from '../api/hooks';
7
  import { Pill } from '../components/common';
8
  import { ProcessFlow } from '../components/ProcessFlow';
9
+ import { RUN_STATUS_WORDS, VERDICT_TONE } from '../domain/glossary';
10
+ import { ScenarioCard } from '../pages/run/ScenarioReview';
11
+ import { runTitle } from '../domain/runName';
12
  import { cancelAction, confirmAction, type ChatAction, type ChatCard, type ChatLink, type ChatSource } from './api';
13
 
14
  const hhmm = (iso?: string | null) => {
web/src/chat/speaker.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { COWORKERS, type Coworker } from '../coworkers';
2
  import type { ChatResult } from './api';
3
 
4
  /** Who an answer comes from: a coworker of the AI team, the built-in coordinator ("Astra"), or Hermes. */
 
1
+ import { COWORKERS, type Coworker } from '../domain/coworkers';
2
  import type { ChatResult } from './api';
3
 
4
  /** Who an answer comes from: a coworker of the AI team, the built-in coordinator ("Astra"), or Hermes. */
web/src/components/AdminOnly.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { Button, Stack, Text } from '@mantine/core';
2
- import { IconLock } from '@/icons';
3
  import type { ReactNode } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { useAuth } from '../auth/AuthContext';
 
1
  import { Button, Stack, Text } from '@mantine/core';
2
+ import { IconLock } from '@/components/icons';
3
  import type { ReactNode } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { useAuth } from '../auth/AuthContext';
web/src/components/CommandPalette.tsx CHANGED
@@ -2,13 +2,13 @@ import { Modal, useMantineColorScheme } from '@mantine/core';
2
  import {
3
  IconBug, IconCalendarTime, IconFileReport, IconHistory, IconHome, IconKeyboard, IconListCheck, IconMessageCircle, IconMoon, IconPlayerPlay, IconPlus,
4
  IconSearch, IconServer, IconSettings, IconSun, IconUserCheck,
5
- } from '@/icons';
6
  import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
7
  import { useNavigate } from 'react-router-dom';
8
  import { useRuns } from '../api/hooks';
9
  import { useAuth } from '../auth/AuthContext';
10
- import { runAreas, runTitle } from '../runName';
11
- import { useWaitsOnMe } from '../waiting';
12
  import { isMac } from './shell/TopBar';
13
  import { useShell } from './shell/prefs';
14
 
 
2
  import {
3
  IconBug, IconCalendarTime, IconFileReport, IconHistory, IconHome, IconKeyboard, IconListCheck, IconMessageCircle, IconMoon, IconPlayerPlay, IconPlus,
4
  IconSearch, IconServer, IconSettings, IconSun, IconUserCheck,
5
+ } from '@/components/icons';
6
  import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
7
  import { useNavigate } from 'react-router-dom';
8
  import { useRuns } from '../api/hooks';
9
  import { useAuth } from '../auth/AuthContext';
10
+ import { runAreas, runTitle } from '../domain/runName';
11
+ import { useWaitsOnMe } from '../domain/waiting';
12
  import { isMac } from './shell/TopBar';
13
  import { useShell } from './shell/prefs';
14
 
web/src/components/CoworkerCard.tsx CHANGED
@@ -1,8 +1,8 @@
1
- import '../coworkers.css';
2
  import { Link } from 'react-router-dom';
3
  import { useRuns } from '../api/hooks';
4
  import { useAuth } from '../auth/AuthContext';
5
- import { COWORKERS, coworkerState, type Coworker, type CoworkerState } from '../coworkers';
6
  import { CoworkerAvatar } from './CoworkerAvatar';
7
 
8
  const STATE: Record<CoworkerState, { words: string; tone: string }> = {
 
1
+ import './coworkers.css';
2
  import { Link } from 'react-router-dom';
3
  import { useRuns } from '../api/hooks';
4
  import { useAuth } from '../auth/AuthContext';
5
+ import { COWORKERS, coworkerState, type Coworker, type CoworkerState } from '../domain/coworkers';
6
  import { CoworkerAvatar } from './CoworkerAvatar';
7
 
8
  const STATE: Record<CoworkerState, { words: string; tone: string }> = {
web/src/components/ErrorPages.test.tsx CHANGED
@@ -1,6 +1,6 @@
1
  import { fireEvent, screen } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
- import { LoginPage } from '../pages/LoginPage';
4
  import { jsonResponse, renderUi } from '../test/utils';
5
  import { NotFoundPage, ScreenErrorBoundary } from './ErrorPages';
6
 
 
1
  import { fireEvent, screen } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
+ import { LoginPage } from '../pages/auth/LoginPage';
4
  import { jsonResponse, renderUi } from '../test/utils';
5
  import { NotFoundPage, ScreenErrorBoundary } from './ErrorPages';
6
 
web/src/components/GraphView.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { Text } from '@mantine/core';
2
- import { AGENT_BY_NODE, ENGINE_LABEL, ENGINE_TONE, ENGINE_WORDS, stepName } from '../agents';
3
  import type { NodeState } from '../hooks/useRunStream';
4
  import { Pill } from './common';
5
 
 
1
  import { Text } from '@mantine/core';
2
+ import { AGENT_BY_NODE, ENGINE_LABEL, ENGINE_TONE, ENGINE_WORDS, stepName } from '../domain/agents';
3
  import type { NodeState } from '../hooks/useRunStream';
4
  import { Pill } from './common';
5
 
web/src/components/Layout.tsx CHANGED
@@ -4,9 +4,9 @@ import { Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'rea
4
  import { Outlet, useLocation, useNavigate, useSearchParams } from 'react-router-dom';
5
  import { useHealth, useKill, useRuns, useSavedState } from '../api/hooks';
6
  import { useAuth } from '../auth/AuthContext';
7
- import { desktop, statusTransitions } from '../desktop';
8
  import { useAsk } from '../chat/useAsk';
9
- import { StartRunSheet } from '../pages/StartRunWizard';
10
  import { CommandPalette } from './CommandPalette';
11
  import { ScreenErrorBoundary } from './ErrorPages';
12
  import { KeyboardSheet } from './KeyboardSheet';
 
4
  import { Outlet, useLocation, useNavigate, useSearchParams } from 'react-router-dom';
5
  import { useHealth, useKill, useRuns, useSavedState } from '../api/hooks';
6
  import { useAuth } from '../auth/AuthContext';
7
+ import { desktop, statusTransitions } from '../domain/desktop';
8
  import { useAsk } from '../chat/useAsk';
9
+ import { StartRunSheet } from '../pages/runs/StartRunWizard';
10
  import { CommandPalette } from './CommandPalette';
11
  import { ScreenErrorBoundary } from './ErrorPages';
12
  import { KeyboardSheet } from './KeyboardSheet';
web/src/components/ProcessFlow.tsx CHANGED
@@ -1,8 +1,8 @@
1
  import { Group, Text, Tooltip } from '@mantine/core';
2
- import { IconAlertTriangle, IconArrowRight, IconCircleCheck, IconCircleDashed, IconMinus, IconX } from '@/icons';
3
  import type { ReactNode } from 'react';
4
  import type { ProcessStep } from '../api/types';
5
- import { STEP_STATE } from '../glossary';
6
 
7
  const ICON: Record<string, ReactNode> = {
8
  failing: <IconX size={12} aria-hidden />, gap: <IconAlertTriangle size={12} aria-hidden />, not_tested: <IconCircleDashed size={12} aria-hidden />,
 
1
  import { Group, Text, Tooltip } from '@mantine/core';
2
+ import { IconAlertTriangle, IconArrowRight, IconCircleCheck, IconCircleDashed, IconMinus, IconX } from '@/components/icons';
3
  import type { ReactNode } from 'react';
4
  import type { ProcessStep } from '../api/types';
5
+ import { STEP_STATE } from '../domain/glossary';
6
 
7
  const ICON: Record<string, ReactNode> = {
8
  failing: <IconX size={12} aria-hidden />, gap: <IconAlertTriangle size={12} aria-hidden />, not_tested: <IconCircleDashed size={12} aria-hidden />,
web/src/components/common.tsx CHANGED
@@ -1,10 +1,10 @@
1
  import { Alert, Anchor, Button, Code, CopyButton, Group, Pagination, Popover, Text, Tooltip } from '@mantine/core';
2
- import { IconCheck, IconCopy, IconHelp, IconPlus, IconRobot, IconShieldLock } from '@/icons';
3
  import type { ReactNode } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { explainError, supportDetails } from '../api/errors';
6
  import { useAuth } from '../auth/AuthContext';
7
- import { decisionWords, GLOSSARY, RUN_STATUS_WORDS } from '../glossary';
8
  import { TopBar } from './shell/TopBar';
9
  import { useShell } from './shell/prefs';
10
  import { TextBlurReveal } from './wensity/text-blur-reveal';
 
1
  import { Alert, Anchor, Button, Code, CopyButton, Group, Pagination, Popover, Text, Tooltip } from '@mantine/core';
2
+ import { IconCheck, IconCopy, IconHelp, IconPlus, IconRobot, IconShieldLock } from '@/components/icons';
3
  import type { ReactNode } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { explainError, supportDetails } from '../api/errors';
6
  import { useAuth } from '../auth/AuthContext';
7
+ import { decisionWords, GLOSSARY, RUN_STATUS_WORDS } from '../domain/glossary';
8
  import { TopBar } from './shell/TopBar';
9
  import { useShell } from './shell/prefs';
10
  import { TextBlurReveal } from './wensity/text-blur-reveal';
web/src/components/components.test.tsx CHANGED
@@ -1,15 +1,15 @@
1
  import { fireEvent, screen, waitFor } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
- import { statusTransitions } from '../desktop';
4
  import { nodeStates, type RunEvent } from '../hooks/useRunStream';
5
- import { LoginPage } from '../pages/LoginPage';
6
- import { RunCases } from '../pages/RunCases';
7
- import { StartRunForm } from '../pages/StartRunWizard';
8
  import { jsonResponse, renderUi } from '../test/utils';
9
  import type { ProcessStep } from '../api/types';
10
- import { reviewAnswer } from '../glossary';
11
- import { ScenarioReview } from '../pages/ScenarioReview';
12
- import { runTitle } from '../runName';
13
  import { DecisionBadge, MockBanner, RuleResult } from './common';
14
  import { ProcessFlow } from './ProcessFlow';
15
  import { GraphView } from './GraphView';
 
1
  import { fireEvent, screen, waitFor } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
+ import { statusTransitions } from '../domain/desktop';
4
  import { nodeStates, type RunEvent } from '../hooks/useRunStream';
5
+ import { LoginPage } from '../pages/auth/LoginPage';
6
+ import { RunCases } from '../pages/run/RunCases';
7
+ import { StartRunForm } from '../pages/runs/StartRunWizard';
8
  import { jsonResponse, renderUi } from '../test/utils';
9
  import type { ProcessStep } from '../api/types';
10
+ import { reviewAnswer } from '../domain/glossary';
11
+ import { ScenarioReview } from '../pages/run/ScenarioReview';
12
+ import { runTitle } from '../domain/runName';
13
  import { DecisionBadge, MockBanner, RuleResult } from './common';
14
  import { ProcessFlow } from './ProcessFlow';
15
  import { GraphView } from './GraphView';
web/src/{coworkers.css → components/coworkers.css} RENAMED
File without changes
web/src/{icons.tsx → components/icons.tsx} RENAMED
File without changes
web/src/components/shell/AppSidebar.tsx CHANGED
@@ -1,20 +1,20 @@
1
- import '../../shell.css';
2
  import { Menu, Tooltip, useMantineColorScheme } from '@mantine/core';
3
  import {
4
  IconAlertTriangle, IconBug, IconCheck, IconDeviceDesktop, IconFileReport, IconHandStop, IconHome, IconListCheck, IconLogout, IconMessageCircle, IconMoon,
5
- IconPlayerPlay, IconPlug, IconRobot, IconServer, IconSettings, IconSun, IconActivity } from '@/icons';
6
  import type { ReactNode } from 'react';
7
  import { NavLink as RouterLink, useLocation } from 'react-router-dom';
8
  import type { Schemas } from '../../api/client';
9
  import { useBrand, useHealth, useKill, useRuns } from '../../api/hooks';
10
  import { useAuth } from '../../auth/AuthContext';
11
- import { desktop } from '../../desktop';
12
- import { areaTone } from '../../agents';
13
- import { runTitle } from '../../runName';
14
  import { EnvSwitcher, envKind, useChosenEnv } from './EnvSwitcher';
15
  import { setCursorEffects, useCursorEffects } from './CursorFx';
16
  import { setSimpleMode, useSimpleMode } from './simpleMode';
17
- import { isWaiting, useWaitsOnMe } from '../../waiting';
18
 
19
  type RunSummary = Schemas['RunSummary'];
20
  export interface NavItem { to: string; label: string; icon: ReactNode; match?: (p: string) => boolean; admin?: boolean }
 
1
+ import './shell.css';
2
  import { Menu, Tooltip, useMantineColorScheme } from '@mantine/core';
3
  import {
4
  IconAlertTriangle, IconBug, IconCheck, IconDeviceDesktop, IconFileReport, IconHandStop, IconHome, IconListCheck, IconLogout, IconMessageCircle, IconMoon,
5
+ IconPlayerPlay, IconPlug, IconRobot, IconServer, IconSettings, IconSun, IconActivity } from '@/components/icons';
6
  import type { ReactNode } from 'react';
7
  import { NavLink as RouterLink, useLocation } from 'react-router-dom';
8
  import type { Schemas } from '../../api/client';
9
  import { useBrand, useHealth, useKill, useRuns } from '../../api/hooks';
10
  import { useAuth } from '../../auth/AuthContext';
11
+ import { desktop } from '../../domain/desktop';
12
+ import { areaTone } from '../../domain/agents';
13
+ import { runTitle } from '../../domain/runName';
14
  import { EnvSwitcher, envKind, useChosenEnv } from './EnvSwitcher';
15
  import { setCursorEffects, useCursorEffects } from './CursorFx';
16
  import { setSimpleMode, useSimpleMode } from './simpleMode';
17
+ import { isWaiting, useWaitsOnMe } from '../../domain/waiting';
18
 
19
  type RunSummary = Schemas['RunSummary'];
20
  export interface NavItem { to: string; label: string; icon: ReactNode; match?: (p: string) => boolean; admin?: boolean }
web/src/components/shell/EnvSwitcher.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { Menu, UnstyledButton } from '@mantine/core';
2
- import { IconCheck, IconCloud, IconSelector, IconServer, IconShieldLock } from '@/icons';
3
  import { useNavigate } from 'react-router-dom';
4
  import { usePods, type Pod } from '../../api/hooks';
5
  import { MOCK_TEXT } from '../common';
 
1
  import { Menu, UnstyledButton } from '@mantine/core';
2
+ import { IconCheck, IconCloud, IconSelector, IconServer, IconShieldLock } from '@/components/icons';
3
  import { useNavigate } from 'react-router-dom';
4
  import { usePods, type Pod } from '../../api/hooks';
5
  import { MOCK_TEXT } from '../common';
web/src/components/shell/IconRail.tsx CHANGED
@@ -1,10 +1,10 @@
1
  import './rail.css';
2
  import { Tooltip } from '@mantine/core';
3
- import { IconAlertTriangle, IconHandStop } from '@/icons';
4
  import { NavLink as RouterLink, useLocation } from 'react-router-dom';
5
  import { useBrand, useHealth, useKill, useRuns } from '../../api/hooks';
6
  import { useAuth } from '../../auth/AuthContext';
7
- import { useWaitsOnMe } from '../../waiting';
8
  import { AccountMenu, AGENT_STUDIO, AI_MONITORING, INTEGRATIONS, LIBRARY, MAIN, SETTINGS, SETUP, type NavItem } from './AppSidebar';
9
  import { envKind, useChosenEnv } from './EnvSwitcher';
10
 
 
1
  import './rail.css';
2
  import { Tooltip } from '@mantine/core';
3
+ import { IconAlertTriangle, IconHandStop } from '@/components/icons';
4
  import { NavLink as RouterLink, useLocation } from 'react-router-dom';
5
  import { useBrand, useHealth, useKill, useRuns } from '../../api/hooks';
6
  import { useAuth } from '../../auth/AuthContext';
7
+ import { useWaitsOnMe } from '../../domain/waiting';
8
  import { AccountMenu, AGENT_STUDIO, AI_MONITORING, INTEGRATIONS, LIBRARY, MAIN, SETTINGS, SETUP, type NavItem } from './AppSidebar';
9
  import { envKind, useChosenEnv } from './EnvSwitcher';
10
 
web/src/components/shell/RunListItem.tsx CHANGED
@@ -1,10 +1,10 @@
1
  import { Tooltip } from '@mantine/core';
2
  import { Link } from 'react-router-dom';
3
  import type { Schemas } from '../../api/client';
4
- import { decisionWords, RUN_STATUS_WORDS } from '../../glossary';
5
- import { runAreas, runTitle, shortWhen } from '../../runName';
6
  import type { EnvKind } from './EnvSwitcher';
7
- import { isWaiting, useWaitsOnMe, waitingForWords } from '../../waiting';
8
  import { runState, StatusDot } from './StatusDot';
9
 
10
  type RunSummary = Schemas['RunSummary'];
 
1
  import { Tooltip } from '@mantine/core';
2
  import { Link } from 'react-router-dom';
3
  import type { Schemas } from '../../api/client';
4
+ import { decisionWords, RUN_STATUS_WORDS } from '../../domain/glossary';
5
+ import { runAreas, runTitle, shortWhen } from '../../domain/runName';
6
  import type { EnvKind } from './EnvSwitcher';
7
+ import { isWaiting, useWaitsOnMe, waitingForWords } from '../../domain/waiting';
8
  import { runState, StatusDot } from './StatusDot';
9
 
10
  type RunSummary = Schemas['RunSummary'];
web/src/components/shell/SidePanel.tsx CHANGED
@@ -1,6 +1,6 @@
1
  import { Drawer, Tabs, Tooltip } from '@mantine/core';
2
  import { useViewportSize } from '@mantine/hooks';
3
- import { IconBroadcast, IconFileReport, IconFileSpreadsheet, IconLayoutSidebarRightCollapse, IconListNumbers, IconPhoto, IconX } from '@/icons';
4
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react';
5
  import { useSearchParams } from 'react-router-dom';
6
  import { useShell, useUiPrefs, type PanelTab } from './prefs';
 
1
  import { Drawer, Tabs, Tooltip } from '@mantine/core';
2
  import { useViewportSize } from '@mantine/hooks';
3
+ import { IconBroadcast, IconFileReport, IconFileSpreadsheet, IconLayoutSidebarRightCollapse, IconListNumbers, IconPhoto, IconX } from '@/components/icons';
4
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react';
5
  import { useSearchParams } from 'react-router-dom';
6
  import { useShell, useUiPrefs, type PanelTab } from './prefs';
web/src/components/shell/TopBar.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { Button } from '@mantine/core';
2
- import { IconChevronLeft, IconMenu2, IconSearch, IconSparkles } from '@/icons';
3
  import type { ReactNode } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { NotificationBell } from '../../notify/NotificationBell';
 
1
  import { Button } from '@mantine/core';
2
+ import { IconChevronLeft, IconMenu2, IconSearch, IconSparkles } from '@/components/icons';
3
  import type { ReactNode } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { NotificationBell } from '../../notify/NotificationBell';
web/src/components/shell/TopNav.tsx CHANGED
@@ -1,11 +1,11 @@
1
  import './topnav.css';
2
  import { Menu, useComputedColorScheme, useMantineColorScheme } from '@mantine/core';
3
- import { IconChevronDown, IconHandStop, IconMoon, IconSearch, IconSun } from '@/icons';
4
  import { Link, NavLink as RouterLink, useLocation, useNavigate } from 'react-router-dom';
5
  import { useBrand, useKill, useRuns } from '../../api/hooks';
6
  import { useAuth } from '../../auth/AuthContext';
7
  import { NotificationBell } from '../../notify/NotificationBell';
8
- import { useWaitsOnMe } from '../../waiting';
9
  import { AccountMenu, AGENT_STUDIO, AI_MONITORING, INTEGRATIONS, LIBRARY, MAIN, SETTINGS, SETUP, type NavItem } from './AppSidebar';
10
  import { EnvSwitcher } from './EnvSwitcher';
11
  import { useShell } from './prefs';
 
1
  import './topnav.css';
2
  import { Menu, useComputedColorScheme, useMantineColorScheme } from '@mantine/core';
3
+ import { IconChevronDown, IconHandStop, IconMoon, IconSearch, IconSun } from '@/components/icons';
4
  import { Link, NavLink as RouterLink, useLocation, useNavigate } from 'react-router-dom';
5
  import { useBrand, useKill, useRuns } from '../../api/hooks';
6
  import { useAuth } from '../../auth/AuthContext';
7
  import { NotificationBell } from '../../notify/NotificationBell';
8
+ import { useWaitsOnMe } from '../../domain/waiting';
9
  import { AccountMenu, AGENT_STUDIO, AI_MONITORING, INTEGRATIONS, LIBRARY, MAIN, SETTINGS, SETUP, type NavItem } from './AppSidebar';
10
  import { EnvSwitcher } from './EnvSwitcher';
11
  import { useShell } from './prefs';
web/src/components/shell/cockpit.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { usePatchWatch, usePodProfile, usePods } from '../../api/hooks';
2
- import { shortWhen } from '../../runName';
3
 
4
  /** The release the readiness is about, as the page's one-line sub-title: "Patch 26C. Test environment release 26C, checked 18 Oct 23:53."
5
  * "Next Oracle update" is shown only when the API gives a date; it is never guessed. The environment cue lives in the top bar. */
 
1
  import { usePatchWatch, usePodProfile, usePods } from '../../api/hooks';
2
+ import { shortWhen } from '../../domain/runName';
3
 
4
  /** The release the readiness is about, as the page's one-line sub-title: "Patch 26C. Test environment release 26C, checked 18 Oct 23:53."
5
  * "Next Oracle update" is shown only when the API gives a date; it is never guessed. The environment cue lives in the top bar. */
web/src/components/shell/panelTabs.tsx CHANGED
@@ -1,19 +1,19 @@
1
  import { Anchor, Button, CopyButton, Group, Skeleton, Stack, Text, Title } from '@mantine/core';
2
- import { IconCheck, IconFileReport, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconListNumbers } from '@/icons';
3
  import { useEffect, useState } from 'react';
4
  import { Link } from 'react-router-dom';
5
- import { MODULE_NAMES } from '../../agents';
6
  import { useGate, useReport, useRun, useRunReadiness, useRunScenarios, useScenario } from '../../api/hooks';
7
  import type { ApproveGate } from '../../api/types';
8
- import { scriptUrl } from '../../pages/RunGuide';
9
- import { RunScripts } from '../../pages/RunData';
10
- import { OUTCOME, ScenarioBody } from '../../pages/ScenarioReview';
11
- import { decisionSentence } from '../../pages/SignOffReport';
12
  import { AiText, Can, DecisionBadge, ErrorAlert, Prio } from '../common';
13
  import { CoworkerAvatar } from '../CoworkerAvatar';
14
- import { coworkerForNode } from '../../coworkers';
15
  import { EmptyState } from './EmptyState';
16
- import '../../pages/report.css';
17
 
18
  const ORIGIN: Record<string, { label: string; tone: string }> = {
19
  library: { label: 'Library', tone: 'neutral' }, generated: { label: 'New', tone: 'lav' }, ai: { label: 'Written by the AI model', tone: 'lav' },
 
1
  import { Anchor, Button, CopyButton, Group, Skeleton, Stack, Text, Title } from '@mantine/core';
2
+ import { IconCheck, IconFileReport, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconListNumbers } from '@/components/icons';
3
  import { useEffect, useState } from 'react';
4
  import { Link } from 'react-router-dom';
5
+ import { MODULE_NAMES } from '../../domain/agents';
6
  import { useGate, useReport, useRun, useRunReadiness, useRunScenarios, useScenario } from '../../api/hooks';
7
  import type { ApproveGate } from '../../api/types';
8
+ import { scriptUrl } from '../../pages/run/RunGuide';
9
+ import { RunScripts } from '../../pages/run/RunData';
10
+ import { OUTCOME, ScenarioBody } from '../../pages/run/ScenarioReview';
11
+ import { decisionSentence } from '../../pages/run/SignOffReport';
12
  import { AiText, Can, DecisionBadge, ErrorAlert, Prio } from '../common';
13
  import { CoworkerAvatar } from '../CoworkerAvatar';
14
+ import { coworkerForNode } from '../../domain/coworkers';
15
  import { EmptyState } from './EmptyState';
16
+ import '../../pages/run/report.css';
17
 
18
  const ORIGIN: Record<string, { label: string; tone: string }> = {
19
  library: { label: 'Library', tone: 'neutral' }, generated: { label: 'New', tone: 'lav' }, ai: { label: 'Written by the AI model', tone: 'lav' },
web/src/{shell.css → components/shell/shell.css} RENAMED
File without changes
web/src/components/shell/shell.test.tsx CHANGED
@@ -56,7 +56,7 @@ describe('shell', () => {
56
  describe('run stage card', () => {
57
  it('is the one guide element, with a stage kicker and a progress line in words', async () => {
58
  const { renderUi } = await import('../../test/utils');
59
- const { StageCard } = await import('../../pages/RunStage');
60
  const { screen } = await import('@testing-library/react');
61
  renderUi(<StageCard stage="judge"><p>body</p></StageCard>);
62
  expect(screen.getByTestId('run-guide')).toHaveAttribute('data-stage', 'judge');
 
56
  describe('run stage card', () => {
57
  it('is the one guide element, with a stage kicker and a progress line in words', async () => {
58
  const { renderUi } = await import('../../test/utils');
59
+ const { StageCard } = await import('../../pages/run/RunStage');
60
  const { screen } = await import('@testing-library/react');
61
  renderUi(<StageCard stage="judge"><p>body</p></StageCard>);
62
  expect(screen.getByTestId('run-guide')).toHaveAttribute('data-stage', 'judge');
web/src/components/ui/motion/alert.tsx CHANGED
@@ -1,7 +1,7 @@
1
  "use client";
2
  // beui.dev/components/motion/alert
3
 
4
- import { IconAlertCircle as AlertCircle, IconCircleCheck as CheckCircle2, IconInfoCircle as Info, IconAlertTriangle as TriangleAlert, IconX as X } from "@/icons";
5
  import { AnimatePresence, type HTMLMotionProps, motion, useReducedMotion } from "motion/react";
6
  import {
7
  createContext,
 
1
  "use client";
2
  // beui.dev/components/motion/alert
3
 
4
+ import { IconAlertCircle as AlertCircle, IconCircleCheck as CheckCircle2, IconInfoCircle as Info, IconAlertTriangle as TriangleAlert, IconX as X } from "@/components/icons";
5
  import { AnimatePresence, type HTMLMotionProps, motion, useReducedMotion } from "motion/react";
6
  import {
7
  createContext,
web/src/components/ui/motion/button/stateful.tsx CHANGED
@@ -1,7 +1,7 @@
1
  "use client";
2
  // beui.dev/components/motion/button
3
 
4
- import { IconCheck as Check, IconLoader2 as Loader2, IconX as X } from "@/icons";
5
  import {
6
  AnimatePresence,
7
  motion,
 
1
  "use client";
2
  // beui.dev/components/motion/button
3
 
4
+ import { IconCheck as Check, IconLoader2 as Loader2, IconX as X } from "@/components/icons";
5
  import {
6
  AnimatePresence,
7
  motion,
web/src/{agents.test.ts → domain/agents.test.ts} RENAMED
File without changes
web/src/{agents.ts → domain/agents.ts} RENAMED
File without changes
web/src/{coworkers.test.ts → domain/coworkers.test.ts} RENAMED
File without changes
web/src/{coworkers.ts → domain/coworkers.ts} RENAMED
File without changes
web/src/{desktop.ts → domain/desktop.ts} RENAMED
File without changes
web/src/{glossary.ts → domain/glossary.ts} RENAMED
File without changes
web/src/{podAreas.ts → domain/podAreas.ts} RENAMED
@@ -3,7 +3,7 @@
3
  // - an Oracle Fusion pod offers the areas discovery found on it (in use, or present with no records yet), as the server
4
  // reports them in run_areas; before the first discovery, every area the server knows (the run's scout discovers);
5
  // - any other pod offers what the admin registered for it, else every area.
6
- import type { Pod } from './api/hooks';
7
 
8
  export const ALL_AREAS = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP', 'CX'];
9
 
 
3
  // - an Oracle Fusion pod offers the areas discovery found on it (in use, or present with no records yet), as the server
4
  // reports them in run_areas; before the first discovery, every area the server knows (the run's scout discovers);
5
  // - any other pod offers what the admin registered for it, else every area.
6
+ import type { Pod } from '../api/hooks';
7
 
8
  export const ALL_AREAS = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP', 'CX'];
9
 
web/src/{runName.ts → domain/runName.ts} RENAMED
File without changes
web/src/{waiting.ts → domain/waiting.ts} RENAMED
@@ -2,7 +2,7 @@
2
  // gate's permission may answer it (consultant: approve the scenarios; QA approver: decide the failures; admin: both).
3
  // "Waiting for you" counts only the gates the signed-in user may answer; other runs say whom they wait for.
4
  import { useCallback } from 'react';
5
- import { useAuthOptional } from './auth/AuthContext';
6
 
7
  const TERMINAL = ['completed', 'failed', 'killed', 'cancelled'];
8
  export const GATE_PERM: Record<string, string> = { approve_cases: 'gate.approve_cases', human_review: 'gate.human_review' };
 
2
  // gate's permission may answer it (consultant: approve the scenarios; QA approver: decide the failures; admin: both).
3
  // "Waiting for you" counts only the gates the signed-in user may answer; other runs say whom they wait for.
4
  import { useCallback } from 'react';
5
+ import { useAuthOptional } from '../auth/AuthContext';
6
 
7
  const TERMINAL = ['completed', 'failed', 'killed', 'cancelled'];
8
  export const GATE_PERM: Record<string, string> = { approve_cases: 'gate.approve_cases', human_review: 'gate.human_review' };
web/src/main.tsx CHANGED
@@ -3,20 +3,20 @@ import '@mantine/notifications/styles.css';
3
  import '@fontsource-variable/manrope/wght.css';
4
  import '@fontsource-variable/space-grotesk/wght.css';
5
  import '@fontsource-variable/geist-mono/wght.css'; // monospace for identifiers
6
- import './tokens.css'; // design tokens: the one source of colour, type, space and size (docs/DESIGN_SYSTEM.md)
7
- import './styles.css';
8
- import './apple.css';
9
- import './apple-components.css';
10
- import './apple-screens.css';
11
- import './apple-run.css';
12
- import './apple-pages.css';
13
- import './surfaces.css'; // shared pw-* surface utilities (cards, stat cards, status pills, tables)
14
- import './type.css'; // the display-mono type layer on top of the surfaces
15
- import './beui.css'; // beUI / shadcn layer on the app's tokens (Tailwind 4 theme + utilities, no reset)
16
- import './layout.css'; // the layout layer: framed buttons, cards that hold their content, every screen size
17
- import './run-polish.css'; // the test run page in the reviewed design (one alignment line, one button system)
18
  import './components/wensity/wensity.css'; // Wensity UI components take the app's tokens
19
- import './ember.css'; // the Ember look (after Sheryians): loaded last
20
  import { MantineProvider } from '@mantine/core';
21
  import { Notifications } from '@mantine/notifications';
22
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
 
3
  import '@fontsource-variable/manrope/wght.css';
4
  import '@fontsource-variable/space-grotesk/wght.css';
5
  import '@fontsource-variable/geist-mono/wght.css'; // monospace for identifiers
6
+ import './styles/00-tokens.css'; // design tokens: the one source of colour, type, space and size (docs/DESIGN_SYSTEM.md)
7
+ import './styles/01-base.css';
8
+ import './styles/10-apple.css';
9
+ import './styles/11-apple-components.css';
10
+ import './styles/12-apple-screens.css';
11
+ import './styles/13-apple-run.css';
12
+ import './styles/14-apple-pages.css';
13
+ import './styles/20-surfaces.css'; // shared pw-* surface utilities (cards, stat cards, status pills, tables)
14
+ import './styles/21-type.css'; // the display-mono type layer on top of the surfaces
15
+ import './styles/30-tailwind.css'; // beUI / shadcn layer on the app's tokens (Tailwind 4 theme + utilities, no reset)
16
+ import './styles/40-layout.css'; // the layout layer: framed buttons, cards that hold their content, every screen size
17
+ import './styles/50-run-polish.css'; // the test run page in the reviewed design (one alignment line, one button system)
18
  import './components/wensity/wensity.css'; // Wensity UI components take the app's tokens
19
+ import './styles/90-theme.css'; // the current look (Astra, CES blue): loaded last; see web/README.md "Styling"
20
  import { MantineProvider } from '@mantine/core';
21
  import { Notifications } from '@mantine/notifications';
22
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
web/src/notify/NotificationBell.tsx CHANGED
@@ -1,9 +1,9 @@
1
  import { Button, Popover, Switch } from '@mantine/core';
2
- import { IconBell } from '@/icons';
3
  import { useState } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { CoworkerAvatar } from '../components/CoworkerAvatar';
6
- import { COWORKERS } from '../coworkers';
7
  import { toPath, useBrowserPref, useNotifications, whenWords, type Notice } from './useNotifications';
8
  import './notify.css';
9
 
 
1
  import { Button, Popover, Switch } from '@mantine/core';
2
+ import { IconBell } from '@/components/icons';
3
  import { useState } from 'react';
4
  import { Link } from 'react-router-dom';
5
  import { CoworkerAvatar } from '../components/CoworkerAvatar';
6
+ import { COWORKERS } from '../domain/coworkers';
7
  import { toPath, useBrowserPref, useNotifications, whenWords, type Notice } from './useNotifications';
8
  import './notify.css';
9
 
web/src/notify/NotificationsSettings.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { Button, Group, Switch, Text } from '@mantine/core';
2
- import { IconSend } from '@/icons';
3
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { getJson, sendJson } from '../api/client';
5
  import { ErrorAlert, fmtTs } from '../components/common';
 
1
  import { Button, Group, Switch, Text } from '@mantine/core';
2
+ import { IconSend } from '@/components/icons';
3
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { getJson, sendJson } from '../api/client';
5
  import { ErrorAlert, fmtTs } from '../components/common';
web/src/notify/TelegramCard.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { Button, Group, Text } from '@mantine/core';
2
- import { IconBrandTelegram, IconCircleCheck, IconSearch, IconSend } from '@/icons';
3
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { useState } from 'react';
5
  import { getJson, sendJson } from '../api/client';
 
1
  import { Button, Group, Text } from '@mantine/core';
2
+ import { IconBrandTelegram, IconCircleCheck, IconSearch, IconSend } from '@/components/icons';
3
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { useState } from 'react';
5
  import { getJson, sendJson } from '../api/client';
web/src/notify/TelegramLinkCard.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import { Button, CopyButton, Group, Text } from '@mantine/core';
2
- import { IconBrandTelegram, IconCheck, IconCopy, IconLink, IconLinkOff } from '@/icons';
3
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { useEffect, useState } from 'react';
5
  import { getJson, sendJson } from '../api/client';
 
1
  import { Button, CopyButton, Group, Text } from '@mantine/core';
2
+ import { IconBrandTelegram, IconCheck, IconCopy, IconLink, IconLinkOff } from '@/components/icons';
3
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
4
  import { useEffect, useState } from 'react';
5
  import { getJson, sendJson } from '../api/client';
web/src/pages/{fixes.test.tsx → __tests__/fixes.test.tsx} RENAMED
@@ -1,8 +1,8 @@
1
  import { fireEvent, screen, waitFor } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
- import type { Failure } from '../api/types';
4
- import { jsonResponse, renderUi } from '../test/utils';
5
- import { FailureReview, isDecided } from './FailureReview';
6
 
7
  const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
8
  const ME = { id: 1, username: 'qa', role: 'qa_approver', permissions: ['read', 'gate.human_review', 'evidence.read'] };
@@ -56,7 +56,7 @@ describe('failure review: every pending failure needs a decision', () => {
56
 
57
  describe('waiting counts follow the role', () => {
58
  it('a consultant waits on approvals only, a QA approver on failure decisions, an admin on both', async () => {
59
- const { waitsOn, waitingForWords } = await import('../waiting');
60
  const approve = { status: 'waiting_approval', pending_gate: 'approve_cases' };
61
  const judge = { status: 'waiting_review', pending_gate: 'human_review' };
62
  const as = (perms: string[]) => (p: string) => perms.includes(p);
@@ -89,7 +89,7 @@ describe('scenario review: explicit skip-all, saved decisions, each scenario onc
89
  it('lists each scenario once and asks before skipping all; the answer then skips every scenario explicitly', async () => {
90
  const posts: unknown[] = [];
91
  mock(posts);
92
- const { ScenarioReview } = await import('./ScenarioReview');
93
  renderUi(<ScenarioReview id="r2" waiting />, { auth: true });
94
  await screen.findByTestId('approval-card-AI-1');
95
  expect(screen.queryAllByTestId('scenario-AI-1')).toHaveLength(0); // the AI scenario is a card, not also a row
@@ -105,7 +105,7 @@ describe('scenario review: explicit skip-all, saved decisions, each scenario onc
105
 
106
  it('keeps unsent decisions for the run in this browser tab', async () => {
107
  mock([]);
108
- const { ScenarioReview } = await import('./ScenarioReview');
109
  const first = renderUi(<ScenarioReview id="r3" waiting />, { auth: true });
110
  await screen.findByTestId('approval-card-AI-1');
111
  fireEvent.click(screen.getByRole('button', { name: 'Approve Title AI-1' }));
@@ -118,7 +118,7 @@ describe('scenario review: explicit skip-all, saved decisions, each scenario onc
118
 
119
  it('says so in words when the scenarios cannot be loaded, with Try again', async () => {
120
  mock([], 500);
121
- const { ScenarioReview } = await import('./ScenarioReview');
122
  renderUi(<ScenarioReview id="r4" waiting />, { auth: true });
123
  const box = await screen.findByTestId('review-load-error');
124
  expect(box).toHaveTextContent('Something went wrong on the server.');
@@ -130,7 +130,7 @@ describe('Test environments: add an Oracle Fusion pod', () => {
130
  afterEach(() => vi.restoreAllMocks());
131
 
132
  it('podFormErrors: https address and a name of 2+ characters', async () => {
133
- const { podFormErrors } = await import('./PodsPage');
134
  expect(podFormErrors({ name: 'A', base_url: 'https://', modules: ['AP'] })).toMatchObject({ name: expect.any(String), base_url: expect.any(String) });
135
  expect(podFormErrors({ name: 'Acme', base_url: 'http://acme.example.com', modules: ['AP'] }).base_url).toBe('The address must start with https://');
136
  expect(podFormErrors({ name: 'Acme', base_url: 'https://acme.fa.ocs.oraclecloud.com', modules: ['AP'] })).toEqual({});
@@ -152,7 +152,7 @@ describe('Test environments: add an Oracle Fusion pod', () => {
152
  if (u.includes('/api/pods')) return jsonResponse([]);
153
  return jsonResponse({});
154
  });
155
- const { PodsPage } = await import('./PodsPage');
156
  renderUi(<PodsPage />, { auth: true, route: '/pods?add=1' });
157
  const name = await screen.findByRole('textbox', { name: /^Name/ });
158
  fireEvent.change(name, { target: { value: 'A' } });
 
1
  import { fireEvent, screen, waitFor } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
+ import type { Failure } from '../../api/types';
4
+ import { jsonResponse, renderUi } from '../../test/utils';
5
+ import { FailureReview, isDecided } from '../run/FailureReview';
6
 
7
  const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
8
  const ME = { id: 1, username: 'qa', role: 'qa_approver', permissions: ['read', 'gate.human_review', 'evidence.read'] };
 
56
 
57
  describe('waiting counts follow the role', () => {
58
  it('a consultant waits on approvals only, a QA approver on failure decisions, an admin on both', async () => {
59
+ const { waitsOn, waitingForWords } = await import('../../domain/waiting');
60
  const approve = { status: 'waiting_approval', pending_gate: 'approve_cases' };
61
  const judge = { status: 'waiting_review', pending_gate: 'human_review' };
62
  const as = (perms: string[]) => (p: string) => perms.includes(p);
 
89
  it('lists each scenario once and asks before skipping all; the answer then skips every scenario explicitly', async () => {
90
  const posts: unknown[] = [];
91
  mock(posts);
92
+ const { ScenarioReview } = await import('../run/ScenarioReview');
93
  renderUi(<ScenarioReview id="r2" waiting />, { auth: true });
94
  await screen.findByTestId('approval-card-AI-1');
95
  expect(screen.queryAllByTestId('scenario-AI-1')).toHaveLength(0); // the AI scenario is a card, not also a row
 
105
 
106
  it('keeps unsent decisions for the run in this browser tab', async () => {
107
  mock([]);
108
+ const { ScenarioReview } = await import('../run/ScenarioReview');
109
  const first = renderUi(<ScenarioReview id="r3" waiting />, { auth: true });
110
  await screen.findByTestId('approval-card-AI-1');
111
  fireEvent.click(screen.getByRole('button', { name: 'Approve Title AI-1' }));
 
118
 
119
  it('says so in words when the scenarios cannot be loaded, with Try again', async () => {
120
  mock([], 500);
121
+ const { ScenarioReview } = await import('../run/ScenarioReview');
122
  renderUi(<ScenarioReview id="r4" waiting />, { auth: true });
123
  const box = await screen.findByTestId('review-load-error');
124
  expect(box).toHaveTextContent('Something went wrong on the server.');
 
130
  afterEach(() => vi.restoreAllMocks());
131
 
132
  it('podFormErrors: https address and a name of 2+ characters', async () => {
133
+ const { podFormErrors } = await import('../setup/PodsPage');
134
  expect(podFormErrors({ name: 'A', base_url: 'https://', modules: ['AP'] })).toMatchObject({ name: expect.any(String), base_url: expect.any(String) });
135
  expect(podFormErrors({ name: 'Acme', base_url: 'http://acme.example.com', modules: ['AP'] }).base_url).toBe('The address must start with https://');
136
  expect(podFormErrors({ name: 'Acme', base_url: 'https://acme.fa.ocs.oraclecloud.com', modules: ['AP'] })).toEqual({});
 
152
  if (u.includes('/api/pods')) return jsonResponse([]);
153
  return jsonResponse({});
154
  });
155
+ const { PodsPage } = await import('../setup/PodsPage');
156
  renderUi(<PodsPage />, { auth: true, route: '/pods?add=1' });
157
  const name = await screen.findByRole('textbox', { name: /^Name/ });
158
  fireEvent.change(name, { target: { value: 'A' } });
web/src/pages/{mustfix.test.tsx → __tests__/mustfix.test.tsx} RENAMED
@@ -1,8 +1,8 @@
1
  import { act, screen } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
- import { ScenarioSteps } from '../components/shell/panelTabs';
4
- import { jsonResponse, renderUi } from '../test/utils';
5
- import { ScenarioReview } from './ScenarioReview';
6
 
7
  const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
8
  const scenario = { id: 'P2P-APR-001', title: 'Requisition below threshold approved by first-level approver', module: 'P2P', process: 'Requisition', step: 'Requisition',
 
1
  import { act, screen } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
+ import { ScenarioSteps } from '../../components/shell/panelTabs';
4
+ import { jsonResponse, renderUi } from '../../test/utils';
5
+ import { ScenarioReview } from '../run/ScenarioReview';
6
 
7
  const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
8
  const scenario = { id: 'P2P-APR-001', title: 'Requisition below threshold approved by first-level approver', module: 'P2P', process: 'Requisition', step: 'Requisition',
web/src/pages/{recovery.test.tsx → __tests__/recovery.test.tsx} RENAMED
@@ -1,10 +1,10 @@
1
  import { act, screen } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
- import { jsonResponse, renderUi } from '../test/utils';
4
- import { LiveView, SLOW_START_MS } from './LiveView';
5
- import { PodsPage } from './PodsPage';
6
- import { patchCadence } from '../runName';
7
- import { scheduleSentence } from './ScheduledRunsPage';
8
 
9
  const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
10
  const me = { id: 1, username: 'a', role: 'admin', permissions: ['read', 'evidence.read', 'admin', 'run.start'] };
 
1
  import { act, screen } from '@testing-library/react';
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
+ import { jsonResponse, renderUi } from '../../test/utils';
4
+ import { LiveView, SLOW_START_MS } from '../run/LiveView';
5
+ import { PodsPage } from '../setup/PodsPage';
6
+ import { patchCadence } from '../../domain/runName';
7
+ import { scheduleSentence } from '../runs/ScheduledRunsPage';
8
 
9
  const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
10
  const me = { id: 1, username: 'a', role: 'admin', permissions: ['read', 'evidence.read', 'admin', 'run.start'] };