Skip to content

fix(scripts, install): honor test:fast "without build" promise and orient Node.js engine mismatches - #2026

Merged
morluto merged 2 commits into
morluto:mainfrom
astralyx0129:audit/deep-fix
Oct 12, 2026
Merged

morluto merged 2 commits into
morluto:mainfrom
astralyx0129:audit/deep-fix

Conversation

@astralyx0129

Copy link
Copy Markdown
Contributor

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

…ns without build

Two helpers under scripts/lib/ reached into ../../dist/ at module load even
though the top-level import was only needed by one of their exports. That
turned mocked, dist-free tests into failing tests under `npm run test:fast`,
which docs/testing.md § test scripts explicitly promises runs "without build":

- tests/conformance/providers/hopper/realHopperSemantic.test.ts only calls
  requireCurrentDocument and resolveFixtureProcedure (both mock-only), but
  scripts/lib/real-hopper-semantic.mjs eagerly imported
  requireFunctionDossierOracle from dist/application/RealHopperAssertions.js.
  Moved the dist-dependent dossier oracle into a lazy loader called from
  verifyRealHopperFixture, which is where it is actually used (against the
  real Hopper bridge, after build:cached).

- tests/evaluation/package/packagePlatformDiagnostics.test.ts only uses
  assertLinuxPackageProviderFailure, which depends on `json`, but
  scripts/lib/verify-package-core.mjs eagerly re-exported helpers from
  mcp-verifier-results.mjs, which in turn pulls four dist/ modules. Moved
  that import into verifyCompleteToolCatalog (the only consumer in this
  file). Downstream scripts (verify-recorded-crash.mjs, verify-package-mcp.mjs,
  verify-windows-package.mjs) are unaffected because they already run after
  build:cached.

Reproduction before fix:
  rm -rf dist && npm run test:fast → 2 failed (both import-time errors)

Reproduction after fix:
  rm -rf dist && npm run test:fast → 388 passed, 4924 tests, 0 failed
  npm run build:cached && npm run test:fast → 388 passed, 4924 tests, 0 failed

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T03:41:21.297080Z 716cc96 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1be1b42f6a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread install.sh Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2ce9ae14a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread install.sh Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0b6ab743d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/user-visible-errors.csv Resolved
…e remediation

install.sh previously told operators "use Node.js 22.x (>=22.19), 24.x (>=24.11),
or 26+" without saying how to install one. The curl|bash onboarding path then
left the operator to guess between nvm, fnm, n, Volta, system packages, or
nodejs.org — a lookup that bounces across search engines for a first-time user.

Replace the one-line failure with a block that:
- Names the detected Node.js version (so the operator confirms it is theirs).
- Shows the three most common install paths (nvm, fnm, direct tarball).
- 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
  (e.g. darwin/arm64, linux/x64), so the operator can grab the right archive
  from https://nodejs.org/dist/latest-v24.x/ without a second lookup.

Verified with four Node.js versions (24.18 compatible, 25.9/20.11 outside the
supported ranges, 22.18 below the minor floor) that remediation triggers only
on real mismatches and names the host labels correctly. shellcheck install.sh
and npm run check:fast remain clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: Both fixes work on Linux. With no build, npm run test:fast failed two files before and passes all 388 now, on Node 22 and 24. The new Node version message prints as described.

Results

Base is edf4624 (#2004), the commit this PR branched from. Head is 716cc96. GitHub lists a1b5d51 (#1363) as base, which is one commit later and adds the Go feature. I used the branch point so only this PR's five files differ.

Check Node 22.23.1 Node 24.18.0 Node 26.11.1
test:fast, no dist/, base exit 1, 2 files fail exit 1, 2 files fail not run
test:fast, no dist/, head exit 0, 388 files pass exit 0, 388 files pass not run
test:fast, with dist/, head exit 0, 388 files pass exit 0, 388 files pass not run
installScript test, base 30 pass 30 pass not run
installScript test, head 30 pass 30 pass not run
npm run typecheck, base and head exit 0 exit 0 not run
install.sh --dry-run, real Node, head exit 0 exit 0 exit 0

On base, both failures match the PR text. realHopperSemantic.test.ts cannot find dist/application/RealHopperAssertions.js. packagePlatformDiagnostics.test.ts cannot find dist/contracts/errorSchemas.js, reached through mcp-verifier-results.mjs.

On head, 4,928 tests pass and 3 skip. The PR body says 4,924. I do not know why the counts differ. On my base the two failing files run 0 tests. On head they add 11.

Node version message

I used a fake node that prints a set version. I ran the installer with --dry-run, an empty throwaway home folder and no downloads. Each fake version exits 1 on base and head.

Fake Node Base message Head message
20.0.0 one line, "use Node.js 22.x, 24.x, or 26+" names 20.0.0, lists nvm, fnm and the download link
22.18.0, below the 22.19 floor one line the 20.0.0 block, naming 22.18.0
24.5.0, below the 24.11 floor one line the 20.0.0 block, naming 24.5.0
25.9.0, between the supported lines one line the 20.0.0 block, naming 25.9.0

The 24.5.0 case runs the branch the audit file marks "verified by shell branch inspection" only.

Host labels with a fake uname

Darwin on arm64 prints darwin/arm64. Linux on aarch64 prints linux/arm64. An unknown arch such as riscv64 prints as is. I did not check whether nodejs.org ships a riscv64 tarball.

Codex reviewed this PR three times. All three findings are in the final head: the test fixture, the audit rows, and the old-copy and new-copy columns.

Not run

  • Node 26.11.1 for test:fast, the installScript test and typecheck. Node 26 only ran the dry-run install.
  • shellcheck. It is not installed here, so I did not confirm the PR's "clean" claim.
  • Lint (check:fast) and the other test projects.
  • The verifier scripts that now load dist/ lazily, run for real. That includes a real Hopper run.
  • macOS, Windows, and a real install that downloads.
  • This PR merged onto a1b5d51 or current main.

Thanks, astralyx0129, for the fix. Thanks also for answering each Codex finding with a small amended commit.

Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 22.23.1, 24.18.0, 26.11.1
  • Head: 716cc96
  • Base: edf4624, the branch point. GitHub's recorded base is one commit later.
  • Other: other test agents may have shared the box, so timings are rough. I capped each run at 6 GB of memory. None hit the cap.
Commands
# trees from the read-only mirror, no .git inside
git -C ~/code/rea-mirror/rea.git archive 716cc96ad | tar -x -C $J/head
git -C ~/code/rea-mirror/rea.git archive edf46248f | tar -x -C $J/base

# step 1 (Node 24 first on PATH; for Node 22 use /usr/bin/node's npm)
HUSKY=0 npm ci
rm -rf dist
npm run test:fast
npm run build && npm run test:fast      # head only

# step 2 (job-dir HOME, fake node first on PATH)
env -i HOME=$J/home PATH=$J/shims/20.0.0:/usr/bin:/bin \
  bash install.sh --version 0.3.0 --dry-run --no-setup </dev/null

# step 3
npx vitest run --project boundary tests/boundary/filesystem/installScript.test.ts
npm run typecheck
npm run docs:check                      # head only, Node 24: exit 0

The fake node is a two-line shell script. For node -p process.versions.node it prints the bare version, such as 20.0.0.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@morluto

morluto commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Congratulations on your first PR. Thank you for this. Looks good to merge.

1 similar comment
@morluto

morluto commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Congratulations on your first PR. Thank you for this. Looks good to merge.

@morluto
morluto merged commit 69e097a into morluto:main Oct 12, 2026
28 of 29 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: setup Setup, packaging, upgrade, install, Doctor, and client registration labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants