mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 01:13:55 +00:00
b10c38514f
Every mutator in runtimeState.ts now has a *Core function that receives the state it operates on and touches nothing else. The module keeps the singleton and exports thin wrappers with the existing names and signatures, so all call sites (EventTimer, runtime service, rundown service) are unchanged and the hot path gains no allocations. This also removes the partial-injection hazards of the previous seams: start(state) wrote timer.phase, offset and expected times to the module singleton rather than the received state, and stop(state) cleared the singleton. Production behaviour is identical since production always operated on the singleton; the characterisation harness and snapshots are untouched and prove it. The cores can now be unit tested against a plain state object without the singleton, module resets or the rundown cache. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PVTnCfesGNGwPQJwJ9FwoD