Repository navigation
perf(javascript): skip nested callables during fingerprint traversal - #1871
Merged
morluto merged 1 commit intoOct 11, 2026
Merged
Conversation
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. |
3 tasks done
Owner
|
Thanks, @cyanseek, for teaching the shared AST walker to skip child subtrees and using that at nested-callable boundaries. A parent fingerprint no longer re-walks nested function bodies, while each nested callable still gets its own fingerprint; your parity checks cover generated nesting and complete published parser sources. |
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.
Summary
Skip nested callable subtrees while collecting a function's syntax fingerprint. Related to #1065 and the cooperative traversal introduced in #1545.
Problem and expected behavior
fingerprintSyntaxStepswalks each callable's complete subtree, then ignores nodes belonging to nested callables. A deeply nested function body is therefore visited once for every enclosing function even though it contributes tokens only to its own fingerprint. Fingerprint collection should visit the syntax owned by the current callable while preserving every existing fingerprint.Change and scope
Add an optional child-subtree
skippredicate to the shared AST traversal. Fingerprints use it at nested callable boundaries, replacing the local callable stack. The root is still visited; skipped children receive neither enter nor exit callbacks. Traversal order, ancestor snapshots, and cooperative checks remain intact. Each nested callable still gets its own fingerprint in the existing outer collection loop.Contract and boundary impact
Evidence and regression coverage
@babel/[email protected]lib/index.js, and the complete[email protected]UMD file. The published-package sources provide semantic parity coverage.069308b; final patch integrated withd3e9ee5, followed by static, domain, focused, and MCP parity verification.Generated input
Save as the only
main.jsin an input directory. Runrea analyze-javascript-application <directory> --artifact-format directory --format jsonwith stdout fully consumed. Semantic timing callsanalyzeJavaScriptSemantics(source)separately, excluding result serialization.Validation performed
npm run check— passed, including typecheck, lint/module boundaries, formatting, Knip, metadata, and architecture guards.npm run build:cached— passed.node node_modules/vitest/vitest.mjs run --project domain src/domain/javascript --maxWorkers=2— 844 passed across 44 files.npm run test:focused --the two changed test files,javascriptApplicationCancellation.test.ts,javascriptAnalysisCancellation.test.ts,javascriptCancellationCli.test.ts, andpackageSubpathsCli.test.ts— 34 passed; two POSIX SIGINT cases use the suite's existing Windows skip. SDK cancellation/recovery and native Windows CLI/MCP cases passed.git diff --checkand commit hooks — passed.Compatibility, safety, and release
No breaking change, migration, or package metadata change. Verification covers native Windows static JavaScript workflows. Hopper/Ghidra/browser execution is outside this change; no new engine or runtime-execution capability is claimed.
Review checklist