feat(schema): warn when an embedded schema version drifts from a rivet.yaml pin (REQ-249)#679
Merged
Merged
Conversation
…t.yaml pin (REQ-249, DD-073, #431) Adds a user-owned `project.schema-pins` map to rivet.yaml recording the expected version per schema. `rivet validate` compares each resolved schema version against its pin and warns on stderr when they drift — the silent-upgrade case where an embedded-schema bump changes validation out from under a project. .rivet-version already records scaffolded_from.schemas but is regenerated on `rivet upgrade`, so it cannot serve as a stable pin baseline; a user-owned map in rivet.yaml can (DD-073). Warnings go to stderr so `--format json` on stdout stays machine-clean. Escalation to a hard error under a strict flag is left as a follow-on. Confirmed with the new embedded::tests::schema_pin_drift_is_detected unit test and a full `rivet validate` pass (Result: PASS). Implements: REQ-249 Refs: DD-073, FEAT-001
📐 Rivet artifact delta
Graphgraph LR
REQ_249["REQ-249"]:::modified
DD_073["DD-073"]:::added
classDef added fill:#d4edda,stroke:#28a745,color:#155724
classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Added
Modified
Posted by |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a user-owned
project.schema-pinsmap torivet.yamlrecording the expected version per schema.rivet validatecompares each resolved schema version against its pin and warns on stderr when they drift.This closes the silent-upgrade gap: an embedded-schema version bump (via
rivet upgradeor a new binary) can change validation semantics out from under a project with no signal. A pin makes that drift loud.Why a new map (DD-073)
.rivet-versionalready recordsscaffolded_from.schemas, but it is regenerated onrivet upgrade— so it tracks the current state, not the expected baseline, and can't serve as a pin. A user-owned map inrivet.yamlsurvives upgrades and is the thing the user reviews-and-bumps deliberately.Behavior
--format jsonon stdout stays machine-clean.--strictflag is a deliberate follow-on slice.Verification
embedded::tests::schema_pin_drift_is_detected(pins vs provenance, sorted, only drift reported).cargo clippy --all-targets -- -D warningsclean.rivet validate→Result: PASS.Implements: REQ-249
Refs: DD-073, FEAT-001
🤖 Generated with Claude Code