Files
ontime/apps
Claude b10c38514f refactor: parameterize runtimeState mutators on an explicit state
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
2026-07-04 09:55:56 +00:00
..
2026-07-01 13:20:04 +02:00
2026-07-01 13:20:04 +02:00
2026-07-01 13:20:04 +02:00
2026-03-08 16:22:12 +01:00