core/workbench
Shay 18e25580f3 feat(l10): always-on daemon/CLI — the process that runs the continuous-life heartbeat
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).
2026-06-14 17:33:37 -07:00
..
__init__.py feat(W-026): read-only workbench API (ADR-0160 Phase 1) (#292) 2026-05-26 10:16:35 -07:00
api.py feat(workbench): Lived Life surface — the always-on heartbeat made felt (read-only, persist-first) 2026-06-14 16:45:03 -07:00
calibration.py feat(workbench): land B3.5-b/c/d/e — calibration evidence subject, B4a leeway gate, docs; runner-reproducible practice artifact 2026-06-13 07:36:44 -07:00
evidence_bundle.py feat(workbench): Wave M D3 — shareable evidence bundles (reproducibility as a deliverable) 2026-06-13 17:26:26 -07:00
field_evidence.py feat(workbench): Wave M C3 field substrate — persist-first field evidence 2026-06-13 16:26:46 -07:00
journal.py feat(workbench): Wave M C3 field substrate — persist-first field evidence 2026-06-13 16:26:46 -07:00
lived_life.py feat(workbench): Lived Life surface — the always-on heartbeat made felt (read-only, persist-first) 2026-06-14 16:45:03 -07:00
logos.py feat(workbench): add read-only core-logos readers 2026-06-14 11:43:39 -07:00
pipeline_record.py feat(workbench): Wave M Phase C legibility — pipeline record, contemplation, identity continuity 2026-06-13 15:44:31 -07:00
readers.py feat(l10): always-on daemon/CLI — the process that runs the continuous-life heartbeat 2026-06-14 17:33:37 -07:00
replay.py feat(workbench): Wave M C3 field substrate — persist-first field evidence 2026-06-13 16:26:46 -07:00
schemas.py feat(workbench): Lived Life surface — the always-on heartbeat made felt (read-only, persist-first) 2026-06-14 16:45:03 -07:00
server.py feat(workbench): Wave M Phase C legibility — pipeline record, contemplation, identity continuity 2026-06-13 15:44:31 -07:00
tour.py feat(workbench): Wave M D1+D2 — guided determinism tour (provider-agnostic) 2026-06-13 19:39:41 -07:00