The reference check of an event against the active rules: every precondition of its entity accepts it on the key's history before it, and every invariant holds on the store with it.
3.7. Appending
How a write is checked and stored: an event is appended when it fits its event type, its expected_revision matches, and no rule rejects it. A client sends a batch of events; the batch is stored whole or not at all. On the shift of the rules page, a batch that creates a shift and assigns Anna is stored, and a batch whose second event is rejected stores nothing:
The reference meaning of an append.
3.7.1. Batches
Each event of a batch is checked against the store with the events before it in the batch, so a batch can pass through a state that a single event could not. Two users swap emails in one batch, through a temporary address; the unique-email invariant holds after every event:
Two users can swap emails in one batch through a temporary address.
3.7.2. Rejections
A rejected batch names the first rejected event and why: its schema, its expected_revision, or the rule, counted in file order. On the folio:
Event sent | Reason | Claim |
|---|---|---|
a charge without its amount | the event does not fit its type | |
a charge expecting revision 1 on a folio at revision 2 |
| |
a charge on a closed folio | rule 1 |
A rejected batch: the first rejected event and why.
Constructor
Spec.Rejection.mk
Fields
index : Nat
the event's index in the batch, from 0
position : Nat
the position it would have had
reason : Reason
the first check it fails
3.7.3. Concurrency
Two batches can run at the same time when they touch different keys and groups; they then give the same result in either order.
What checking a batch touches, on the store it is checked against.
Constructor
Spec.Footprint.mk
Neither batch writes what the other reads or writes, and they share no group.