Skip to main content

ingest_validates_every_event_not_the_head

Function ingest_validates_every_event_not_the_head 

Source
pub async fn ingest_validates_every_event_not_the_head<F: IngestFixture>(
    open: impl AsyncFn() -> F,
) -> Result<RuleOutcome, Violation>
Expand description

SY-18: a store holds every event an ingest writes to the per-event ceilings it declares, not the head of each group, and an event over one refuses the whole call.

SY-18 says an event that cannot land is discovered at ingest, so the refusal has to be a true one: [IngestError::ExceedsStoreLimit] naming the limit and the magnitude, class [FailureClass::Park], with nothing written. The rule reads the ceilings from the fixture’s MAX_EVENT_DATA_LEN, MAX_TAGS_PER_EVENT and MAX_METADATA_LEN, and for each declared one, on a fresh fixture, after one local event:

  1. The control. Two groups, the second carrying an event exactly at the ceiling behind its head and a compensation whose second event is exactly at it too, land as three appended and two compensations, each sized event found by its bytes.
  2. Over, in the foreign events. Two groups, the second’s second event one over the ceiling: refused, the log, head and watermark as they were, and none of the three events held.
  3. Over, in the compensation. One group whose compensation’s second event is one over: refused in the same way.

A ceiling at or above MAX_PROVOKED_TAGS tags or MAX_PROVOKED_BATCH_BYTES bytes is not exercised, because the over-ceiling event is allocated whole (H-13). A fixture that leaves the rule nothing to exercise is reported Skipped with NO_PER_EVENT_LIMITS.

§Rejects

A store that holds only each group’s first event to its ceilings; one that never checks the compensation it writes itself; and one that refuses an event exactly at a ceiling, which only the control sees. tests/wrong_ingest_stores.rs carries all three.

§Does not reject

A head-only check of the store’s own identity. That is SY-38’s rule’s, whose unheld claim already sits behind a group’s head, so a mutant that checked only each group’s head for it would fail that rule too. Nor the batch limit, which is Split, not a fact about one event.

§Errors

A Violation of SY-18 if the control is refused or miscounted, or if an over-ceiling call is accepted, refused as anything but that limit and magnitude or with a class other than Park, or leaves anything behind. The wrong-arm message cites VT-25.