Skip to content

fix(javascript)!: preserve Vite dependency values and uncertainty - #1840

Open
evenafterallisaid wants to merge 106 commits into
morluto:mainfrom
evenafterallisaid:fix/vite-dependency-values
Open

evenafterallisaid wants to merge 106 commits into
morluto:mainfrom
evenafterallisaid:fix/vite-dependency-values

Conversation

@evenafterallisaid

@evenafterallisaid evenafterallisaid commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

summary

recover decoded vite dependency table values, exact array slots, and source ranges through the shared javascript analyzer, cli, and mcp. table selections remain candidates when the actual load target is unproven. holes, dynamic slots, and changed or exposed caches remain explicit unknowns. independent direct imports retain their resolved targets.

the shared ast, binding, allocation, and property owners distinguish primitives, source containers, copied values, inherited values, and reachable cache owners. normalized descriptor facts retain enumerability and copied child identities. file-occurrence identities distinguish equal-content siblings while retaining digests and original Evidence. version comparison uses path and content for source-map occurrences while retaining container provenance in Evidence. retained historical Evidence remains readable.

table-only selections use vite-table-candidate / candidate references. graph coverage records unresolved candidates.

review fixes

  • inherited helper constructors retain a shared owner for Function prototype writes. snapshots preserve an ordered own constructor replacement.

  • the Vite intrinsic resolver considers writes from other scopes when deciding whether a callable or wrapper read has native authority.

  • writes through ownerless intrinsic aliases retain shared-prototype effects. named ambient paths retain their key-specific precision.

  • captured call and apply aliases check inherited wrapper authority at the capture site.

  • call exposure proofs are evaluated again after property snapshots settle, including assignments that replace data-only copy sources with getters.

  • version comparison pairs unchanged windows, context bridges, and utility processes by source digest, file path, and local selector while retaining the full occurrence identity in Evidence.

  • changed Reflect.construct calls remain opaque before the analyzer follows the constructor argument. captured callable and wrapper authority stay with the shared invocation resolver.

  • borrowed non-array intrinsic calls retain their normalized receiver as an exposure, including getter dispatch through Object.prototype.toString.call, .apply, and Reflect.apply.

  • array property selection preserves inherited constructor identity, including mapped helper results. ordered own-property replacements retain their selected value.

  • intrinsic-copy hazards use the write receiver and copied intrinsic identity. unrelated local writes preserve valid candidates. unproven receivers and external prototype exposures remain conservative.

  • property snapshots reuse indexed write positions and replacement proofs per allocation and key. restrictions invalidate those indexes. both property and copy indexes use one stable merge sort that yields in bounded steps. branches, repeating reads, multiple declarators, and unresolved effects retain conservative ordering.

  • main through c52a9b9d7 is integrated. conditional loader authority survives worker transfer and graph projection. Electron applicability requires an observed load with proven authority. main also includes the source-publication fixture fix that sizes its delivery budget from the current envelope.

  • checkpoint and native-handoff assertions use file-occurrence identities and actual byte digests.

validation

  • the merged branch passed 5,489 selected source, service, and boundary cases across the broad run and the corrected Electron applicability rerun. all 12 source-publication fixture tests passed.

  • all 16 selected public tests passed, including Vite batches 26–29 on cli and sdk stdio mcp, Electron interop on both adapters, and version comparisons. the inherited constructor and three cross-scope replacements reproduced stale paths on the baseline.

  • build, formatting, and architecture guards passed.

  • all 62 compiled acceptance tests passed on Windows, including 445 Vite scenarios in 56 cli and sdk stdio mcp batches and six version comparison tests. the baseline reproduced five stale Vite cases and the removed-window comparison.

  • the broad domain run passed 5,098 tests. the unrelated-slot precision failure passed after narrowing the intrinsic write rule, alongside all 234 focused source tests.

  • build, formatting, and architecture guards passed.

  • the earlier 015a02d57 merge passed 5,123 selected source, service, and worker-schema tests across the initial run and the corrected Electron applicability rerun. 17 additional compiled acceptance and boundary tests passed, including Vite batches 26–28, Electron cli and sdk stdio mcp, and loader authority. build, typecheck, lint, formatting, and architecture guards passed.

  • on e1996f58e, all 4,980 javascript domain tests passed locally across 178 suites, plus 30 focused boundary and public tests. these include captured call/apply and Electron workflows, loader method authority, and Vite batches 26–28 through cli and sdk stdio mcp.

  • five new public cases cover replaced Reflect constructors, borrowed calls, alias writes, and changed/unchanged Reflect.apply. stale dependency paths reproduced on the baseline and stay unknown after the fix.

  • a 4,097-write property snapshot regression observed 9,214 ordering reads in one baseline step. the complete analysis now stays within the existing 8,192-read per-step bound and retains the expected candidate. the existing wide prototype-copy regression also passes. the four ordering tests complete locally in 5.35 seconds, with the snapshot case taking 3.62 seconds.

  • the complete 432-scenario cli/mcp matrix and all 60 affected boundary/acceptance tests passed locally on 3498d44d4.

  • build, typecheck, lint, repository formatting, architecture guards, and Windows native artifact verification pass.

  • the native addon comes from the successful main run 42065378278 at the integrated commit. its verified SHA-256 begins with bacce63c6edd.

the Windows source-analyzer probe with 200 repeated writes retained the same candidate. replacement proofs fell from 80,000 to 200 and inert-write checks from 60,100 to 599. cold/warm elapsed time was 5,480/3,867 ms before and 5,689/3,782 ms after. cpu was 5,937/4,063 ms before and 6,047/4,047 ms after. process peak rss was 185,932/282,912 KiB before and 172,728/270,928 KiB after. the probe uses one process. total analyzer time stayed similar. whole-task token costs and cli/mcp performance were unmeasured.

hosted ci on e1996f58e reported one source fixture timeout, with 42,005 other portable tests passing. the reduced fixture still reproduces the sorting regression against the native-sort baseline.

local verification covers the selected Windows workflows. real-provider execution and the complete repository suite are outside this follow-up's local validation. the previous head failed one source-publication assertion. the merged fixture passes locally. fresh ci is pending on the updated branch.

Required repository checklist

Author readiness

Human owner: @evenafterallisaid

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 13:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f0bee9979

ℹ️ 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".

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T00:36:45.584531Z ae97bb1 New commits
ℹ️ 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.

@dandgabr dandgabr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review corrections

  • P2 — Recognize equivalent down-leveled Vite helper shapes. src/domain/javascript/javascriptViteDependencies.ts:101-104 only recognizes the canonical arrow/default-parameter expression form. Transpilers can emit a function with arguments-based defaults or a block body while preserving the same m.f || (m.f = [...]) table; those artifacts then lose preload dependency edges. Recognize semantically equivalent emitted forms, or preserve an explicit unknown dependency when such a helper is identified.
  • P2 — Key classified calls by full AST node identity. src/domain/javascript/javascriptStaticAnalysisCalls.ts:153-155 looks up Vite classification by node.start. Babel gives __vite__mapDeps([0]).filter(Boolean)'s inner and outer calls the same start, so the outer call is misclassified as Vite and emits a spurious unknown import (or bogus table entry), downgrading otherwise complete evidence. Key the classification by the call node or an unambiguous source range.
  • P2 — Honor explicitly undefined default arguments. In src/domain/javascript/javascriptStaticAnalysisCalls.ts:158-160, __vite__mapDeps([0], void 0) is treated as an override, although JavaScript applies the parameter default and uses the helper's default table. Distinguish provably undefined arguments from actual mapper overrides so known dependencies are retained.

@dandgabr dandgabr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review

  • P2 — Invalidate dependency tables after aliased or in-place cache writes. In src/domain/javascript/javascriptViteDependencies.ts:188-199, mutation tracking resolves a write only from the identifier at the root of the target. A helper alias can therefore mutate the same cache without invalidating the original table: const alias = __vite__mapDeps; alias.f = ["./other.js"]; __vite__mapDeps([0]); can still be reported using the stale table. In-place array mutations such as __vite__mapDeps.f.splice(0, 1, "./other.js") also bypass the assignment/update/delete checks. Track alias writes and known mutating calls against the cache, or mark the table unknown when the cache escapes, so later edges do not claim stale dependency paths.

@evenafterallisaid
evenafterallisaid force-pushed the fix/vite-dependency-values branch from 5f0bee9 to d04d671 Compare October 13, 2026 06:27
@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.

@evenafterallisaid

Copy link
Copy Markdown
Contributor Author

addressed all four findings in d04d671 and refreshed the branch against main.

  • helper recognition now includes equivalent function/block forms and Babel's lowered defaults; the actual Vite bundle and its Babel transformation pass through both CLI and MCP.
  • classified dependencies use exact AST call-node identity, so chained calls keep their own ranges without spurious imports.
  • unshadowed undefined and inert void defaults retain known entries; overrides, shadowed values, and effectful arguments remain unknown.
  • cache ownership follows helper/cache aliases, shared shallow-copy children, and in-place mutations. replacing a copied container's property preserves the original table. ambiguous ownership retains unknown dependencies. shared expression vertices and finite per-binding joins avoid cross-product state growth.

the source regex and downstream table/index interpretation are removed; the reference consumer uses the domain owner's parsed facts and shared lexical index. no separate binding collector remains.

validation: 80 tests across nine affected suites passed; the final cache representation was rechecked through public CLI/MCP and bundler suites (four tests, 38 public scenarios). npm run check, npm run docs:check, and discovery of all 1024 test files pass. real Vite/Babel CLI/MCP checks preserve decoded paths and source digests, and transport ping/cleanup pass. two existing Ghidra fixture blocks needed formatting-only wrapping for the repository gate.

the updated description records performance measurements and proof limits. stylesheet graph resolution and arbitrary runtime effects remain outside this static-analysis fix; browser and provider execution are unverified. refreshed CI is pending.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The follow-up appears safe to merge; both numbered previous findings are addressed and no new blocking issue was established.

Summary

The PR preserves decoded Vite dependency values as uncertain candidates and separates equal-content file occurrences.

The follow-up:

  • Vite dependency analysis keeps decoded table values, ordered slots, and uncertainty.
  • Vite table picks appear as candidates, not confirmed loads.
  • Application graphs keep identical files separate by where they occur.

Both numbered previous findings are addressed. No new actionable issue or security finding was established.

Review was source-only; no tests were run. GitHub credentials were unavailable, so whether another PR supersedes this one could not be checked.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Parsed JavaScript] --> B[Helper and cache facts]
  B --> C[Property snapshots]
  C --> D[Recheck call exposures]
  D --> E[Known values or explicit unknowns]
  E --> F[Vite candidate references]
  F --> G[Application graph]
  H[File occurrence identities] --> G
  G --> I[Version comparison]
  J[Source digest and coordinates] --> I
Loading

Reviews (59) · Last reviewed commit: "fix(javascript): retain call authority a..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f029c24edc

ℹ️ 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bb4b1feee

ℹ️ 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".

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

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.

  1. thread 1

The ownership edge selected f before applying copy semantics, so a shared child was relabeled as the copied container. Edges now retain selection before an object-rest copy separately from selection after a spread copy. Copies lose container identity, and a later f projection regains the exact shared child identity. Copying the array itself does not regain its original identity.

Source validation: inspected the producing boundary and affected consumers, applied targeted formatting with two threads, and passed git diff --check. Tests, builds, lint, typechecks, provider workloads, and CI reruns were not run, as explicitly requested.

Added unrun projected-child assignment/splice cases and a nested object-rest copied-array independence case. Mutation consumers continue using the single ownership graph.

  1. thread 1

An unresolved computed property was treated as proof that the original cache had been overwritten. Copy ownership now stops only at a proven f replacement with a fresh value; unresolved keys retain possible shared ownership so subsequent writes invalidate the original table conservatively.

Source validation: inspected the producing boundary and affected consumers, applied targeted formatting with two threads, and passed git diff --check. Tests, builds, lint, typechecks, provider workloads, and CI reruns were not run, as explicitly requested.

Added an unrun computed-key override case. Unknown keys stay possible in the shared owner instead of being repaired in dependency-output consumers.

  1. thread 1

The copy owner ignored keys contributed by later literal spreads. It now computes cached literal-spread facts iteratively and recognizes a definitive fresh f override before retaining earlier shared-cache ownership. Unknown expressions/keys remain possible, and nested literal spreads reuse source-sized cached facts.

Source validation: inspected the producing boundary and affected consumers, applied targeted formatting with two threads, and passed git diff --check. Tests, builds, lint, typechecks, provider workloads, and CI reruns were not run, as explicitly requested.

Added unrun direct and nested literal-spread override cases. The helper uses an explicit work stack rather than recursive rewalking and does not enumerate owner cross-products; performance was not measured.

@morluto morluto added bug Something isn't working area: domain Domain logic, errors, and pure functions P2: medium Medium priority issue labels Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a28279108a

ℹ️ 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".

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

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.

review thread

The Vite helper matcher rejected TypeScript ES5 output with plain parameters and assignment-guarded defaults. It now recognizes the exact ordered undefined guards and return shape before rejecting the candidate. Added a representative TS 6 ES5 fixture. Validation: formatter and git diff --check; tests were not run.

review thread

The fresh-replacement whitelist omitted regular-expression literals, so a write to a replacement regexp invalidated the original cache. RegExp literals are now classified as fresh replacements through the shared recursive freshness owner. Added a lastIndex regression. Validation: formatter and git diff --check; tests were not run.

@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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e8dbeb7a3

ℹ️ 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".

@morluto

morluto commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Hey @evenafterallisaid, thanks for this! The fix looks good. What's left: it has merge conflicts with main in src/application/native/NativeFunctionMatchingService.ts (merging main into the branch is fine). Greptile is at 4/5 on the current head, mainly over "Unrelated writes erase candidates". Happy to get this in once that's sorted out.

@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.

@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.

@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.

@CassieFox23

CassieFox23 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: On head 80711fc, both of my open cases are fixed. A frozen object read back from a property now says unknown on both calls. The harmless-reads case now keeps first.js. The 39 changed test files pass on Node 24, and I did not test the merge with main.

Edit (8 Nov): I ran the new head, 97e86f5, in a VM, and the results are here.

This follows my review above, which ran head 09bf40f. Please read this first. On this head the CLI marks each Vite table value as a candidate with partial coverage, even in the control with no write. So "first.js, complete" no longer appears. A candidate with a path is the old "first.js". A candidate with no path is the old "unknown".

I ran 25 small cases through the compiled CLI on Node 24, each with its real final value from plain Node. In the table, Before is from my review above (I did not rerun 09bf40f), and Now is 80711fc.

Finding from my review above Real final value Before Now
Frozen holder: Object.freeze(box.object) (Greptile) last.js first.js (complete) unknown on both calls
Same, with box["object"] last.js first.js (complete) unknown on both calls
Harmless reads, then Object.assign({}, helper) (Greptile) first.js unknown on both calls first.js on both calls

The harmless-reads fix does not hide a real write. Three new guards still say unknown, and the real value is last.js in each. One is a harmless read, then a write. One copies the cache into another object with Object.assign, then writes. One copies the helper, then writes.

The earlier fixes still hold. These all say unknown: direct eval, eval on a shadowed alias, for await, using and await using. So do the inherited getter, in the same call and a later one, and import() with options or a source. The controls with no write, an unrelated write, and a synchronous for...of over a thenable say first.js. An eval on an unrelated object still says unknown, where the real value is first.js. That is safe, but less precise, as before.

Every freeze case also says unknown on the lead call, whose real value is first.js. That is safe too.

Tests on Node 24.22.1: 39 changed test files, 535 tests, all pass. On Node 22.23.4 and 26.12.1, 12 of those files (the Vite files, 233 tests) also pass. The tests ran at the same time as my other runs on the same 4 vCPUs, so their times are rough.

The merge. GitHub shows the branch as conflicting with main. That is GitHub's report. I did not test the merge, so the compile error in my review above is neither confirmed nor cleared. The head alone typechecks (exit 0).

I ran only this head. The branch has commits from the author (24 Oct to 6 Nov) and from morluto (29 Oct), so I can't say which commit fixed which case.

Still not run

  • The merge of the head with main.
  • Node 22.23.4 and 26.12.1 on the other 27 changed test files.
  • My full 71-case set, main's side, the two exported cases and the late-index case.
  • Windows, macOS, a real Vite build, whole suites and rea doctor.

Thanks, evenafterallisaid, for the work on this branch since my last review.

Test setup
  • Box: Fedora 44 VM (4 vCPUs, 8 GB), Linux 7.2.11, on my Nobara 44 PC
  • Node: 24.22.1 (all 39 files and the 25 cases), 22.23.4 and 26.12.1 (12 files)
  • Head / base: 80711fc / ec34109 (merge base with main; main was 015a02d at the check)
  • Other: rea-agents 6.8.0
  • Other: checked 7 Nov, 5:42 PM to about 5:56 PM EST. The probe ran on the same VM as the Node 24 tests, so their time (238.9 s) is rough.
  • Other: GitHub's merge state and CI rollup are GitHub's report. I did not run those jobs.
Commands
npm --prefix <guest>/pr-1840/src ci --offline
npm run prepare
npm run test:prepare
grep -l -i doctor <the 39 test files>          (no match, so none skipped)
npm run test:focused -- <the 39 changed test files, named one by one>
node scripts/run-typescript.mjs --noEmit        (head alone)
node scripts/rea.mjs analyze-javascript-application <fixture folder> --json
node <fixture folder>/main.cjs                  (plain Node, real final value)

The 39 test files are the test files in git diff --name-only from the merge base to the head. Node 22 and 26 ran 12 of them: the Vite and intrinsic files plus javascriptStaticAnalysis.mapEndpoints.test.ts and javascriptStaticAnalysisFindings.steps.test.ts.

Each fixture folder holds main.js and six small modules (first.js, last.js, other.js, decoy.js, left.js, right.js). main.js ends with throw new Error("fixture source must never execute");. The real value comes from my own copy without the throw line, which prints the last call. These fixtures are scratch, not PR code.

helper (first line of every main.js, table ["./first.js"] unless noted):
  const __vite__mapDeps = (i, m = __vite__mapDeps, d = (m.f || (m.f = ["./first.js"]))) => i.map(i => d[i]);
lead call:  __vite__mapDeps([0]);          final call: __vite__mapDeps([0])
init:       const initialize = __vite__mapDeps; initialize([]);

frozen holder:   lead call; const inner = {cache: __vite__mapDeps.f}; const box = {};
                 box.object = inner; Object.freeze(box.object);          (bracket form: box["object"] = inner; Object.freeze(box["object"]);)
                 inner.cache = []; inner.cache[0] = "./last.js"; final call
harmless reads:  lead call; const cache = __vite__mapDeps.f; console.log(cache[0]); Object.assign({}, __vite__mapDeps); final call
guard 1:         lead call; const cache = __vite__mapDeps.f; console.log(cache[0]); cache[0] = "./last.js"; final call
guard 2:         lead call; const sink = {}; Object.assign(sink, {cache: __vite__mapDeps.f}); sink.cache[0] = "./last.js"; final call
guard 3:         lead call; const copy = Object.assign({}, __vite__mapDeps); copy.f[0] = "./last.js"; final call
direct eval:     init; eval("__vite__mapDeps.f[0] = './last.js'"); final call
shadowed eval:   init; const cache = __vite__mapDeps.f; { const __vite__mapDeps = null; eval("cache[0] = './last.js'"); } final call
for await:       init; for await (const value of [{cache: __vite__mapDeps.f, then(resolve) { this.cache[0] = "./last.js"; resolve(); }}]) {} final call
using:           init; { using box = {cache: __vite__mapDeps.f, [Symbol.dispose]() { this.cache[0] = "./last.js"; }}; } final call
getter, same call (table ["./first.js", , "./last.js"]):
                 init; Object.defineProperty(Array.prototype, "1", {get() { this[0] = "./last.js"; return 1; }, configurable: true}); __vite__mapDeps([1,0])
import options:  init; import("./other.js", {cache: __vite__mapDeps.f, get with() { this.cache[0] = "./last.js"; return {}; }}); final call

The cases that use await, using or import() ran as ES modules.

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91a2db2b72

ℹ️ 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97e86f5751

ℹ️ 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".

@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: On head 97e86f5, the 38 changed test files passed on Node 22.23.4, 24.22.1 and 26.12.1. The CI run on that head ended completed/failure. One test in tests/boundary/mcp/sourcePublicationComposed.test.ts failed in that run.

Findings

Check Node 22.23.4 Node 24.22.1 Node 26.12.1
Focused run of the 38 changed test files pass: 38/38 files, 527/527 tests pass: 38/38 files, 527/527 tests pass: 38/38 files, 527/527 tests
  • The PR changes 83 files against the merge base: 38 test files and 45 others.
  • Since my last comment, the head moved from 80711fc to 97e86f5. Three commits are new. ee6bd3c and 91a2db2 are merges of main. The third is 97e86f5 (fix(javascript): retain call authority and match unchanged Electron sites).
  • CI run 42540658684 on 97e86f5 failed. Its log shows preserves the source when an inline result with unknown retention exceeds delivery failing in tests/boundary/mcp/sourcePublicationComposed.test.ts. It failed in the mcp-boundary test project and again in a second run labelled built.
  • The log shows an AssertionError. An object with code resource_constraint did not match the expected object.
  • That test file is not in this PR. It came to main in 88cf498 (fix!: preserve results when source publication fails #8444), and CI tests the PR merged with main. It was not one of the 38 files I ran. I don't know the cause.
  • Workflow runs: CI is completed/failure, and CodeQL production is completed/skipped. PR readiness and PR title each have one completed/success run and one completed/cancelled run.
  • Check runs that failed (3): CI required, Portable tests, Test shard (1/8).
  • Check runs that were cancelled (6): Conventional PR title, Test shard (2/8), Test shard (5/8), Test shard (7/8), Test shard (8/8), Validate author declaration.
  • Conventional PR title and Validate author declaration each appear as both cancelled and succeeded.
  • 17 check runs succeeded. They include Source tests, Static checks, Build package, Documentation, Test shard (3/8), Test shard (4/8) and Test shard (6/8). 22 were skipped.
  • GitHub reports the PR as mergeable true, state blocked, not a draft. The head is 38 commits behind main c78c8ae.

Not run

  • A run of the whole test suite in my VM, not only the 38 files.
  • A probe that passes an old non-JSON evidence key to javascriptApplicationFileIdentity.ts through safeParse(parseExactJson(key)).
  • A merge with current main, c78c8ae.
Test setup
  • Box: Fedora 44 VM (4 vCPUs, 8 GB) on my Nobara 44 PC, Linux 7.2.11
  • Node: 22.23.4, 24.22.1, 26.12.1
  • Head / base: 97e86f5 / 015a02d (merge base with main)
  • Install: npm ci --offline and npm run test:prepare on Node 24.22.1
Commands
npm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/domain/javascript/electronStaticReceiverAdmission.test.ts src/domain/javascript/javascriptApplicationVersionMatching.test.ts src/domain/javascript/javascriptIntrinsicInvocation.test.ts src/domain/javascript/javascriptStaticAnalysis.mapEndpoints.test.ts src/domain/javascript/javascriptStaticAnalysisElectronApplicability.test.ts src/domain/javascript/javascriptStaticAnalysisFindings.steps.test.ts src/domain/javascript/javascriptViteDependencies.steps.test.ts src/domain/javascript/javascriptViteHelperDefaults.test.ts src/domain/javascript/javascriptViteInheritedValues.test.ts src/domain/javascript/javascriptVitePreloadDependencies.test.ts src/domain/javascript/javascriptViteTableCandidates.test.ts src/javascript/analysis/JavaScriptWorkerViteCandidate.test.ts tests/acceptance/applications/applicationVersionMatchingCli.test.ts tests/acceptance/applications/bundlerCallbackMetadataCli.test.ts tests/acceptance/applications/javascriptCheckpointReserveCli.test.ts tests/acceptance/applications/javascriptContentDeduplicatedModulePaths.test.ts tests/acceptance/applications/javascriptEndpointPayload.test.ts tests/acceptance/applications/javascriptSourceMapVersionCli.test.ts tests/acceptance/applications/javascriptViteDependencies.test.ts tests/boundary/cli/javascriptBundlerRuntimeScopes.test.ts tests/boundary/filesystem/artifactLiteralBackslash.test.ts tests/boundary/filesystem/javascript-applications/javascriptApplicationEmptyLiterals.test.ts tests/boundary/filesystem/javascript-applications/javascriptApplicationTemplateLiterals.test.ts tests/boundary/filesystem/javascript-applications/javascriptArtifactReconstruction.test.ts tests/boundary/filesystem/javascript-applications/javascriptAsarOccurrenceIdentity.test.ts tests/boundary/filesystem/javascript-applications/javascriptBundlerAdapters.test.ts tests/boundary/filesystem/javascript-applications/javascriptFileOccurrenceIdentity.test.ts tests/boundary/filesystem/javascript-applications/javascriptRuntimeReconciliation.test.ts tests/boundary/filesystem/javascript-applications/javascriptSourceMapVersionOccurrence.test.ts tests/boundary/filesystem/javascript-applications/viteOutputDependencies.test.ts tests/boundary/filesystem/javascript-applications/viteTableCandidate.test.ts tests/boundary/filesystem/javascriptArtifactReconstruction.test.ts tests/boundary/filesystem/javascriptSourceMapLocations.test.ts tests/boundary/filesystem/sourceToBundlePaths.test.ts tests/boundary/mcp/javascriptAnalysisResources.test.ts tests/boundary/mcp/javascriptFactsViewMcp.test.ts tests/boundary/mcp/javascriptLiteralBudget.test.ts tests/boundary/mcp/javascriptNativeHandoffIdentity.test.ts

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae97bb1bf8

ℹ️ 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.isLiteral(node) ||
t.isFunction(node) ||
t.isObjectMethod(node) ||
t.isClass(node);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve cache ownership through class heritage

A remaining route beyond the class-field initializer case is superclass inheritance: for an admitted function-form helper, __vite__mapDeps([]); const C = class extends __vite__mapDeps {}; C.f[0] = './last.js'; __vite__mapDeps([0]); returns ./last.js. The subclass inherits the live cache, but this classification makes C foreign, and no field initializer exists to trigger the exposure pass. Consequently, the indexed write loses its cache owner and the final selection retains the stale ./first.js candidate. Preserve the superclass ownership edge or conservatively expose superClass when indexing the class.

AGENTS.md reference: AGENTS.md:L21-L21

Useful? React with 👍 / 👎.

Comment on lines +700 to +702
if (t.isAwaitExpression(node)) expose(node, node.argument);
if (t.isForOfStatement(node) && node.await)
expose(node, identities.containedValues(node.right));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Expose cache-bearing receivers of with statements

For sloppy-script input, __vite__mapDeps([]); with (__vite__mapDeps) { f[0] = './last.js'; } __vite__mapDeps([0]); mutates the live cache through the dynamic environment. The semantic binding owner deliberately leaves f unresolved, but this effect index neither exposes WithStatement.object nor connects the dynamic lookup to that receiver. The write therefore has no cache owner, and the final selection still emits the stale ./first.js candidate instead of an unknown. Retain the with receiver as a possible exposure when lookup ownership cannot be proved.

AGENTS.md reference: AGENTS.md:L21-L21

Useful? React with 👍 / 👎.

@morluto morluto added the area: build Build, CI, packaging, and publishing label Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing area: domain Domain logic, errors, and pure functions bug Something isn't working P2: medium Medium priority issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants