The L10 heartbeat loop (run_continuous) had no process to drive it; `core always-on` is that process — the T-experience spine made runnable. It ticks idle_tick on a wall-clock cadence so the engine LIVES and LEARNS with no user turn, persists lived_life.json (the workbench Lived Life surface) + the checkpoint, and resumes the SAME life on restart. - chat/always_on.py: run_continuous gains unbounded operation (heartbeats=None, runs until stop) + an interruptible inter-beat wait (_sleep_until_stop) so shutdown latency is one slice, not the cadence interval. Persists the run's identity pack ids (resume-verdict faithfulness). on_heartbeat is now best-effort (a broken log pipe can't kill the life). - chat/always_on_daemon.py (new): the daemon shell — a single-instance OS lock (fcntl.flock: kernel-held, atomic, auto-released on death — no stale window, no PID-reuse, no half-written race), SIGINT/SIGTERM -> graceful stop (handlers saved/restored), the continuous-life config FORCED on, ephemeral (--no-load-state) writes no durable artifact. Foreground + explicit: no hidden background execution (CLAUDE.md); only writes the engine-state dir it was given. - core/cli.py: `core always-on [--interval --max-beats --no-load-state --quiet]` with per-beat + summary logging; validates --interval; reports IdentityContinuityError / IncompatibleEngine StateError (the "different life / newer build" cases) as clean refusals, not tracebacks. - workbench/readers.py: ENGINE_STATE_ROOT now honors CORE_ENGINE_STATE_DIR (= the daemon's resolved dir), so the workbench can't be split-brained (reading REPO_ROOT/engine_state while the daemon writes elsewhere); the Lived Life resume verdict recomputes from the persisted pack config, not a default config (no false substrate_changed for a non-default-pack life). - Lived Life absence state now points at the real `core always-on` command (loop closed). Adversarial 4-lens review (lock/concurrency, signals/shutdown, invariants/trust-boundary, test-vacuity/CLI) caught 16 findings; this fixes all real ones — the HIGH lock races (two daemons over one life), the env split-brain, the IO-kill, the uncaught identity/schema errors, the unvalidated interval, the ephemeral-artifact shadow, and the resume-verdict pack-id bug — and closes the two test-coverage gaps it flagged (real SIGTERM path + config-forcing-at-the- runtime boundary). Tests (non-vacuous): 11 daemon (flock live-holder refusal, leftover-lock reclaim, unbounded+ stop, interruptible sleep, forced-config-at-boundary, no-load-state guard, REAL SIGTERM subprocess) + the reader pack-id discrimination test (fails under the old default-config bug). 245 workbench+invariants+always-on Python green; frontend tsc + vitest green; `core always-on` verified end-to-end (bounded, real SIGTERM graceful stop, interval rejection). engine_state/always_on.lock is runtime state (gitignored, ADR-0146 pattern). |
||
|---|---|---|
| .. | ||
| e2e | ||
| preview | ||
| public/fonts | ||
| scripts | ||
| src | ||
| .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 insrc/app/<route>/.src/app/routes.tsis the single route registry (feeds App, LeftNav, command palette, shortcuts, and conformance).src/api/— apiFetch client, TanStack Query hookssrc/types/— TypeScript mirrors of Python schemas (src/types/api.ts)src/routes/— the Chat route entrysrc/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