Repository navigation
fix(electron): resolve const object and function bindings in contextBridge exposures - #9503
saariuslystoned wants to merge 19 commits into
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
[High impact] The changes reach shared JavaScript analysis as well as Electron preload reconstruction. The PR should not merge until callback scope handling stops hiding real Electron method overwrites. Findings
Fix with agent prompt### Issue 1
src/domain/javascript/javascriptSemanticAnalysis.ts:4438-4444
`evaluateGroupByStatements` copies the environment for every block, but `var` belongs to the whole function. For example:
```js
Object.groupBy([ipcRenderer], () => {
var key = "skip";
{ var key = "all"; }
return key;
}).all[0].invoke = replacement;
```
This replaces the real `ipcRenderer.invoke`. The evaluator instead puts the item under `"skip"`, so the caller drops the `"all"` write without taking its conservative fallback. Later calls can still appear as genuine IPC.
Use binding-aware evaluation, or fall back when the callback contains declarations or effects this evaluator cannot safely model.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryRecovers constant-bound, frozen, nested, and callable Electron
Review was source-based; no runtime reproduction was performed. Supersession could not be checked because GitHub authentication was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Parsed exposure] --> B[Direct shape collection]
A --> C[Deferred binding and mutation checks]
C --> D[Resolved shape and source ranges]
B --> E[Symbolic fallback and callable tracing]
D --> E
E --> F[Worker transfer]
F --> G[Boundary graph and IPC paths]
Reviews (11) · Last reviewed commit: "fix(javascript): scope groupBy blocks an..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff01d982a1
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bba9dbf8f
ℹ️ 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".
…duplicate-key order
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccd5ed3a89
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 370d0d3bb1
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb60a208af
ℹ️ 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".
…on snapshots, and track frozen Electron writes
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c6c71f757
ℹ️ 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".
…tity, and nested bridge sources
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58f06ebef1
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efb1e2305d
ℹ️ 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".
…tbridge-const-bindings
…rapped bridge APIs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a23f2d653e
ℹ️ 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".
…tbridge-const-bindings
…extBridge accessors dynamic
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c538e041a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a31ccf9180
ℹ️ 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".
…and preserve fresh containers
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9bb37f42e
ℹ️ 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".
…cessor identities
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ad484486d
ℹ️ 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".
…t.get member-write identities
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d44642ed4
ℹ️ 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".
| } else if (t.isNewExpression(node)) { | ||
| enqueueOpaqueInvocationArguments(node.arguments, current, pending); |
There was a problem hiding this comment.
Preserve fresh-instance identity for resolved constructors
In a CommonJS preload containing class Box { constructor(ipc) { this.ipc = ipc; } } const local = new Box(ipcRenderer); local.invoke = () => 0;, the assignment changes only the fresh instance. This branch nevertheless treats constructor arguments as possible result identities, attributing the assignment to electron.ipcRenderer.invoke. Consequently, intactExport suppresses subsequent genuine IPC endpoints and bridge forwarding paths that the parent revision retained. Resolve known constructor return/instance facts before applying the opaque argument-alias fallback; storing an argument on an instance does not make the instance that argument.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| if (t.isBlockStatement(stmt)) { | ||
| const inner = evaluateGroupByStatements(stmt.body, env, ctx, depth + 1); |
There was a problem hiding this comment.
Respect block scope when evaluating groupBy callbacks
For Object.groupBy([{}, ipcRenderer], (_item, i) => { const key = "all"; if (i === 0) { const key = "skip"; } return key; }), both native callback results are "all". The new evaluator instead shares this name-keyed environment across nested blocks, leaking the inner const and producing skip: [0], all: [1]. A subsequent g.all[0].invoke = () => 0 therefore gets attributed to Electron even though it only modifies the first, fresh object, suppressing genuine downstream IPC endpoints. Preserve lexical binding identities/scopes in callback evaluation, or leave the partition unresolved when those facts cannot be established.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| ctx.pending.push({ | ||
| ...ctx.current, | ||
| node: target, | ||
| suffix: ["__proto__", ...ctx.current.suffix], |
There was a problem hiding this comment.
Separate prototype identity from proto property reads
In a CommonJS preload, const obj = { __proto__: {}, ["__proto__"]: ipcRenderer }; const p = Object.getPrototypeOf(obj); p.invoke = () => 0; modifies the fresh prototype object, not Electron. Translating getPrototypeOf into an ordinary "__proto__" property selection instead follows the unrelated own data property. The write index consequently invalidates electron.ipcRenderer.invoke and removes subsequent genuine IPC endpoints and bridge paths. Preserve an internal prototype-selection fact distinct from user-defined property lookup; the shared branch also affects Reflect.getPrototypeOf.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
…tbridge-const-bindings Keep main's wrapper-depth budget and alias-selection precision, and retain shared contextBridge member budgets and returned-reference frames. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Nested groupBy callback blocks no longer leak const bindings into the outer key. Alias expansion uses semantic precision after main removed the fixed cap, and the contextBridge budget type stays with analysis state so the semantic modules do not form a new import cycle. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b3f5ab84d
ℹ️ 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".
| callArgs[1], | ||
| new Set<string>(), |
There was a problem hiding this comment.
Preserve own-property shadowing in setPrototypeOf result lookups
For a CommonJS preload using the native intrinsic, const v = Object.setPrototypeOf({ ipc: {} }, { ipc: ipcRenderer }); v.ipc.invoke = () => 0; only changes the fresh own ipc object. Passing an empty shadowed-key set nevertheless adds the prototype's ipcRenderer as a write target, so electronMemberWriteExports records an electron.ipcRenderer.invoke overwrite and intactExport suppresses subsequent genuine IPC endpoints and bridge paths. Resolve the target's effective own properties before following its prototype, as the adjacent Object.create handling already does for descriptor-defined slots.
AGENTS.md reference: AGENTS.md:L27-L27
Useful? React with 👍 / 👎.
| const last = expr.expressions.at(-1); | ||
| return last === undefined | ||
| ? undefined | ||
| : evaluateGroupByExpression(last, env, ctx, depth + 1); |
There was a problem hiding this comment.
Reject effectful sequence prefixes in groupBy partitioning
For a CommonJS preload with native Object.groupBy, const g = Object.groupBy([{}, ipcRenderer], (_x, i) => (i = 1, i === 0 ? "skip" : "all")); g.all[0].invoke = () => 0; only mutates the first fresh object, because both callback invocations return "all". Evaluating only the final comma operand ignores i = 1 and constructs the exact partition skip: [0], all: [1]; the downstream write is therefore attributed to ipcRenderer.invoke, suppressing genuine endpoints and forwarding paths. Consume the value/effect owner's facts, or leave the partition unresolved when preceding expressions can mutate callback bindings.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
|
Closing this. At about 10k lines with findings still open after many review rounds (constructor instance identity, |
| if (t.isBlockStatement(stmt)) { | ||
| const inner = evaluateGroupByStatements( | ||
| stmt.body, | ||
| new Map(env), | ||
| ctx, | ||
| depth + 1, | ||
| ); |
There was a problem hiding this comment.
evaluateGroupByStatements copies the environment for every block, but var belongs to the whole function. For example:
Object.groupBy([ipcRenderer], () => {
var key = "skip";
{ var key = "all"; }
return key;
}).all[0].invoke = replacement;This replaces the real ipcRenderer.invoke. The evaluator instead puts the item under "skip", so the caller drops the "all" write without taking its conservative fallback. Later calls can still appear as genuine IPC.
Use binding-aware evaluation, or fall back when the callback contains declarations or effects this evaluator cannot safely model.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/javascript/javascriptSemanticAnalysis.ts
Line: 4438-4444
Comment:
**Blocks hide method overwrites**
`evaluateGroupByStatements` copies the environment for every block, but `var` belongs to the whole function. For example:
```js
Object.groupBy([ipcRenderer], () => {
var key = "skip";
{ var key = "all"; }
return key;
}).all[0].invoke = replacement;
```
This replaces the real `ipcRenderer.invoke`. The evaluator instead puts the item under `"skip"`, so the caller drops the `"all"` write without taking its conservative fallback. Later calls can still appear as genuine IPC.
Use binding-aware evaluation, or fall back when the callback contains declarations or effects this evaluator cannot safely model.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
Recover Electron preload
contextBridge.exposeInMainWorldandcontextBridge.exposeInIsolatedWorldAPI shapes and IPC forwarding paths when the exposed API argument is hoisted into an immutableconstorfunctionbinding, wrapped in an unmodified intrinsicObject.freeze(...)or TypeScript/parenthesized expression wrapper, composed from nestedconstsub-objects, or exposed directly as a callable function.Previously,
inspectContextBridgeinspectedcall.argumentsinline during the initial AST walk without consultingJavaScriptBindingIndex, andcollectContextBridgeMembersdegraded every non-inlineObjectExpressionargument to{ status: "dynamic", members: [], unknown: 1 }. Real-world bundled Electron preload scripts (esbuild, Rollup, Rolldown, Vite, Webpack) routinely hoist API objects intoconstbindings, wrap them inObject.freeze(...), or expose single functions directly, leavingexposed_api_membersempty and missing preload-to-IPC forwarding paths.No existing issue is linked; this is a standalone Electron static-analysis accuracy fix discovered while auditing preload boundary reconstruction.
Problem and expected behavior
Smallest triggers on base:
Hoisted
const/Object.freeze/ nestedconstpreload exposure:Base behavior:
api_status: "dynamic",members: [],unknown_members: 1(violating parity withfinishElectronBrowserWindowsSteps, which already defersBrowserWindowoptions and resolves proven immutableconstinitializers throughJavaScriptBindingIndex).Expected behavior:
api_status: "object-literal",members: ["nested", "nested.notify"],unknown_members: 0,resolution_sourcesrecording the substituted AST initializer ranges, and candidatebridge-memberIPC call paths emitted.Direct callable exposure:
Base behavior:
api_status: "dynamic",members: [],unknown_members: 1, and nocall_pathsentry for ESM Electron imports or direct function exposures.Expected behavior:
api_status: "function",members: [],unknown_members: 0, and abridge-membercall path (entry: "uploadItem",entry_path: ["uploadItem"],channel: "items:upload",terminal: "electron.ipcRenderer.invoke").Change and scope
electronStaticContextBridge.ts,electronStaticAnalysisBrowser.ts,javascriptStaticAnalysis.ts):inspectContextBridgedeferscontextBridge.exposeInMainWorld/exposeInIsolatedWorldcalls whose API expression (or nested object property up tocontextBridgeMemberPathDepth) contains anIdentifieror call wrapper intopendingContextBridgeApis, then resolves them infinishElectronContextBridgesStepsviaJavaScriptBindingIndexandindexMemberMutationFactsSteps()beforecollectElectronWrappedCallPathsStepsruns.Identifierreferences (root and nested object properties) only when bound to a single proven non-rebindableconstorFunctionDeclarationinitializer with a definite initializer at the read site (immutableLexicalInitializerAtRead) and!index.referenceMayHaveChangedAt(site, ref)(rejectinglet/var, reassignments, prior/uncertain property mutations, escapes, TDZ reads, parameters, shadowed bindings, classic-script ambient global function overwrites, and cyclic object/binding references).Object.freezehandling (javascriptSemanticObjectFreeze.ts,javascriptSemanticMemberMutations.ts):Object.freeze(expr)only when globalObject.freezeidentity is intact and unescaped.collectSemanticMemberMutationsStepsonly whenObject.freezetargets an ordinary object literal or function (isIntrinsicOrdinaryObjectFreezeCall, excludingProxy/TypedArray/opaque targets), while forwarding member-mutation paths throughunwrapUnmodifiedObjectFreezeArgumentinbranchReferenceValuesso shallowObject.freeze({ sub })still marksapi.sub.extra = ...ormutate(api)as unsound for nestedsub.electronStaticAnalysisValues.ts,electronWrappedCallPaths.ts,javascriptSymbolicBindings.ts):"function"toElectronContextBridgeFinding["api_status"](members: [],unknown_members: 0) for inline and constant-resolved functions, and enforces a shared per-fileContextBridgeMemberBudget(4,096visits,131,072UTF-8 bytes checked before path-string allocation) across inline, deferred, and symbolic inventories so shared sub-object DAGs stay bounded and mark truncated branches unknown.contextBridgeexposures incollectElectronWrappedCallPathsSteps(entry_kind: "bridge-member",entry_path: [apiKey]), unwraps unmodifiedObject.freeze(...)inJavaScriptSymbolicBindings, and resolves intact ESMimportbindings from"electron"viaJavaScriptElectronIdentityso ESM preload scripts participate in call-path tracing and IPC pairing.expose(key, value),bag.api,{ ...shared }, and isolatedworld_idconstants) while retaining resolvedapi_status("object-literal"/"function") andresolution_sourceson complete direct API shapes.ElectronBoundaryGraphWindows.ts):astObservationEvidence(operation: "observe-context-bridge-api", noresolution_sources).Object.freeze-substituted exposures projectresolution_sourcesandstaticInferenceEvidence(operation: "resolve-context-bridge-constant-api").Object.assignfolding, or dynamic runtime property synthesis.Follow the contribution scope.
Contract and boundary impact
src/domain/javascript/(javascriptSemanticObjectFreeze.ts,javascriptSemanticMemberMutations.ts,electronStaticContextBridge.ts,electronStaticAnalysisValues.ts,electronStaticAnalysisBrowser.ts,javascriptSymbolicBindings.ts,electronWrappedCallPaths.ts), consumed bysrc/javascript/analysis/JavaScriptAnalysisWorkerSchemas.tsandsrc/application/javascript/ElectronBoundaryGraphWindows.ts.Not applicable — ordinary static-analysis accuracy fix within existing JavaScript/Electron read-only static reconstruction boundaries.
No CLI flag or MCP tool-input schema changes. JavaScript static analysis and application-graph
context-bridge-apiobservations may reportapi_status: "function"andresolution_sourceswhen constant/frozen bindings are resolved.Platform-neutral Babel AST and semantic analysis over CommonJS, ESM, and TypeScript-annotated Electron preload sources.
Direct inline AST observations remain
state: "observed"(authority: "ast-static-analysis",operation: "observe-context-bridge-api"), whereas constant-binding andObject.freezesubstitutions emitstate: "inferred"(authority: "static-relationship-inference",operation: "resolve-context-bridge-constant-api") withresolution_sourcesranges. Uncertain or mutable bindings remainapi_status: "dynamic"with explicitunknown_memberscounts.Not applicable — pure static AST analysis; never executes target JavaScript.
docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs):None;
docs/guides/javascript/javascript-artifact-reconstruction.mdupdated to documentconst/Object.freeze/callablecontextBridgeresolution.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/domain/javascript/electronContextBridgeBindings.test.ts: hoistedconst,Object.freeze, pre-frozenconst, nestedconstDAGs,as const/satisfies/!wrappers inexposeInMainWorldandexposeInIsolatedWorld; inline,const,Object.freeze, andFunctionDeclarationcallable exposures with ESM/CJS IPCcall_paths; nested member expressions (bag.sub) via symbolic fallback, unknown nested leaves, and duplicate-key overwrite order; source-order preservation; soundness negative cases (let,var, reassigned binding, property mutation, escaped binding,Object.assignmutation, mutated callable, shadowed/overwrittenObject.freeze, cyclicconstaliases, self-referential/mutually recursiveconstobjects, shallowObject.freezenested mutations/escapes, TDZ read-before-init, uninvoked parameters, shadowed bindings, classic-script global function overwrite, unknown external identifier); sharedexpose(key, value)helper regression.src/application/javascript/JavaScriptArtifactGraphElectronCoverage.test.ts: end-to-end application graph test verifyingcontext_bridge_apis,exposed_api_members,paired_renderer_transmissions,join-electron-wrapper-paths(invokesandsendsedges),resolution_sources, andobserve-context-bridge-apivsresolve-context-bridge-constant-apievidence separation.src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.test.ts: worker transfer schema round-trip validation forapi_status: "function"andresolution_sources.Executed against synthetic fixtures above; on base
88cf49803, hoistedconst,Object.freeze, and callablecontextBridgeexposures fail withapi_status: "dynamic",members: [],unknown_members: 1, and missing ESMcall_paths.Representative
context-bridge-apinode observation properties inJavaScriptApplicationGraph:{ "api_status": "object-literal", "members": ["nested", "nested.notify"], "unknown_members": 0, "resolution_sources": [ { "kind": "source-range", "source": "preload.js", "start": { "line": 3, "column": 36 }, "end": { "line": 3, "column": 54 } }, { "kind": "source-range", "source": "preload.js", "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 73 } } ] }Cross-module preload object imports remain conservative (
api_status: "dynamic") by design.Boundary regressions covered:
JavaScriptAnalysisWorkerSchemas.test.ts) forapi_status: "function"andresolution_sources.JavaScriptArtifactGraphElectronCoverage.test.ts) keepingast-static-analysis(observed) distinct fromstatic-relationship-inference(inferred) and joining preload wrapper paths toipcMainhandlers.For evidence-bearing changes:
Validation performed
npx oxfmt . && npx oxfmt --check .— passed (All matched files use the correct formatacross 7,234 files)npm run build:cached— passed (metadata:check,compile,artifacts:skills: 3/3 tasks succeeded)npm run check:fast— passed (typecheckandlint+verify:module-boundaries: 2/2 tasks succeeded, 0 errors)npm run verify:architecture-guards && npm run verify:test-discovery && npm run scan:todos && npm run metadata:check && npm run mcp-catalog:check && npm run docs:check— passed (2,550 source files, 3,197 test files discovered once, 0 tech-debt markers, package/MCP metadata and 9/9 docs checks clean)npm run jscpd && npm run knip && npm run knip:production && npm run lint:typed— passed (3.45%duplicated lines, Knip clean,lint:typed0 errors)v22.23.4,v24.22.1,v26.13.0) acrosselectronContextBridgeBindings.test.ts,JavaScriptArtifactGraphElectronCoverage.test.ts,JavaScriptAnalysisWorkerSchemas.test.ts,electronStaticAnalysisOptions.test.ts,electronStaticAnalysisIdentity.test.ts,electronModuleInterop.test.ts, andelectronWrappedCallPaths.test.ts— passed (all 7 suites passed on each runtime, including 6,000-alias and 125,000-member stress cases)rea analyze-javascript-application --format json) and stdio MCP (analyze_javascript_application) parity probe on hoistedconst+Object.freeze+ nestedconstpreload fixture — passed (context_bridge_apis: 1,exposed_api_members: 3,ipc.paired_renderer_transmissions: 1)Compatibility, safety, and release
None.
ElectronContextBridgeFinding.api_statusadds"function"alongside"object-literal" | "dynamic" | "missing"and optionalresolution_sourcesranges;exposed_api_memberscontinues counting dotted object members (0for direct bare callables).Not applicable — pure TypeScript static JavaScript/Electron AST and semantic analysis.
None.
Read-only static analysis over parsed ASTs; no target code execution, process attachment, or network access. Soundness invariants keep mutable, escaped, shadowed, or overwritten bindings
"dynamic"rather than over-claiming exposed API surfaces.Author readiness
Human owner: @saariuslystoned
Before merge
type(scope): outcome.