Module rules
Expand description
The conformance rules. See the crate documentation for the map of what each group covers.
Functions§
- a_
live_ read_ stream_ does_ not_ block_ an_ append - A read stream that is still alive does not block an append.
- acknowledged_
writes_ survive_ a_ reopen - An append acknowledged with
Okis still there after a reopen. - append_
is_ atomic - A batch lands entirely or not at all.
- append_
is_ atomic_ under_ a_ mid_ batch_ fault - A batch interrupted by a fault part way through lands whole or not at all.
- append_
preserves_ an_ empty_ payload - A zero-length payload round-trips as a zero-length payload.
- append_
preserves_ event_ payload - Payload, tags and metadata survive the round trip unchanged.
- append_
preserves_ event_ type_ and_ tags_ byte_ for_ byte - An event type and a tag survive the round trip byte for byte, whitespace included.
- append_
rejects_ empty_ batch - An empty batch is refused.
- append_
reports_ exceeded_ store_ limits - A store that refuses an over-capacity append reports it as
AppendError::ExceedsStoreLimit, and never by truncating. - append_
returns_ last_ written_ position appendreturns the position of the last event written.- append_
stamps_ a_ local_ event_ id - VT-5 — a locally appended event’s
EventIdis this store’s incarnation paired with the position this store just assigned. - append_
stamps_ a_ recorded_ time - VT-9 — the store stamps a time at append, and reports that same value on every read of that event.
- append_
stamps_ identity_ and_ time - VT-4 — the four facts on a
SequencedEventare persisted, not produced by the read that returned them. - appending_
equal_ events_ yields_ two_ events - VT-2 — structural equality is not identity.
- arming_
a_ mid_ batch_ fault_ makes_ the_ append_ fail - A fixture that declares
MID_BATCH_FAULTsupported must arm a fault the store cannot absorb, so the append returnsErr. - arming_
a_ read_ fault_ makes_ the_ stream_ yield_ an_ error - A fixture that declares
READ_FAULTsupported must arm a fault the store surfaces as anErritem, not as the end of the stream. - batch_
is_ not_ evaluated_ against_ its_ own_ condition - A condition is evaluated only against events the store already held.
- batch_
positions_ follow_ slice_ order - Positions within one batch are assigned in slice order, strictly ascending.
- condition_
after_ beyond_ head_ admits_ the_ append - A condition whose
afteris beyond the store’s head admits the append. - condition_
after_ beyond_ the_ last_ matching_ position_ admits_ the_ append afterpast the last matching position admits the append, even while later non-matching events exist.- condition_
after_ ignores_ events_ at_ the_ boundary afteris exclusive: an event exactly at the boundary was already seen by the caller and must not reject the append.- condition_
after_ ignores_ non_ matching_ events - Non-matching events beyond the boundary are irrelevant.
- condition_
after_ rejects_ events_ beyond_ the_ boundary - A matching event beyond the boundary rejects the append.
- condition_
against_ an_ empty_ store_ admits_ the_ append - A condition evaluated against an empty store admits the append.
- condition_
guards_ carry_ independent_ boundaries - Each guard of an
AppendConditionis evaluated against its own boundary. - condition_
matches_ on_ every_ tag_ in_ an_ item - An event carrying only SOME of a condition item’s tags does not match it, so the append stands.
- condition_
matches_ on_ tags - A condition’s verdict depends on tags, not on types alone.
- condition_
matching_ every_ tag_ rejects_ the_ append - An event carrying ALL of a condition item’s tags does match it, so the append is refused.
- condition_
over_ removed_ history_ does_ not_ reject - ES-40 (ADR-0028, decision 2): a condition whose only matching event was removed outside the port admits the append, and a condition over an event the store still holds still refuses it.
- condition_
rejection_ is_ reported_ as_ condition_ violated - The rejection is reported as the specification’s concurrency signal, not as an adapter-specific failure.
- condition_
rejection_ leaves_ store_ unchanged - A rejected append changes nothing observable.
- condition_
with_ an_ unheld_ tag_ does_ not_ reject - The mirror: a condition carrying a tag no event holds must not reject, even when a stored event matches its types.
- condition_
with_ one_ guard_ behaves_ as_ today - A one-guard condition is evaluated by the same rules as any other guard.
- condition_
without_ after_ allows_ non_ match - A condition that matches nothing lets the append through.
- condition_
without_ after_ rejects_ any_ match - Without
after, any matching event rejects the append. - contains_
event_ id_ reports_ a_ held_ row_ above_ the_ frontier - ES-41 (ADR-0095):
contains_event_idanswers whether the store holds an event, not whether a read would show it now. - contains_
event_ id_ reports_ membership - ES-41 (VT-7) —
contains_event_idanswers about an identity, not about a position. - dropped_
append_ future_ leaves_ no_ partial_ batch - Dropping an
appendfuture leaves the store fully applied or unchanged, never partially applied. - duplicate_
items_ do_ not_ duplicate_ events - An event matching several items, or carrying several tags, is yielded once.
- empty_
batch_ is_ refused_ before_ the_ condition_ is_ evaluated - An empty batch is refused before the condition is evaluated.
- event_
id_ is_ not_ matchable_ by_ query - VT-7 — an
EventIdis outside the query language, and in particular it is not aTag. - event_
ids_ are_ unique_ within_ a_ store - VT-5 and VT-8 — a store holds at most one event per
EventId, and it is the store’s job to make that true rather than the caller’s. - head_
advances_ across_ two_ handles - A head read through one handle covers what another handle wrote.
- head_
is_ the_ highest_ visible_ position head()covers the whole store, not the part some default query matches.- head_
of_ an_ empty_ store_ is_ none - A store holding nothing reports no head.
- interleaved_
appends_ on_ one_ handle_ elect_ one_ winner - Two
appendfutures from one handle both complete, and exactly one wins. - limit_
applies_ across_ items_ not_ per_ item limitis a budget for the whole result, not one per query item.- metadata_
distinguishes_ absent_ from_ empty - Absent metadata and present-but-empty metadata are two different values.
- nothing_
below_ an_ observed_ position_ appears_ later - Nothing becomes visible below a position a reader has already observed.
- positions_
are_ not_ reused_ after_ removal - ES-38 (ADR-0028, decision 2): a store that has had events removed
outside the port never hands a removed position out again, and its
read(Query::all())andheaddescribe exactly the events it still holds. - positions_
are_ strictly_ monotonic - Positions strictly increase. Gaps are permitted, so this checks ordering rather than density.
- positions_
are_ unique - Positions are unique across the store.
- query_
all_ matches_ every_ event Query::all()matches every event in the store.- query_
item_ combines_ types_ and_ tags_ with_ and - Within one item, the type constraint and the tag constraint combine with AND.
- query_
item_ order_ does_ not_ change_ the_ result_ set - The order of a query’s items does not change what it selects.
- query_
item_ rejects_ partial_ tag_ overlap - Overlapping-but-incomplete tags must not match.
- query_
item_ tags_ are_ and - Tags within one query item combine with AND.
- query_
item_ tags_ match_ supersets - An event carrying extra tags still matches.
- query_
item_ types_ are_ or - Types within one query item combine with OR.
- query_
items_ are_ or - Items within a query combine with OR.
- query_
items_ share_ one_ snapshot - Every item of one
Queryis evaluated against the same sample. - query_
matching_ nothing_ yields_ empty - A query that matches nothing yields an empty stream rather than an error.
- query_
union_ is_ item_ concatenation - The match set of concatenated items is the union of their match sets.
- racing_
conditional_ appends_ elect_ one_ winner - Two command handlers that decided from the same snapshot cannot both commit.
- read_
backwards_ from_ with_ limit - The specification’s own worked example: N events at or before a position, newest first.
- read_
backwards_ limit_ applies_ after_ filtering - The same claim from the other end, because a store truncates the scan at whichever end it reads from.
- read_
backwards_ reverses_ order ReadOptions::backwardsreverses the order.- read_
defaults_ to_ ascending_ order - Reading is ascending by position unless asked otherwise.
- read_
from_ a_ gap_ position fromis a range predicate over assigned positions, not a seek.- read_
from_ and_ to_ bound_ a_ closed_ window fromandtotogether name a closed window, and nothing outside it is yielded.- read_
from_ composes_ with_ limit - Reading forwards from a cursor with a budget spends the budget.
- read_
from_ composes_ with_ multi_ item_ query - Every read option composes with a multi-item query.
- read_
from_ is_ inclusive ReadOptions::fromincludes the event at that position.- read_
limit_ applies_ after_ filtering limitcounts matches, not scanned rows.- read_
limit_ truncates ReadOptions::limittruncates the result.- read_
limit_ zero_ yields_ nothing limit(0)yields nothing.- read_
result_ is_ stable_ under_ concurrent_ append - One
readis one sample: an append made after the stream has been polled does not appear in it. - read_
to_ composes_ with_ limit - A window and a budget on the same read, with the budget the smaller.
- read_
to_ composes_ with_ multi_ item_ query - The upper bound composes with a multi-item query.
- read_
to_ is_ inclusive ReadOptions::toincludes the event at that position.- read_
to_ under_ backwards_ bounds_ the_ older_ end - Under
backwards,tobounds the older end. - reading_
an_ empty_ store_ yields_ nothing - A store nobody has appended to reads as empty, and does not error.
- recorded_
time_ survives_ a_ reopen - VT-9 — a reopen does not restamp an event’s recorded time.
- reissued_
batch_ conditioned_ on_ other_ events_ lands_ twice - A conditional append whose condition does not match its own events has no at-most-once property either.
- reissued_
conditional_ batch_ lands_ once - A conditional append whose condition matches its own events is at-most-once under verbatim reissue.
- reissued_
unconditional_ batch_ lands_ twice - An unconditional append has no at-most-once property: a reissue appends a second copy.
- removal_
outside_ the_ port_ removes_ exactly_ the_ named_ events - CF-27 (ADR-0028): a fixture that declares
REMOVALremoves exactly the events it is told to, from the store a caller already holds, and leaves every other event as it was. - reopened_
store_ does_ not_ reissue_ an_ event_ id - VT-6 — reopening a store does not reissue an
EventId. - store_
accepts_ a_ max_ length_ identifier - An identifier at the documented maximum length survives, and still matches itself.
- store_
accepts_ non_ ascii_ identifiers - Non-ASCII identifiers survive, and are not folded into each other.
- store_
accepts_ the_ guaranteed_ minimum_ batch_ size - A batch at the guaranteed minimum size is accepted whole.
- store_
accepts_ the_ guaranteed_ minimum_ payload - A payload at the guaranteed minimum is accepted whole.
- store_
accepts_ the_ guaranteed_ minimum_ tag_ count - An event carrying the guaranteed minimum number of tags keeps all of them.
- store_
accepts_ the_ guaranteed_ minimum_ tags_ per_ batch - A batch carrying the guaranteed minimum number of tags is accepted whole.
- store_
evaluates_ a_ query_ at_ the_ guaranteed_ minimum_ item_ count - A query at the guaranteed minimum item count is evaluated in full.
- tags_
differing_ only_ by_ unicode_ normalisation_ are_ distinct - Two tags that differ only by Unicode normal form are two tags.
- tags_
may_ repeat_ a_ key - One key, two values, two tags — and both are queryable.
- two_
fixture_ instances_ observe_ none_ of_ each_ others_ appends - Two fixture instances are two backing stores.
- two_
handles_ observe_ each_ others_ appends - Two handles onto one backing store see each other’s writes, on both the read side and the append-condition side.
- untagged_
events_ match_ query_ all - An event carrying no tags at all is still yielded by
Query::all().