Repository navigation
Conversation
[Medium impact] The reviewed changes appear safe to merge. SummaryRetains source-proven Electron main-to-renderer sends through static analysis, worker transfer, application counts, and graph edges.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Source call] --> B[Shared allocation and mutation checks]
B --> C[IPC fact with receiver and source range]
C --> D[Worker schema]
D --> E[Main transmission count]
D --> F[Allocation-scoped channel and sends edge]
F --> G[Renderer delivery remains unknown]
Reviews (1) · Last reviewed commit: "feat(javascript): retain source-proven m..." · Reviewed by Greptile |
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. |
|
Hi @morluto, this PR is ready for review. It preserves source-proven main-to-renderer Electron IPC sends, including repeated sends after The author-readiness declaration is complete. The PR body includes the reproduction, 1,156 passing targeted tests, required check results, and the Windows/Vite validation limitation. Could you take a look when you have time? Thanks! |
|
Thanks for this. On current main it conflicts in 13 hunks across 7 files, mostly in the JavaScript semantic core: |
|
@frabcd thanks for the PR — this branch has merge conflicts with |
Summary
Retain source-proven main-to-renderer Electron IPC sends in static application analysis.
BrowserWindow.webContents.send/postMessageandwebContents.mainFrame.send/postMessagepreviously disappeared while corresponding renderer listeners remained visible.Problem and expected behavior
On base
1173c0a9, a directory containing two main sends and two renderer listeners reports only 2 IPC operations. The change retains all 4, withmain_transmissions: 2, source ranges and destination allocation identity. This is a static syntax result, not proof of delivery.Change and scope
The existing BrowserWindow allocation/mutation resolver admits the four supported receiver/method combinations. Its allocation proof is shared with the mutation producer: proven native messaging and existing
loadFile/loadURLoperations preserve receiver identity, while argument escapes and invalidated receivers retain conservative effects. Loading checks the delegated WebContents methods too. This prevents a preceding load or send from hiding later sends on the same window. Main sends require receiver provenance in both the domain type and worker transport. Summary and graph consumers use those facts; no second receiver parser or runtime probe is added.Distinct window allocations retain distinct channel nodes. Same channel text does not pair a main send with an arbitrary renderer listener. Dynamic channels stay unresolved; replaced, shadowed and lookalike receivers are excluded.
Contract and boundary impact
analyze-javascript-application/analyze_javascript_applicationgain main send facts andsummary.ipc.main_transmissions.Expected effects:
Evidence and regression coverage
Executed baseline: the six new public CLI/MCP cases fail for missing main sends; four existing scoped IPC controls pass. The later repeated-send regression also failed on the intermediate implementation in both transports (11 operations instead of 12). Producer regressions exposed receiver escape after native loading. On the final change, 1,156 tests pass across 24 files, covering the semantic producer, both public transports, application projection, worker schema validation and receiver admission.
Coverage includes load-then-repeated-send, aliases, webContents/mainFrame operations, two same-channel windows, existing renderer-to-main pairing, dynamic channels, fake/shadowed/modified receivers, delegated loading method replacement, mandatory worker provenance and historical count absence. Targets are inert fixtures; no fixture code is executed. Scoped independent review found the loading regression fixed with no remaining actionable issue.
Validation performed
npm run test:focused -- tests/boundary/cli/electronMainTransmissions.test.ts tests/boundary/cli/electronScopedIpc.test.ts src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.test.ts tests/boundary/filesystem/javascript-applications/electronApplicationAnalysis.test.ts— runtime build succeeded; 31 passed, 45.03s.node scripts/rea.mjs analyze-javascript-application <fixture> --source-path main.cjs --source-path preload.cjs --format json— original two-send/two-listener fixture now reportsoperations: 4,main_transmissions: 2,renderer_listeners: 2; no speculative pairing.npm run check— exit 0: typecheck, lint, formatting, Knip, metadata, module boundaries, architecture guards, reachability and typed lint. Typed lint reports 0 errors and 3,670 advisory warnings across 5,433 files; this is not a warning-free claim.npm run docs:check— exit 0, including 9 README conformance tests.npm run verify:test-discovery— all 2,498 test files discovered exactly once.git diff --check— passed.Windows x64, Node24.22.1, npm11.16.0, Vitest5.0.3. The locked Vite8.3.5 Rolldown native binding is blocked by Windows Application Control; its WASM backend cannot resolve the Windows source paths. Tests ran with Vitest's supported Vite7.3.7 peer in ignored local dependencies, using the repository's unchanged config. Manifests/lockfile and security controls were not modified. Exact locked Vite8 test execution remains unverified on this host.
Compatibility, safety, and release
No migration or target authority change.
sendToFrame,event.reply, dynamically obtained WebContents and wrapper substitution beyond source-proven receivers remain unsupported by this pass. Receiving renderer identity, listener reachability and runtime delivery remain unverified. No real Electron GUI, Hopper, Ghidra or IDA session was exercised. This is not a performance improvement claim; agent tokens, CPU and process-family peak memory were not benchmarked.Author readiness
Human owner: @frabcd
Before merge