[PR #6994] [MERGED] fix(javascript): exclude erased imports from runtime bindings #7557

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6994
Author: @gensokyo-dev
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @gensokyo-dev

Base: main ← Head: test/worker-type-erasure-20261024


📝 Commits (1)

  • f1f4289 fix(javascript): exclude erased imports from runtime bindings

📊 Changes

4 files changed (+53 additions, -27 deletions)

View changed files

📝 src/domain/javascript/javascriptSemanticAnalysis.require_links.test.ts (+5 -0)
📝 src/domain/javascript/javascriptSemanticAnalysis.ts (+6 -6)
📝 src/domain/javascript/javascriptSemanticValues.ts (+1 -10)
📝 tests/acceptance/applications/javascriptWorkerUrlCli.test.ts (+41 -11)

📄 Description

Problem and outcome

CI for #6988 fails the Worker URL CLI identity fixture after the TypeScript-erasure change. The old fixture expects a declaration-wide type import to shadow the ambient Worker; that expectation is stale. Independent esbuild compilation and execution also expose a real remaining defect: an inline import { type Worker } still creates a runtime semantic binding.

Filter erased specifiers at import binding creation using the existing module-declaration predicates, and remove the obsolete type-import provenance fallback. CLI and MCP reuse this semantic owner. Source type links, mixed value imports, and the existing warning about compiler-dependent module side effects remain. Correct the two Worker fixture expectations, retain every identity/assignment/namespace negative case, and assert the exact runtime binding inventory in the existing type-link regression. Two independent compiler/runtime oracles use an inert Worker recorder; they launch no Worker.

Executed validation

Pinned base 9895f1870, Node 24.22.1 / npm 11.16.0, Linux x64, two CPUs:

  • Fixture corrections alone: 1 failed / 118 passed through the compiled CLI, stdio MCP and related source checks. The inline type import is incorrectly unresolved (58.85 s wall / 86.56 s CPU / 2788.4 MiB sampled process-family RSS).
  • New binding-inventory assertion against restored base production files: 1 failed / 32 passed, precisely because Inline and Erased remain in the value binding table (2.59 s / 2.89 s CPU / 486.4 MiB). Production edits were restored afterward.
  • Fixed source: eight related files, 298 passed (4.19 s / 5.95 s CPU / 655.1 MiB).
  • Fixed compiled Worker URL suite, CLI/MCP erasure workflows and path/type source checks: four files, 119 passed (53.47 s / 75.56 s CPU / 2791.2 MiB), including both independent compiler/runtime oracles.

npm run check and git diff --check passed (25.65 s wall / 47.82 s CPU / 2658.2 MiB; 2/6 static tasks cached). npm run verify:test-discovery passed: all 2369 files discovered exactly once (1.17 s / 1.11 s CPU / 284.7 MiB). These are real REA CLI/stdio MCP runs over controlled source fixtures, with an independent compiler/runtime oracle; no browser, native provider or external model was exercised. Validation costs include setup/build where required; no speedup is claimed. Agent tokens were not measured. RSS sums descendants at 100 ms intervals and can double-count shared pages or miss brief/reparented children. Compiled checks had a 3 GiB sampled guard; source checks 1.5 GiB; commands had elapsed guards. No OOM occurred. A prior 1.5 GiB CLI diagnostic stopped before assertions and is incomplete evidence.

Scope: ordinary existing source-analysis correctness repair; no new execution authority, provider or public schema. Complete PR CI passed at exact head f1f428979: Source 17689 passed / 13 skipped; all eight built shards, static/build/docs, JavaScript recovery, Windows native build, Linux package baseline and the final required gate passed. Merged report: 32017 passed / 0 failed / 233 conditionally skipped. Codex and Greptile reviews completed without findings; there are no inline review threads. Main advanced separately with verifier ownership changes (0402012a9); post-merge main verification remains required, and is not claimed by these PR results.

Author readiness

Human owner: @gensokyo-dev

The owner explicitly delegated readiness declarations and agent-managed review. Inspection and execution were performed by Codex; no separate human inspection is claimed.

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

🔄 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/6994 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `test/worker-type-erasure-20261024` --- ### 📝 Commits (1) - [`f1f4289`](https://github.com/morluto/rea/commit/f1f4289793476389609cfe6308e279520f86440a) fix(javascript): exclude erased imports from runtime bindings ### 📊 Changes **4 files changed** (+53 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptSemanticAnalysis.require_links.test.ts` (+5 -0) 📝 `src/domain/javascript/javascriptSemanticAnalysis.ts` (+6 -6) 📝 `src/domain/javascript/javascriptSemanticValues.ts` (+1 -10) 📝 `tests/acceptance/applications/javascriptWorkerUrlCli.test.ts` (+41 -11) </details> ### 📄 Description ## Problem and outcome [CI for #6988](https://github.com/morluto/rea/actions/runs/40085480702/job/120848202693) fails the Worker URL CLI identity fixture after the TypeScript-erasure change. The old fixture expects a declaration-wide type import to shadow the ambient Worker; that expectation is stale. Independent esbuild compilation and execution also expose a real remaining defect: an inline `import { type Worker }` still creates a runtime semantic binding. Filter erased specifiers at import binding creation using the existing module-declaration predicates, and remove the obsolete type-import provenance fallback. CLI and MCP reuse this semantic owner. Source type links, mixed value imports, and the existing warning about compiler-dependent module side effects remain. Correct the two Worker fixture expectations, retain every identity/assignment/namespace negative case, and assert the exact runtime binding inventory in the existing type-link regression. Two independent compiler/runtime oracles use an inert Worker recorder; they launch no Worker. ## Executed validation Pinned base `9895f1870`, Node 24.22.1 / npm 11.16.0, Linux x64, two CPUs: - Fixture corrections alone: **1 failed / 118 passed** through the compiled CLI, stdio MCP and related source checks. The inline type import is incorrectly unresolved (58.85 s wall / 86.56 s CPU / 2788.4 MiB sampled process-family RSS). - New binding-inventory assertion against restored base production files: **1 failed / 32 passed**, precisely because `Inline` and `Erased` remain in the value binding table (2.59 s / 2.89 s CPU / 486.4 MiB). Production edits were restored afterward. - Fixed source: eight related files, **298 passed** (4.19 s / 5.95 s CPU / 655.1 MiB). - Fixed compiled Worker URL suite, CLI/MCP erasure workflows and path/type source checks: four files, **119 passed** (53.47 s / 75.56 s CPU / 2791.2 MiB), including both independent compiler/runtime oracles. `npm run check` and `git diff --check` passed (25.65 s wall / 47.82 s CPU / 2658.2 MiB; 2/6 static tasks cached). `npm run verify:test-discovery` passed: all 2369 files discovered exactly once (1.17 s / 1.11 s CPU / 284.7 MiB). These are real REA CLI/stdio MCP runs over controlled source fixtures, with an independent compiler/runtime oracle; no browser, native provider or external model was exercised. Validation costs include setup/build where required; no speedup is claimed. Agent tokens were not measured. RSS sums descendants at 100 ms intervals and can double-count shared pages or miss brief/reparented children. Compiled checks had a 3 GiB sampled guard; source checks 1.5 GiB; commands had elapsed guards. No OOM occurred. A prior 1.5 GiB CLI diagnostic stopped before assertions and is incomplete evidence. Scope: ordinary existing source-analysis correctness repair; no new execution authority, provider or public schema. [Complete PR CI](https://github.com/morluto/rea/actions/runs/40087977860) passed at exact head `f1f428979`: Source **17689 passed / 13 skipped**; all eight built shards, static/build/docs, JavaScript recovery, Windows native build, Linux package baseline and the final required gate passed. Merged report: **32017 passed / 0 failed / 233 conditionally skipped**. Codex and Greptile reviews completed without findings; there are no inline review threads. Main advanced separately with verifier ownership changes (`0402012a9`); post-merge main verification remains required, and is not claimed by these PR results. ## Author readiness Human owner: @gensokyo-dev The owner explicitly delegated readiness declarations and agent-managed review. Inspection and execution were performed by Codex; no separate human inspection is claimed. - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:38:40 +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#7557
No description provided.