Skip to content

test(agentry,agent-tools): exhaustive export-surface assertions - #932

Draft
0xpatrickbot wants to merge 1 commit into
llmfrom
build/agentry-agent-tools-exports-exhaustive
Draft

test(agentry,agent-tools): exhaustive export-surface assertions#932
0xpatrickbot wants to merge 1 commit into
llmfrom
build/agentry-agent-tools-exports-exhaustive

Conversation

@0xpatrickbot

Copy link
Copy Markdown
Collaborator

Description

The @endo/agentry and @endo/agent-tools export-surface tests now assert
the complete runtime surface of every package.json exports entry point
with a sorted Object.keys equality check, instead of only asserting that a
hand-picked subset of names exist. Existing typeof shape assertions are
kept; the negative t.false('name' in module) checks are removed because the
exhaustive equality assertion subsumes them.

Both packages' exports maps had entry points with no prior test coverage
at all (agentry's ./define-agent, ./harness/types.js,
./code-mode/types.js; agent-tools's ./tool.js, ./workspace.js, the
./json-tools/*.js tools, ./code-mode/declarations.js,
./adapters/mcp.js, the ./generated/code-mode-globals/*-declarations.js
files, 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 (makeCodeModeGitLoopAgent from
@endo/agentry's ./code-mode) and temporarily adding an unlisted export
(an extra re-export from @endo/agent-tools's root entry point) each made
the corresponding exports.test.js fail with a clear diff; reverting each
change restored a passing test.

Compatibility Considerations

None; no runtime source changed.

Upgrade Considerations

None.

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.
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