Skip to content

test(npm): prove a clean install-to-use TypeScript journey through an isolated registry (#4627) - #14822

Merged
EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-xizr6v
Nov 16, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-xizr6v

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven Zimmerman · project thread

Summary

  • Adds packaging/npm/qualification/, a dependency-free Node harness:
  • Adds the Rust-owned crates/ripr/tests/npm_consumer.rs. It runs the Node controls with the candidate ripr binary staged as the native payload and requires every control to run, including the live journey.

Source-of-truth Links

Proposal: n/a
Spec: n/a (packaging qualification; no product behavior change)
ADR: n/a
Plan item: #4492 / #4493 npm journey and qualification
Governing issue or accepted claim: #4627
Acceptance delta (one sentence): A clean consumer installs the exact launcher and native npm tarballs from an isolated loopback registry with scripts disabled, analyzes a TypeScript change, follows the continuation offline from a new process and foreign CWD, and missing or mismatched native packages fail with precise recovery, all recorded in a gate-checked receipt.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-xizr6v
Stack parent or prerequisite PR (if any): none. Native npm package production is already on main (#11085, #13809).
Proposed replacement of PR (if any; not yet accepted): none
Follow-up: #4632 wires this journey per target into package-family-qualification.yml and gates each receipt.

Scope

The journey's checks, all through real npm with a private userconfig/globalconfig/cache and child processes under a scrubbed PATH:

check what it proves
isolated_registry_started the staged launcher pins all five natives exactly, and the target's native tarball and riprNative metadata match
scrubbed_consumer_path cargo, rustc and rustup can't be found; ripr resolves only to a planted decoy
registry_install_scripts_disabled npm install --ignore-scripts into a TypeScript project at a space/Unicode path fetches the launcher and the target native, and no foreign native; the lockfile pins the staged integrity
installed_payload_identity the installed launcher's own resolver selects bytes whose SHA-256 equals the executable inside the staged native tarball
control_install_omit_optional the --omit=optional control install
npm_exec_package_spec_foreign_cwd npm exec --package=@effortlessmetrics/ripr@<v> -- ripr --version from a directory with no project
registry_teardown the registry process exits 0 and its port refuses connections
project_script_version_offline npm run ripr:version, offline
typescript_check_nonzero_subject npm run ripr:check (ripr check --format json) reports a finding on the changed src/pricing.ts plus an explain continuation
continuation_new_process_foreign_cwd_offline the continuation runs via npm exec --prefix from a foreign CWD with no registry
public_bin_symlink_foreign_cwd node_modules/.bin/ripr (POSIX)
control_missing_optional_package exit ≠ 0, empty stdout, stderr names @effortlessmetrics/ripr-<target>@<v> and the exact reinstall advice
control_wrong_native_version a tampered native version is refused with the exact requirement
reinstall_from_lockfile_offline npm ci --offline restores identical bytes and leaves the lockfile unchanged
uninstall_removes_launcher_and_payload launcher, payload and bin shim are gone
decoy_never_executed the ambient PATH decoy never ran

Scope Classification

  • Docs/spec/test-only evidence package

Production delta:

  • none (no product, launcher or packaging-producer change)

Evidence/support delta:

  • npm consumer journey harness, its controls, and a Rust-owned test that runs them

Single acceptance criterion:

  • the live journey passes against the candidate binary, and each fail-closed control rejects its bad input

Non-goals:

Support-tier Impact

  • none

Policy Impact

  • file policy: policy/non-rust-allowlist.toml entries plus the enforced retention reason in xtask/src/main.rs
  • process/network: policy/process_allowlist.d/4627-npm-registry-journey.txt (one Command::new in the Rust test). check-network-policy passes; the only listener is the harness's own loopback registry.

Proof

RIPR_PACKAGE_TEST_BINARY=$PWD/target/debug/ripr node --test --test-reporter=tap packaging/npm/qualification/test/journey.test.cjs   # 7/7 pass, 0 skipped
cargo test -p ripr --test npm_consumer          # 1 passed (26s), Linux x64 glibc, Node 22.23.4, npm 10.9.9
node packaging/npm/qualification/bin/journey.cjs --packages <staged> --target x86_64-unknown-linux-gnu --version 0.11.0 --receipt r.json \
  --source-commit <sha> --source-tree <tree> --expected-version-line "ripr 0.11.0 (<sha>)"   # 17/17 checks
cargo xtask package-qualification-gate --receipt r.json   # verdict passed, no failures
cargo fmt --check; cargo xtask check-process-policy; cargo xtask check-network-policy   # pass

Discriminating controls: an impostor native that prints the right version passes install, identity and version but fails the TypeScript check, so the row fails. A missing target native fails at staging. Range pins, wrong riprNative target and runtime dependencies are refused. Mutation check: forcing rowPassed = true makes 3 of the 7 controls fail.

Local gap: cargo xtask check-file-policy ran its covered commands and the kernel OOM-killed the unrelated ripr lib-test compile in this 15 GB container. cargo xtask precommit result goes in the review record; hosted CI is the authority there.

Claim Boundary

After this PR you may claim: the npm install-to-use TypeScript journey and its controls exist, and pass for a locally staged candidate binary on Linux x64.

You may not claim yet: qualification of the release tarballs on all five targets (#4632), Windows or macOS execution, an upgrade between two released versions, or any other package manager.

Rollback

Revert the commit. It only adds the harness, its test, the policy entries and the changelog fragment.

Spec-Test-Code Traceability

  • Tests: packaging/npm/qualification/test/journey.test.cjs, crates/ripr/tests/npm_consumer.rs
  • Code: packaging/npm/qualification/lib/{registry,journey}.cjs

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

  • LEM impact: one more ripr integration test (~26 s locally, plus npm install)
  • Workflows touched: none

Generated by Claude Code

… isolated registry (#4627)

Add a dependency-free Node harness under packaging/npm/qualification/:
a loopback-only, upstream-free, read-only registry that serves only staged
launcher/native tarballs, and a scripts-disabled npm journey on a TypeScript
subject with a scrubbed PATH (no cargo/rustc), a PATH decoy, offline
continuation from a foreign CWD after registry teardown, missing/wrong
optional-package controls, lockfile reinstall and uninstall. It emits a typed
package_qualification_receipt accepted by package-qualification-gate.

The Rust-owned npm_consumer test runs the Node controls with the candidate
binary staged as the native payload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLULVXtgF68BCf5BDrq
@EffortlessSteven EffortlessSteven self-assigned this Nov 15, 2026
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 146 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: e591dd75-f743-44bd-843e-a8f80ecb6f49
Commits

Reviewing files that changed from the base of the PR and between 1ca2136 and 5005ab3.

Files selected for processing: 10

  • changelog.d/4627-npm-install-to-use-journey.md
  • crates/ripr/tests/npm_consumer.rs
  • packaging/npm/qualification/README.md
  • packaging/npm/qualification/bin/journey.cjs
  • packaging/npm/qualification/lib/journey.cjs
  • packaging/npm/qualification/lib/registry.cjs
  • packaging/npm/qualification/test/journey.test.cjs
  • policy/non-rust-allowlist.toml
  • policy/process_allowlist.d/4627-npm-registry-journey.txt
  • xtask/src/main.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

gemini-code-assist[bot]

This comment was marked as resolved.

Require source identity, refuse a non-empty --work, report --keep cleanup as
not_run, kill the registry child on a failed start and exit the bin
explicitly, record and require the npm version, pin the launcher integrity
in the lockfile, add a foreign-target native control, reject duplicate tar
entries and malformed registry paths, block uninstall lifecycle scripts, keep
the registry request log complete, and state the npm/Node/Windows limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLULVXtgF68BCf5BDrq

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SOURCE_REVIEW_READY

Review record for head 1025946 (governing issue #4627).

Independent review: a fresh-context reviewer subagent with no part in the implementation reviewed 69da791 and found 11 should-fix items and several nits, none blocking. All of those plus the five Gemini threads were repaired in 1025946. The same reviewer re-checked that diff item by item and reported no blocker. Bot threads were answered and resolved.

What was inspected: the full diff; the registry protocol and isolation (loopback, no upstream, 405 on writes, 400 on malformed paths, lifecycle-script and duplicate-entry refusal); the journey steps and their oracles against packaging/npm/launcher/lib/launcher.cjs error strings; the receipt shape against xtask/src/package_qualification/{model,parse,gate}.rs; and the Rust-owned crates/ripr/tests/npm_consumer.rs assertions, which require all controls executed and zero skips on supported launcher platforms.

Local proof on this head (Linux x64 glibc, Node 22.23.4, npm 10.9.9):

  • node --test packaging/npm/qualification/test/journey.test.cjs with the candidate binary: 9/9 pass, 0 skipped, including the live 18-step journey.
  • cargo test -p ripr --test npm_consumer: 1 passed.
  • cargo xtask precommit: exit 0 on 69da791; the follow-up commit touches only Node harness files and the README.
  • cargo xtask package-qualification-gate accepted a live receipt with verdict passed.
  • Mutation experiment: forcing the receipt row to pass makes 3 controls go red.

Known limits, recorded in the receipt and README: npm is the only package manager; only the recorded Node and npm versions are exercised; macOS and Windows runs are left to the #4632 rehearsal.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 15, 2026 14:51
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 4 potential issues.

Devin Review

…roups, find distro npm

Address Devin review on #14822: the continuation check now runs the exact
command ripr printed (POSIX and Windows quoting), with a control that an
unusable emitted continuation fails the row; a timed-out step kills its whole
POSIX process group, with a discriminating control; npm-cli.js is also found
through npm on PATH for distribution layouts; test-owned temp directories are
removed when the suite ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLULVXtgF68BCf5BDrq

Copy link
Copy Markdown
Member Author

Coordination for the existing #4627 owner: the current head 1025946 has an independent review record, so Gemini's later quota notice is missing provider evidence, not itself a new source finding or a reason to duplicate review. However, Devin's later review 5911360991 raises findings after that ready record: emitted continuation replaced by a hard-coded command, distro npm discovery, descendant survival after timeout, and retained test artifacts. Please reconcile those findings against this exact head before promotion, preserving an invalid-emitted-command negative, distro-layout controls, and admitted owned-descendant teardown-before-cleanup proof. Distinguish intentional retained receipts from expendable payload cruft. This handoff does not claim an independent replay or override the current review/qualification requirements; no new build or provider retry is requested.

Copy link
Copy Markdown
Member Author

Additional concrete qualification evidence for the existing owner: run 43726666300 admitted head 1025946, but hosted shard 1 job 132850274233 failed the real npm journey. The live Node test reports failing control_foreign_target_native and reinstall_from_lockfile_offline; npm ci --offline reports missing foreign-platform optional packages from the lock file. Node suite was 8/9; nextest then stopped with 1680/7602 tests not run. This is an actual hosted qualification failure, separate from provider quota. Please retain the failing receipts and reconcile hosted npm/lockfile behavior before requesting another qualification; do not mask the controls or treat prior local pass as hosted equivalence.

…lockfile

npm 11 refuses npm ci when the lockfile omits an optional dependency the
launcher pins. The journey now requires the full native family, as a real
registry serves, and the tests stage foreign natives as placeholders that
must never be fetched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLULVXtgF68BCf5BDrq
Node stops only the direct child of a timed-out step on Windows, so its
descendants may outlive cleanup. Until owned teardown exists there, the
journey reports cleanup as failed and the gate refuses the receipt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLULVXtgF68BCf5BDrq
@github-actions

Copy link
Copy Markdown
Contributor

merge-ready is set, but no qualification run exists for head 671f8ae9: it was pushed after the label was applied, or the label event was dropped. 1. Remove and re-apply merge-ready to request admission and qualification only. 2. After qualification is green, enqueue the PR through the native queue route; re-applying the label does not enqueue it.

Unoptimized candidate binaries now exceed 256 MiB unpacked, which made the
gunzip bound refuse a valid native tarball. The file bound stays 256 MiB;
the unpacked bound is 1 GiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLULVXtgF68BCf5BDrq

Copy link
Copy Markdown
Member Author

Reconciled the hosted failure from run 43726666300 (job 132850274233) rather than masking it.

Cause. The hosted runner's npm is 11.x. npm 11's npm ci refuses a lockfile that omits an optional dependency the launcher pins. The journey staged only the current target's native, so the four foreign natives returned 404 and were left out of the lock. That broke control_foreign_target_native and reinstall_from_lockfile_offline. Locally I had npm 10.9.9, which tolerates the gap. I reproduced the exact hosted failure with npm 11.21.2: Missing: @effortlessmetrics/ripr-linux-arm64-gnu@ from lock file.

Fix (e299db2). The journey now requires every native the launcher pins to be staged, because that is what a real registry serves, and it fails isolated_registry_started otherwise. The tests stage the foreign natives as placeholders, and the existing "no foreign native fetched" check still guards them. The release rehearsal already stages the full family from ripr-platform-packages.

Also (5005ab3). The gunzip bound now caps unpacked output at 1 GiB, separately from the 256 MiB file bound. An unoptimized candidate ripr is about 358 MB and was refused.

Evidence on 5005ab3. The full suite with the real binary passed 13/13 with 0 skipped, on both npm 11.21.2 and npm 10.9.9. cargo xtask precommit exited 0. The failing receipts and log from the old head stay in that run's job log. Hosted equivalence is still not established until the new qualification run is green.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SOURCE_REVIEW_READY

Exact head 5005ab3. I inspected the full delta from 671f8ae, plus an independent reviewer pass, which returned no blocking findings.

  • Hosted failure reconciled. npm 11's npm ci needs every launcher-pinned optional native in the lock. The journey now requires the full family to be staged, and fails isolated_registry_started otherwise. The tests stage foreign placeholders, so the "no foreign native fetched" check now discriminates. Before this change it compared against an empty set.
  • Windows timeout boundary. A step timeout on Windows fails cleanup closed, so main exits 1 and the gate refuses the receipt. A control covers it, and mutating the flag fails that control. There is no Windows-native proof yet; owned teardown is tracked under #4632.
  • Unpacked bound. The gunzip output bound is 1 GiB, separate from the 256 MiB file bound, because an unoptimized candidate is about 358 MB.
  • Local proof. The Node suite passes 13/13 with 0 skipped and the real binary, on both npm 11.21.2 and npm 10.9.9. cargo xtask precommit exits 0.
  • Non-blocking follow-ups. Foreign-fetch detection runs only after the first install. There is no negative control that makes leaked fire.
  • Not established here. Hosted qualification on this head.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Qualification follow-through for the existing owner: protected run 43731395029 is now green for the candidate head 5005ab3, including Rust gates, all four Rust test shards, complete/disjoint shard verification and Ripr Rust Small Result. This is hosted qualification evidence, not a merge claim. Please carry this exact reviewed candidate through the normal protected native-queue route, first reconciling any current base/head or eligibility changes. No redundant CI retry, direct merge, guard change or queue-design change is requested. The successor npm 11 lockfile repair now has green hosted qualification in addition to the recorded npm 10/11 local proof. Windows-native owned-descendant teardown remains the explicitly separate #4632 obligation; this Linux qualification does not establish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants