Expand description
Pure separable reducer over canonical events.
apply_event is the deterministic state-transition function: given a
Project and a StateEvent, it produces the next Project. It does
not construct events, validate proposals, or call into network code.
It is the inverse pole of proposals::apply_proposal, which prepares
an event from a proposal and a current state.
Why this matters: v0 doctrine says “proposal → canonical event →
reducer → replayable frontier state.” Until v0.3, the reducer step was
implicit inside apply_proposal — replay was hash-walking, not
reduction. Phase C of the v0.3 focusing run pulls the reducer out so a
second implementation can independently reduce a canonical event log
and produce byte-identical state.
Replay verification (replay_from_genesis + verify_replay) is the
check that turns “state was claimed to result from these events” into
“state demonstrably results from these events when re-derived from
scratch.”
Structs§
Constants§
- REDUCER_
MUTATION_ KINDS - Single source of truth for the event kinds whose mutations the
reducer enforces. The no-op anchor
frontier.createdis excluded because it does not mutate state. Used by:
Functions§
- apply_
event - Apply one canonical event to
state, mutating it in place. - replay_
from_ genesis - Replay an entire event log from genesis state.
- verify_
replay - Verify that
state.events, when replayed fromstate.findings_at_genesis(or a derived genesis if absent), produces a frontier whose finding states match the materializedstate. Returns the diff if any.