core/docs/workbench
Shay e89463a975
feat(workbench-ui): design system v1 scaffold (ADR-0162 Branch 1) (#295)
* feat(workbench-ui): design system v1 scaffold

* fix(workbench): close R1 (GroundingSource enum coverage) + R4 (digest test)

R1 — Promote GroundingSource to a typed Literal in core/epistemic_state.py
so it has the same single-source-of-truth shape as ReviewState.  The
existing epistemic_state_for_grounding_source() function already
enumerates the six labels (pack, teaching, vault, partial, oov, none);
this codifies them.

scripts/dump-enums.py now snapshots GroundingSource via the existing
literal_values helper.  workbench-ui's enumCoverage.test.ts gains a
fourth assertion that the badge mapping matches the Python source
1:1.  Adding a grounding-source value on the Python side without
updating the badge fails the build-time test loud — same discipline
as the other three enums.

R4 — Add an explicit DigestBadge test to StableJsonViewer.test.tsx:
asserts the badge text matches the SHA-256 prefix of the source bytes,
and clicking the badge copies the FULL digest (not the truncated
prefix).  Recomputes the expected digest via crypto.subtle to avoid
hard-coding a hex string that could drift.

R2 (component-level reduced-motion enforcement), R3 (EmptyState
copy-CLI affordance), and R5 (`uv run core` packaging paper cut) are
deferred — R2/R3 become meaningful with W-027/W-029, R5 is a
packaging-layer concern outside this PR's scope.

Validation:
- pnpm test: 19 passed (was 17, +1 enum coverage, +1 digest test)
- pnpm build: clean
- pnpm test:enum-coverage: 4 passed
- core test --suite smoke -q: 67 passed
2026-05-26 11:33:27 -07:00
..
acceptance-gates.md feat(W-026): read-only workbench API (ADR-0160 Phase 1) (#292) 2026-05-26 10:16:35 -07:00
api-contract-v1.md feat(W-026): read-only workbench API (ADR-0160 Phase 1) (#292) 2026-05-26 10:16:35 -07:00
core-workbench-v1-blueprint.md docs(workbench): CORE Workbench v1 planning architecture (ADR-0160) 2026-05-26 08:22:38 -07:00
data-shapes-v1.md docs(workbench): CORE Workbench v1 planning architecture (ADR-0160) 2026-05-26 08:22:38 -07:00
design-system.md feat(workbench-ui): design system v1 scaffold (ADR-0162 Branch 1) (#295) 2026-05-26 11:33:27 -07:00
implementation-plan.md feat(W-026): read-only workbench API (ADR-0160 Phase 1) (#292) 2026-05-26 10:16:35 -07:00
README.md feat(W-026): read-only workbench API (ADR-0160 Phase 1) (#292) 2026-05-26 10:16:35 -07:00
ui-component-map.md docs(workbench): CORE Workbench v1 planning architecture (ADR-0160) 2026-05-26 08:22:38 -07:00

CORE Workbench v1

CORE Workbench is the first dedicated operator/auditor UI for CORE.

It is intentionally designed as:

  • a cognition observatory,
  • replay debugger,
  • proposal review workstation,
  • deterministic eval console,
  • and audit surface.

It is NOT intended to be a generic chatbot shell.


Document Index

Doctrine

  • ../decisions/ADR-0160-core-workbench-v1.md

Defines:

  • product doctrine
  • trust boundaries
  • architecture direction
  • module scope
  • acceptance criteria

UX Blueprint

  • core-workbench-v1-blueprint.md

Defines:

  • visual philosophy
  • interaction model
  • module behavior
  • navigation
  • replay/proposal/eval UX

Implementation Plan

  • implementation-plan.md

Defines:

  • W-026 through W-031
  • phase sequencing
  • backend/frontend constraints
  • release criteria

API Contract

  • api-contract-v1.md

Defines:

  • read-only endpoint surface
  • request/response envelopes
  • mutation boundaries
  • runtime/trace/proposal/eval/replay routes

Data Shapes

  • data-shapes-v1.md

Defines:

  • typed UI-facing shapes
  • proposal structures
  • replay structures
  • artifact references
  • trust badges

UI Component Map

  • ui-component-map.md

Defines:

  • page layout
  • navigation structure
  • shared components
  • trace drawer structure
  • proposal/eval/replay modules

Acceptance Gates

  • acceptance-gates.md

Defines:

  • implementation gates
  • red flags
  • release conditions
  • mutation restrictions

Core Principles

Replay before persuasion

The UI should make replay evidence more important than aesthetic persuasion.

Calm by default

The interface should remain quiet and precise.

Progressive disclosure

The system should become more transparent the deeper an operator inspects.

Proposal is not ratification

The UI must preserve ADR-0057 review doctrine.

Read-only first

The first workbench phases prioritize visibility and auditability before any mutation capability.


Current Status

The planning package is merged on main via 404e694 (docs(workbench): CORE Workbench v1 planning architecture (ADR-0160)).

The prototype branch feat/w026-workbench-readonly-api is superseded and must not be used as the implementation base. It mixed W-026 with frontend and trace work, added auth and web-framework dependencies before the local read-only boundary was proven, and included placeholder replay/trace behavior that could be mistaken for evidence.

The next accepted implementation starts clean from main with W-026 only: dataclass schemas, repo-root-constrained readers, a standard-library local HTTP API, and route/read-model tests. W-027 and later phases build on that boundary after it is accepted.


W-026 Local Runbook

Start the read-only local API:

core workbench api

Verify liveness:

curl http://127.0.0.1:8765/health

Inspect each W-026 endpoint family:

curl http://127.0.0.1:8765/runtime/status
curl http://127.0.0.1:8765/artifacts
curl http://127.0.0.1:8765/artifacts/evals/contemplation_quality/contract.md
curl http://127.0.0.1:8765/proposals
curl http://127.0.0.1:8765/evals
curl http://127.0.0.1:8765/evals/contemplation_quality
curl -X POST http://127.0.0.1:8765/evals/run \
  -H 'Content-Type: application/json' \
  -d '{"lane":"contemplation_quality","version":"v1","split":"public"}'

Bind to a different local port:

core workbench api --port 9000

Non-local binds require an explicit operator flag:

core workbench api --host 0.0.0.0 --allow-nonlocal-bind

Initial Work Queue

Work Item Goal
W-026 Read-only API
W-027 Frontend shell
W-028 Chat + trace drawer
W-029 Proposal queue
W-030 Eval center
W-031 Replay theater

Guiding Question

The correct operator reaction to the workbench should be:

“Wait… I can actually inspect and replay the cognition.”

not:

“Cool chatbot.”