[PR #258] [MERGED] feat(application): add isolated JavaScript replay #1905

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/258
Author: @N0zoM1z0
Created: 7/16/2026
Status: ✅ Merged
Merged: 7/16/2026
Merged by: @N0zoM1z0

Base: main ← Head: agent/isolated-javascript-replay


📝 Commits (3)

  • 774e48d feat(application): add isolated JavaScript replay
  • 17e4ff7 docs: stabilize replay API source links
  • 9501aa7 test(replay): use portable seam executables

📊 Changes

194 files changed (+6332 additions, -604 deletions)

View changed files

📝 .github/pull_request_template.md (+1 -1)
➕ .github/workflows/real-javascript-replay.yml (+33 -0)
📝 AGENTS.md (+8 -3)
📝 README.md (+8 -8)
📝 README_ar.md (+4 -4)
📝 README_ja.md (+4 -4)
📝 README_ko.md (+4 -4)
📝 README_zh.md (+4 -4)
📝 docs/adr/0002-controlled-replay-authority-and-sandbox.md (+25 -27)
📝 docs/adr/README.md (+4 -4)
📝 docs/api/assets/hierarchy.js (+1 -1)
📝 docs/api/assets/navigation.js (+1 -1)
📝 docs/api/assets/search.js (+1 -1)
📝 docs/api/classes/application_PermissionAuthority.PermissionAuthority.html (+12 -12)
📝 docs/api/classes/application_PermissionAuthority.PermissionPathError.html (+1 -1)
📝 docs/api/classes/application_ProcessCaptureError.ProcessCaptureError.html (+1 -1)
📝 docs/api/classes/application_ProjectPermissionStore.ProjectPermissionStoreError.html (+5 -5)
📝 docs/api/classes/domain_errors.AnalysisCancelledError.html (+9 -9)
📝 docs/api/classes/domain_errors.AnalysisCapabilityUnavailableError.html (+11 -11)
📝 docs/api/classes/domain_errors.AnalysisError.html (+9 -8)

...and 80 more files

📄 Description

Summary

  • add the run_controlled_replay application tool and run-controlled-replay CLI command with one shared plan/execute contract
  • execute only operator-selected extracted ESM or CommonJS/Rspack factories in a disposable Linux x64 Bubblewrap namespace
  • commit source bytes, cases, deterministic providers, the Node ELF closure, worker, sandbox executables, seccomp policy, limits, effects, and optional reproducer export in an exact plan digest
  • preserve left/right replay observations as source Evidence and derive differential comparisons without erasing unknown results
  • update doctor, capability inventory, configuration, permission storage, localized product facts, generated catalogs/API docs, package verification, and the packaged REA analysis skill for 83 tools

Why

Static reconstruction and passive browser/Electron observation cannot answer bounded questions about pure extracted parsers, sanitizers, serializers, or clipboard transforms. This adds that experimental authority without widening passive observation or running recovered code in the REA/CLI/MCP process.

Security and behavior

  • disabled by default behind a distinct javascript_replay administrator ceiling
  • exact canonical source roots and sandbox executables; no ambient package resolution
  • fresh worker realms, closed dependencies, deterministic clock and PRNG
  • empty mount root, no network namespace, dropped capabilities, architecture-checked seccomp, Node permission defense in depth
  • delegated systemd user cgroup memory/swap/task/CPU limits plus an outer wall deadline
  • independently bounded case input, worker protocol, stdout, stderr, result depth, and result nodes
  • strict parent validation of worker response count, ordering, case IDs, and input digests
  • explicit return, exception, serialization error, denial, timeout, OOM, crash, cancellation, and protocol-error observations
  • cancellation is checked before admission; timeout/cancel waits for the cgroup kill before cleanup is classified
  • optional owner-only reproducer output requires separate evidence_write authority and excludes source by default

Contract impact

Application tools increase from 2 to 3. Total MCP inventory increases from 82 to 83:

33 direct + 10 enhanced + 5 native + 2 artifact + 8 browser + 4 Electron + 3 application + 18 session

CLI inventory increases from 42 to 43.

Validation

  • npm run check — 133 files, 928 tests; coverage 81.89% statements / 71.24% branches / 84.96% functions / 84.05% lines
  • npm run knip
  • npm run jscpd — 1.47% duplicated lines
  • npm run scan:todos
  • REA skill quick_validate.py
  • CC=/usr/bin/gcc-13 CXX=/usr/bin/g++-13 npm run verify:package — 83 MCP tools and target-free package lifecycle
  • npm run verify:replay — real parser differential, ambient side-effect denial, timeout, differential timeout, OOM, and complete cgroup cleanup
  • REA_REPLAY_INPUT_PATH=/tmp/rea-replay-manifest.json npm run verify:replay — operator-local CommonJS/Rspack sanitizer manifest
  • git diff --check

Real JavaScript replay verification was performed on Linux x64 with Bubblewrap, seccomp, and a delegated systemd user cgroup. Real Hopper and Ghidra verification were not run because this change does not alter either provider boundary.


🔄 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/258 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 7/16/2026 **Status:** ✅ Merged **Merged:** 7/16/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `agent/isolated-javascript-replay` --- ### 📝 Commits (3) - [`774e48d`](https://github.com/morluto/rea/commit/774e48dfdb24d084aba59744f6819904e839ee5a) feat(application): add isolated JavaScript replay - [`17e4ff7`](https://github.com/morluto/rea/commit/17e4ff76db13beef5860be620302b32f5646eb10) docs: stabilize replay API source links - [`9501aa7`](https://github.com/morluto/rea/commit/9501aa7dd45cbf44c36fe140bfe44bf22a85120a) test(replay): use portable seam executables ### 📊 Changes **194 files changed** (+6332 additions, -604 deletions) <details> <summary>View changed files</summary> 📝 `.github/pull_request_template.md` (+1 -1) ➕ `.github/workflows/real-javascript-replay.yml` (+33 -0) 📝 `AGENTS.md` (+8 -3) 📝 `README.md` (+8 -8) 📝 `README_ar.md` (+4 -4) 📝 `README_ja.md` (+4 -4) 📝 `README_ko.md` (+4 -4) 📝 `README_zh.md` (+4 -4) 📝 `docs/adr/0002-controlled-replay-authority-and-sandbox.md` (+25 -27) 📝 `docs/adr/README.md` (+4 -4) 📝 `docs/api/assets/hierarchy.js` (+1 -1) 📝 `docs/api/assets/navigation.js` (+1 -1) 📝 `docs/api/assets/search.js` (+1 -1) 📝 `docs/api/classes/application_PermissionAuthority.PermissionAuthority.html` (+12 -12) 📝 `docs/api/classes/application_PermissionAuthority.PermissionPathError.html` (+1 -1) 📝 `docs/api/classes/application_ProcessCaptureError.ProcessCaptureError.html` (+1 -1) 📝 `docs/api/classes/application_ProjectPermissionStore.ProjectPermissionStoreError.html` (+5 -5) 📝 `docs/api/classes/domain_errors.AnalysisCancelledError.html` (+9 -9) 📝 `docs/api/classes/domain_errors.AnalysisCapabilityUnavailableError.html` (+11 -11) 📝 `docs/api/classes/domain_errors.AnalysisError.html` (+9 -8) _...and 80 more files_ </details> ### 📄 Description ## Summary - add the `run_controlled_replay` application tool and `run-controlled-replay` CLI command with one shared plan/execute contract - execute only operator-selected extracted ESM or CommonJS/Rspack factories in a disposable Linux x64 Bubblewrap namespace - commit source bytes, cases, deterministic providers, the Node ELF closure, worker, sandbox executables, seccomp policy, limits, effects, and optional reproducer export in an exact plan digest - preserve left/right replay observations as source Evidence and derive differential comparisons without erasing unknown results - update doctor, capability inventory, configuration, permission storage, localized product facts, generated catalogs/API docs, package verification, and the packaged REA analysis skill for 83 tools ## Why Static reconstruction and passive browser/Electron observation cannot answer bounded questions about pure extracted parsers, sanitizers, serializers, or clipboard transforms. This adds that experimental authority without widening passive observation or running recovered code in the REA/CLI/MCP process. ## Security and behavior - disabled by default behind a distinct `javascript_replay` administrator ceiling - exact canonical source roots and sandbox executables; no ambient package resolution - fresh worker realms, closed dependencies, deterministic clock and PRNG - empty mount root, no network namespace, dropped capabilities, architecture-checked seccomp, Node permission defense in depth - delegated systemd user cgroup memory/swap/task/CPU limits plus an outer wall deadline - independently bounded case input, worker protocol, stdout, stderr, result depth, and result nodes - strict parent validation of worker response count, ordering, case IDs, and input digests - explicit return, exception, serialization error, denial, timeout, OOM, crash, cancellation, and protocol-error observations - cancellation is checked before admission; timeout/cancel waits for the cgroup kill before cleanup is classified - optional owner-only reproducer output requires separate `evidence_write` authority and excludes source by default ## Contract impact Application tools increase from 2 to 3. Total MCP inventory increases from 82 to 83: `33 direct + 10 enhanced + 5 native + 2 artifact + 8 browser + 4 Electron + 3 application + 18 session` CLI inventory increases from 42 to 43. ## Validation - `npm run check` — 133 files, 928 tests; coverage 81.89% statements / 71.24% branches / 84.96% functions / 84.05% lines - `npm run knip` - `npm run jscpd` — 1.47% duplicated lines - `npm run scan:todos` - REA skill `quick_validate.py` - `CC=/usr/bin/gcc-13 CXX=/usr/bin/g++-13 npm run verify:package` — 83 MCP tools and target-free package lifecycle - `npm run verify:replay` — real parser differential, ambient side-effect denial, timeout, differential timeout, OOM, and complete cgroup cleanup - `REA_REPLAY_INPUT_PATH=/tmp/rea-replay-manifest.json npm run verify:replay` — operator-local CommonJS/Rspack sanitizer manifest - `git diff --check` Real JavaScript replay verification was performed on Linux x64 with Bubblewrap, seccomp, and a delegated systemd user cgroup. Real Hopper and Ghidra verification were not run because this change does not alter either provider boundary. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:12:23 +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#1905
No description provided.