Skip to content

test: pin the endpoint guard's barrel re-export, and fix two stale references to its old internal/ path - #5851

Merged
atomantic merged 1 commit into
mainfrom
fix/endpoint-guard-followup
Sep 2, 2026
Merged

test: pin the endpoint guard's barrel re-export, and fix two stale references to its old internal/ path#5851
atomantic merged 1 commit into
mainfrom
fix/endpoint-guard-followup

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Three follow-ups from the #5625 review (endpoint guard moved out of aiToolkit/internal/). None belonged in an external contributor's PR.

  • Pin the barrel re-export. aiToolkit/index.js carries export * from './endpointGuard.js', but nothing asserted it. bootstrap.js is 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.
  • Fix a dangling path. scripts/migrations/195-cerebras-provider.js:8 still referenced aiToolkit/internal/endpointGuard.js, which no longer exists.
  • Trim the README row. server/lib/README.md's aiToolkit/ 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 passed
  • Bypass probe: deleted the export * line from index.js and 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

…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.
@atomantic
atomantic merged commit 6dbd7d5 into main Sep 2, 2026
7 checks passed
@atomantic
atomantic deleted the fix/endpoint-guard-followup branch September 2, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant