feat(compartment-mapper): expose findUnknownCanonicalNames()#3205
Merged
boneskull merged 1 commit intoboneskull/ast-servicefrom Apr 30, 2026
Merged
Conversation
Member
Author
|
Warning This PR is part of a stack and targets branch 📚 Pull Request Stack
Managed by gh-stack |
This was referenced Apr 29, 2026
Merged
564f98d to
d74629e
Compare
277cd71 to
77b0347
Compare
🦋 Changeset detectedLatest commit: 198d94c The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Expose `findUnknownCanonicalNames()` from new export `@endo/compartment-mapper/policy.js`. Should be used _after_ `captureFromMap` when called without policy, since unknown canonical names are not emitted by the `UnknownCanonicalNameHook` unless a policy is present.
d74629e to
edbf51e
Compare
77b0347 to
198d94c
Compare
Base automatically changed from
boneskull/cjs-ast-parser
to
boneskull/ast-service
April 30, 2026 01:37
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.
This exports a new function
findUnknownCanonicalNames()frompolicy.js.This function was extracted from the existing
validatePolicyResources()innode-modules.js.The use-case for this function is to help gather unknown canonical names in the case where
mapNodeModules()is called without policy. Currently, policy is required for theunknownCanonicalNameHookto fire, which makes sense. Instead, we can use this new function to compare an arbitrary policy against the result ofmapNodeModules().Practically speaking,
@lavamoat/nodecan use this to compare generated policy and/or policy overrides against the result ofmapNodeModules().