Make model snapshot builds deterministic - #960
Open
fettpl wants to merge 3 commits into
Open
Conversation
fettpl
marked this pull request as ready for review
August 8, 2026 12:38
Contributor
Author
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
packages/ai/src/models.generated.tssnapshot during normal, CI, package, and release builds without fetching catalogs.refresh-modelscommands.Why
Build artifacts should be determined by the reviewed commit. A transient catalog outage or upstream change must not silently alter or truncate a release build.
Impact
Builds are network-independent and compile the reviewed catalog snapshot. Maintainers opt into catalog changes with
npm run refresh-models, then review both model changes and the canonical source digests in the generated diff. A failed refresh leaves the existing snapshot intact and exits nonzero.Root cause
The
packages/aibuild script ran live generation before every compile. Catalog helpers converted network and parsing failures to empty arrays, while the top-level handler logged errors without setting a failing exit status, allowing a partial snapshot to overwrite the committed file.Checks
cd packages/ai && npx tsx ../../node_modules/vitest/dist/cli.js --run test/model-snapshot-generation.test.ts(6 passed)npm run checkcd packages/ai && npm run refresh-models(four required live catalogs loaded; snapshot and provenance generated)Fixes #930
Note
Make model snapshot builds deterministic with provenance tracking and strict validation
npm run build; snapshots must now be explicitly regenerated vianpm run refresh-models(or the new root-level proxy).npm run buildregenerating models will no longer do so; the snapshot is now a committed artifact.Macroscope summarized 6d9155c.