Skip to content

fix(javascript): preserve loader identity across terminal origins - #9107

Merged
gensokyo-dev merged 3 commits into
mainfrom
fix/7253-webpack-loader-alias-proof
Nov 6, 2026
Merged

gensokyo-dev merged 3 commits into
mainfrom
fix/7253-webpack-loader-alias-proof

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A Webpack getter can lose Electron identity when an unrelated object has more than 512 possible literal initializers. The loader alias walk counted those terminal values against its selector budget, then treated an unrelated .n write as a possible loader overwrite. The public CLI regression changes from zero windows/IPC operations to one of each.

Refs #7253. This fixes a reproduced subcase; the full Bitwarden window/handler regression remains open.

Approach

Use the shared fresh-object and exact-literal facts to exclude proven separate terminal values before queuing identifier references. Unresolved identifiers, expressions that may return the loader, and projected initializers without a proven selected value, remain unknown. The real 512-alias bound remains. Iterate initializer collections without a concatenated temporary array; no new cache or retained index.

The shared CLI/MCP producer owns this change. Sibling CommonJS field and projected-origin walks were inspected: their terminal/projection work differs, so their bounds remain. Ordinary static-analysis fix within existing authority; third-party sources are parsed as inert data.

Validation performed

Node 24.22.1/npm 11.16.0, Linux x64. Expensive commands use two CPUs and wall/RSS guards.

  • 336 tests passed in four files, including compiled public CLI positive/negative cases, 1/520 conditional/call/member/unresolved-identifier alternatives, projected loader writes, fresh values and the long-alias unknown outcome. Source-owned VM controls independently confirm that replacing the getter prevents runtime window creation.
  • New unsupported-expression assertions failed on the initial patch; projected-origin assertions failed before their owner fix. The original positive regression failed on the base.
  • npm run check:fast, focused build, formatting and git diff --check passed.
  • Public CLI on the 8,155-byte reduction: 0 windows / 0 IPC → 1 window / 1 IPC; full Evidence retained separately from the summary.

Real artifact: official Bitwarden-2026.10.0-amd64.deb, SHA-256 fcabfc7da3c327e2625b105e951cee4e60703bb8e256f0aac9cc9bc83ec7063f. Extracted privately, never executed.

Completed workflow Wall s Family CPU s Sampled family RSS MiB
Preload, base d3a4fc87c (two runs) 6.750–6.784 8.779–8.876 571.8–573.1
Preload, final 6f701b985 (one run) 8.672 9.240 563.0
Main + preload, final 6f701b985 (120 s source deadline) 113.189 122.697 2106.9

All preload controls retain the same semantic Evidence ID and 80 IPC operations. Final main/preload still has partial alias coverage, zero windows and 112 IPC operations. The main/preload base and one final-revision retry hit the 90-second per-source deadline (the final retry: 99.308 s wall / 1811.8 MiB sampled RSS, exit 1; CPU omitted because that receipt inherited earlier shell child accounting). The final 120-second run completed; different deadline settings and failed baselines do not establish an equivalent completed-task comparison. No throughput improvement is claimed; the completed preload control is slightly more expensive. No OOM or external resource guard stop occurred in these validations; the reported source deadline failure is retained. RSS is a 100 ms descendant sum, with possible shared-page double counting and missed short peaks; OS caches were uncontrolled. Actual model tokens and a separate real MCP client run were not measured. Summary selection and the retained Evidence entry point are unchanged.

Author readiness

@gensokyo-dev is exempt from the readiness declaration under CONTRIBUTING.md. No human-review attestation is made by this automation.

Normalize the loader reachability worklist to identifier references so
unrelated terminal object origins cannot exhaust the alias-state budget.
Keep the existing bound on actual alias walks and avoid copying initializer
arrays while scheduling them.

Refs #7253

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-06T07:05:24.771893Z
We couldn’t complete this review. Comment @codex review to try again.
fbb2be3 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

The PR preserves Webpack loader identity beside large collections of proven separate values. The latest change keeps unresolved identifiers unknown instead of silently excluding them.

  • Webpack Electron analysis keeps loader identity around unrelated values.

Reviews (3) · Last reviewed commit: "fix(javascript): preserve unresolved loa..." · Reviewed by Greptile

Use shared fresh-value and literal facts to distinguish separate terminal values from expressions that may return the loader. Keep projected origins unknown and retain the actual alias-state budget.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

CI triage: the current static-check failure is unrelated to this diff. The job checked merge 0fa5fef against main 99bcd3e4e; its sole lint error is tests/boundary/cli/mcpDoctorHelpCli.test.ts:7:38, max-lines-per-function 179 > 150. That file is absent from this PR. I checked out untouched main 99bcd3e4e separately and ran the pinned installed oxlint on that file: the same error reproduces exactly (exit 1). The PR branch check:fast and 334 focused tests pass. This inherited lint failure will not be repaired in the loader-identity change.

Greptile reviewed final 62077b0e7 at 5/5 with no new actionable findings; the previous P1 is fixed and resolved. Codex automated review could not run because the repository review quota was reached; no review was requested or retriggered. Awaiting the remaining CI jobs before merge.

An unresolved identifier is not proof that a possible getter receiver is separate from the loader. Preserve the unknown outcome and cover both short and overflowing unions.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
@gensokyo-dev
gensokyo-dev merged commit 3e0599a into main Nov 6, 2026
49 of 51 checks passed
@gensokyo-dev
gensokyo-dev deleted the fix/7253-webpack-loader-alias-proof branch November 6, 2026 07:59
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants