Full 'pnpm test' previously hung indefinitely (killed at CI walls, misdiagnosed as teardown slowness). Two root causes found and fixed: 1. RightInspector.test.tsx called setSubject() during render with a fresh object every pass -> infinite synchronous render loop (100% CPU spin, blocks the event loop so no timeout can fire). Moved into useEffect. 2. Test QueryClients used retry:false but default gcTime (5 min) -> a live GC timer per cached query kept workers from exiting. New shared createTestQueryClient() with gcTime:0 adopted across all 7 test files. Hardening so any future leak fails loudly instead of hanging: - vite.config.ts: testTimeout/hookTimeout 10s, teardownTimeout 5s - useManagedTimeout hook owns previously-bare setTimeouts in DigestBadge, MetadataTable, RatificationCommandPanel (4 sites), CommandPalette focus First-ever frontend CI lane (.github/workflows/workbench-ui.yml): path-filtered to workbench-ui/** AND the workflow file itself, pnpm install --frozen-lockfile + build + vitest, timeout-minutes 15. Honesty fix: KeyboardHelp no longer advertises j/k, /, Enter (unbuilt until R0d restores them registry-backed). Route conformance test (ADR-0162 §6, executable): empty/error/loading contracts asserted for Chat/Proposals/Evals/Replay; fixed the two gaps it caught (ReplayRoute bare-div error branch -> ErrorState contract; ArtifactList empty state gained a next action). Result: 27 files / 181 tests pass, suite EXITS in 4.9s wall-clock (was: indefinite hang). |
||
|---|---|---|
| .. | ||
| preview | ||
| public/fonts | ||
| scripts | ||
| src | ||
| .gitignore | ||
| api-schema-snapshot.json | ||
| enum-snapshot.json | ||
| index.html | ||
| package.json | ||
| pnpm-lock.yaml | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
CORE Workbench UI
React/Vite/TypeScript frontend for CORE Workbench — a local operator UI for inspecting engine state, proposals, evals, and audit trails.
Local development
# Terminal 1 — start the API (W-026)
uv run core workbench api
# Terminal 2 — start the frontend
cd workbench-ui
pnpm install
pnpm dev # http://127.0.0.1:5173
Custom API URL
VITE_WORKBENCH_API_URL=http://127.0.0.1:9000 pnpm dev
Design system baseline
pnpm preview # Serves dist/ on http://127.0.0.1:4173
# Navigate to /preview for the Branch 1 design-system baseline
Tests
pnpm test # Vitest unit + component tests
pnpm test:enum-coverage # Badge enum coverage (requires uv)
Schema drift detection
The TypeScript types in src/types/api.ts mirror workbench/schemas.py.
To check for drift after Python schema changes:
# From repo root
uv run python scripts/dump-api-schemas.py
# Then run: pnpm test (api.test.ts catches field-level drift)
Architecture
src/app/— Shell, TopBar, LeftNav, StatusFooter, ApiErrorBoundarysrc/api/— apiFetch client, TanStack Query hookssrc/types/— TypeScript mirrors of Python schemassrc/routes/— Route placeholder componentssrc/design/— Branch 1 design-system substrate (DO NOT MODIFY except EmptyState and CommandPalette)
ADR cross-references
- ADR-0160 — Workbench v1 architecture
- ADR-0162 — Design substrate (Branch 1)
- ADR-0156, ADR-0157, ADR-0158 — Engine-state checkpoint and reboot audit trail