[PR #1369] [CLOSED] fix(javascript): preserve exact static CommonJS export keys #2832

Closed
opened 2026-10-17 21:10:47 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1369
Author: @rudycelekli
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: fix/javascript-static-export-keys


📝 Commits (6)

  • a47517c fix(javascript): preserve exact static CommonJS export keys
  • 3ae5ac3 Merge upstream main into static export key fix
  • 0751974 fix(javascript): integrate exact CommonJS export keys
  • 73c8b36 fix(javascript): qualify export helper calls before argument scanning
  • 456aa4f fix(javascript): integrate current main for export-key review
  • 28b1e5c fix(javascript): integrate current ADB schema repair

📊 Changes

3 files changed (+107 additions, -43 deletions)

View changed files

➕ src/domain/javascript/javascriptAstExports.exact_keys.test.ts (+53 -0)
📝 src/domain/javascript/javascriptAstFingerprint.ts (+52 -37)
📝 src/domain/javascript/javascriptStaticAnalysis.member_path_depth.test.ts (+2 -6)

📄 Description

Computed identifiers such as exports[key] were reported as a literal export named key, and joining member components misread module["exports.value"] as module.exports.value. Keep exact member segments for export-root identification, reuse static property-key parsing, and retain valid empty export names in assignments, object declarations, and Object.defineProperty.

The maintainer follow-up preserves member helper recognition: standalone d(...) does not declare exports, while this.d(exports, {...}) remains supported. Classify the callee before inspecting export arguments to avoid extra work for unrelated calls.

Validation on current main plus this branch:

  • Actual public CLI and pinned SDK MCP stdio analysis of an 833-byte, 11-module source: eight baseline cases change to the expected export names; ordinary and computed static controls remain correct.
  • Separate 296-byte and 113-byte public CLI/MCP controls reproduce the standalone-helper false positive and this.d regression before the follow-up, and verify both afterward. Controlled native Node snippets establish the expected helper behavior.
  • Complete CLI/MCP normalized Evidence and IDs agree, MCP text/structured payloads agree, targets remain unchanged, and subsequent MCP ping succeeds. Integrating current main leaves all three full CLI results equal to the already reviewed follow-up.
  • Real compiled producer plus a 43-byte Babel AST control: unrelated argument property reads are 0 on main, 16 on the original PR, and 0 after the follow-up. This is a structural count, not a throughput or billed-token measurement.
  • 126 tests across 10 source, composition, filesystem, cancellation, and public adapter test files; typecheck, lint/module boundaries, formatting, knip, duplication, generated docs, and architecture checks pass.

The historical alias-test CI failure does not reproduce on current main: its seven selected cases pass, and the full semantic graph builder suite is included in validation. The old separate signed test patch is not applied. Observational CLI/MCP traces retain explicit unknown/partial scope; no full control-flow precision claim is made.

During validation, the formatting failure on cca7bf00 was tracked in #1585 and verified resolved by the following main commit 65434052; no redundant patch is included.

No real native analysis providers, Notion, or Obsidian verification in this iteration. No arbitrary result truncation or Evidence removal. Original contributor authorship is preserved; maintainer commits use GitHub noreply identities. Prepared with AI assistance.


🔄 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/1369 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/javascript-static-export-keys` --- ### 📝 Commits (6) - [`a47517c`](https://github.com/morluto/rea/commit/a47517c67c09aea5ad261f449faa0c624d641574) fix(javascript): preserve exact static CommonJS export keys - [`3ae5ac3`](https://github.com/morluto/rea/commit/3ae5ac3359ce12be686109c0e67d7f1aee1f12d9) Merge upstream main into static export key fix - [`0751974`](https://github.com/morluto/rea/commit/0751974d49a25ed51b766d83f1b4e1ae61bb834b) fix(javascript): integrate exact CommonJS export keys - [`73c8b36`](https://github.com/morluto/rea/commit/73c8b36615e989256dfda61a65cc29587fb74cec) fix(javascript): qualify export helper calls before argument scanning - [`456aa4f`](https://github.com/morluto/rea/commit/456aa4f6de6b9576ea55595d5818015349890d9c) fix(javascript): integrate current main for export-key review - [`28b1e5c`](https://github.com/morluto/rea/commit/28b1e5cadc604aa6ec18cfe4fb4e4791cebbda02) fix(javascript): integrate current ADB schema repair ### 📊 Changes **3 files changed** (+107 additions, -43 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/javascript/javascriptAstExports.exact_keys.test.ts` (+53 -0) 📝 `src/domain/javascript/javascriptAstFingerprint.ts` (+52 -37) 📝 `src/domain/javascript/javascriptStaticAnalysis.member_path_depth.test.ts` (+2 -6) </details> ### 📄 Description Computed identifiers such as `exports[key]` were reported as a literal export named `key`, and joining member components misread `module["exports.value"]` as `module.exports.value`. Keep exact member segments for export-root identification, reuse static property-key parsing, and retain valid empty export names in assignments, object declarations, and `Object.defineProperty`. The maintainer follow-up preserves member helper recognition: standalone `d(...)` does not declare exports, while `this.d(exports, {...})` remains supported. Classify the callee before inspecting export arguments to avoid extra work for unrelated calls. Validation on current main plus this branch: - Actual public CLI and pinned SDK MCP stdio analysis of an 833-byte, 11-module source: eight baseline cases change to the expected export names; ordinary and computed static controls remain correct. - Separate 296-byte and 113-byte public CLI/MCP controls reproduce the standalone-helper false positive and `this.d` regression before the follow-up, and verify both afterward. Controlled native Node snippets establish the expected helper behavior. - Complete CLI/MCP normalized Evidence and IDs agree, MCP text/structured payloads agree, targets remain unchanged, and subsequent MCP ping succeeds. Integrating current main leaves all three full CLI results equal to the already reviewed follow-up. - Real compiled producer plus a 43-byte Babel AST control: unrelated argument property reads are 0 on main, 16 on the original PR, and 0 after the follow-up. This is a structural count, not a throughput or billed-token measurement. - 126 tests across 10 source, composition, filesystem, cancellation, and public adapter test files; typecheck, lint/module boundaries, formatting, knip, duplication, generated docs, and architecture checks pass. The historical alias-test CI failure does not reproduce on current main: its seven selected cases pass, and the full semantic graph builder suite is included in validation. The old separate signed test patch is not applied. Observational CLI/MCP traces retain explicit unknown/partial scope; no full control-flow precision claim is made. During validation, the formatting failure on `cca7bf00` was tracked in #1585 and verified resolved by the following main commit `65434052`; no redundant patch is included. No real native analysis providers, Notion, or Obsidian verification in this iteration. No arbitrary result truncation or Evidence removal. Original contributor authorship is preserved; maintainer commits use GitHub noreply identities. Prepared with AI assistance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:47 +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#2832
No description provided.