fromSnapshot

open fun fromSnapshot(bytes: ByteArray): S

Rebuilds the authoritative game state from a Raft snapshot install's embedded bytes.

Called by SpeculativeSequencer on a TurnEvent.Reset (log compaction): the sequencer discards its pending buffer and replaces its authoritative state with the value this returns, then folds later committed actions on top.

bytes is the consumer's own snapshot envelope (TurnEvent.Reset's us.tractat.kuilt.raft.Snapshot.state) — the game state is typically a sub-field, not the whole blob, so extract it rather than decoding bytes wholesale as S.

The default throws: a consumer that never enables log compaction need not implement this, and one that does but forgets will fail loud the first time a snapshot install arrives rather than silently corrupting state.