Repository navigation
Conversation
Identifier-aliased invocation member reads like `const change = Object.defineProperty.call; change(...)` invoke Function.prototype.call without a callable receiver and throw TypeError at runtime. Assert the resolver keeps them opaque (conservative unknown), never a confirmed write, while resolvable callables still resolve known and argument-side effects remain recorded.
…terface semantics Verifier: history_mode=none zero-byte inputs are a valid "no records" state (not corrupt); packaged-input existence no longer counts as hash coverage; cancelled runs recorded but ineligible; missing window endpoints produce OBSERVED_PARTIAL + ineligibility instead of a crash; ready_epoch_s required when readiness is claimed. Regression: F18–F22 fixtures for the five focused-review cases (27/27); T8–T10 run the real runner->extract->verify chain for R0 empty-history negative, R1 positive, R2 repeat, and cancelled runs (10/10). Ledger: PR morluto#2465 exists upstream (Draft, approval-blocked); tart pull resolved — image digest pinned; VM precheck pass (SSH, macOS 15.7.7).
|
@greptileai review |
[Medium impact] The PR appears safe to merge; the outstanding explicit-receiver bug is fixed. SummaryPreserves captured invocation-member identity across aliases, bound functions, reads, and writes.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Captured invocation member] --> B{Explicit receiver supplied?}
B -->|Yes| C[Select the receiver as callable]
B -->|No| D[Use existing member rules]
C --> E[Shift call or apply arguments]
E --> F[Check selected callable again]
F --> G{Callable understood?}
G -->|Yes| H[Record its effects]
G -->|No| I[Do not claim an intrinsic write]
Reviews (28) · Last reviewed commit: "fix(javascript): prefer the explicit rec..." · 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d5e11efcd
ℹ️ 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: 3c75efc034
ℹ️ 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: facc35478f
ℹ️ 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. Handled in facc354. The invocation owner preserves receiver loss while peeling comma expressions, so detached call/apply values stay opaque. intrinsicReadChanged follows stable aliases and sequence values through separate invocation-member and base-capture checks. Call-effect offsets now use node.end, preserving findings evaluated in arguments before the opaque invocation takes effect. Added targeted receiver, aliased-capture and converted-window argument regressions. Source inspection and git diff --check completed. Tests, builds, typechecking, lint, and real-provider verification were skipped at the user's explicit request. |
|
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. This finding is already addressed in the current branch. The write owner retains replace-value, mutate-object and opaque as distinct effects; invocation-member reads test immediate object mutation as well as exact slot replacement. Object.assign(define,{call:replacement}) therefore invalidates the captured function's later .call read, while replacing Object.defineProperty alone preserves an already captured function. The existing focused source regression covers this example. The final follow-up also preserves that distinction while fixing destructuring evaluation order. Validation: inspected producing boundaries and affected consumers; targeted source formatting and git diff --check completed. Tests, typechecks, lint, builds, provider runs and CI reruns were not executed, per the user's explicit instruction. No directly related cleanup is deferred. Root cause: whole-assignment end effects and source offsets place every destructuring write after all defaults, even though JavaScript writes each leaf before evaluating later defaults and computed keys. The identity-write owner now traverses destructuring RHS before targets, retains each leaf at its completed assignment point (after its own default), and shares those evaluation boundaries with intrinsic-read/dependency validation. Ordinary assignments remain exit effects. Shared AST child expansion is retained through an explicit field-order override; the superseded aggregate pattern-write path is removed. Authored source regressions cover array/object defaults, bound invocation members, computed keys, for-of patterns, and RHS-before-write preservation. Both related PR branches receive the same structural fix. The evaluation index adds bounded per-AST-node bookkeeping; its performance costs have not been measured. Validation: inspected producing boundaries and affected consumers; targeted source formatting and git diff --check completed. Tests, typechecks, lint, builds, provider runs and CI reruns were not executed, per the user's explicit instruction. No directly related cleanup is deferred. Root cause: the path-undefined bound-alias fallback reconstructed a member receiver after a sequence had erased it. That branch now checks the explicit receiver state before following the bound function. Receiverless bound .call/.apply remains opaque, with no invented known defineProperty write. Added focused normalization regressions for both bound members; the parallel invocation branch retains its existing detached-call semantics. Validation: inspected producing boundaries and affected consumers; targeted source formatting and git diff --check completed. Tests, typechecks, lint, builds, provider runs and CI reruns were not executed, per the user's explicit instruction. No directly related cleanup is deferred. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef8eb3ab19
ℹ️ 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".
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1253bede9
ℹ️ 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".
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. Fixed publicly in e1253be. The member-resolution fallback proved only that an explicit receiver existed, then discarded it and reconstructed callee.object as the callable. It now continues from the outer explicit receiver, preserving the same generic Function.prototype.call/apply semantics as the intrinsic-path branch. The bound owner is used only when no explicit receiver was supplied. Regressions cover detached call and apply with noop as the receiver and preserve valid Electron findings. Source inspection covered the producing boundary and affected consumers; prior live history is preserved and git diff --check passed. Tests, builds, lint, typechecks, provider workloads and CI reruns were not run at the explicit user request. No directly related source cleanup remains. |
* fix(comparison): preserve incomplete function call evidence Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty. Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls. * fix(comparison): recheck historical calls-only changes --------- Co-authored-by: morluto <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bf3a74e8c
ℹ️ 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".
| if (capturedOwner !== undefined && capturedOwner.replaced !== true) | ||
| ownerPath = intrinsicInvocationMemberPath(capturedOwner.key); | ||
| } | ||
| if (ownerPath === undefined) return undefined; |
There was a problem hiding this comment.
Propagate replaced state through nested member captures
Fresh evidence beyond the fixed direct invoke.call case is an extra stable alias: with change.call = {call: poison}; const invoke = change.call; const outer = invoke.call; outer(), the recursive lookup returns {replaced: true}, but this condition discards it and the next guard returns undefined. The collector therefore records neither the call nor an opaque intrinsic effect even though outer() runs poison; if poison mutates Object.create before a Rolldown conversion, the helper remains trusted and a spurious BrowserWindow finding can be emitted. Propagate the replaced result (or another opaque marker) instead.
AGENTS.md reference: AGENTS.md:L21-L21
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in efd68b4. The recursive owner proof now propagates the replaced marker: when capturedInvocationMember(owner) returns {replaced: true}, the outer capture returns {replaced: true, path: capturedOwner.path} instead of falling through to undefined. outer = invoke.call; outer() — where invoke stored the {call: poison} replacement — now classifies outer() as opaque at [i,O,defineProperty,call] with an ["intrinsic"] effect retained, instead of recording nothing. Regression: "propagates replaced state through a nested captured owner" (fails on 2bf3a74 — invocation unresolved, no effect). 64/64 capture, 1764/1764 JS domain, check:fast green.
When a captured member's owner is itself a replaced captured member, the recursive owner proof discarded the marker and returned undefined — `outer = invoke.call; outer()` then recorded neither a known call nor an opaque effect even though the stored replacement executes. Propagate the replaced result so the call classifies opaque at the owner path. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@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: efd68b4a36
ℹ️ 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".
| if (!terminal && members.length !== 1) return undefined; | ||
| bindReads.push(captured?.capturedAt ?? current.callee); | ||
| bindReads.push(current.callee); |
There was a problem hiding this comment.
Carry captured invocation values through direct bind
When a captured invocation member is itself bound—for example const change = Object.defineProperty.bind(null, Object, "create"); const invoke = change.call; const changed = invoke.bind(change, null); changed({value: customCreate})—this direct-.bind branch keeps the raw invoke target, and resolveBoundIntrinsic later follows it to the member-expression initializer and returns undefined. At runtime this binds Function.prototype.call, so the final call reaches the bound defineProperty and replaces Object.create; because no intrinsic write is retained, the Rolldown helper can remain trusted and emit a spurious BrowserWindow finding. Fresh evidence beyond the fixed captured-.bind alias case is the inverse operation of binding a captured .call value; canonicalize that target before continuing.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c8048a1.
Reproduced on efd68b4: invoke.bind(change, null) reached resolveBoundIntrinsic, hit the !isCallExpression(current) early return, and produced no invocation at all — the subsequent Object.create write was dropped and a spurious BrowserWindow finding surfaced.
resolveBoundIntrinsic now consults capturedInvocationMember when a bind chain (gated on argumentGroups.length > 0, so bare aliases are untouched) bottoms out on a non-call value. An intact capture returns {kind:"known", path:[i,F,p,call], receiver, arguments} so the chain continues into the bound defineProperty; a replaced capture returns opaque with the captured slot path. Regression test carries a captured member value through a direct bind fails on the previous implementation and passes now (66/66 capture tests, 1766/1766 JS-domain tests).
| owner = peelValueSequence(next.object); | ||
| at = next; | ||
| } else { | ||
| if (initializer.projection.length !== 1) return undefined; |
There was a problem hiding this comment.
Follow multi-segment destructured member captures
When an invocation member is destructured through more than one static property—for example const {call: {call: invoke}} = change for a bound change—this guard drops the binding solely because its projection is ["call", "call"]. Both runtime reads yield Function.prototype.call, so invoke.call(change, null, {value: customCreate}) reaches the bound defineProperty and replaces Object.create; analysis instead retains no write and can trust a poisoned Rolldown helper, producing a spurious BrowserWindow finding. Fresh evidence beyond the fixed one-key destructuring case is this two-key static projection; walk it through captured-owner identity rather than rejecting it.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c8048a1.
Reproduced on efd68b4: const {call: {call: invoke}} = change was rejected by the projection.length !== 1 guard, so invoke.call(change, null, {value: customCreate}) lost its Object.create write.
Destructured captures now accept projections whose every segment is call/apply/bind — each read lands on a Function.prototype member whose own invocation members resolve to the same canonical members, so the final segment names the captured member. projectedCaptureAt walks nested object patterns level by level (matching the binding's own name for duplicate keys), and the destructuring-offset slot check covers every projection level: [ownerPath,call] and [i,F,p,call,call]-style nested slots. Regression test follows a multi-segment destructured member capture fails on the previous implementation and passes now (66/66, 1766/1766).
…ctions
A bound captured member carries the canonical member's value —
`changed = invoke.bind(change, …)` where `invoke = change.call` binds
Function.prototype.call itself. resolveBoundIntrinsic now consults
capturedInvocationMember when a bind chain reaches a non-call value,
returning the canonical member path with the accumulated receiver;
replaced captures stay opaque.
Destructured captures accept multi-segment invocation-member
projections — `{call: {call: invoke}}` reads Function.prototype.call
through Function.prototype.call. projectedCaptureAt walks nested
object patterns one level at a time and every projection level's slot
is checked for replacement at the destructuring offset.
…ains and nested projections
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8048a1ec2
ℹ️ 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".
| if (t.isAssignmentExpression(node) && isPattern(node.left)) | ||
| return ["right", "left"]; |
There was a problem hiding this comment.
Unwrap the whole pattern before applying evaluation order
Fresh evidence beyond the fixed wrapped-leaf case is a transparent wrapper around the entire LHS, such as ([change.call, ignored = change.call({value: customCreate})] as any) = [replacement, undefined]. Here isPattern(node.left) is false for the TSAsExpression, so the collector neither switches to RHS-before-pattern traversal nor registers per-leaf effects and instead retains both writes only when the whole assignment exits. If replacement is Object.defineProperty.bind(null, Object, "create"), runtime installs it before evaluating the later default and replaces Object.create, while analysis still classifies the default against the old change.call; a following Rolldown conversion remains trusted and can emit a spurious BrowserWindow finding. Unwrap the target in every pattern-ordering/leaf gate, not only nested AssignmentPattern.left.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 79af132.
Reproduced on 8fbb88e — added the exact case to the existing destructuring it.each: ([change.call, ignored = change.call(null,metadata,"x",{value:1})] as any) = [replacement, undefined] failed (windows emitted) before the fix and passes now.
Root cause: every pattern gate keyed on the raw node.left/target, so a TSAsExpression wrapper fell through both the RHS-before-pattern childKeys ordering and the per-leaf registration — leaf effects were retained only at the assignment's exit, making the RHS-installed replacement look later than the default's change.call write. All four isPattern gates now unwrap the target first: childKeys (assignment + AssignmentPattern.left, already unwrapped), the enter-time leaf registration, the for…of loop guard, and the exit-time retainTargets gate (rewritten to unwrap once and reuse the value).
| // binding back to the owner's initializer and miss writes between | ||
| // them. Check the slot at the destructuring offset directly. | ||
| const scope = opaqueMutationPath(at).join("."); | ||
| const offset = evaluationOffset(at); |
There was a problem hiding this comment.
Track capture time separately for every projected property
Fresh evidence beyond the fixed one-level destructuring timestamp is a nested projection such as const {call: {missing: x = (change.call = noop), call: invoke}} = change: the outer change.call value is captured before the default overwrites that owner slot, so the later inner read still obtains Function.prototype.call. This code compares every projected slot against the single final-leaf offset, causing the intervening write to look as though it preceded the outer capture and making invoke.call(...) opaque. When change is a bound defineProperty targeting fresh metadata, runtime mutates only that metadata, but the opaque classification invalidates all intrinsics and suppresses a valid BrowserWindow finding; retain an evaluation point for each projection level.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Already fixed in 8fbb88e — this report was generated against c8048a1, before that commit landed.
The implementation now tracks one timing node per projection level (projectedCaptureAts): an intermediate level uses its property's key node, which exits before the value subtree runs defaults, so const {call: {missing: x = (change.call = noop), call: invoke}} = change checks the outer [ownerPath,call] slot at the outer read's offset — before the inner default's write. Two related bugs were fixed in the same commit: the intermediate canonical slot [i,F,p,proj[i-1]] is now checked at each level, and the resolver no longer re-checks [bound.path,method] on virtual-member iterations (the synthetic owner substitution is not a real slot read). The regression test times each projected level at its own property read is your exact example — it fails on c8048a1 and passes on 8fbb88e (69/69 capture, 1769/1769 JS-domain).
The captured-member bind fallback skipped the recorded `.bind` read
checks — `invoke.bind = replacement` could hide that `invoke.bind(…)`
produces the replacement, not bound Function.prototype.call. Run the
same bindReads check against the canonical member's bind slot before
returning the captured bound value.
Destructured multi-segment captures now check the inherited canonical
member slot at every level — `{call: {apply: invoke}}` verifies
[i,F,p,call] as well as [i,F,p,call,apply] and [i,F,p,apply] — and each
level is timed at its own property read (the property key exits before
the value subtree's defaults), so a write inside an inner default no
longer marks an earlier outer read replaced.
The resolver no longer re-checks the substituted owner's member slot on
virtual-member iterations: `invoke.call(…)` models the stored member
applied to the owner, it does not re-read `owner.call`, so a write
between capture and call is irrelevant.
…ots, bindReads, virtual-member timing
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fbb88eb22
ℹ️ 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".
| // captured member is itself provable — `outer = invoke.call` reads the | ||
| // member from the function `invoke` already stores. | ||
| let ownerPath = intrinsicPath(owner) ?? boundIntrinsic(owner)?.path; | ||
| if (ownerPath === undefined && depth < 4) { |
There was a problem hiding this comment.
Preserve uncertainty past the captured-owner depth cap
With six nested stable reads (a = change.call through f = e.call), this fixed depth cap stops before proving f, so f.call(change, null, descriptor) is classified as having no retained effect rather than known or opaque. At runtime every alias is Function.prototype.call, and the final call reaches the bound Object.defineProperty and can replace Object.create; before a Rolldown conversion, the missed write leaves the helper trusted and can emit a spurious BrowserWindow finding. Fresh evidence beyond the earlier one-level nested-owner case is this first chain beyond the hard cap; use the binding cycle guard without a fixed depth, or return opaque when the bound is exhausted.
AGENTS.md reference: AGENTS.md:L21-L21
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 79af132.
Reproduced on 8fbb88e: the depth < 4 cap stopped the recursive owner proof at the fifth captured owner, so f.call(change, null, descriptor) in the six-alias chain resolved undefined — neither known nor opaque — and the Object.create write was dropped.
The fixed depth is gone: capturedInvocationMember now threads the same binding-visited set through recursion, so the chain a…f resolves fully while a cyclic owner chain (a = b.call; b = a.call) still terminates at the cycle guard. Regression test follows a captured-member owner chain without a depth cap fails on the previous implementation and passes now (71/71 capture, 1771/1771 JS-domain, check:fast + knip green).
…epth cap A transparent wrapper around a whole destructuring LHS (`([change.call, …] as any) = [replacement]`) defeated every pattern-ordering gate — the collector retained leaf effects only at the assignment's exit, so a RHS-installed replacement appeared to postdate defaults it actually precedes. isPattern checks now unwrap the target in the childKeys ordering, the per-leaf registration, the for-of loop guard, and the exit-time retain gate. Nested captured-owner resolution no longer stops at a fixed depth of four — `f = e.call` on the sixth alias could not be proven and the final call lost its effect entirely. The binding-visited set is now shared across recursion, which also terminates cyclic owner chains.
…epth cap removal
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79af1328f4
ℹ️ 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".
| idOf(callee), | ||
| receiver === undefined ? -1 : idOf(receiver), | ||
| explicitReceiver ? 1 : 0, | ||
| arguments_ === undefined ? -1 : arguments_.length, |
There was a problem hiding this comment.
Distinguish equal-length arguments in cycle detection
When a captured apply alias re-enters with a different argument list of the same length, this key treats the states as identical. For example, const change = Object.defineProperty.bind(null, Object, "create"); const invoke = change.apply; invoke.apply(invoke, [invoke, [change, [null, [{value: customCreate}]]]]) reaches the virtual change.apply state first with receiver invoke and arguments beginning with invoke, then again with the same receiver and two arguments beginning with change; Node v24 ultimately replaces Object.create, but the second state is rejected and the collector records neither a known nor opaque effect, so a subsequent Rolldown helper remains trusted and can emit a spurious BrowserWindow finding. Fresh evidence beyond the earlier re-entry case is that the receiver and arity are unchanged while the argument identities differ, so include the argument identities in the cycle key (or keep the collision opaque).
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ac857c8 — the cycle key now includes argument node identities (arguments_.map(idOf).join(",")) instead of arity alone, so equal-length re-entries through different argument nodes can no longer collide.
One honest correction to the reported mechanism: I instrumented the resolver on your exact example — the re-entered change.apply states arrive with different receiver nodes (each apply expansion consumes a distinct argument node), so the arity-only key did not actually collide on this input and the write was already retained. Argument identities are in the key regardless per your direction; the regression re-enters a captured member with different argument identities pins the intended outcome (known Object.defineProperty + retained ["intrinsic","Object","create"]).
| projected.some( | ||
| (segment) => | ||
| segment !== "call" && segment !== "apply" && segment !== "bind", | ||
| ) |
There was a problem hiding this comment.
Resolve container segments before member projections
A destructured capture is discarded whenever its projection contains a literal container segment, even when that segment is exactly recoverable. With const change = Object.defineProperty.bind(null, Object, "create"); const [{call: invoke}] = [change]; invoke.call(change, null, {value: customCreate}), the projection is [0, "call"], so this guard rejects it although Node v24 invokes the bound defineProperty and replaces Object.create; no intrinsic write is retained and a later Rolldown conversion can produce a spurious BrowserWindow finding. Fresh evidence beyond the earlier multi-member destructuring case is the leading literal array index rather than another invocation member; resolve exact array/object container projections before validating the remaining call/apply/bind path.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ac857c8 — leading literal container segments now resolve into the RHS before the member suffix is validated.
capturedInvocationMember descends containerElement for non-member segments ([{call: invoke}] = [change] reads element 0 of the array literal, then .call on it); every remaining projected segment must still be call/apply/bind, and interleaved members-then-containers are still rejected. projectedCaptureAts now descends ArrayPattern element positions so each member level keeps its own read-offset timing.
Regression resolves a member capture through a literal container segment failed on 79af132 and now passes (known Object.defineProperty + retained ["intrinsic","Object","create"]).
… projections
- Captured-member owner chains now descend on an explicit work stack so
flat files with thousands of `aN = aN-1.call` aliases cannot exhaust
the call stack; the shared binding-visited set still terminates
cycles and per-level slot checks are preserved.
- Invocation cycle detection keys on argument node identities, not
arity alone, so equal-length re-entries through apply chains cannot
collide.
- Destructured captures resolve leading literal container segments
into the RHS (`[{call: invoke}] = [change]`) before validating the
invocation-member suffix; projectedCaptureAts descends ArrayPattern
element positions for per-level timing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac857c881c
ℹ️ 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".
| const virtual = virtualMember; | ||
| virtualMember = undefined; | ||
| let path = intrinsicPath(callee); |
There was a problem hiding this comment.
Process virtual members before accepting owner paths
When memberRead recovers an alias only through a literal-container projection and its owner already has an intrinsic path, these lines clear the virtual call/apply/bind marker before the direct-path branch can process it. For const [{call: invoke}] = [Object.defineProperty]; const metadata = {}; Reflect.apply(invoke, Object.defineProperty, [null, metadata, "x", {value: 1}]), runtime only defines metadata.x, but resolution returns Object.defineProperty with the leading null still in arguments; write collection consequently records an opaque intrinsic mutation and can invalidate a later Rolldown helper, hiding a valid BrowserWindow finding. Handle the virtual member before accepting intrinsicPath(callee).
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8da8ab2 — a pending virtual member is now consumed before intrinsicPath(callee) is accepted.
When a captured member substitutes an intrinsic owner (invoke = Object.defineProperty.call), virtual is processed first: call/apply shift receiver = arguments[0] and slice the argument list (via invocationArguments), then resolution continues so the owner's own intrinsicReadChanged check still runs; bind returns a Function.prototype.bind bound value with explicitReceiver target selection, matching the direct-member branch.
On your example the call now resolves as Object.defineProperty(metadata, "x", {value: 1}) — regression applies a captured virtual member before an owner intrinsic path fails on ac857c8 and now passes. This also covers the pre-existing direct-initializer form const invoke = Object.defineProperty.call, which hit the same path.
| return element === null || element === undefined ? undefined : element; | ||
| } | ||
| if (t.isObjectExpression(node)) | ||
| for (const property of node.properties) |
There was a problem hiding this comment.
Select the effective object-literal property
When a destructured capture crosses an inline object literal with duplicate static keys, this source-order loop returns the first property even though the last matching data property is the runtime value. With const {slot:{call:invoke}} = {slot: change, slot: {call: noop}} for a bound Object.defineProperty change, invoke.call(change, null, descriptor) invokes only noop, while the analysis resolves invoke from the shadowed first slot and records a nonexistent Object.create replacement; before a Rolldown helper capture, that false write suppresses a valid BrowserWindow finding. Select the last effective property rather than the first shadowed one.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8da8ab2 — same root cause as the adjacent comment; containerElement selects the effective last entry.
{slot: change, slot: {call: noop}} now resolves invoke from the second slot value ({call: noop} — an unprovable owner), so the capture is rejected and no Object.create write is fabricated. A later spread or method definition likewise resets the effective value to unknown; an earlier spread before the last matching literal is correctly overridden and still resolves.
Covered by reads the effective last value for duplicate literal keys (fails on ac857c8, passes now) plus the spread-order case.
…bers
- containerElement selects the effective last literal slot: duplicate
keys, trailing spreads, and unmodelable method values now hide the
owner instead of returning the shadowed first match; array spreads
at or before the target index also bail.
- A pending virtual call/apply/bind member is consumed before the
callee's intrinsic path is accepted, so [{call: invoke}] =
[Object.defineProperty] invokes ODP with a shifted receiver and
sliced arguments instead of returning ODP with the raw list.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…ic owner When a pending virtual call/apply member sits on an intrinsic owner, the explicit receiver is the callable - Reflect.apply(invoke, noop, args) invokes noop, never Object.defineProperty. Only the no-explicit- receiver path keeps the owner as the callable.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: I read the 18 new commits on 3e18226 and ran nothing. My earlier results are for f3765f1 and do not carry over, because the code and tests changed a lot. GitHub's CI is red on this head, and the PR now conflicts with main.
Conflict with main. GitHub says this PR conflicts with main aba487e. 10 of the PR's 13 files changed on main since the PR's base 4135c91. A text merge of those 10 files gives 9 conflicts: 3 each in CI. Bot threads. 7 Codex threads are unresolved and not outdated. The author has replied to each, saying the fix is in a named commit or is unchanged. Nobody has resolved them. The PR has 57 threads in all. Still not run
Thanks, Mason, for the 18 follow-up commits and for the replies on the bot threads. What I read
Test setup🤖 Written with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Thank you for this fix! The intrinsic invocation read identity changes were already integrated into |
Summary
Preserve intrinsic-invocation identity across aliased member reads, bound
callables, and destructured writes. Identifier-aliased reads of intrinsic
invocation members (e.g.
const change = Object.defineProperty.call; change(...)) were left effect-free after #1912's receiver tracking: themember path resolved but derived no callable. This change keeps such calls'
effects unknown (
opaque) — argument expressions still evaluate — ratherthan effect-free or a confirmed write.
Semantics, verified against a real engine (Node v26): a bare alias
invocation throws
TypeError, but its argument expressions still evaluate.Covers, on top of the shared captured-member identity model:
.call/.apply/.bindreads resolved conservativelyas
invoke = change.callresolve the captured member's canonicalFunction.prototype.<member>identity for both reads and writesinvoke.call,invoke.apply) validated against writes at the callee's evaluationoffset; nested
Function.prototype.<member>.<member>reads checked atcanonical depth
empty prefix
effect timing, sequence-expression callee tails
write site (statement context) while each leaf keeps its own effect
timing;
for-insites positioned likefor-of; transparent wrappers(
ascasts, assertions) defer a default target's write until after thedefault runs
copy = invoke,(0, change.call)sequence tails) and only canonicalize when the owneris a provable callable whose own slot was unwritten at capture —
"recognized but replaced" resolves
opaque, never effect-free or aconfirmed write
Reflect.applytargets(
Reflect.apply(invoke, change, [...]))origin(root, kind, writeSite)signature and[null]unknown-child member-mutation encoding
Test plan
electronIntrinsicCapture.test.ts: 78/78 — semantic-contrast casesincluding alias writes to captured members, replaced outer-member
reads, argument-side effects, sequence callees/tails, copied aliases,
owner-slot replacement (opaque), bare calls of replaced captured
members (opaque), destructured
call/apply/bindcaptures(incl. slot checks at destructuring time), nested captured owners,
explicit-receiver member calls, direct
Reflect.applytargets, andwrapped destructuring defaults
javascriptSemanticAmbientWrites.test.ts: 10/10 — destructuredwrites through reassigned vs still-global aliases (Worker specifier)
src/domain/javascriptsuite: 71 files, 1778/1778check:fastgreen;oxfmt --checkclean on touched filesf3765f117(run38679888243): CI required +Portable tests pass; newer heads pending
check:prfull suiteNotes
aliased calls, keeping downstream intrinsic identity and producing
unsound findings; the base/head contrast is recorded in the research
notes (not part of this diff).
Generated with Devin
Author readiness
Human owner: