[PR #4958] [CLOSED] fix(javascript-recovery): gate Wakaru on capability, not host platform #6696

Closed
opened 2026-11-01 21:42:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4958
Author: @cbnwtzvgf4-oss
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/wakaru-capability-gate


📝 Commits (3)

  • f6eeeae fix(javascript-recovery): gate Wakaru on capability, not host platform
  • b70e96b fix(javascript-recovery): follow the shared helper-root cleanup marker
  • 115f4f3 fix(javascript-recovery): treat a vanished default limiter as a probe miss

📊 Changes

24 files changed (+2065 additions, -156 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/javascript-applications.md (+13 -1)
📝 docs/javascript-recovery.md (+57 -13)
📝 docs/testing.md (+1 -1)
📝 src/application/CapabilityInventory.ts (+1 -1)
📝 src/cli/javascriptRecoveryCommands.ts (+26 -1)
📝 src/composition/javascriptRecovery.ts (+13 -2)
📝 src/contracts/javascript/javascriptRecoveryToolContracts.ts (+1 -1)
📝 src/javascript/recovery/WakaruCommand.test.ts (+239 -1)
📝 src/javascript/recovery/WakaruCommand.ts (+278 -41)
📝 src/javascript/recovery/WakaruProvider.ts (+201 -63)
📝 src/javascript/recovery/WakaruPublication.ts (+2 -2)
📝 src/javascript/recovery/WakaruRelease.ts (+71 -1)
➕ src/process/ProviderProcessOwnership.ts (+16 -0)
📝 src/server/createServer.ts (+49 -6)
➕ tests/boundary/cli/javascriptRecoveryWarning.test.ts (+34 -0)
📝 tests/boundary/javascript-recovery/wakaruCommandConfiguration.test.ts (+153 -22)
➕ tests/boundary/javascript-recovery/wakaruHostDisclosure.test.ts (+104 -0)
➕ tests/boundary/javascript-recovery/wakaruOwnershipAvailability.test.ts (+24 -0)
➕ tests/boundary/javascript-recovery/wakaruPreparationCleanup.test.ts (+309 -0)
➕ tests/boundary/javascript-recovery/wakaruProcessCleanup.test.ts (+93 -0)

...and 4 more files

📄 Description

Fixes #4948.

resolveWakaruCommand() hard-requires process.platform === "linux" && process.arch === "x64", so a binary the caller supplies and that demonstrably works is unreachable on any other host. As noted in #4948, this turns "verified on Linux x64" into "unavailable everywhere else".

Changes

  • WakaruCommand.ts — gate only on REA_WAKARU_COMMAND being present and absolute. Host verification becomes reported state, not a precondition. Requirement/error strings no longer claim a Linux-only binary; the resource-limiter failure message is host-neutral.
  • createServer.ts — javascriptRecoveryEnabled is derived from the configured command instead of linuxX64.
  • CapabilityInventory.ts, javascriptRecoveryToolContracts.ts, docs/javascript-recovery.md — Linux x64 is described as the only fully verified host; other hosts are unverified; REA_JAVASCRIPT_PRLIMIT_COMMAND is documented as the hook for hosts without util-linux.
  • test — wakaruCommandConfiguration.test.ts no longer skips on non-Linux; both cases are pure configuration checks and now pass on macOS.

Verification (darwin-arm64, macOS 27.0.1)

End-to-end recover_javascript_sources through the stdio MCP server, with REA_WAKARU_COMMAND = npm-installed @wakaru/cli-darwin-arm64/wakaru (1.14.0) and REA_JAVASCRIPT_PRLIMIT_COMMAND = a small shim mapping --fsize/--core/--cpu onto ulimit:

input      react-dom 18.3.1 production.min.js   131,685 bytes
exit_code  0
provider   wakaru 1.14.0
modules    1 decompiled / 0 failed
elapsed    180 ms
output     modules/bundle.js 309,106 bytes + bundle.js.map 183,126 bytes

Output is readable ES modules (import aa from "react" …), not a placeholder. The same call before this change fails with AnalysisCapabilityUnavailableError.

npx tsc --noEmit                            -> 0
vitest tests/boundary/javascript-recovery   -> 2 files passed; the 2 previously-skipped cases pass on darwin-arm64

Compatibility

Linux x64 behaviour is unchanged: an absent or relative REA_WAKARU_COMMAND still throws AnalysisCapabilityUnavailableError, and /usr/bin/prlimit remains the default limiter. Only the refusal of otherwise-configured non-Linux hosts is removed.

One open question: macOS has no ulimit -v, so the 1 GiB address-space ceiling cannot be enforced there and the shim drops that flag. If you would rather keep an unbreakable ceiling, the alternative is to require REA_JAVASCRIPT_PRLIMIT_COMMAND on unverified hosts and still throw when it is absent. Happy to adjust either way.


🔄 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/4958 **Author:** [@cbnwtzvgf4-oss](https://github.com/cbnwtzvgf4-oss) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/wakaru-capability-gate` --- ### 📝 Commits (3) - [`f6eeeae`](https://github.com/morluto/rea/commit/f6eeeae76cf988323951797e7b3b3752e330c590) fix(javascript-recovery): gate Wakaru on capability, not host platform - [`b70e96b`](https://github.com/morluto/rea/commit/b70e96bd7a0d61fb689cbc71303714fba63c444a) fix(javascript-recovery): follow the shared helper-root cleanup marker - [`115f4f3`](https://github.com/morluto/rea/commit/115f4f385952a89c8f60570911f7dd52d57fd824) fix(javascript-recovery): treat a vanished default limiter as a probe miss ### 📊 Changes **24 files changed** (+2065 additions, -156 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/javascript-applications.md` (+13 -1) 📝 `docs/javascript-recovery.md` (+57 -13) 📝 `docs/testing.md` (+1 -1) 📝 `src/application/CapabilityInventory.ts` (+1 -1) 📝 `src/cli/javascriptRecoveryCommands.ts` (+26 -1) 📝 `src/composition/javascriptRecovery.ts` (+13 -2) 📝 `src/contracts/javascript/javascriptRecoveryToolContracts.ts` (+1 -1) 📝 `src/javascript/recovery/WakaruCommand.test.ts` (+239 -1) 📝 `src/javascript/recovery/WakaruCommand.ts` (+278 -41) 📝 `src/javascript/recovery/WakaruProvider.ts` (+201 -63) 📝 `src/javascript/recovery/WakaruPublication.ts` (+2 -2) 📝 `src/javascript/recovery/WakaruRelease.ts` (+71 -1) ➕ `src/process/ProviderProcessOwnership.ts` (+16 -0) 📝 `src/server/createServer.ts` (+49 -6) ➕ `tests/boundary/cli/javascriptRecoveryWarning.test.ts` (+34 -0) 📝 `tests/boundary/javascript-recovery/wakaruCommandConfiguration.test.ts` (+153 -22) ➕ `tests/boundary/javascript-recovery/wakaruHostDisclosure.test.ts` (+104 -0) ➕ `tests/boundary/javascript-recovery/wakaruOwnershipAvailability.test.ts` (+24 -0) ➕ `tests/boundary/javascript-recovery/wakaruPreparationCleanup.test.ts` (+309 -0) ➕ `tests/boundary/javascript-recovery/wakaruProcessCleanup.test.ts` (+93 -0) _...and 4 more files_ </details> ### 📄 Description Fixes #4948. `resolveWakaruCommand()` hard-requires `process.platform === "linux" && process.arch === "x64"`, so a binary the caller supplies and that demonstrably works is unreachable on any other host. As noted in #4948, this turns "verified on Linux x64" into "unavailable everywhere else". ## Changes - **`WakaruCommand.ts`** — gate only on `REA_WAKARU_COMMAND` being present and absolute. Host verification becomes reported state, not a precondition. Requirement/error strings no longer claim a Linux-only binary; the resource-limiter failure message is host-neutral. - **`createServer.ts`** — `javascriptRecoveryEnabled` is derived from the configured command instead of `linuxX64`. - **`CapabilityInventory.ts`**, **`javascriptRecoveryToolContracts.ts`**, **`docs/javascript-recovery.md`** — Linux x64 is described as the only fully verified host; other hosts are unverified; `REA_JAVASCRIPT_PRLIMIT_COMMAND` is documented as the hook for hosts without util-linux. - **test** — `wakaruCommandConfiguration.test.ts` no longer skips on non-Linux; both cases are pure configuration checks and now pass on macOS. ## Verification (darwin-arm64, macOS 27.0.1) End-to-end `recover_javascript_sources` through the stdio MCP server, with `REA_WAKARU_COMMAND` = npm-installed `@wakaru/cli-darwin-arm64/wakaru` (1.14.0) and `REA_JAVASCRIPT_PRLIMIT_COMMAND` = a small shim mapping `--fsize/--core/--cpu` onto `ulimit`: ``` input react-dom 18.3.1 production.min.js 131,685 bytes exit_code 0 provider wakaru 1.14.0 modules 1 decompiled / 0 failed elapsed 180 ms output modules/bundle.js 309,106 bytes + bundle.js.map 183,126 bytes ``` Output is readable ES modules (`import aa from "react"` …), not a placeholder. The same call before this change fails with `AnalysisCapabilityUnavailableError`. ``` npx tsc --noEmit -> 0 vitest tests/boundary/javascript-recovery -> 2 files passed; the 2 previously-skipped cases pass on darwin-arm64 ``` ## Compatibility Linux x64 behaviour is unchanged: an absent or relative `REA_WAKARU_COMMAND` still throws `AnalysisCapabilityUnavailableError`, and `/usr/bin/prlimit` remains the default limiter. Only the refusal of otherwise-configured non-Linux hosts is removed. One open question: macOS has no `ulimit -v`, so the 1 GiB address-space ceiling cannot be enforced there and the shim drops that flag. If you would rather keep an unbreakable ceiling, the alternative is to require `REA_JAVASCRIPT_PRLIMIT_COMMAND` on unverified hosts and still throw when it is absent. Happy to adjust either way. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:22 +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#6696
No description provided.