Skip to content

Record the preparation contract in model provenance - #1040

Merged
Userunknown84 merged 2 commits into
Userunknown84:mainfrom
pavsoss:feat/1037-preprocess-provenance
Aug 1, 2026
Merged

Record the preparation contract in model provenance#1040
Userunknown84 merged 2 commits into
Userunknown84:mainfrom
pavsoss:feat/1037-preprocess-provenance

Conversation

@pavsoss

@pavsoss pavsoss commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

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

  • Matching, mismatching and unrecorded contract versions, and the version appearing in the reported provenance payload.
  • A card written by training is read back through the registry.
  • Card contents: recorded contract, holdout accuracy, training row count, label set and training timestamp.

Depends on

Stacked on #1038 and #1039. Their commits are included here, so this diff shrinks to just the provenance changes once they merge.

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.
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

@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.

@Userunknown84
Userunknown84 merged commit 8f34997 into Userunknown84:main Aug 1, 2026
1 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants