core/workbench-ui
Shay 71eed1b73d
workbench(vault): exact-CGA recall evidence for persisted entries (#766)
Close the deferred Vault item 4: a read-only endpoint proving a selected
vault entry is recallable by CORE's actual exact CGA machinery, surfaced
in the entry inspector.

Backend (read-only, cold-persisted only):
- GET /vault/entries/{index}/recall rehydrates the persisted VaultStore
  (VaultStore.from_dict — bit-exact versors, no reprojection) and runs the
  real VaultStore.recall using the entry's own stored versor as the query.
  Exact cga_inner scan — never ANN / cosine / approximate.
- recall's +inf exact-self-match sentinel never crosses the boundary: the
  genuine finite cga_inner is reported plus an exact_self_match flag. The
  raw versor never leaves the engine — only content-addressed digests.
- Trust boundary: caller-controlled index -> 404 (out of range / non-int);
  absent persisted snapshot -> 501. The file is never written; the live
  runtime is never touched; recall is deterministic over persisted bytes.

Frontend:
- "Exact CGA Recall" inspector panel, collapsed by default so the read is
  opt-in (the query hook only mounts on expand). Copy says "exact CGA
  recall" / cga_inner — never similarity / relevance / score / ANN /
  cosine. Honestly surfaces that a byte-identical self-match is promoted
  ahead of metric ranking (CGA null-vector self inner-product ~0).

INV-24: register workbench/readers.py in VAULT_RECALL_SITES as
EVIDENCE_TELEMETRY (operator inspection evidence, not claim-shaping), and
tighten the recall-site detector to recognise VaultStore.from_dict factory
bindings so the obligation is real rather than silently bypassed.

Tests: backend 501/404/self-recall/determinism/no-mutation/JSON-safety +
API status codes; frontend collapsed-doctrine + expanded self-recall
evidence. Full workbench suite (192) + architectural invariants (61) +
vault-touching vitest (70) all green.
2026-06-15 02:28:37 -07:00
..
e2e
preview
public/fonts
scripts
src workbench(vault): exact-CGA recall evidence for persisted entries (#766) 2026-06-15 02:28:37 -07:00
.gitignore
api-schema-snapshot.json
enum-snapshot.json
index.html
package.json
playwright.config.ts
pnpm-lock.yaml
postcss.config.js
README.md
schema-snapshot.json
tailwind.config.ts
tsconfig.json
tsconfig.node.json
vite.config.ts

CORE Workbench UI

React/Vite/TypeScript frontend for CORE Workbench — a local operator/auditor UI over the deterministic engine. 14 registry-driven routes (src/app/routes.ts): chat; trace (per-turn pipeline / field-invariant / leeway / evidence-bundle tabs); the guided determinism tour; replay (hash-to-hash); demos; proposals + HITL ratification; evals (wrong=0 ledger); calibration (gold-tether arena); runs; vault; packs; and audit. Read-only, with allowlisted execution only.

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, ApiErrorBoundary, and the route surfaces in src/app/<route>/. src/app/routes.ts is the single route registry (feeds App, LeftNav, command palette, shortcuts, and conformance).
  • src/api/ — apiFetch client, TanStack Query hooks
  • src/types/ — TypeScript mirrors of Python schemas (src/types/api.ts)
  • src/routes/ — the Chat route entry
  • src/design/ — design-system substrate (tokens, primitives, doctrine gates)

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