Skip to main content

Module rules

Module rules 

Source
Expand description

The sync rules. See the crate documentation for what each covers.

Each rule is an async function taking impl AsyncFn() -> F — not a fixture but how to make one, as in the event-store family — and returning Result<RuleOutcome, Violation>.

§What no rule here does

Decode a payload (SY-35). Events are compared whole — identity, recorded time and the opaque bytes — and never parsed. A suite that parsed data would certify a peer that does, and ADR-0003’s guarantee is that no peer needs to.

Hold two peers (SY-8). Where a clause speaks of two peers, the rule plays one of them itself: it is the side that pushes and pulls, and the fixture’s peer is the far side.

Functions§

ack_never_confirms_a_non_durable_event
SY-31: an Ack confirms only what the far side still holds once the handle that acknowledged is gone.
compensation_is_atomic_with_the_losing_event
SY-2, the transport’s half: a losing event and the compensation that answers it travel as one group, and a peer hands them back as one group.
event_id_order_is_identical_on_every_peer
SY-23: the order a deployment may rely on peer-independently, EventId order, is the same on this peer as on every other, whatever order the events arrived in.
every_refusal_states_its_class
SY-36: every error a peer reports states its failure class, and the class is the one its adapter says it is.
ingest_never_rejects
SY-1: a peer appends every replicated event it does not already hold, and never evaluates an append condition — the origin’s or its own — as a precondition.
nothing_waiting_means_the_next_pull_is_empty
SY-37: a peer that answers a pull with [Waiting::Nothing] hands back an empty batch on the next pull from the token that answer carried.
peer_declares_its_own_limits
SY-18: a peer declares the limits it imposes, synchronously, and the declaration is true: an event it admits lands, so a runner that read it learns of an event that cannot land before pushing, not at ingest.
peer_takes_a_batch_at_its_declared_limits
SY-18: a peer’s declared batch limits are the limits it imposes: a push at the declared corner, which the declaration admits, lands whole.
push_envelope_preserves_group_boundaries
SY-30: the decomposition into independently conditioned groups is kept end to end. What a peer is pushed as three groups it hands back as those three groups: the same boundaries, the same events in order, and the same guards.
retention_gap_is_reported_not_silent
SY-32: a peer that has forgotten history reports the floor, and refuses a resume token below it with class Reseed, so a peer that was offline longer than its retention window is told it cannot converge rather than converging on a strict subset in silence.
round_trip_preserves_the_whole_log
SY-28, and SY-27 beneath it: a round trip preserves the whole log. Once the two sides have pushed and pulled to quiescence, each holds the same set of EventIds, each event with byte-identical type, tags, data and metadata, and the recorded time it was pushed with (VT-9).