Function query_union_is_item_concatenation
pub async fn query_union_is_item_concatenation<F: Fixture>(
open: impl AsyncFn() -> F,
) -> RuleOutcomeExpand description
The match set of concatenated items is the union of their match sets.
VT-31, and the rule ES-15’s Rejects: names as still owed: an adapter
that sorts and deduplicates a query’s items as an optimisation.
query_item_order_does_not_change_the_result_set cannot catch that —
sorting the items is precisely what makes their order stop mattering, so
an adapter that sorts them passes an order-invariance rule by
construction. What catches it is a match-set claim over an item whose
presence changes the set.
The two items constrain tags alone, so both carry the same (empty)
type list — which is the key a deduplicating adapter interns them under.
QueryItem::new already sorts and deduplicates types, so interning
items by their type list to emit one type_id IN (…) clause per distinct
set is the natural next step, and it silently drops the tag half of every
item it swallows. ItemDedupByTypeStore is that adapter.
A shared non-empty type list would demonstrate the same collapse, and
was rejected for a reason worth recording: an item carrying both a type
and a tag is ClauseJoinerStore’s blind spot, so that mutant would fail
this rule at its anchor for a reason
query_item_combines_types_and_tags_with_and already owns.
The two single-item reads are the non-vacuity anchor, and they carry more weight here than usual: without them a store returning both events for every query would satisfy the union assertion, and so would one returning neither for any.
What this rule cannot state, recorded so nobody looks for it. VT-31’s
second sentence — any query unioned with Query::All matches everything —
is not expressible through the constructors. A Query is All or
Items, Query::All is not a QueryItem, and there is no union
operator, so the concatenation this rule performs cannot include it.