COMPARATOR_VOCABULARY

Constant COMPARATOR_VOCABULARY 

Source
pub const COMPARATOR_VOCABULARY: &[&str];
Expand description

Wire-canonical vocabulary of PassDetail.comparator tokens.

Every comparator implementation in crate::assert::claim emits one of these tokens when it records a passing claim. The vocabulary is the stable wire contract — renderers, sidecar consumers, and the auto-repro pipeline match against these exact strings. A token rename in claim.rs without a parallel update here breaks every downstream consumer; the regression test in tests/claim_comparator_tokens_canonical.rs pins this.

One synthetic token is NOT in this vocabulary: the cap-overflow sentinel record (see PASSES_TRUNCATION_SENTINEL_NAME) carries comparator = "truncated" to indicate the slot is metadata, not a real claim. Renderers that filter passes by vocabulary should also handle the sentinel as a distinct category.

Tokens follow three style rules:

  1. Operator-canonical: comparison operators map to short operator names (eq, ne, ge, le, lt, gt) regardless of whether the builder method is eq or at_least. The vocabulary is independent of method naming.
  2. Container-prefixed: comparators bound to a specific container type prefix their token with the container name (set_*, sequence_*) to disambiguate same-named operations across surfaces. Scalar tokens are unprefixed.
  3. Snake-case ASCII: every token is lower-snake-case, no Unicode, no spaces — survives shell escapes, IDE regex search, and log-mining pipelines without transformation.

Asymmetries are intentional: sequence_* does not carry subset_of / disjoint_from because sequences have order and duplicates that set semantics don’t model.

Categorization below groups by SEMANTIC AXIS (comparison / predicate / cardinality / membership / relation), not by call- site arity. Every len_* cardinality token (set_len_eq / set_len_le / set_len_ge and the sequence peers) records via the binary helper so renderer-side handling is uniform: each pass surfaces both the actual length and the expected bound. The previous unary-on-eq + binary-on-le/ge asymmetry was a micro-optimization (eq’s actual == expected makes the actual redundant on the pass arm) that traded uniform output for one elided field. The *_is_non_empty and *_is_empty predicates remain unary by design — the comparator token IS the predicate, and there is no separate expected bound to surface. *_is_non_empty records the observed length (evidence the container was non-empty); *_is_empty records no value (the predicate token alone carries the meaning — emptiness is self-evident from the comparator).