[PR #6923] feat(setup): configurable JS runtime (Node/Bun) and Python toolchain (uv/system) with interactive setup #7449

Open
opened 2026-11-01 21:47:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6923
Author: @Ercaner1988
Created: 10/23/2026
Status: 🔄 Open

Base: main ← Head: fix/bun-runtime-and-client-registration


📝 Commits (1)

  • 770c049 feat(setup): add configurable JS runtime (Bun/Node) and Python toolchain (uv/system) with quick standard defaults

📊 Changes

14 files changed (+502 additions, -20 deletions)

View changed files

📝 src/application/ClientRegistrationIdentity.ts (+66 -6)
📝 src/application/Setup.ts (+9 -0)
📝 src/application/SetupHost.ts (+27 -4)
➕ src/application/SetupPythonEnvironment.test.ts (+24 -0)
➕ src/application/SetupPythonEnvironment.ts (+85 -0)
📝 src/application/SetupRegistrationEnvironment.ts (+1 -0)
📝 src/application/SetupTypes.ts (+8 -0)
📝 src/cli/interactiveSetup.ts (+135 -0)
📝 src/cli/setupCommands.ts (+92 -2)
📝 src/domain/runtimeVersion.test.ts (+1 -0)
📝 src/domain/runtimeVersion.ts (+15 -4)
📝 src/domain/versionReport.test.ts (+16 -0)
📝 src/domain/versionReport.ts (+5 -1)
📝 tests/boundary/cli/versionReportCli.test.ts (+18 -3)

📄 Description

Summary

This update adds configurable JavaScript runtime selection (Node.js vs Bun) and Python toolchain options (uv + ruff vs system vs none) to the interactive REA setup, while providing a zero-prompt Quick Setup mode that defaults to the upstream repository owner's standard defaults (Node.js + standard Python).

In addition, it resolves upstream reviewer feedback by completely removing bun.lock from the PR, fixes launcher recognition for --mcp and node/bun executables, admits Node 26 compatibility for Bun 1.4+, and resolves duplicated imports in ClientRegistrationIdentity.ts.

Problem and Motivation

  1. Lockfile isolation: As noted in upstream reviews, committing bun.lock can create noise or conflicts for repos maintaining package-lock.json. Modern Bun works seamlessly with package-lock.json, so bun.lock has been completely omitted.
  2. Toolchain flexibility: Developers and automated agent environments increasingly use modern fast toolchains like Bun for JS/TS and uv/ruff for Python. Previously, REA setup assumed Node and system Python without configurable options or flags.
  3. Setup convenience: While flexibility is essential, the default experience must remain minimal and aligned with upstream conventions. A default 'Quick Setup' profile allows users and CI to proceed immediately with standard upstream defaults (Node.js + system Python).
  4. Bun 1.4+ Node 26 compatibility: Bun 1.4 reports Node compatibility 26.3.0 (process.versions.node), which previously failed REA's version range check despite Bun 1.4 being fully compatible.
  5. Launcher inspection: Direct launcher registrations using bun/bun.exe and the documented --mcp flag (recognized in scripts/rea.mjs) were previously marked unknown or stale because inspectDirectRegistrationCommand only inspected "mcp" and expected interpreterIdentity === "owned".

Changes

1. Interactive & Non-Interactive Setup Options

  • Added setup profiles:
    • Quick Setup (Default): Uses standard upstream defaults (Node.js runtime, standard system Python).
    • Custom Setup: Interactively prompts for:
      • JavaScript Runtime: Node.js (Default) vs Bun
      • Python Toolchain: Standard / System Python (Default) vs uv + ruff (Fast isolated toolchain) vs None / Skip
  • Added CLI flags to rea setup:
    • --quick: Proceed with standard upstream defaults without prompts.
    • --custom: Force interactive customization.
    • --runtime <node|bun>: Explicitly choose the JS runtime.
    • --python-runner <system|uv|none>: Explicitly choose Python runner.
  • When uv is selected, the setup runs uv python find to locate the managed Python executable and sets REA_PYTHON_RUNNER="uv".

2. Runtime & Compatibility Alignment

  • Added SUPPORTED_BUN_NODE_COMPATIBILITY_RANGE = "^22.23.4 || ^24.22.1 || >=26.0.0" in src/domain/runtimeVersion.ts.
  • supportsJavaScriptRuntime checks Bun's nodeCompatibilityVersion against this range, preserving Node engine floors while admitting modern Bun releases.
  • Fixed hostRemediation in src/application/SetupHost.ts to use supportsJavaScriptRuntime(host.runtime).

3. Client Registration & Launcher Recognition

  • Extended inspectDirectRegistrationCommand in src/application/ClientRegistrationIdentity.ts to accept --mcp alongside mcp.
  • Recognized both node and bun (and .exe variants) in isJavaScriptRuntimeExecutable.
  • Cleaned up duplicate isAbsolute import in ClientRegistrationIdentity.ts.

4. Tests

  • Added unit tests for Python environment detection (SetupPythonEnvironment.test.ts).
  • Added Bun 1.4.3 Node compatibility test case in src/domain/runtimeVersion.test.ts.
  • Updated tests/boundary/cli/versionReportCli.test.ts to dynamically match runtime ID under Bun/Node.

Validation Performed

  • vitest run src/domain/runtimeVersion.test.ts src/application/SetupPythonEnvironment.test.ts — all passed.
  • bunx --bun tsc -p tsconfig.json --noEmit — 0 errors.
  • Verified interactive prompt and CLI flags (--quick, --custom, --runtime, --python-runner).

Author readiness

Human owner: @Ercaner1988

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • 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/6923 **Author:** [@Ercaner1988](https://github.com/Ercaner1988) **Created:** 10/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/bun-runtime-and-client-registration` --- ### 📝 Commits (1) - [`770c049`](https://github.com/morluto/rea/commit/770c0494b6862b9d4ed8830b070d498ef00f5963) feat(setup): add configurable JS runtime (Bun/Node) and Python toolchain (uv/system) with quick standard defaults ### 📊 Changes **14 files changed** (+502 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ClientRegistrationIdentity.ts` (+66 -6) 📝 `src/application/Setup.ts` (+9 -0) 📝 `src/application/SetupHost.ts` (+27 -4) ➕ `src/application/SetupPythonEnvironment.test.ts` (+24 -0) ➕ `src/application/SetupPythonEnvironment.ts` (+85 -0) 📝 `src/application/SetupRegistrationEnvironment.ts` (+1 -0) 📝 `src/application/SetupTypes.ts` (+8 -0) 📝 `src/cli/interactiveSetup.ts` (+135 -0) 📝 `src/cli/setupCommands.ts` (+92 -2) 📝 `src/domain/runtimeVersion.test.ts` (+1 -0) 📝 `src/domain/runtimeVersion.ts` (+15 -4) 📝 `src/domain/versionReport.test.ts` (+16 -0) 📝 `src/domain/versionReport.ts` (+5 -1) 📝 `tests/boundary/cli/versionReportCli.test.ts` (+18 -3) </details> ### 📄 Description ## Summary This update adds configurable JavaScript runtime selection (`Node.js` vs `Bun`) and Python toolchain options (`uv + ruff` vs `system` vs `none`) to the interactive REA setup, while providing a zero-prompt Quick Setup mode that defaults to the upstream repository owner's standard defaults (Node.js + standard Python). In addition, it resolves upstream reviewer feedback by completely removing `bun.lock` from the PR, fixes launcher recognition for `--mcp` and `node`/`bun` executables, admits Node 26 compatibility for Bun 1.4+, and resolves duplicated imports in `ClientRegistrationIdentity.ts`. ## Problem and Motivation 1. **Lockfile isolation:** As noted in upstream reviews, committing `bun.lock` can create noise or conflicts for repos maintaining `package-lock.json`. Modern Bun works seamlessly with `package-lock.json`, so `bun.lock` has been completely omitted. 2. **Toolchain flexibility:** Developers and automated agent environments increasingly use modern fast toolchains like Bun for JS/TS and uv/ruff for Python. Previously, REA setup assumed Node and system Python without configurable options or flags. 3. **Setup convenience:** While flexibility is essential, the default experience must remain minimal and aligned with upstream conventions. A default 'Quick Setup' profile allows users and CI to proceed immediately with standard upstream defaults (Node.js + system Python). 4. **Bun 1.4+ Node 26 compatibility:** Bun 1.4 reports Node compatibility `26.3.0` (`process.versions.node`), which previously failed REA's version range check despite Bun 1.4 being fully compatible. 5. **Launcher inspection:** Direct launcher registrations using `bun`/`bun.exe` and the documented `--mcp` flag (recognized in `scripts/rea.mjs`) were previously marked `unknown` or `stale` because `inspectDirectRegistrationCommand` only inspected `"mcp"` and expected `interpreterIdentity === "owned"`. ## Changes ### 1. Interactive & Non-Interactive Setup Options - Added setup profiles: - **Quick Setup (Default):** Uses standard upstream defaults (Node.js runtime, standard system Python). - **Custom Setup:** Interactively prompts for: - JavaScript Runtime: `Node.js (Default)` vs `Bun` - Python Toolchain: `Standard / System Python (Default)` vs `uv + ruff (Fast isolated toolchain)` vs `None / Skip` - Added CLI flags to `rea setup`: - `--quick`: Proceed with standard upstream defaults without prompts. - `--custom`: Force interactive customization. - `--runtime <node|bun>`: Explicitly choose the JS runtime. - `--python-runner <system|uv|none>`: Explicitly choose Python runner. - When `uv` is selected, the setup runs `uv python find` to locate the managed Python executable and sets `REA_PYTHON_RUNNER="uv"`. ### 2. Runtime & Compatibility Alignment - Added `SUPPORTED_BUN_NODE_COMPATIBILITY_RANGE = "^22.23.4 || ^24.22.1 || >=26.0.0"` in `src/domain/runtimeVersion.ts`. - `supportsJavaScriptRuntime` checks Bun's `nodeCompatibilityVersion` against this range, preserving Node engine floors while admitting modern Bun releases. - Fixed `hostRemediation` in `src/application/SetupHost.ts` to use `supportsJavaScriptRuntime(host.runtime)`. ### 3. Client Registration & Launcher Recognition - Extended `inspectDirectRegistrationCommand` in `src/application/ClientRegistrationIdentity.ts` to accept `--mcp` alongside `mcp`. - Recognized both `node` and `bun` (and `.exe` variants) in `isJavaScriptRuntimeExecutable`. - Cleaned up duplicate `isAbsolute` import in `ClientRegistrationIdentity.ts`. ### 4. Tests - Added unit tests for Python environment detection (`SetupPythonEnvironment.test.ts`). - Added Bun 1.4.3 Node compatibility test case in `src/domain/runtimeVersion.test.ts`. - Updated `tests/boundary/cli/versionReportCli.test.ts` to dynamically match runtime ID under Bun/Node. ## Validation Performed - `vitest run src/domain/runtimeVersion.test.ts src/application/SetupPythonEnvironment.test.ts` — all passed. - `bunx --bun tsc -p tsconfig.json --noEmit` — 0 errors. - Verified interactive prompt and CLI flags (`--quick`, `--custom`, `--runtime`, `--python-runner`). ## Author readiness Human owner: @Ercaner1988 - [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. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] 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>
bsakaguchi changed title from [PR #6923] fix(runtime): admit Node 26 compatibility for Bun and accept --mcp registrations to [PR #6923] feat(setup): configurable JS runtime (Node/Bun) and Python toolchain (uv/system) with interactive setup 2026-11-04 11:17:56 +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#7449
No description provided.