Repository navigation
fix(javascript): omit self-referential bundler edges with disclosure - #1153
Closed
kaoru0822-kitauji wants to merge 1 commit into
Closed
kaoru0822-kitauji wants to merge 1 commit into
kaoru0822-kitauji wants to merge 1 commit into
Conversation
A webpack/Rspack chunk file that lazily requests one of its own chunk
ids (`__webpack_require__.e(<own id>)`, including merged multi-id
chunks) produced a bundler-async-chunk edge from the chunk to itself. A
bundled module that requires its own key (`r(50)` inside module 50) did
the same through the static-reference composer. The application graph
forbids self-referential edges, so one such edge failed result
validation and lost the entire analysis ("Result schema rejected ...
(custom)").
Apply the treatment #1130 gave self-imports to both composers: skip the
edge, count it, and disclose the omission in the graph limitations. The
shared helper keeps the existing self-import wording.
Fixes #1146
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Collaborator
Author
Owner
|
Thanks @kaoru0822-kitauji for surfacing how self-referential bundler and static-reference edges could invalidate the whole graph result. Main now omits those edges with explicit limitation counts, preserving the rest of the analysis (main). |
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.
Fixes #1146.
Problem
analyze_javascript_applicationlost the whole result when a webpack/Rspack chunk referenced itself:{"code":"unreadable_output","details":{"operation":"analyze_javascript_application","reason":"Result schema rejected 1 issue at /edges/4 (custom)"}}The application graph schema forbids self-referential edges. #1130 skipped and disclosed them only for module import relationships. Following the new AGENTS.md guidance on adjacent cases, I checked every edge composer. Two more emit self-edges, and both are reproduced on
main:JavaScriptArtifactGraphBundlers.ts). A chunk file that requests one of its own chunk ids resolves to its own chunk node. This covers single-id chunks (push([[1],{…r.e(1)…}])) and merged multi-id chunks (push([[3,4],{…r.e(4)…}])). These are the 8 edges in the issue.JavaScriptArtifactGraphFindings.ts). A bundled module that requires its own key (push([[5],{50(e,t,r){r(50)}}])) resolves back to its own module node.Other self-reference shapes I checked do not produce self-edges and are unchanged. They resolve to distinct nodes:
<script src>pointing at its own document;//# sourceMappingURL=naming its own file;Change
addJavaScriptModuleRelationshipsdoes since fix(javascript): omit self-referential import edges with disclosure #1130.graphLimitationsdiscloses each nonzero count through one helper:No schemas change.
Verification
tests/boundary/cli/javascriptSelfReferentialBundlerEdges.test.tsruns through the compiled CLI. It covers single-id and merged self chunk requests (2 omitted, sibling chunk request kept) and a module self-require (1 omitted, sibling require kept). It asserts that no self-edges remain and that the limitations are disclosed. Both tests fail without the source change.analyze_javascript_application: 275 passed, includingjavascriptSelfImportRelationships.test.ts.npm run check:fastI also noticed that async chunk requests resolve only to chunks registered in the same file (
chunkLookupKeyincludes the file path). Cross-file requests staynot-found. That predates this change, which doesn't alter it.No real Hopper or Ghidra verification was run, because this change does not touch those providers.
🤖 Generated with Claude Code