test(agentry,agent-tools): exhaustive export-surface assertions - #932
Draft
0xpatrickbot wants to merge 1 commit into
Draft
test(agentry,agent-tools): exhaustive export-surface assertions#9320xpatrickbot wants to merge 1 commit into
0xpatrickbot wants to merge 1 commit into
Conversation
Cover every package.json exports-map entry point with a sorted Object.keys deepEqual assertion so an accidental new export or an unlisted removal fails the test, not just the names it already enumerates. Keep the existing typeof shape assertions and drop the now-redundant negative in-checks.
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.
Description
The
@endo/agentryand@endo/agent-toolsexport-surface tests now assertthe complete runtime surface of every
package.jsonexportsentry pointwith a sorted
Object.keysequality check, instead of only asserting that ahand-picked subset of names exist. Existing
typeofshape assertions arekept; the negative
t.false('name' in module)checks are removed because theexhaustive equality assertion subsumes them.
Both packages'
exportsmaps had entry points with no prior test coverageat all (
agentry's./define-agent,./harness/types.js,./code-mode/types.js;agent-tools's./tool.js,./workspace.js, the./json-tools/*.jstools,./code-mode/declarations.js,./adapters/mcp.js, the./generated/code-mode-globals/*-declarations.jsfiles, and
./types-index.js); those are now imported and asserted too.Security Considerations
None. Test-only change.
Scaling Considerations
None.
Documentation Considerations
None.
Testing Considerations
The exhaustive assertion is exercised in both directions: temporarily
un-exporting a currently-listed name (
makeCodeModeGitLoopAgentfrom@endo/agentry's./code-mode) and temporarily adding an unlisted export(an extra re-export from
@endo/agent-tools's root entry point) each madethe corresponding
exports.test.jsfail with a clear diff; reverting eachchange restored a passing test.
Compatibility Considerations
None; no runtime source changed.
Upgrade Considerations
None.