Skip to main content

Module sequence

Module sequence 

Source
Expand description

Sequence/Protocol conformance: multi-step interactions on one store — append→read round-trips, optimistic-conflict protocol, $all ordering and resume, and the subscription catch-up→live protocol.

Functions§

check_all_boundary_then_new_append
read_all(Some(last)) is empty at the boundary; a later append surfaces exactly the new event from the same checkpoint.
check_all_empty_store_yields_none
Empty store: read_all(None) yields nothing.
check_all_from_is_exclusive
read_all(Some(p)) is EXCLUSIVE: strictly after p.
check_all_global_order_across_streams
read_all(None) yields every event across streams in append (position) order, positions strictly increasing.
check_all_items_carry_their_stream_key
#333: every $all item carries the origin StreamKey.
check_all_metadata_round_trips
Metadata round-trips byte-for-byte on the $all read path.
check_all_multi_resume_cycles
Multi-resume cycles reconstruct the single-shot read exactly — no gap, duplicate, or skip across the seams.
check_append_conflict_is_surfaced
A mismatched expected_version surfaces AppendError::Conflict carrying the store’s actual head, and the store is untouched.
check_append_retry_after_conflict_succeeds
After a conflict, retrying with the corrected expectation succeeds — the standard optimistic-concurrency protocol completes.
check_append_returns_assigned_all_position
#330: append returns the $all position it assigned to the run’s last event — the read-your-writes token.
check_append_then_read_round_trips
Mixed-shape rows round-trip byte-for-byte in insertion order: Unicode and dotted event types, schema versions across the u32 range, payloads from empty through 4 KiB, metadata absent and present.
check_empty_read_yields_none
A fresh, empty stream reads back empty (absent stream = empty, not error).
check_large_stream_completes
A stream larger than any internal batch/refill size (1500 events) drains completely with no gap or duplicate across the seams.
check_multi_event_append_returns_last_position
#330: a multi-event append returns the LAST event’s position, so a consumer that has reached it has necessarily been delivered the whole run.
check_read_stream_from_is_inclusive
read_stream(from) is INCLUSIVE: from=3 on a 5-event stream yields 3,4,5.
check_read_stream_inclusive_read_all_exclusive_coexist
Inclusive read_stream and exclusive read_all coexist on one store — the intentional asymmetry (CLAUDE rule 4).
check_subscription_absent_stream_waits_then_delivers
Subscribing to a stream that does not exist yet parks (after CaughtUp) and is woken by the stream’s FIRST event — the producer-after-consumer startup order must work.
check_subscription_all_backlog_then_caught_up_then_live
$all subscription protocol: cross-stream backlog in position order, then CaughtUp exactly once, then live events with strictly increasing tags.
check_subscription_backlog_then_caught_up_then_live
Per-stream subscription protocol: backlog in order, then CaughtUp exactly once, then live events.
check_subscription_beyond_head_filters_below_bound
A subscription opened beyond the head filters below-bound live appends.
check_subscription_large_backlog_crosses_chunk_seam
A backlog larger than the catch-up chunk (1024) crosses the internal rescan seams with no gap or duplicate, and CaughtUp still arrives.
check_subscription_resume_strict_after
subscribe(Some(v)) resumes STRICTLY AFTER v — no duplicate of the checkpointed event.
check_two_subscribers_same_stream_both_receive
Two simultaneous subscribers on ONE stream each receive the full event sequence — subscriptions are fan-out, never competing-consumer queues.
check_versions_strictly_monotonic_and_fused
Versions read back strictly monotonic and the stream is fused after None.