Skip to main content

an_unheld_own_identity_stops_the_ingest

Function an_unheld_own_identity_stops_the_ingest 

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

SY-38: an event claiming the store’s own identity at a position the store did not hold when the call began refuses the whole call as [IngestError::UnheldOwnIdentity], class [FailureClass::Stop], and writes nothing. A held own identity is a re-delivery, and a skip.

Three arrangements, each on a fresh fixture, and every claimed position computed from the head the store assigned:

  1. The unheld claim. After one local event, two groups arrive, and the claim, three positions past the head, is the second event of the second. The call is refused naming the claim; the log, head and watermark are as they were; and the store holds none of the three.
  2. The held echo. The store’s own local event, sent back to it, is skipped, and nothing changes.
  3. The claim the call’s own compensation would hide. The first group carries a compensation, which a dense store mints two positions past the head; the second group claims exactly that identity. The call is refused naming it, and writes nothing. The rule then ingests the first group alone to see where its compensation lands. A store that leaves a gap there was never shown the hidden claim, which the specification permits, so the rule reports Skipped with NO_HIDDEN_CLAIM rather than a pass.

This refusal is the one SY-33’s rule, when it is written, must exempt (ADR-0098): it is about the store’s own identity, never about an event’s content.

§Rejects

A store that drops the claim as a re-delivery and writes the rest; one that checks only the batch’s first event; one that commits group by group and keeps the groups before the claim; one that refuses a claim only when it lands, so a claim meeting the call’s own compensation is skipped and two events share one identity; and one that refuses a held echo too. tests/wrong_ingest_stores.rs carries all five, and the conformant store that leaves a gap, which this rule must skip.

§Errors

A Violation of SY-38 if any arrangement’s ingest is accepted, or refused other than as the unheld claim it carries, or writes anything, or if the echo is not a skip.