Skip to content

CI: vintage-aware token-catalog provenance gate (tokens-gen → cmp) #6280

Description

@matthewevans

Context

Follow-up from #6274 (token coverage de-pinned to invariants + ratchet floors) and #6278 (weekly auto-refresh of the tracked catalogs).

The token_coverage test now asserts invariants + non-vacuity floors (total >= 2858, rules_text >= 1490, source_card_refs >= 9821). Those catch truncation / partial-regen (the #6199 class), but — as documented in the coverage.rs comment added by #6274 — they do not establish provenance: that the committed crates/engine/data/known-tokens.toml is the deterministic tokens-gen output for its declared MTGJSON vintage. No unit test can, because the generator input (data/mtgjson/sets) is gitignored and absent from the test binary.

Proposal (optional defense-in-depth)

Add a PR-scoped, vintage-aware provenance gate in CI (ci.yml card-data job, which already fetches MTGJSON and runs oracle-gen):

  1. ./scripts/fetch-token-sets.sh to populate data/mtgjson/sets.
  2. cargo run --profile tool --features cli --bin tokens-gen -- --input data/mtgjson/sets --output /tmp/kt.toml.
  3. Vintage-aware compare: read the fetched MTGJSON .meta.date and the committed crates/engine/data/mtgjson-vintage.

Priority

Low. #6278 makes the automated regen the catalog's sole update path (provenance-by-construction), and the floors catch the realistic threat. This gate is defense-in-depth against a manual/rogue edit to the committed catalog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions