Skip to content

fix(verifiers): launch npm through Node on Windows - #4153

Merged
N0zoM1z0 merged 2 commits into
mainfrom
fix/windows-package-npm-launch-4125
Oct 15, 2026
Merged

N0zoM1z0 merged 2 commits into
mainfrom
fix/windows-package-npm-launch-4125

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

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 the npm.cmd exposed by standard Windows Node distributions. A real ordinary-user packaged-WASM lane stopped before verification even though npm_execpath named 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

execNpm in verify-package-core.mjs is now the owner of package-verifier npm selection. It uses caller-provided npm_execpath; without one it uses Node's adjacent npm CLI on Windows and retains direct npm execution 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

  • Semantic owner and earliest changed stage: package-verifier process launch in scripts/lib/verify-package-core.mjs.
  • Contribution scope fit and linked maintainer decision: ordinary defect fix within existing package-verifier authority; additional maintainer scope decision is not applicable.
  • CLI and MCP/tool-catalog contract: no product CLI, MCP, schema, or catalog change.
  • Provider, bridge, target-format, or platform compatibility: fixes Windows npm launch; preserves non-Windows fallback and caller-selected npm.
  • Evidence, artifact, provenance, or reconstruction contract: no product Evidence change; verification artifact ownership is preserved.
  • Target selection, authority, upstream behavior, and cleanup details: existing npm operations and their workspaces are unchanged; argument arrays remain shell-free.
  • Generated metadata, package, or installation impact: no metadata change; package verification and installation scripts share the corrected launcher.

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

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_execpath fallback modes passed version and real npm pack operations 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.

  • 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

  • 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.
  • Exact-head GitHub CI — 35/35 jobs passed, including the Windows fallback test and complete verify:package:windows.
  • Codex and Greptile reviews — passed on exact head with zero unresolved threads.
  • npm run test:focused -- tests/boundary/process/releaseArtifactCanary.test.ts — 1/1 passed; installed-tarball rehearsal and catalog-drift rejection.
  • Ordinary-user Windows selected/fallback npm + real pack lane — both modes passed; source preserved, empty stderr, Job0.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: real Windows npm/package boundary; no provider behavior changed.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no shell interpolation; caller-selected executable inputs and execFile options remain explicit. The real lane used native Job ownership and left no matching process.

Author readiness

Human owner: @N0zoM1z0

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T15:02:28.574774Z 2909ca5 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.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue remains.

Summary

Package verifiers now share execNpm, which launches a selected npm JavaScript entry through Node and supplies the adjacent entry on Windows.

  • Package verifiers launch npm through Node when needed.

Reviews (2) · Last reviewed commit: "test(verifiers): cover Windows npm fallb..." · Reviewed by Greptile

@N0zoM1z0
N0zoM1z0 merged commit 6ae59f3 into main Oct 15, 2026
38 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/windows-package-npm-launch-4125 branch October 15, 2026 15:12
@morluto morluto added area: tests Test suite and verification bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Windows package verifiers cannot spawn npm command scripts

2 participants