Record the preparation contract in model provenance - #1040
Merged
Userunknown84 merged 2 commits intoAug 1, 2026
Conversation
Artifacts carried no record of how text must be prepared for them, so a future change to preparation could silently desynchronize from a model trained under the old rules. Training now emits the provenance sidecar the registry has always looked for, and a mismatch is reported when the artifacts are loaded.
|
@pavsoss is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
The model registry has always looked for a model card beside the artifacts to populate the training time, metrics and label set, but nothing ever wrote one — so those provenance fields were reported as empty for every deployed model. Separately, artifacts carried no record of how text must be prepared for them, meaning a future change to preparation could silently desynchronize from a model trained under the old rules.
Part of #1037.
Changes
Training now writes the provenance card after a successful save, recording when the model was trained, how it scored on the held-out split, its label set, and the text-preparation contract it was trained under. The card is written atomically and only after the artifacts land, so it can never describe a model that failed to persist or be read half-finished.
When a served model was trained under a different contract than the one in force, the mismatch is reported as the artifacts are loaded instead of quietly degrading predictions. It is surfaced rather than fatal: the model still answers, because taking the API down over a metadata disagreement is worse than serving a model an operator may already be retraining. Artifacts predating the card make no claim about their preparation and remain servable.
Test plan
Depends on
Stacked on #1038 and #1039. Their commits are included here, so this diff shrinks to just the provenance changes once they merge.