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 afterp.- 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
$allitem carries the originStreamKey. - check_
all_ metadata_ round_ trips - Metadata round-trips byte-for-byte on the
$allread 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_versionsurfacesAppendError::Conflictcarrying 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:
appendreturns the$allposition 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_streamand exclusiveread_allcoexist 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 $allsubscription protocol: cross-stream backlog in position order, thenCaughtUpexactly once, then live events with strictly increasing tags.- check_
subscription_ backlog_ then_ caught_ up_ then_ live - Per-stream subscription protocol: backlog in order, then
CaughtUpexactly 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
CaughtUpstill arrives. - check_
subscription_ resume_ strict_ after subscribe(Some(v))resumes STRICTLY AFTERv— 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.