Repository navigation
Conversation
…al callee
Webpack and Next.js emit `(0, module.export)(...)` for every imported call.
`calleeName` returned "" for that sequence callee, so named endpoint
detectors in analyze_web_bundle and analyzeJavaScriptStaticSource missed
calls such as `(0, r.fetch)("/api/a")` and `(0, o.get)("/api/b")`.
`calleeName` now reads the final comma operand when every discarded operand
is an exact literal. Any other operand may replace the callee, so effectful
or rebinding prefixes keep an empty name. The name stays spelling only:
receiver facts and intrinsic proofs still read the original callee, so
`(0, navigator.sendBeacon)(...)` stays an unverified candidate.
The tRPC factory reader's own sequence unwrapping is superseded and removed;
it now shares the literal-operand rule. The Electron call-path label keeps
its value-semantics unwrapping because it labels what the symbolic evaluator
followed.
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The change reaches results across JavaScript source-analysis workflows, not runtime behavior. The code changes appear sound, but the required issue discussion remains outstanding before merge. Findings
Fix with agent prompt### Issue 1
src/domain/javascript/javascriptStaticAnalysisHelpers.ts:729-733
This change adds shared callee-name recovery, but the PR says there is no linked issue. The repository requires opening or discussing an issue that explains the problem and proposed solution before submitting changes. Open that discussion and link it here; this requirement must be satisfied before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryNames literal-prefixed comma calls by their final callee without treating the name as proof of browser API identity.
Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
|
TL;DR: I ran the 2 changed test files on Node 22.23.4, 24.22.1 and 26.12.1, and all 176 tests passed on each version. With the 2 source files swapped back to the base, 2 tests failed on each version. The ResultsI ran head aad1eb3. The red run used the same head and test files, with
On Node 24.22.1, these two tests failed in the red run:
Node 22.23.4 and Node 26.12.1 fail the same two tests. The PR changes 5 files against the merge base. Two are test files, and three are The head is 50 commits behind main c78c8ae. CI on the head, read live with
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/domain/javascript/javascriptRpcEndpoints.test.ts src/domain/webBundleAnalyzer.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
@sueun-dev thanks for the PR — there is 1 open review thread here:
Could you address or reply to this? Once it's resolved and CI is green we can take another look. |
|
@sueun-dev also, this branch has merge conflicts with |
…let-4c1ca8 # Conflicts: # docs/guides/javascript/javascript-artifact-reconstruction.md # src/domain/javascript/javascriptRpcEndpoints.test.ts
Summary
Webpack and Next.js minifiers emit
(0, module.export)(...)for every importedfunction call.
calleeNamereturned""for that sequence-expression callee, sothe named endpoint detectors in both
analyze_web_bundleandanalyzeJavaScriptStaticSourcemissed calls such as(0, r.fetch)("/api/a")and(0, o.get)("/api/b"). They now report these calls as unverified endpointcandidates, the same way they report
r.fetch("/api/a").Fixes #14388. The gap turned up while probing a fetch-wrapper detector.
Problem and expected behavior
Smallest trigger:
(0,r.fetch)("/api/a")inside a webpack chunk. Before thischange neither analyzer reported anything.
(0, f)only drops the receiver, sothe callee spelling is the final operand
r.fetch.Expected: a low-confidence candidate (
call:r.fetch:unverified-network-receiverin the web bundle,
call:r.fetchwithinterpretation: "candidate"in staticanalysis), never an observed endpoint, because the spelling proves no receiver
or intrinsic identity.
Change and scope
calleeName(javascriptStaticAnalysisHelpers.ts) now reads the final commaoperand only when every discarded operand is an exact literal. Any other
operand may replace the callee before it is read, so
(track(), r.fetch)and(r.fetch = y, r.fetch)keep an empty name. A final operand that is not amember or identifier (
(0, r.client()),(0, c ? a : b)) already produced noname.
callee:
isBrowserNetworkRequest,isUnmodifiedGlobalReference, the XHRopenproof and the open-receiver facts.(0, navigator.sendBeacon)("/x")therefore stays a web-bundle candidate, and static analysis still drops it
through its familiar-network-spelling guard. Without its receiver that call
throws, so it never sends a request.
rpcFactoryNameduplicated this unwrapping and isremoved. It now shares the literal-operand rule, so
(track(), t.httpLink)({url})is no longer recognized.callLabelkeeps its own unwrapping on purpose. Itlabels what the symbolic evaluator followed, and that evaluator takes the last
operand of any comma expression (value semantics, not callee spelling).
docs/guides/javascript/javascript-artifact-reconstruction.md.Not included: proving
(0, fetch)or other receiverless intrinsic calls asknown requests.
Contribution scope: an ordinary fix within existing static-analysis boundaries;
a maintainer scope decision is not applicable.
Contract and boundary impact
calleeName, the shared producer ofcallee spellings. I audited every consumer. Each one either classifies by
spelling alone (web-bundle require,
importScriptsand route-framework names;route-scan navigation and structured calls; esbuild wrapper names;
isFileIdentityforfileURLToPath; ElectronsenderSubject; static-analysisWorker, Vite, SQLite,
loadFileandloadURLnames) or gates the spellingwith its own proof on
node.callee. For these consumers,(0, x.f)nowbehaves like
x.f. The superseded copy inrpcFactoryNamewas removed.(existing analyzer behavior).
new endpoint candidates for literal-prefixed comma callees.
their existing low confidence, detector or mechanism, and first-site basis.
The detector names the final callee spelling (for example
call:r.fetch).applicable.
Expected effects:
Evidence and regression coverage
webBundleAnalyzer.test.tsadds a webpack-chunk-shaped fixture that runsthrough both analyzers. Positives:
(0,r.fetch),(0,o.get), and nestedor multi-literal
(0,0,(0,o.post)). Receiver-dropping case:(0,navigator.sendBeacon). Negatives: effectful prefix, rebinding prefix,call result, and conditional final operand.
javascriptRpcEndpoints.test.tsadds an effectful-prefix tRPC link negative.failed with
expected [] to deeply equal [ [ '/api/a', … ], …(3) ].report
/api/effectand/api/rebound, and made the tRPC test report/api/effect. Both failed at the intended assertions; the guard was thenrestored.
receiver-identity negative.
For evidence-bearing changes:
Validation performed
npm run test:local --59 files (webBundle*,javascriptStaticAnalysis*,javascriptRoute*,electron*,javascriptRpc*,javascriptStaticPathResolution,javascriptSemanticAnalysis.member_depth):59 files and 2286 tests passed.
npm run check:fast: typecheck and lint passed (uncached); the pre-push hookalso passed.
b2b93fed5): the same file groups, now 131 files and4749 tests, passed, and
npm run check:fastpassed. With the two source filesswapped back to main
42bbf33f2, the two changed test files fail 2 tests.dependencies with
npm ci --engine-strict=falseon Node 24.21.0.npm run docs:check,npm run check:pr.Compatibility, safety, and release
report additional low-confidence candidates and route or edge names for
(0, x.f)calls.analysis only).
file effects; parsing captured source only.
Author readiness
Human owner:
Before merge
type(scope): outcome.