Repository navigation
fix(javascript): prove namespace interop before attributing Electron APIs - #1857
Conversation
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
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. |
|
Review/verification: namespace provenance now depends on the complete helper operations and captured intrinsic identities, rather than helper spelling. The released T3 producer retains four window anchors; the fake-helper public CLI control reports zero. Known mutation, shadowing and reassignment failures are covered. Unverified helper variants and arbitrary cross-call effects remain explicit limits. The integrated focused suite passed 91 tests; the final AST-owner extraction passed 45 source regressions and public CLI checks. Static/type/architecture, docs and test-discovery checks passed. Final 5.4 MB T3 profiling retained four windows; Flameox attributed 43/2,737 self samples to the interop module (single static-producer run, not a before/after benchmark). No target code was executed. Waiting for the remaining CI gates before merging. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ced8778094
ℹ️ 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".
Share one pattern-target walker across lexical definitions, member mutation tracking and Electron identity writes. Keep overwritten globals unresolved without treating property keys or shadowed locals as global replacements. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Include the main-branch Hopper startup timeout normalization already merged in #1866 so combined CI retains launcher diagnostics when either timer fires. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
|
The failed shard hit the Hopper startup/request timeout race already fixed upstream in #1866. Integrated current main ( @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47f8156efe
ℹ️ 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 Resolve known mutators through static binding projections and prove stable identifier chains to fresh literals before widening unknown mutation targets. Keep reassigned, uninitialized and member-projected targets conservative. Cover both review regressions through source tests and inert CLI/MCP fixtures. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
|
@codex review Please review head 5569e96, including both fixes for the previous review. Static intrinsic projections and stable fresh-literal target identity now have failing-before/passing-after regressions. All 63 interop cases, 277 adjacent source cases, four public CLI/stdio MCP cases, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5569e96162
ℹ️ 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".
Recognize stable local function, undecorated class and RegExp targets before widening intrinsic mutations. Keep decorated classes opaque because their binding value can be replaced, and preserve class-initialization writes. Cover fresh targets and replacement decorators in inert CLI/MCP fixtures. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
|
@codex review Please review head b03df22. The fresh function/class/RegExp finding is fixed; decorated classes remain opaque and direct class-initialization intrinsic writes are retained. All 354 affected source and public CLI/stdio MCP tests, full static checks and docs checks passed. The previous head's unrelated first-connect Hopper fixture race is being fixed separately; final CI is running on this head. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b03df22ce4
ℹ️ 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".
Validate each alias read after initialization and retain the original function capture across copies. Share declaration initializer facts with RPC and Electron analysis, including class declarations used for fresh-target identity. Accept single-statement control blocks while keeping lexical roles and added operations checked. Cover the capture regressions through inert source and public CLI/MCP workflows.
Function declarations provide fresh targets before their textual position. Retain initialization-order checks for variable and class values, including aliases. Cover the reviewed regression with source controls and the public CLI/MCP fixture.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b460683d7
ℹ️ 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: 3d1d5b56b2
ℹ️ 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".
|
Merged #1857 ( The eventual sole #1912 CI test failure was a separate static Wasm/Harmony wording-audit omission. #1917 fixes it; all four test shards and CI required pass. Both requested coauthors are preserved and recognized on the actual main commits. Verification covers Linux static workflows; no target runtime or GUI provider claim. |
Keep repeated variable declarations with one unconditional initializer while rejecting assignments, conditional initialization and multiple values. Normalize known intrinsic calls, aliases and bound argument prefixes at the semantic owner, retaining opaque targets without tainting unused bindings or fresh local objects. Cover both regressions through source and CLI/MCP tests. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Include the merged Hopper reconnect-listener readiness fix so local and CI validation use the same current main recovery boundary. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b60248c462
ℹ️ 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: 3e9bce6249
ℹ️ 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: ad27b8b4ff
ℹ️ 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: c98d326514
ℹ️ 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".
| callee = unwrapJavaScriptExpression(callee).node; | ||
| if (visited.has(callee)) return undefined; | ||
| visited.add(callee); | ||
| let path = intrinsicPath(callee); |
There was a problem hiding this comment.
Normalize sequence-wrapped intrinsic calls
When a known mutator is invoked through the common comma-call form (0, Object.defineProperty)(Object, "create", descriptor), intrinsicPath(callee) receives a SequenceExpression, so neither it nor boundIntrinsic recognizes the invocation. The write to Object.create is omitted, allowing the subsequent Rolldown helper proof to trust the replacement and falsely attribute Electron APIs. Normalize a sequence callee to its final expression while retaining traversal of preceding expressions.
AGENTS.md reference: AGENTS.md:L17-L19
Useful? React with 👍 / 👎.
| node: t.Node, | ||
| path: readonly string[], | ||
| ): boolean => { | ||
| const capture = capturedIntrinsic(node)?.capturedAt ?? node; |
There was a problem hiding this comment.
Preserve alias capture time when invoking through call
When a function is captured before its global property is replaced and later invoked through a member, such as const define = Object.defineProperty; Object.defineProperty = replacement; define.call(null, metadata, "x", descriptor), capturedIntrinsic(define.call) timestamps the whole path at the later .call read. The earlier replacement therefore appears to invalidate define even though that alias still holds the original function, and the otherwise harmless local-object mutation becomes an opaque intrinsic write that suppresses valid Electron findings from helpers using the same capture. Preserve the base alias's capture time separately while checking the newly read call member at invocation time.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
Summary
A helper named
__toESMthat returns{BrowserWindow: FakeWindow}currently produces an Electron window observation. This follow-up to #1827 replaces emitted-name trust with structural proof while retaining the released T3 Rolldown namespace conversion. Fixes #1842; validates the original #1802 reproduction.Problem and expected behavior
let electron = require("electron"); electron = __toESM(electron, 1)must retain origin only when the helper preserves that module. Stable names alone cannot prove this. Unproven results must remain unresolved.Change and scope
Contract and boundary impact
Evidence and regression coverage
165 dedicated domain cases cover canonical/renamed helpers, identity helpers, fake/async/generator/fallback helpers, shadowing, reassignment, intrinsic writes, mutators, destructuring, fresh targets, class decorators, class-initialization effects and capture scope.
CLI and production stdio MCP fixture retains seven real construction anchors despite local-object/function/class/RegExp mutation and excludes the fake helper and eight reached modules with overwritten intrinsics, including a destructured mutator, replacement class decorator and bound mutator. All ten JavaScript files are parsed; literal preload resolves, dynamic expression stays unknown.
On main
0b4ce8361, public CLI reports one window for the fake helper; final tree reports zero.Contributor verification on the exact public T3 nightly main producer source (SHA-256
e566055ab42d104b413575920bb62ea7f43677e014ad840fd7319d69fc83cf1f, 5.4 MB) reports four windows and zero parse failures. Dynamic preloads remain visible; resolved preload entrypoints remain zero in this subset.Proof gaps: this is a boot/main source subset, not the complete ASAR. No Electron execution. Arbitrary cross-call side effects and other unverified esbuild/TypeScript/Babel helper bodies remain unresolved.
Observations and derived facts remain distinguishable.
Artifact/source identity and failed attempts remain preserved.
Unknown and partial outcomes remain visible.
Validation performed
npm run check— passed, including architecture guards.npm run docs:check— passed.Maintainer capture and normalization follow-up
Function.prototype.call/applyfollow that receiver to the actual mutator; rebinding keeps the original receiver. Remove the redundant alias traversal from invocation normalization. Five valid generic-invocation controls failed before this correction; eight new cases cover generic invocation, receiver-preserving rebinding and fresh targets. The public CLI control reported eight windows before correction. Both final CLI/MCP controls retain seven windows across all ten parsed JavaScript files. This addresses review thread discussion_r4242338265.Compatibility, safety, and release
Review checklist