Skip to main content

event_id_is_not_matchable_by_query

Function event_id_is_not_matchable_by_query 

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

VT-7 — an EventId is outside the query language, and in particular it is not a Tag.

Two halves, and the second is the one that bites. The first is that the event’s own tags come back as the caller wrote them, with nothing added. The second is that the identity is not matchable — because the dangerous implementation does not put the tag on the event at all. It writes an extra row into the tag side table so that a membership question can be answered by the index the adapter already has, leaving Event::tags() round-tripping untouched and every payload-fidelity rule in the suite still passing. IdentityMatchableAsTagStore in tests/mutation_coverage/mutants.rs is that store.

What it costs is structural rather than merely expensive. Query’s algebra is types-OR within an item, tags-AND with superset matching, items-OR across the query, and VT-31 freezes it because E2E-32’s fan-out runner is correct only if Items(a) ∪ Items(b) == Items(a ++ b). An identity axis is not a set-superset predicate; it is a point lookup on a unique key, and grafting it onto QueryItem::matches gives the item a third semantic with different composition rules.

The probes cover the four keys an adapter would actually choose and both renderings — the whole store:position identity and the incarnation alone — because an adapter indexing only the origin store is the same mistake at lower cardinality.