fix(registry): generated-registry loader reads the refreshed data-dir file (#3707)#3818
Merged
Merged
Conversation
`registry refresh` writes the regenerated catalog to the DATA dir (registry-command.ts:293, nexusDataPath), but loadGeneratedRegistryEntries read only the bundled PACKAGE copy (dirname(import.meta.url)) — so a refresh's file was silently never loaded, even after #3185's reloadDefaultRegistry() re-read via the same package path. The hot-reload appeared to work but had no effect on the generated tier. Fix: defaultGeneratedPath() prefers a refreshed file in the data dir when present, falling back to the bundled package copy — the data-dir > package precedence the overlay path already uses (and the package dir is often read-only under a global npm install, so the data dir is the only writable refresh target). Fail-soft kept. TDD: new models-generated-loader.test.ts — data-dir precedence (was RED), package fallback, explicit-override. 804 config tests pass; typecheck/lint/governance/ producer-consumer clean. Closes #3707. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes #3707.
Bug
registry refreshwrites the regenerated catalog to the data dir (registry-command.ts:293→nexusDataPath('model-registry.generated.json')), butloadGeneratedRegistryEntriesread only the bundled package copy (models-generated-loader.ts:50→dirname(import.meta.url)/…). So a refresh's generated file was silently never picked up — even after #3185's in-processreloadDefaultRegistry(), which re-reads via the same package path. The hot-reload reported success but had no effect on the generated long-tail tier.Fix
defaultGeneratedPath()now prefers a refreshed file in the data dir when present, falling back to the bundled package copy — the same data-dir > package precedence the overlay path already uses. (The package dir is also typically read-only under a global npm install, so the data dir is the only writable target a refresh has.) Fail-soft behavior preserved; an explicitpathoverride is unchanged.Verification (TDD)
New
models-generated-loader.test.ts:pathoverride still honored804 config tests pass; typecheck, lint, governance, producer-consumer clean.
🤖 Generated with Claude Code