[PR #4327] [CLOSED] fix(javascript): preserve literal percent runtime paths #6174

Closed
opened 2026-10-31 01:12:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4327
Author: @ShuaixinHuang
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: codex/fix-runtime-literal-percent


📝 Commits (10+)

  • d4de95c fix(javascript): preserve literal percent runtime paths
  • f675800 Merge upstream/main into codex/fix-runtime-literal-percent
  • b3fcaab fix(javascript): ignore resolve prefixes before the final anchor
  • b3f0400 fix(electron): retain application roots for loadFile declarations
  • ee25b9a fix(electron): resolve loadFile from enclosing application package
  • ca427f9 Merge remote-tracking branch 'origin/main' into codex/fix-runtime-literal-percent
  • 0fbd037 fix(electron): retain outer application root across package scopes
  • 522fc05 fix(electron): derive application ownership from inventoried packages
  • 31dd95e fix(electron): retain resolved package entrypoint ownership
  • f0f721a fix(electron): preserve competing application ownership

📊 Changes

21 files changed (+1866 additions, -106 deletions)

View changed files

📝 src/application/javascript/JavaScriptArtifactAnalysis.ts (+7 -0)
📝 src/application/javascript/JavaScriptArtifactAnalysisTypes.ts (+2 -0)
📝 src/application/javascript/JavaScriptArtifactGraphBuilder.ts (+68 -1)
📝 src/application/javascript/JavaScriptArtifactGraphContext.ts (+127 -4)
📝 src/application/javascript/JavaScriptArtifactGraphFindings.ts (+126 -17)
📝 src/application/javascript/JavaScriptArtifactGraphStructure.test.ts (+5 -0)
📝 src/application/javascript/JavaScriptArtifactGraphStructure.ts (+70 -19)
📝 src/application/javascript/JavaScriptArtifactPathResolution.test.ts (+179 -0)
📝 src/application/javascript/JavaScriptArtifactPathResolution.ts (+66 -10)
📝 src/domain/javascript/javascriptModuleResolutionMode.ts (+8 -0)
📝 src/domain/javascript/javascriptRuntimeStaticCandidates.ts (+35 -9)
📝 src/domain/javascript/javascriptStaticAnalysisHelpers.ts (+19 -34)
📝 src/domain/javascript/javascriptStaticPathResolution.test.ts (+52 -4)
➕ tests/acceptance/applications/javascriptLiteralPercentPaths.test.ts (+545 -0)
📝 tests/boundary/cli/electronWrappedCallPaths.test.ts (+2 -2)
📝 tests/boundary/filesystem/javascript-applications/javascriptArtifactReconstruction.test.ts (+398 -0)
📝 tests/boundary/filesystem/javascript-applications/javascriptFileUrlPaths.test.ts (+11 -4)
📝 tests/boundary/filesystem/javascript-applications/javascriptModuleRelationships.test.ts (+53 -0)
📝 tests/boundary/filesystem/javascript-applications/javascriptRuntimeReconciliation.test.ts (+75 -0)
📝 tests/boundary/filesystem/javascriptArtifactGraphObservationLookup.test.ts (+1 -0)

...and 1 more files

📄 Description

Superseded by #4941 at the author's request. The replacement incorporates current main and reruns focused validation. This PR and its original branch are retained for the review history, fixes and historical CI evidence.

Summary

Preserve literal percent bytes in filesystem runtime paths while retaining explicit file-URL conversion. Resolve Electron loadFile targets from proven application ownership, keeping possible competing owners when entrypoints or imports cannot be examined.

The graph producer records examined module imports once; consumers use those facts and parsed resolution. Main/default entries establish running roots. Browser/module/renderer metadata preserves observations. Exact lowercase JSON loader targets are inert; resolved HTML/.JSON and unavailable directory entries retain uncertainty. Equivalent proven missing page candidates share a renderer while retaining both declarations.

Validation

Current head: 5500de132d7168e4fdf39004712a39421cfd6817, normally merged upstream d9099190. The merge preserves upstream skipped-parse reporting and test-owned MCP connection reuse. One named options argument keeps source-path selection and MCP caller ownership explicit; the new upstream parse-status fixture includes this PR's graph-context fields.

Executed on Windows x64 with Node 24.18.0/npm 11.16.0:

  • Nine focused files: 391 passed / 12 platform skips. The upstream MCP-reuse matrix and skipped-parse controls passed alongside the literal-percent and ownership regressions.
  • npm run check: 6/6 tasks plus resolved module boundaries and architecture guards passed. git diff --check: passed.
  • Original ownership regressions reproduced 6 failures/50 passes before the import/frontend corrections; the later unavailable-directory-main case also failed before its correction. Current focused suites retain those regression controls.

The selection covers actual CLI/stdio-MCP path analysis and MCP connection-reuse matrices, competing owners, JSON/default/frontend entrypoints, runtime reconciliation, producer path resolution, module relationships, observation lookup, and skipped-parse reporting. Unavailable-reader cases inject a boundary; no live Electron/provider-engine verification is claimed.

The unchanged file-URL case requiring the Windows-invalid preload?#.cjs filename was not rerun locally in this merge selection. Historical Linux CI at 78f06711 executed all 27 file-URL cases successfully. That previous head also passed required CI; these are historical results, not checks of this merged head.

The current merged head passed CI required in run 39024161180. All five test shards, portable tests, the Windows capability/package lane and native package baselines passed. Optional/provider lanes recorded as skipped are not claimed as executed validation.

Author readiness

Human owner: @ShuaixinHuang

  • 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/4327 **Author:** [@ShuaixinHuang](https://github.com/ShuaixinHuang) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/fix-runtime-literal-percent` --- ### 📝 Commits (10+) - [`d4de95c`](https://github.com/morluto/rea/commit/d4de95c71707f22f5039c9aa99788719a293d854) fix(javascript): preserve literal percent runtime paths - [`f675800`](https://github.com/morluto/rea/commit/f675800bdb599fabe46e283b83fcdec1510ce5d7) Merge upstream/main into codex/fix-runtime-literal-percent - [`b3fcaab`](https://github.com/morluto/rea/commit/b3fcaab706249089e9c2e9f67c5a8bcf87ae358a) fix(javascript): ignore resolve prefixes before the final anchor - [`b3f0400`](https://github.com/morluto/rea/commit/b3f04002f5f37d4a858777e66e33e6145805b37c) fix(electron): retain application roots for loadFile declarations - [`ee25b9a`](https://github.com/morluto/rea/commit/ee25b9a539ce4de7a4587d8ed0977a8e5092ec2e) fix(electron): resolve loadFile from enclosing application package - [`ca427f9`](https://github.com/morluto/rea/commit/ca427f9ff56d707f86f3a2afd8482c34657a129a) Merge remote-tracking branch 'origin/main' into codex/fix-runtime-literal-percent - [`0fbd037`](https://github.com/morluto/rea/commit/0fbd037603272d91b03554efc92ce5aabb0aeed7) fix(electron): retain outer application root across package scopes - [`522fc05`](https://github.com/morluto/rea/commit/522fc0566a239c69747a88e0a0159b1c020e6180) fix(electron): derive application ownership from inventoried packages - [`31dd95e`](https://github.com/morluto/rea/commit/31dd95e8e4f93fc43cc94aa3d7a9afc914afd56e) fix(electron): retain resolved package entrypoint ownership - [`f0f721a`](https://github.com/morluto/rea/commit/f0f721acb761ca0b51d435174987355924cd44c8) fix(electron): preserve competing application ownership ### 📊 Changes **21 files changed** (+1866 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `src/application/javascript/JavaScriptArtifactAnalysis.ts` (+7 -0) 📝 `src/application/javascript/JavaScriptArtifactAnalysisTypes.ts` (+2 -0) 📝 `src/application/javascript/JavaScriptArtifactGraphBuilder.ts` (+68 -1) 📝 `src/application/javascript/JavaScriptArtifactGraphContext.ts` (+127 -4) 📝 `src/application/javascript/JavaScriptArtifactGraphFindings.ts` (+126 -17) 📝 `src/application/javascript/JavaScriptArtifactGraphStructure.test.ts` (+5 -0) 📝 `src/application/javascript/JavaScriptArtifactGraphStructure.ts` (+70 -19) 📝 `src/application/javascript/JavaScriptArtifactPathResolution.test.ts` (+179 -0) 📝 `src/application/javascript/JavaScriptArtifactPathResolution.ts` (+66 -10) 📝 `src/domain/javascript/javascriptModuleResolutionMode.ts` (+8 -0) 📝 `src/domain/javascript/javascriptRuntimeStaticCandidates.ts` (+35 -9) 📝 `src/domain/javascript/javascriptStaticAnalysisHelpers.ts` (+19 -34) 📝 `src/domain/javascript/javascriptStaticPathResolution.test.ts` (+52 -4) ➕ `tests/acceptance/applications/javascriptLiteralPercentPaths.test.ts` (+545 -0) 📝 `tests/boundary/cli/electronWrappedCallPaths.test.ts` (+2 -2) 📝 `tests/boundary/filesystem/javascript-applications/javascriptArtifactReconstruction.test.ts` (+398 -0) 📝 `tests/boundary/filesystem/javascript-applications/javascriptFileUrlPaths.test.ts` (+11 -4) 📝 `tests/boundary/filesystem/javascript-applications/javascriptModuleRelationships.test.ts` (+53 -0) 📝 `tests/boundary/filesystem/javascript-applications/javascriptRuntimeReconciliation.test.ts` (+75 -0) 📝 `tests/boundary/filesystem/javascriptArtifactGraphObservationLookup.test.ts` (+1 -0) _...and 1 more files_ </details> ### 📄 Description > Superseded by #4941 at the author's request. The replacement incorporates current main and reruns focused validation. This PR and its original branch are retained for the review history, fixes and historical CI evidence. ## Summary Preserve literal percent bytes in filesystem runtime paths while retaining explicit file-URL conversion. Resolve Electron loadFile targets from proven application ownership, keeping possible competing owners when entrypoints or imports cannot be examined. The graph producer records examined module imports once; consumers use those facts and parsed resolution. Main/default entries establish running roots. Browser/module/renderer metadata preserves observations. Exact lowercase JSON loader targets are inert; resolved HTML/.JSON and unavailable directory entries retain uncertainty. Equivalent proven missing page candidates share a renderer while retaining both declarations. ## Validation Current head: `5500de132d7168e4fdf39004712a39421cfd6817`, normally merged upstream `d9099190`. The merge preserves upstream skipped-parse reporting and test-owned MCP connection reuse. One named options argument keeps source-path selection and MCP caller ownership explicit; the new upstream parse-status fixture includes this PR's graph-context fields. Executed on Windows x64 with Node 24.18.0/npm 11.16.0: - Nine focused files: **391 passed / 12 platform skips**. The upstream MCP-reuse matrix and skipped-parse controls passed alongside the literal-percent and ownership regressions. - `npm run check`: **6/6 tasks plus resolved module boundaries and architecture guards passed**. `git diff --check`: passed. - Original ownership regressions reproduced 6 failures/50 passes before the import/frontend corrections; the later unavailable-directory-main case also failed before its correction. Current focused suites retain those regression controls. The selection covers actual CLI/stdio-MCP path analysis and MCP connection-reuse matrices, competing owners, JSON/default/frontend entrypoints, runtime reconciliation, producer path resolution, module relationships, observation lookup, and skipped-parse reporting. Unavailable-reader cases inject a boundary; no live Electron/provider-engine verification is claimed. The unchanged file-URL case requiring the Windows-invalid `preload?#.cjs` filename was not rerun locally in this merge selection. Historical Linux CI at `78f06711` executed all 27 file-URL cases successfully. That previous head also passed required CI; these are historical results, not checks of this merged head. The current merged head passed [CI required](https://github.com/morluto/rea/actions/runs/39024161180/job/117373952534) in [run 39024161180](https://github.com/morluto/rea/actions/runs/39024161180). All five test shards, portable tests, the Windows capability/package lane and native package baselines passed. Optional/provider lanes recorded as skipped are not claimed as executed validation. ## Author readiness Human owner: @ShuaixinHuang - [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-10-31 01:12:26 +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#6174
No description provided.