Skip to content

Embedded (builtin) schemas are binary-versioned, not pinned — upgrading rivet silently changes validation (new diagnostics on unchanged artifacts) #431

@avrabe

Description

@avrabe

Reported by the maintainer; confirmed in code.

Symptom

A project using a builtin schema (schemas: [common, aspice, …] with no local schemas/ dir) sees new validation issues appear on unchanged artifacts after upgrading rivet — the same rivet validate that passed now flags things.

Root cause

embedded::load_schemas_with_fallback (rivet-core/src/embedded.rs:250) resolves each schema name by preferring an on-disk <schemas_dir>/<name>.yaml, else falling back to the embedded (compiled-into-the-binary) copy. So with no local schemas, the schema you validate against is whatever shipped in that rivet build. Every release that tightens or adds rules to a builtin schema silently changes validation semantics for every embedded-schema consumer — recent examples that would do exactly this: the status enum on common (status-allowed-values), the coverage-rule-consistency meta-check, prose-mention-without-typed-link, the ASPICE gate changes.

Schemas carry a version: field (common 0.1.0, aspice 0.2.0), but it's cosmetic — there's no pin in rivet.yaml, no min-rivet-version/version gate, and no drift detection. So the change is completely silent.

This is working-as-coded but a real stability gap. Options:

  1. Mitigation that already works today: vendor the schemas into the project — rivet init can write schemas/*.yaml, and the loader prefers on-disk over embedded — so they're pinned in the project's git and immune to binary upgrades. Worth documenting prominently as the recommended posture for projects that need stable validation across upgrades. (Does rivet init vendor schemas by default? If not, an --vendor-schemas flag would make this one step.)
  2. Pin + detect: let rivet.yaml record the schema version(s) it expects and have validate warn when the embedded schema version differs (turn the cosmetic version: into a real gate).
  3. Surface: rivet validate could print the schema name@version set it used (and rivet schema list could show embedded-vs-vendored + version), so an upgrade-induced change is at least visible.

Recommend (1) documented now + (3) as a small surfacing change; (2) is the fuller fix (a maintainer call on the pin syntax). Found while researching the report — can implement the surfacing (3) and a docs section for (1) if you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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