[PR #3030] Fix/android runtime fallback #5566

Open
opened 2026-10-31 01:07:38 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3030
Author: @bossartemii
Created: 10/13/2026
Status: 🔄 Open

Base: main ← Head: fix/android-runtime-fallback


📝 Commits (3)

  • 1b808ae fix(android): fall back to compiled runtime
  • a674691 fix(android): skip empty runtime bundles on Termux
  • 4ec82bc Merge remote-tracking branch 'origin/main' into sweep/3030

📊 Changes

3 files changed (+110 additions, -22 deletions)

View changed files

📝 package.json (+1 -1)
📝 scripts/bundle-runtime.mjs (+58 -1)
📝 scripts/rea.mjs (+51 -20)

📄 Description

fix(android): skip empty runtime bundles on Termux

Summary

Fix the Termux build path so it can use the non-empty TypeScript ESM runtime when Rolldown produces empty runtime entrypoints on Android/Termux ARM64.

The existing runtime dispatcher fallback is retained. The Termux build now explicitly skips bundling, while the bundling script validates that the expected runtime files are non-empty.

Problem and expected behavior

On the affected Android/ARM64 environment, the runtime bundling step can produce zero-byte entrypoints. Those files are unusable even though TypeScript compilation emits non-empty JavaScript modules.

The expected behavior is for "build:termux" to retain the compiled TypeScript ESM runtime rather than overwrite or depend on empty bundles. Missing or empty expected runtime files should fail validation instead of being silently accepted.

Change and scope

  • Set "REA_SKIP_RUNTIME_BUNDLING=1" in the "compile:termux" script.
  • Skip Rolldown when running on Android or when the explicit Termux build flag is set.
  • Validate that the expected TypeScript runtime modules exist and are non-empty on the skip path.
  • Validate that expected Rolldown outputs are non-empty on the normal bundling path.
  • Keep the change limited to "package.json" and "scripts/bundle-runtime.mjs".

This is an existing runtime/build reliability fix; it does not introduce a new provider or capability.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Build pipeline, at "compile:termux" / "scripts/bundle-runtime.mjs".
  • Contribution scope fit and linked maintainer decision: Intended as a fix within existing build/runtime boundaries. No new provider or target-execution capability is introduced. Maintainer confirmation remains pending.
  • CLI and MCP/tool-catalog contract: No intended contract change. The MCP doctor reported the expected 206 tools and 6 prompts, with the expected catalog digest and a successful request flow.
  • Provider, bridge, target-format, or platform compatibility: Targets the Termux/Android build path. A real Termux device/workflow run remains to be confirmed.
  • Evidence, artifact, provenance, or reconstruction contract: Adds non-empty-file validation for expected runtime outputs; no intended change to evidence or reconstruction semantics.
  • Target selection, authority, upstream behavior, and cleanup details: Not applicable to this build-only change.
  • Generated metadata, package, or installation impact: Changes the "compile:termux" package script. No generated build outputs or generated catalogs are intentionally committed.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: Runtime output validation was added to "scripts/bundle-runtime.mjs". No dedicated automated regression test has been added yet.
  • Base reproduction or other evidence: The prior Android-related build investigation found zero-byte runtime bundles while the plain TypeScript compilation produced non-empty runtime modules. The Termux-specific skip path is intended to prevent Rolldown from producing those unusable outputs.
  • User-visible CLI/MCP output: "node scripts/rea.mjs mcp doctor" reported "healthy: true", with 206/206 tools, 6/6 prompts, matching catalog digest, successful request flow, and no stderr.
  • Remaining proof gaps: The final complete "npm run build:termux" output and a real Termux-device workflow result must be confirmed before claiming the Android regression is fully reproduced and resolved.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • "node --check scripts/bundle-runtime.mjs" — passed.
  • "git diff --check" — passed.
  • "node scripts/rea.mjs mcp doctor" — healthy; 206 tools and 6 prompts matched expectations, catalog digest matched, request flow succeeded, stderr empty.
  • "npm run check:fast" — passed; 2 tasks successful (typecheck and lint).
  • "git push origin fix/android-runtime-fallback" — succeeded; branch advanced to commit "a6746916a".
  • "npm run build:termux" — invoked, but the captured output does not establish successful completion of the entire build. Do not treat this as a passed build until confirmed.

Compatibility, safety, and release

  • Breaking changes or migration steps: No intended CLI/MCP breaking change. The Termux compile script now skips Rolldown and uses compiled TypeScript ESM modules.
  • Real Hopper/Ghidra, browser, or OS coverage: MCP doctor and typecheck/lint passed in Debian on Android. Real Termux-device coverage remains unverified.
  • Package or release metadata impact: Updates the "compile:termux" script only; no version bump or generated artifact is included in this change.
  • Security, privacy, process, or containment review: No new target interaction or process instrumentation is introduced. The normal non-Termux bundling path now fails if expected bundle outputs are missing or empty.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows "type(scope): outcome".
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/3030 **Author:** [@bossartemii](https://github.com/bossartemii) **Created:** 10/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/android-runtime-fallback` --- ### 📝 Commits (3) - [`1b808ae`](https://github.com/morluto/rea/commit/1b808ae54e00754a280181c2dcaa5a9f40a694e7) fix(android): fall back to compiled runtime - [`a674691`](https://github.com/morluto/rea/commit/a6746916ad9f26d9e0b2b7a52184aca123c34bad) fix(android): skip empty runtime bundles on Termux - [`4ec82bc`](https://github.com/morluto/rea/commit/4ec82bce9f10d655ff73d1b0163f0a3ed879deec) Merge remote-tracking branch 'origin/main' into sweep/3030 ### 📊 Changes **3 files changed** (+110 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) 📝 `scripts/bundle-runtime.mjs` (+58 -1) 📝 `scripts/rea.mjs` (+51 -20) </details> ### 📄 Description fix(android): skip empty runtime bundles on Termux Summary Fix the Termux build path so it can use the non-empty TypeScript ESM runtime when Rolldown produces empty runtime entrypoints on Android/Termux ARM64. The existing runtime dispatcher fallback is retained. The Termux build now explicitly skips bundling, while the bundling script validates that the expected runtime files are non-empty. Problem and expected behavior On the affected Android/ARM64 environment, the runtime bundling step can produce zero-byte entrypoints. Those files are unusable even though TypeScript compilation emits non-empty JavaScript modules. The expected behavior is for "build:termux" to retain the compiled TypeScript ESM runtime rather than overwrite or depend on empty bundles. Missing or empty expected runtime files should fail validation instead of being silently accepted. Change and scope - Set "REA_SKIP_RUNTIME_BUNDLING=1" in the "compile:termux" script. - Skip Rolldown when running on Android or when the explicit Termux build flag is set. - Validate that the expected TypeScript runtime modules exist and are non-empty on the skip path. - Validate that expected Rolldown outputs are non-empty on the normal bundling path. - Keep the change limited to "package.json" and "scripts/bundle-runtime.mjs". This is an existing runtime/build reliability fix; it does not introduce a new provider or capability. Contract and boundary impact - Semantic owner and earliest changed stage: Build pipeline, at "compile:termux" / "scripts/bundle-runtime.mjs". - Contribution scope fit and linked maintainer decision: Intended as a fix within existing build/runtime boundaries. No new provider or target-execution capability is introduced. Maintainer confirmation remains pending. - CLI and MCP/tool-catalog contract: No intended contract change. The MCP doctor reported the expected 206 tools and 6 prompts, with the expected catalog digest and a successful request flow. - Provider, bridge, target-format, or platform compatibility: Targets the Termux/Android build path. A real Termux device/workflow run remains to be confirmed. - Evidence, artifact, provenance, or reconstruction contract: Adds non-empty-file validation for expected runtime outputs; no intended change to evidence or reconstruction semantics. - Target selection, authority, upstream behavior, and cleanup details: Not applicable to this build-only change. - Generated metadata, package, or installation impact: Changes the "compile:termux" package script. No generated build outputs or generated catalogs are intentionally committed. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. Evidence and regression coverage - Tests added or updated: Runtime output validation was added to "scripts/bundle-runtime.mjs". No dedicated automated regression test has been added yet. - Base reproduction or other evidence: The prior Android-related build investigation found zero-byte runtime bundles while the plain TypeScript compilation produced non-empty runtime modules. The Termux-specific skip path is intended to prevent Rolldown from producing those unusable outputs. - User-visible CLI/MCP output: "node scripts/rea.mjs mcp doctor" reported "healthy: true", with 206/206 tools, 6/6 prompts, matching catalog digest, successful request flow, and no stderr. - Remaining proof gaps: The final complete "npm run build:termux" output and a real Termux-device workflow result must be confirmed before claiming the Android regression is fully reproduced and resolved. For evidence-bearing changes: - [ ] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [ ] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. Validation performed - "node --check scripts/bundle-runtime.mjs" — passed. - "git diff --check" — passed. - "node scripts/rea.mjs mcp doctor" — healthy; 206 tools and 6 prompts matched expectations, catalog digest matched, request flow succeeded, stderr empty. - "npm run check:fast" — passed; 2 tasks successful (typecheck and lint). - "git push origin fix/android-runtime-fallback" — succeeded; branch advanced to commit "a6746916a". - "npm run build:termux" — invoked, but the captured output does not establish successful completion of the entire build. Do not treat this as a passed build until confirmed. Compatibility, safety, and release - Breaking changes or migration steps: No intended CLI/MCP breaking change. The Termux compile script now skips Rolldown and uses compiled TypeScript ESM modules. - Real Hopper/Ghidra, browser, or OS coverage: MCP doctor and typecheck/lint passed in Debian on Android. Real Termux-device coverage remains unverified. - Package or release metadata impact: Updates the "compile:termux" script only; no version bump or generated artifact is included in this change. - Security, privacy, process, or containment review: No new target interaction or process instrumentation is introduced. The normal non-Termux bundling path now fails if expected bundle outputs are missing or empty. Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows "type(scope): outcome". - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5566
No description provided.