[PR #7222] [MERGED] fix(javascript): honor effective symbolic descriptor values #7726

Closed
opened 2026-11-03 13:39:55 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7222
Author: @SII-YDD
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/symbolic-descriptor-values


📝 Commits (10+)

  • 0080007 fix(javascript): honor effective symbolic descriptor values
  • 7aba953 fix(javascript): preserve empty descriptor spreads and CI path identity
  • 32c3715 test(pwntools): retain completed evidence in cleanup regressions
  • 6cc5469 chore: synchronize upstream and retain its Wakaru path contract
  • e857317 test: preserve native paths and workspace admission distinctions
  • 9a786e3 chore: reconcile descriptor fix with current main
  • 61fe689 fix(javascript): invalidate replaced symbolic descriptor exports
  • 23f468a chore: refresh descriptor validation on current main
  • bb88f0c fix(javascript): classify shared descriptor facts before exporting
  • 4a40b54 test(javascript): verify string spread RPC fields against runtime

📊 Changes

12 files changed (+1109 additions, -94 deletions)

View changed files

📝 src/domain/javascript/electronStaticAnalysisBrowser.ts (+7 -7)
📝 src/domain/javascript/javascriptAstValues.test.ts (+145 -2)
📝 src/domain/javascript/javascriptAstValues.ts (+211 -30)
📝 src/domain/javascript/javascriptRpcEndpoints.test.ts (+24 -5)
📝 src/domain/javascript/javascriptSemanticAmbientWrites.test.ts (+98 -1)
📝 src/domain/javascript/javascriptSemanticAmbientWrites.ts (+132 -11)
📝 src/domain/javascript/javascriptSemanticChildProcesses.ts (+2 -2)
📝 src/domain/javascript/javascriptSymbolicBindings.test.ts (+178 -0)
📝 src/domain/javascript/javascriptSymbolicBindings.ts (+51 -30)
📝 src/domain/webBundleAnalyzerAst.ts (+3 -2)
📝 src/domain/webBundleAnalyzerInspection.ts (+3 -3)
📝 tests/boundary/cli/electronWrappedCallPaths.test.ts (+255 -1)

📄 Description

Summary

Fixes #7219. Ordered Object.defineProperty descriptor values could leave stale bundled exports, producing false IPC senders and missing values written last. Shared CLI/MCP analysis now uses effective ordered object facts and records unknown writes instead of reusing stale exports.

The object-member owner parses keys once and supplies related value/get/set queries from one snapshot. Literal spreads, array holes/unknown iterable suffixes, symbolic primitive indices and null/ignored/unknown prototypes retain their distinctions without per-index expansion. One normalized data-value field preserves original ordinary method nodes across symbolic, child-process and browser consumers; accessors stay unresolved. Duplicate prototype interpretation and stale fallback code are removed.

Native descriptor semantics require a retained, read-specific global identity proof. Exact replacements accept canonical direct/global-object spellings only while namespace identity is preserved. Conditional, aliased, parent, mutating or possibly repeated effects remain unknown; only a proven inert empty or exact primitive-literal-return override preserves the previous export. Competing unconditional replacements use the existing definite-order fact for both selection and confirmation; effectful parameter binding stays unknown. Matching ambient facts are cached within the reader. No invocation-count heuristic or expanded call graph was added.

Validation base 5508b2aff is integrated; final head e7e8d7bb645b67cb117c6257601a67198503af1e. Twelve related files change; unrelated conflict resolutions retain main unchanged.

Validation and limits

  • 384 tests pass: 358 symbolic/AST/RPC/shape/ambient/child-process/browser tests and 26 public CLI/MCP acceptance/boundary tests. check:fast, docs:check and diff checks pass.
  • Original and review regressions were reproduced before their producing-boundary fixes. Actual Node confirms that the second invocation can read a replacement installed at the end of the first; unknown is required without a single-invocation proof. The directly affected RPC golden uses an independent runtime oracle.
  • Node 24.22.1 executes 35 test-owned CommonJS/TypeScript bundles (31060 bytes, 5308 AST nodes), with native type erasure and a recording Electron substitute: 26 channels execute, two mixed descriptors throw TypeError. Main has five false channels and misses six runtime channels. Fixed CLI/MCP produce 25 correct channels and explicitly leave the possibly repeated patch-after-sender factory unknown. This is not native Electron or third-party application verification. That deliberate static coverage gap remains; it is not counted as complete recovery.
  • Summary plus 3 javascript-facts pages projects four fields from 150 observations, with exhausted paging. Every row matches the full parent’s node/observation identity, source metadata, evidence, values and field omission. Both completed delivery workflows export the exact same full parent record (ev_79710da7151e46c6115bd2238cb7f0f578934b2490197004391796cda2d0f76f), root digest 239c4dd8b130e1d7be4682626f6b0464cc7eb90a5da03ec58afedad46f0ff660. No tool catalog is fetched.
  • An expanded complete reply correctly exceeds the existing 10 MiB transport budget. Recovery uses retained Evidence and paging without reanalysis; no limit is raised and complete Evidence remains accessible.

Shipped application control

Official Obsidian 1.14.4 ASAR matches the pinned corpus digest 146ef8470d8cbb4a6db209bdc19bf2bad13350444186c0fd93c31087b142b92f (27477966 bytes). Select exactly main.js and enhance.js: 216931 source bytes, 32508 AST nodes, 47 IPC channels and 47 main handlers. Base and fixed complete Evidence records are byte-for-byte structurally equal; MCP exports that same complete parent. The application was not executed. Coverage stays partial: 36 unselected files and bounded alias-selection unknowns remain.

Single completed-task controls with a 512 MiB worker and the same two-CPU guard: base CLI 18.552s wall / 24.736s CPU / 846.98 MiB family peak; fixed CLI 16.877 / 23.416 / 816.02; fixed MCP 18.234 / 24.418 / 1107.77. These samples do not establish a speed gain. MCP uses 3 calls (summary, 3 sample rows, full export), 56054 reply bytes and no catalog. Its sample honestly covers 3/94 rows with a retained next offset; it is not exhaustive. Complete 28.4 MB Evidence stays on disk. Source selection, identities, provenance and omitted fields are verified.

Resource evidence

Two-CPU affinity, bounded worker heap, fresh analysis processes, warm runtime builds, uncontrolled OS caches; single completed-task samples do not establish a speed difference.

Workflow Tool calls Reply bytes Wall / CPU seconds Sampled family peak MiB
Main CLI + capture — — 9.296 / 11.327 568.23
Fixed CLI + capture — — 9.152 / 11.073 559.04
Summary + 3 pages + full export 5 571742 9.764 / 11.603 619.10
Complete request + retained recovery + full export 5 549034 10.620 / 11.714 628.12

CPU/memory/wall include initialization, extraction and export; reply bytes exclude requests/initialization. RSS sampling can double-count shared pages and miss short peaks. Agent/schema tokens were not measured. Source bytes remain unchanged; complete controls and resource reports are retained locally.

Final head CI 40381159489 passes source/static/docs/build, all eight end-to-end shards, real JavaScript recovery, Windows controls and the Linux native package baseline. Codex reports no major issues; Greptile passes; all review threads are resolved. Earlier canceled runs are not counted as passes. The unchecked human readiness declaration is left unchanged and will use the explicitly authorized bypass; it does not assert human review.

Author readiness

Human owner: @SII-YDD

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

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7222 **Author:** [@SII-YDD](https://github.com/SII-YDD) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/symbolic-descriptor-values` --- ### 📝 Commits (10+) - [`0080007`](https://github.com/morluto/rea/commit/008000776a64dbc7a476cfb890abaa786f68069a) fix(javascript): honor effective symbolic descriptor values - [`7aba953`](https://github.com/morluto/rea/commit/7aba953300ed3a4a55ad8b0a8f69b01930f0ec5e) fix(javascript): preserve empty descriptor spreads and CI path identity - [`32c3715`](https://github.com/morluto/rea/commit/32c37153a71d8d9adb679dd486745d0b724a687f) test(pwntools): retain completed evidence in cleanup regressions - [`6cc5469`](https://github.com/morluto/rea/commit/6cc54690a3ad246f4a1f55ad53fc9016969627c4) chore: synchronize upstream and retain its Wakaru path contract - [`e857317`](https://github.com/morluto/rea/commit/e8573176676ecd59c2a6c3386e7dd48dd706bb09) test: preserve native paths and workspace admission distinctions - [`9a786e3`](https://github.com/morluto/rea/commit/9a786e393c24f7f9877cb192614e1ab89ad0137b) chore: reconcile descriptor fix with current main - [`61fe689`](https://github.com/morluto/rea/commit/61fe6892c74bf2d6527e5589153172df93ae970e) fix(javascript): invalidate replaced symbolic descriptor exports - [`23f468a`](https://github.com/morluto/rea/commit/23f468a1878deb6d1f0b0614a3f9445a7af89a16) chore: refresh descriptor validation on current main - [`bb88f0c`](https://github.com/morluto/rea/commit/bb88f0cd59d168c69248a51332d8e69c331ac1c6) fix(javascript): classify shared descriptor facts before exporting - [`4a40b54`](https://github.com/morluto/rea/commit/4a40b541a01c8cc3707cb3e2e3da497e879fc784) test(javascript): verify string spread RPC fields against runtime ### 📊 Changes **12 files changed** (+1109 additions, -94 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/electronStaticAnalysisBrowser.ts` (+7 -7) 📝 `src/domain/javascript/javascriptAstValues.test.ts` (+145 -2) 📝 `src/domain/javascript/javascriptAstValues.ts` (+211 -30) 📝 `src/domain/javascript/javascriptRpcEndpoints.test.ts` (+24 -5) 📝 `src/domain/javascript/javascriptSemanticAmbientWrites.test.ts` (+98 -1) 📝 `src/domain/javascript/javascriptSemanticAmbientWrites.ts` (+132 -11) 📝 `src/domain/javascript/javascriptSemanticChildProcesses.ts` (+2 -2) 📝 `src/domain/javascript/javascriptSymbolicBindings.test.ts` (+178 -0) 📝 `src/domain/javascript/javascriptSymbolicBindings.ts` (+51 -30) 📝 `src/domain/webBundleAnalyzerAst.ts` (+3 -2) 📝 `src/domain/webBundleAnalyzerInspection.ts` (+3 -3) 📝 `tests/boundary/cli/electronWrappedCallPaths.test.ts` (+255 -1) </details> ### 📄 Description ## Summary Fixes #7219. Ordered `Object.defineProperty` descriptor values could leave stale bundled exports, producing false IPC senders and missing values written last. Shared CLI/MCP analysis now uses effective ordered object facts and records unknown writes instead of reusing stale exports. The object-member owner parses keys once and supplies related value/get/set queries from one snapshot. Literal spreads, array holes/unknown iterable suffixes, symbolic primitive indices and null/ignored/unknown prototypes retain their distinctions without per-index expansion. One normalized data-value field preserves original ordinary method nodes across symbolic, child-process and browser consumers; accessors stay unresolved. Duplicate prototype interpretation and stale fallback code are removed. Native descriptor semantics require a retained, read-specific global identity proof. Exact replacements accept canonical direct/global-object spellings only while namespace identity is preserved. Conditional, aliased, parent, mutating or possibly repeated effects remain unknown; only a proven inert empty or exact primitive-literal-return override preserves the previous export. Competing unconditional replacements use the existing definite-order fact for both selection and confirmation; effectful parameter binding stays unknown. Matching ambient facts are cached within the reader. No invocation-count heuristic or expanded call graph was added. Validation base `5508b2aff` is integrated; final head `e7e8d7bb645b67cb117c6257601a67198503af1e`. Twelve related files change; unrelated conflict resolutions retain main unchanged. ## Validation and limits - **384 tests pass:** 358 symbolic/AST/RPC/shape/ambient/child-process/browser tests and 26 public CLI/MCP acceptance/boundary tests. `check:fast`, `docs:check` and diff checks pass. - Original and review regressions were reproduced before their producing-boundary fixes. Actual Node confirms that the second invocation can read a replacement installed at the end of the first; unknown is required without a single-invocation proof. The directly affected RPC golden uses an independent runtime oracle. - Node 24.22.1 executes 35 test-owned CommonJS/TypeScript bundles (31060 bytes, 5308 AST nodes), with native type erasure and a recording Electron substitute: 26 channels execute, two mixed descriptors throw `TypeError`. Main has five false channels and misses six runtime channels. Fixed CLI/MCP produce 25 correct channels and explicitly leave the possibly repeated `patch-after-sender` factory unknown. **This is not native Electron or third-party application verification.** That deliberate static coverage gap remains; it is not counted as complete recovery. - Summary plus 3 `javascript-facts` pages projects four fields from 150 observations, with exhausted paging. Every row matches the full parent’s node/observation identity, source metadata, evidence, values and field omission. Both completed delivery workflows export the exact same full parent record (`ev_79710da7151e46c6115bd2238cb7f0f578934b2490197004391796cda2d0f76f`), root digest `239c4dd8b130e1d7be4682626f6b0464cc7eb90a5da03ec58afedad46f0ff660`. No tool catalog is fetched. - An expanded complete reply correctly exceeds the existing 10 MiB transport budget. Recovery uses retained Evidence and paging without reanalysis; no limit is raised and complete Evidence remains accessible. ## Shipped application control Official Obsidian 1.14.4 ASAR matches the pinned corpus digest `146ef8470d8cbb4a6db209bdc19bf2bad13350444186c0fd93c31087b142b92f` (27477966 bytes). Select exactly `main.js` and `enhance.js`: 216931 source bytes, 32508 AST nodes, 47 IPC channels and 47 main handlers. Base and fixed **complete Evidence records are byte-for-byte structurally equal**; MCP exports that same complete parent. The application was not executed. Coverage stays partial: 36 unselected files and bounded alias-selection unknowns remain. Single completed-task controls with a 512 MiB worker and the same two-CPU guard: base CLI 18.552s wall / 24.736s CPU / 846.98 MiB family peak; fixed CLI 16.877 / 23.416 / 816.02; fixed MCP 18.234 / 24.418 / 1107.77. These samples do not establish a speed gain. MCP uses 3 calls (summary, 3 sample rows, full export), 56054 reply bytes and no catalog. Its sample honestly covers 3/94 rows with a retained next offset; it is not exhaustive. Complete 28.4 MB Evidence stays on disk. Source selection, identities, provenance and omitted fields are verified. ## Resource evidence Two-CPU affinity, bounded worker heap, fresh analysis processes, warm runtime builds, uncontrolled OS caches; single completed-task samples do not establish a speed difference. | Workflow | Tool calls | Reply bytes | Wall / CPU seconds | Sampled family peak MiB | |---|---:|---:|---:|---:| | Main CLI + capture | — | — | 9.296 / 11.327 | 568.23 | | Fixed CLI + capture | — | — | 9.152 / 11.073 | 559.04 | | Summary + 3 pages + full export | 5 | 571742 | 9.764 / 11.603 | 619.10 | | Complete request + retained recovery + full export | 5 | 549034 | 10.620 / 11.714 | 628.12 | CPU/memory/wall include initialization, extraction and export; reply bytes exclude requests/initialization. RSS sampling can double-count shared pages and miss short peaks. Agent/schema tokens were not measured. Source bytes remain unchanged; complete controls and resource reports are retained locally. Final head CI `40381159489` passes source/static/docs/build, all eight end-to-end shards, real JavaScript recovery, Windows controls and the Linux native package baseline. Codex reports no major issues; Greptile passes; all review threads are resolved. Earlier canceled runs are not counted as passes. The unchecked human readiness declaration is left unchanged and will use the explicitly authorized bypass; it does not assert human review. ## Author readiness Human owner: @SII-YDD - [ ] 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. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:39:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7726
No description provided.