[PR #2026] [MERGED] fix(scripts, install): honor test:fast "without build" promise and orient Node.js engine mismatches #4974

Closed
opened 2026-10-31 00:57:34 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2026
Author: @astralyx0129
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: audit/deep-fix


📝 Commits (2)

  • ef9c048 fix(scripts): defer dist/ imports in verifier helpers so test:fast runs without build
  • 716cc96 fix(install): orient Node.js version mismatch failures with actionable remediation

📊 Changes

5 files changed (+90 additions, -9 deletions)

View changed files

📝 docs/user-visible-errors.csv (+16 -2)
📝 install.sh (+33 -1)
📝 scripts/lib/real-hopper-semantic.mjs (+14 -1)
📝 scripts/lib/verify-package-core.mjs (+13 -4)
📝 tests/boundary/filesystem/installScript.test.ts (+14 -1)

📄 Description

Summary

Two independent fixes that align observed behavior with promises already made in the repo.

1. fix(scripts): test:fast runs without build (as docs promises)

docs/testing.md § test scripts tells readers npm run test:fast runs "without build". Reproduction before this change — rm -rf dist && npm run test:fast — fails two test files at import time:

  • tests/conformance/providers/hopper/realHopperSemantic.test.ts: only calls requireCurrentDocument and resolveFixtureProcedure with mock clients, but scripts/lib/real-hopper-semantic.mjs eager-imports requireFunctionDossierOracle from dist/application/RealHopperAssertions.js at the top of the module.
  • tests/evaluation/package/packagePlatformDiagnostics.test.ts: only uses assertLinuxPackageProviderFailure (which needs just json), but reaches scripts/lib/verify-package-core.mjs → scripts/lib/mcp-verifier-results.mjs → four dist/ modules through a top-level re-export.

Both top-level imports move into lazy loaders called from the one function that actually needs dist/ (verifyRealHopperFixture / verifyCompleteToolCatalog). Scripts that run after build:cached (verify-recorded-crash.mjs, verify-package-mcp.mjs, verify-windows-package.mjs) are unaffected because the lazy load still resolves once dist/ exists.

2. fix(install): actionable remediation on Node.js version mismatch

install.sh previously told operators to "use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+" without saying how. For a first-time `curl | bash` user that is a Google search between nvm, fnm, n, Volta, system packages, and nodejs.org.

The new failure block:

  • Names the detected Node.js version so the operator confirms it is theirs.
  • Lists nvm / fnm / direct-tarball install paths.
  • Pins the Node.js release line (24) that satisfies the engine, so copy-paste commands produce a supported runtime instead of whichever latest is on top.
  • Maps uname -m / uname -s to the Node.js tarball label pair for this host (darwin/arm64, linux/x64, …), so the operator can grab the right archive from https://nodejs.org/dist/latest-v24.x/ without a second lookup.
  • Keeps labels verbatim when a host is not mapped, so mismatches are visible instead of silently wrong.

Validation

  • rm -rf dist && npm run test:fast → 388 passed, 4924 tests, 0 failed (before the first fix: 2 import-time failures).
  • npm run build:cached && npm run test:fast → 388 passed, 4924 tests, 0 failed (no regression with dist/ present).
  • shellcheck install.sh → clean.
  • npm run check:fast → typecheck + lint clean.
  • Simulated four Node.js versions (24.18 compatible, 25.9/20.11 outside the supported ranges, 22.18 below the minor floor) via a shimmed node in PATH: remediation triggers only on real mismatches and names the host labels correctly on darwin/arm64.

Test plan

  • rm -rf dist && npm run test:fast passes clean.
  • npm run build:cached && npm run test:fast passes clean.
  • shellcheck install.sh clean.
  • npm run check:fast clean.
  • Four Node.js versions simulated for install.sh remediation.

🤖 Generated with Claude Code


🔄 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/2026 **Author:** [@astralyx0129](https://github.com/astralyx0129) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `audit/deep-fix` --- ### 📝 Commits (2) - [`ef9c048`](https://github.com/morluto/rea/commit/ef9c0484a5e511a45b46520be2324f8234cca4d8) fix(scripts): defer dist/ imports in verifier helpers so test:fast runs without build - [`716cc96`](https://github.com/morluto/rea/commit/716cc96ad07c52fba4a33fe601209198045f75c2) fix(install): orient Node.js version mismatch failures with actionable remediation ### 📊 Changes **5 files changed** (+90 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `docs/user-visible-errors.csv` (+16 -2) 📝 `install.sh` (+33 -1) 📝 `scripts/lib/real-hopper-semantic.mjs` (+14 -1) 📝 `scripts/lib/verify-package-core.mjs` (+13 -4) 📝 `tests/boundary/filesystem/installScript.test.ts` (+14 -1) </details> ### 📄 Description ## Summary Two independent fixes that align observed behavior with promises already made in the repo. ### 1. `fix(scripts)`: `test:fast` runs without build (as docs promises) [docs/testing.md § test scripts](docs/testing.md) tells readers `npm run test:fast` runs "**without build**". Reproduction before this change — `rm -rf dist && npm run test:fast` — fails two test files at import time: - `tests/conformance/providers/hopper/realHopperSemantic.test.ts`: only calls `requireCurrentDocument` and `resolveFixtureProcedure` with mock clients, but `scripts/lib/real-hopper-semantic.mjs` eager-imports `requireFunctionDossierOracle` from `dist/application/RealHopperAssertions.js` at the top of the module. - `tests/evaluation/package/packagePlatformDiagnostics.test.ts`: only uses `assertLinuxPackageProviderFailure` (which needs just `json`), but reaches `scripts/lib/verify-package-core.mjs` → `scripts/lib/mcp-verifier-results.mjs` → four `dist/` modules through a top-level re-export. Both top-level imports move into lazy loaders called from the one function that actually needs `dist/` (`verifyRealHopperFixture` / `verifyCompleteToolCatalog`). Scripts that run after `build:cached` (`verify-recorded-crash.mjs`, `verify-package-mcp.mjs`, `verify-windows-package.mjs`) are unaffected because the lazy load still resolves once `dist/` exists. ### 2. `fix(install)`: actionable remediation on Node.js version mismatch `install.sh` previously told operators to "use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+" without saying how. For a first-time \`curl | bash\` user that is a Google search between nvm, fnm, n, Volta, system packages, and nodejs.org. The new failure block: - Names the detected Node.js version so the operator confirms it is theirs. - Lists `nvm` / `fnm` / direct-tarball install paths. - Pins the Node.js release line (`24`) that satisfies the engine, so copy-paste commands produce a supported runtime instead of whichever latest is on top. - Maps `uname -m` / `uname -s` to the Node.js tarball label pair for this host (`darwin/arm64`, `linux/x64`, …), so the operator can grab the right archive from `https://nodejs.org/dist/latest-v24.x/` without a second lookup. - Keeps labels verbatim when a host is not mapped, so mismatches are visible instead of silently wrong. ## Validation - `rm -rf dist && npm run test:fast` → 388 passed, 4924 tests, 0 failed (before the first fix: 2 import-time failures). - `npm run build:cached && npm run test:fast` → 388 passed, 4924 tests, 0 failed (no regression with `dist/` present). - `shellcheck install.sh` → clean. - `npm run check:fast` → typecheck + lint clean. - Simulated four Node.js versions (24.18 compatible, 25.9/20.11 outside the supported ranges, 22.18 below the minor floor) via a shimmed `node` in `PATH`: remediation triggers only on real mismatches and names the host labels correctly on `darwin/arm64`. ## Test plan - [x] `rm -rf dist && npm run test:fast` passes clean. - [x] `npm run build:cached && npm run test:fast` passes clean. - [x] `shellcheck install.sh` clean. - [x] `npm run check:fast` clean. - [x] Four Node.js versions simulated for install.sh remediation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:57:34 +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#4974
No description provided.