test: pin the endpoint guard's barrel re-export, and fix two stale references to its old internal/ path - #5851
Merged
Merged
Conversation
…ferences to its old internal/ path Follow-ups from the #5625 review, none of which belonged in an external contributor's PR: - `index.js`'s `export * from './endpointGuard.js'` was asserted by nothing. `bootstrap.js` is the only barrel importer, so dropping that line would have failed a live server start rather than a test. The new case loads the barrel lazily and checks both functions resolve to the same identities as the direct import — verified by deleting the re-export and watching it fail. - `scripts/migrations/195-cerebras-provider.js` still pointed at `aiToolkit/internal/endpointGuard.js`, a path that no longer exists. - Trimmed the `server/lib/README.md` row back to the one sentence a reader needs; the graph-cost rationale already lives in the module's own header.
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
Three follow-ups from the #5625 review (endpoint guard moved out of
aiToolkit/internal/). None belonged in an external contributor's PR.aiToolkit/index.jscarriesexport * from './endpointGuard.js', but nothing asserted it.bootstrap.jsis the only barrel importer, so deleting that line would have failed a live server start rather than a test. The new case loads the barrel lazily (a static import would drag the toolkit's route/provider/runner graph into all 34 other cases in the file) and asserts both functions resolve to the same identities as the direct import, so a divergent copy fails too.scripts/migrations/195-cerebras-provider.js:8still referencedaiToolkit/internal/endpointGuard.js, which no longer exists.server/lib/README.md'saiToolkit/cell had grown to a four-clause sentence inside a table cell; the graph-cost rationale already lives in the module's own header comment.Test plan
npx vitest run lib/aiToolkit/endpointGuard.test.js— 35 passedexport *line fromindex.jsand re-ran — the new case fails (1 failed | 34 passed), so it is not vacuous. Restored.npx vitest run lib/index.test.js lib/aiToolkit/endpointGuard.test.js lib/generatedManifests.test.js ../scripts/migrations— 301 files / 1924 tests passed