Repository navigation
fix(verifiers): launch npm through Node on Windows - #4153
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
[Medium impact] The PR appears safe to merge; no blocking issue remains. SummaryPackage verifiers now share
Reviews (2) · Last reviewed commit: "test(verifiers): cover Windows npm fallb..." · Reviewed by Greptile |
This was referenced Oct 15, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Windows package verifiers now launch npm through its JavaScript entry point, so standard Node distributions no longer fail with
spawn npm ENOENT. The shared boundary replaces every raw or duplicated package-verifier npm launcher while preserving caller-selected npm, arguments, environment, cwd, limits, and error details.Fixes #4125.
Problem and expected behavior
execFile("npm", ...)cannot execute thenpm.cmdexposed by standard Windows Node distributions. A real ordinary-user packaged-WASM lane stopped before verification even thoughnpm_execpathnamed a working npm CLI. Package verifiers should resolve npm once at their process boundary and invoke the selected JavaScript entry with Node.Change and scope
execNpminverify-package-core.mjsis now the owner of package-verifier npm selection. It uses caller-providednpm_execpath; without one it uses Node's adjacent npm CLI on Windows and retains directnpmexecution elsewhere. Seven consumers now use it, and the two Windows-specific duplicates are removed. No shell, retry, path scan, cache, or output expansion was introduced.Contract and boundary impact
scripts/lib/verify-package-core.mjs.Expected effects:
Evidence and regression coverage
npm_execpathand launch a controlled npm entry adjacent to a temporarynode.exe; both verify exact arguments and cwd. The fallback test is pinned in the curated Windows lane and its anti-drift check. The existing pack-isolation regression also passes.spawn npm ENOENTfrom the generic pack/install helpers.The real ordinary-user Windows 11 x64 lane used Node 24.18.0/npm 11.16.0, two logical CPUs, BelowNormal priority, and a 1 GiB Job limit. Both caller-selected and no-
npm_execpathfallback modes passed version and realnpm packoperations with fresh caches. Their 227-byte tarballs were byte-identical and contained the expected file with spaces. Job wall was 58.431 s, sampled CPU 8.531 s, peak Job commit 128,131,072 bytes, sampled family working-set peak 183,529,472 bytes, output 740 bytes, stderr empty, and Job0. The tested helper SHA-256 equals the final rebased head's helper SHA-256.Validation performed
npm run check:fast— passed on final head; uncached typecheck/lint, 22.456 s.npm run test:focused -- tests/boundary/process/packageNpmInvocation.test.ts tests/boundary/process/packagePackIsolation.test.ts— selected-entry and pack-isolation cases passed locally; the Windows fallback case skipped by platform.npm run test:focused -- tests/boundary/process/packageNpmInvocation.test.ts tests/process-global/curatedWindowsLane.test.ts— 5 passed, 1 Windows-only skip locally; lane anti-drift coverage passed 4/4.verify:package:windows.npm run test:focused -- tests/boundary/process/releaseArtifactCanary.test.ts— 1/1 passed; installed-tarball rehearsal and catalog-drift rejection.Compatibility, safety, and release
execFileoptions remain explicit. The real lane used native Job ownership and left no matching process.Author readiness
Human owner: @N0zoM1z0
Before merge
type(scope): outcome.