[PR #769] [MERGED] fix(semantics): recognize Node builtin default namespaces #2229

Closed
opened 2026-10-16 21:15:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/769
Author: @rudycelekli
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/builtin-default-namespace-effects-20261006


📝 Commits (2)

  • d797094 fix(semantics): recognize Node builtin default namespaces
  • 6717d8e style(semantics): keep Babel imports before local helpers

📊 Changes

8 files changed (+118 additions, -5 deletions)

View changed files

➕ src/domain/javascriptSemanticAnalysis.builtin_defaults.test.ts (+39 -0)
📝 src/domain/javascriptSemanticAsyncEffects.ts (+3 -1)
📝 src/domain/javascriptSemanticChildProcesses.ts (+4 -1)
📝 src/domain/javascriptSemanticDataEffectHelpers.ts (+4 -1)
📝 src/domain/javascriptSemanticDataEffects.ts (+3 -1)
📝 src/domain/javascriptSemanticProvenance.ts (+7 -0)
📝 src/domain/javascriptSemanticResources.ts (+3 -1)
➕ tests/acceptance/applications/javascriptBuiltinDefaultsCli.test.ts (+55 -0)

📄 Description

Summary

Recognize ESM default and { default as ... } imports as namespace objects for explicitly identified Node built-ins. The existing resource, child process, timer, request, and filesystem configuration collectors currently discard these imports because their imported path is ["default"].

Native reproduction

Node exposes the same fs.readFileSync, child_process.spawn, timers.setTimeout, and http.get methods through default and namespace imports. A real filesystem read/stream, owned child process, and cleared timer provide runtime controls. The built public analyze-javascript-application command reports five effect nodes for namespace imports but zero for both default forms before this change; all three forms report the same five afterward.

External imports, named non-namespace imports, and shadowed parameters remain negative controls. require('fs').default also produces no resource facts; this change uses the existing ESM direct-import provenance only. No runtime execution or schema changes are introduced.

Verification

  • 208 focused semantic and public CLI tests pass across 11 files.
  • npm run build:cached, npm run check, and npm run check:fast pass (125 existing lint warnings, zero errors).
  • Native Node and emitted public CLI before/after checks pass.
  • Signed commit with DCO: d7970942d2ddcb2a337376d9bcec5cda0617cb3c.

Codex assisted on behalf of @rudycelekli with reproduction, implementation, tests, and an independent source review. Hosted CI will run separately; no full-suite result is claimed here.


🔄 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/769 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/builtin-default-namespace-effects-20261006` --- ### 📝 Commits (2) - [`d797094`](https://github.com/morluto/rea/commit/d7970942d2ddcb2a337376d9bcec5cda0617cb3c) fix(semantics): recognize Node builtin default namespaces - [`6717d8e`](https://github.com/morluto/rea/commit/6717d8ea28949ab2e4fa61995a9e1a3b713d12a9) style(semantics): keep Babel imports before local helpers ### 📊 Changes **8 files changed** (+118 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/javascriptSemanticAnalysis.builtin_defaults.test.ts` (+39 -0) 📝 `src/domain/javascriptSemanticAsyncEffects.ts` (+3 -1) 📝 `src/domain/javascriptSemanticChildProcesses.ts` (+4 -1) 📝 `src/domain/javascriptSemanticDataEffectHelpers.ts` (+4 -1) 📝 `src/domain/javascriptSemanticDataEffects.ts` (+3 -1) 📝 `src/domain/javascriptSemanticProvenance.ts` (+7 -0) 📝 `src/domain/javascriptSemanticResources.ts` (+3 -1) ➕ `tests/acceptance/applications/javascriptBuiltinDefaultsCli.test.ts` (+55 -0) </details> ### 📄 Description ## Summary Recognize ESM default and `{ default as ... }` imports as namespace objects for explicitly identified Node built-ins. The existing resource, child process, timer, request, and filesystem configuration collectors currently discard these imports because their imported path is `["default"]`. ## Native reproduction Node exposes the same `fs.readFileSync`, `child_process.spawn`, `timers.setTimeout`, and `http.get` methods through default and namespace imports. A real filesystem read/stream, owned child process, and cleared timer provide runtime controls. The built public `analyze-javascript-application` command reports five effect nodes for namespace imports but zero for both default forms before this change; all three forms report the same five afterward. External imports, named non-namespace imports, and shadowed parameters remain negative controls. `require('fs').default` also produces no resource facts; this change uses the existing ESM direct-import provenance only. No runtime execution or schema changes are introduced. ## Verification - 208 focused semantic and public CLI tests pass across 11 files. - `npm run build:cached`, `npm run check`, and `npm run check:fast` pass (125 existing lint warnings, zero errors). - Native Node and emitted public CLI before/after checks pass. - Signed commit with DCO: `d7970942d2ddcb2a337376d9bcec5cda0617cb3c`. Codex assisted on behalf of @rudycelekli with reproduction, implementation, tests, and an independent source review. Hosted CI will run separately; no full-suite result is claimed here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:58 +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#2229
No description provided.