Skip to main content

appending_equal_events_yields_two_events

Function appending_equal_events_yields_two_events 

pub async fn appending_equal_events_yields_two_events<F: Fixture>(
    open: impl AsyncFn() -> F,
) -> RuleOutcome
Expand description

VT-2 — structural equality is not identity.

Rejects a content-hash identity scheme, and any store that deduplicates on payload equality: a refrigeration engineer consuming two of the same part on one work order writes two byte-identical VanStockConsumed events, a content hash collapses them into one, and the van’s stock balance is permanently one unit high with nothing reporting it.

One batch rather than two appends, which is deliberate on two counts. It is the arrangement a content-addressed scheme collapses — an INSERT … ON CONFLICT (content_hash) DO NOTHING inside one statement — and it exercises ES-19’s slice-order assignment on the identity path at the same time.

ContentHashIdentityStore in tests/mutation_coverage/mutants.rs is the compiled version, and it is a real adapter shape rather than a saboteur: content-addressed identity is what anyone reaching for idempotent ingest proposes first, and it is exactly what VT-8 forbids by making uniqueness the store’s obligation. Its identities are unique across distinct events, stable across a reopen and never reissued, so it survives every other identity rule here.