[PR #1686] [MERGED] feat(javascript): recover code-split bundles from multiple inputs #4753

Closed
opened 2026-10-31 00:54:41 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1686
Author: @JingHao-Leon
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @morluto

Base: main ← Head: feat/recover-javascript-multi-input


📝 Commits (2)

  • 5ddf876 feat(javascript): recover code-split bundles from multiple inputs
  • d3a39a9 fix(javascript): preserve source identity in multi-input recovery

📊 Changes

23 files changed (+695 additions, -121 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/javascript-applications.md (+8 -0)
📝 docs/javascript-recovery.md (+31 -7)
📝 docs/testing.md (+4 -1)
📝 scripts/fixtures/javascript-recovery/build.mjs (+55 -15)
➕ scripts/fixtures/javascript-recovery/code-split/checkout.mjs (+6 -0)
➕ scripts/fixtures/javascript-recovery/code-split/entry.mjs (+3 -0)
➕ scripts/fixtures/javascript-recovery/code-split/shared.mjs (+14 -0)
📝 scripts/verify/javascript/recovery.mjs (+57 -11)
📝 src/application/javascript/JavaScriptRecoveryService.test.ts (+46 -0)
📝 src/application/javascript/JavaScriptRecoveryService.ts (+36 -10)
📝 src/cli/javascriptRecoveryCommands.ts (+9 -0)
📝 src/contracts/javascript/javascriptRecoveryToolContracts.ts (+13 -1)
📝 src/domain/javascript/javascriptRecovery.ts (+15 -5)
📝 src/javascript/recovery/RecoveryFiles.ts (+80 -6)
📝 src/javascript/recovery/WakaruExecution.ts (+33 -27)
📝 src/javascript/recovery/WakaruProvider.ts (+6 -6)
📝 src/javascript/recovery/WakaruPublication.ts (+40 -22)
📝 src/javascript/recovery/WakaruRelease.ts (+1 -1)
📝 src/javascript/recovery/WakaruReport.ts (+5 -4)
📝 tests/boundary/javascript-recovery/wakaruIntegration.test.ts (+153 -1)

...and 3 more files

📄 Description

Related code-split scripts previously required separate recovery calls, leaving cross-chunk module IDs unresolved. additional_paths now recovers up to 16 additional files with the primary path in one native Wakaru invocation. The CLI exposes the same choice through repeatable --additional-path options.

Each input has a separate snapshot, digest and published copy. The manifest retains source for the primary file and adds additional_sources for the rest; module provenance binds to its producer-reported snapshot and retains that file's extraction/context byte ranges. Relative input layout is preserved, aggregate input is limited to 64 MiB before allocation, and every original file is independently rechecked before commit. Single-file recovery retains its existing result shape. This also fixes the strict-schema failure that broke recovery in CI.

Validation:

  • npm run check and npm run docs:check pass.
  • 65 focused Linux tests pass, covering CLI/MCP contracts, per-file mutation, invalid provenance/ranges, malformed UTF-8, input capacity, publication rollback and cleanup.
  • The official Wakaru 1.14.0 Linux x64 binary passes all 12 real CLI/stdio-MCP fixture workflows in a Linux container. The webpack 5.101.3 runtime/shared/entry/lazy-chunk fixture produces four modules, four source maps and four resolved cross-chunk import edges on each surface.
  • Original variable names and arbitrary runtime equivalence remain unknown. Unsupported multi-input filename layouts fail before engine execution when they cannot be published without renaming.

Fixes #1605.


🔄 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/1686 **Author:** [@JingHao-Leon](https://github.com/JingHao-Leon) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `feat/recover-javascript-multi-input` --- ### 📝 Commits (2) - [`5ddf876`](https://github.com/morluto/rea/commit/5ddf8766b8424a2518307d49295927e14a125644) feat(javascript): recover code-split bundles from multiple inputs - [`d3a39a9`](https://github.com/morluto/rea/commit/d3a39a9376544eef8e68f33cad02fed66f3cdf8b) fix(javascript): preserve source identity in multi-input recovery ### 📊 Changes **23 files changed** (+695 additions, -121 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/javascript-applications.md` (+8 -0) 📝 `docs/javascript-recovery.md` (+31 -7) 📝 `docs/testing.md` (+4 -1) 📝 `scripts/fixtures/javascript-recovery/build.mjs` (+55 -15) ➕ `scripts/fixtures/javascript-recovery/code-split/checkout.mjs` (+6 -0) ➕ `scripts/fixtures/javascript-recovery/code-split/entry.mjs` (+3 -0) ➕ `scripts/fixtures/javascript-recovery/code-split/shared.mjs` (+14 -0) 📝 `scripts/verify/javascript/recovery.mjs` (+57 -11) 📝 `src/application/javascript/JavaScriptRecoveryService.test.ts` (+46 -0) 📝 `src/application/javascript/JavaScriptRecoveryService.ts` (+36 -10) 📝 `src/cli/javascriptRecoveryCommands.ts` (+9 -0) 📝 `src/contracts/javascript/javascriptRecoveryToolContracts.ts` (+13 -1) 📝 `src/domain/javascript/javascriptRecovery.ts` (+15 -5) 📝 `src/javascript/recovery/RecoveryFiles.ts` (+80 -6) 📝 `src/javascript/recovery/WakaruExecution.ts` (+33 -27) 📝 `src/javascript/recovery/WakaruProvider.ts` (+6 -6) 📝 `src/javascript/recovery/WakaruPublication.ts` (+40 -22) 📝 `src/javascript/recovery/WakaruRelease.ts` (+1 -1) 📝 `src/javascript/recovery/WakaruReport.ts` (+5 -4) 📝 `tests/boundary/javascript-recovery/wakaruIntegration.test.ts` (+153 -1) _...and 3 more files_ </details> ### 📄 Description Related code-split scripts previously required separate recovery calls, leaving cross-chunk module IDs unresolved. `additional_paths` now recovers up to 16 additional files with the primary `path` in one native Wakaru invocation. The CLI exposes the same choice through repeatable `--additional-path` options. Each input has a separate snapshot, digest and published copy. The manifest retains `source` for the primary file and adds `additional_sources` for the rest; module provenance binds to its producer-reported snapshot and retains that file's extraction/context byte ranges. Relative input layout is preserved, aggregate input is limited to 64 MiB before allocation, and every original file is independently rechecked before commit. Single-file recovery retains its existing result shape. This also fixes the strict-schema failure that broke recovery in CI. Validation: - `npm run check` and `npm run docs:check` pass. - 65 focused Linux tests pass, covering CLI/MCP contracts, per-file mutation, invalid provenance/ranges, malformed UTF-8, input capacity, publication rollback and cleanup. - The official Wakaru 1.14.0 Linux x64 binary passes all 12 real CLI/stdio-MCP fixture workflows in a Linux container. The webpack 5.101.3 runtime/shared/entry/lazy-chunk fixture produces four modules, four source maps and four resolved cross-chunk import edges on each surface. - Original variable names and arbitrary runtime equivalence remain unknown. Unsupported multi-input filename layouts fail before engine execution when they cannot be published without renaming. Fixes #1605. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:54:41 +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#4753
No description provided.