Repository navigation
fix(javascript): ignore Electron callee names that only share a suffix - #2714
Facetomyself wants to merge 3 commits into
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. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 536ade2906
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d69b21aff1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Each call now parses callee segments once and derives its display name from that array. The same named path representation flows into endpoint classification; service-worker matching consumes a pre-split constant and single-member load checks read the final segment. The web-bundle consumer uses the same contract. Superseded repeated AST walks and per-match string splitting were removed. Performance effects have not been measured. Source-inspected at |
62d7ead to
0215068
Compare
morluto#2678) loadFile, loadURL, and serviceWorker.register matched any callee ending with those spellings. uploadFile, downloadURL, and myserviceWorker.register were recorded as renderer or service-worker evidence, and the loadURL suffix also became a network endpoint.
A computed key that contains a dot was joined into the dotted callee name, so api["fake.loadURL"] still matched loadURL. Compare the tail of the AST member segments instead.
0215068 to
012114e
Compare
Preserve CommonJS literal paths and confined ESM URL semantics, including package main fallback, directory intent, Unicode identity, and present opaque modules. Parse extraction inputs at their AST/source owner, retain skipped HTML and source-map coverage, and distinguish endpoint candidates from proven receiver facts. Version structural fingerprints with computed literal contents and propagate them through worker contracts. Reviewed fixes include #1810, #1840, #2642, #2700, #2702, #2714, #2803, #2960, #2968, #2986, #3035, and #3036. Validation: 158 resolver tests passed; public CLI/MCP module lookup controls, package-main/Unicode workflows, and six builtin workflows passed in the current compiled lane. Worker schema/fingerprint regressions passed. Large public pdf.js completion and real Electron analysis remain unverified.
|
Superseded by the delivered change on main: b91b7e01a. Electron callee recognition distinguishes complete builtin names from suffix collisions, with positive and negative producer regressions. Closing this earlier proposal. Current main qualification passed: https://github.com/morluto/rea/actions/runs/38690953281. |
|
Thanks @Facetomyself for catching Electron callee-name suffix collisions. Main has the identity correction so similarly named calls do not become Electron API evidence. |
Summary
Fixes #2678. Static JavaScript analysis no longer treats a callee as
loadFile,loadURL, orserviceWorker.registerjust because its name ends with those characters. Exact calls and real member paths still match.Problem and expected behavior
inspectCallusedname.endsWith("loadFile"),name.endsWith("loadURL"), andname.endsWith("serviceWorker.register").endpointArgumentused the sameloadURLsuffix. The same function already requiresname === "Worker" || name.endsWith(".Worker").On the pre-fix sources, these calls were reported as renderer roles, service-worker references, or network endpoints:
uploadFile("./secret.html")andpreloadFile("./also.html")became rendererloadFilecallsdownloadURL(...),reloadURL(...), andnotloadURL(...)became rendererloadURLcalls and network endpointsmyserviceWorker.register("./nope.js")became a service-worker referencewin.loadFile,BrowserWindow.loadURL,navigator.serviceWorker.register, a bareloadFile(...), andwin?.loadURL(...)should still be recognized.Change and scope
isDottedCalleematches only an exact callee or a dotted path ending in.member.serviceWorker.registeruses that same rule, sonavigator.serviceWorker.registermatches andmyserviceWorker.registerdoes not.This is an ordinary fix inside the existing static-analysis boundary. No new provider, capability, or maintainer scope decision applies.
indexedDB.openandcaches.openstill use a bare suffix and are not part of this change.Follow the contribution scope.
Contract and boundary impact
javascriptStaticAnalysisCalls.tsandendpointArgumentinjavascriptStaticAnalysisHelpers.ts, after the callee name is already built.docs/public/product-catalog.json), package, or installation impact: none.Expected effects:
Evidence and regression coverage
Tests added:
src/domain/javascript/javascriptStaticAnalysisCalleeBoundary.test.ts.Base reproduction: with the new test present and the two source edits stashed, at base
67c7a24e,vitest run --project domain src/domain/javascript/javascriptStaticAnalysisCalleeBoundary.test.tsfailed 1 and passed 1. The negative case received renderer roles foruploadFile,preloadFile,downloadURL,reloadURL, andnotloadURL, network endpoints for the three URL names, and a service-worker reference formyserviceWorker.register. The positive case already passed.After the fix: that file passed 2/2.
electronStaticAnalysisOptions.test.tspassed 4, andwebBundleAnalyzer.test.tspassed 22, including the existingwindow.win.loadURLendpoint case.User-visible CLI/MCP output: no command or schema change. The corrected fields are static-analysis
role_paths,references, andendpoints.Remaining proof gaps:
npm run check:fast, the full suite, and a real Electron application were not run.Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npx vitest run --project domain src/domain/javascript/javascriptStaticAnalysisCalleeBoundary.test.tson the pre-fix sources — 1 failed, 1 passed.npx vitest run --project domain src/domain/javascript/electronStaticAnalysisOptions.test.ts src/domain/webBundleAnalyzer.test.ts src/domain/javascript/javascriptStaticAnalysisCalleeBoundary.test.ts— 28 passed.Compatibility, safety, and release
AI assistance
Grok assisted with the investigation, the patch, the regression test, validation, and this description. The branch is pushed from the Facetomyself fork.
Before merge
type(scope): outcome.