Repository navigation
test(npm): prove a clean install-to-use TypeScript journey through an isolated registry (#4627) - #14822
Conversation
… 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
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
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
left a comment
There was a problem hiding this comment.
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.cjswith 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-gateaccepted 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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…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
|
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. |
|
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
|
|
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
|
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 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 Also (5005ab3). The gunzip bound now caps unpacked output at 1 GiB, separately from the 256 MiB file bound. An unoptimized candidate 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. Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
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 cineeds every launcher-pinned optional native in the lock. The journey now requires the full family to be staged, and failsisolated_registry_startedotherwise. 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 precommitexits 0. - Non-blocking follow-ups. Foreign-fetch detection runs only after the first install. There is no negative control that makes
leakedfire. - Not established here. Hosted qualification on this head.
Generated by Claude Code
|
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. |
Requested by Steven Zimmerman · project thread
Summary
packaging/npm/qualification/, a dependency-free Node harness:lib/registry.cjsis an isolated npm registry. It binds 127.0.0.1 on an ephemeral port, is read-only, and has no upstream: it serves only the staged tarballs, answers 404 to everything else and 405 to writes, and refuses any tarball that declares an install-time lifecycle script. It runs as its own child process, so npm's synchronous runs can't block it.lib/journey.cjs+bin/journey.cjsrun the test(npm): prove a clean install-to-use TypeScript journey and invocation continuity #4627 journey against real npm and emit a typedpackage_qualification_receiptthatcargo xtask package-qualification-gate(feat(distribution): add typed package-qualification receipts and an aggregate gate #4630) accepts.crates/ripr/tests/npm_consumer.rs. It runs the Node controls with the candidateriprbinary 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-xizr6vStack 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.ymland 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:
isolated_registry_startedscrubbed_consumer_pathcargo,rustcandrustupcan't be found;riprresolves only to a planted decoyregistry_install_scripts_disablednpm install --ignore-scriptsinto a TypeScript project at a space/Unicode path fetches the launcher and the target native, and no foreign native; the lockfile pins the staged integrityinstalled_payload_identitycontrol_install_omit_optional--omit=optionalcontrol installnpm_exec_package_spec_foreign_cwdnpm exec --package=@effortlessmetrics/ripr@<v> -- ripr --versionfrom a directory with no projectregistry_teardownproject_script_version_offlinenpm run ripr:version, offlinetypescript_check_nonzero_subjectnpm run ripr:check(ripr check --format json) reports a finding on the changedsrc/pricing.tsplus an explain continuationcontinuation_new_process_foreign_cwd_offlinenpm exec --prefixfrom a foreign CWD with no registrypublic_bin_symlink_foreign_cwdnode_modules/.bin/ripr(POSIX)control_missing_optional_package@effortlessmetrics/ripr-<target>@<v>and the exact reinstall advicecontrol_wrong_native_versionreinstall_from_lockfile_offlinenpm ci --offlinerestores identical bytes and leaves the lockfile unchangeduninstall_removes_launcher_and_payloaddecoy_never_executedScope Classification
Production delta:
Evidence/support delta:
Single acceptance criterion:
Non-goals:
Support-tier Impact
Policy Impact
policy/non-rust-allowlist.tomlentries plus the enforced retention reason inxtask/src/main.rspolicy/process_allowlist.d/4627-npm-registry-journey.txt(oneCommand::newin the Rust test).check-network-policypasses; the only listener is the harness's own loopback registry.Proof
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 = truemakes 3 of the 7 controls fail.Local gap:
cargo xtask check-file-policyran its covered commands and the kernel OOM-killed the unrelatedriprlib-test compile in this 15 GB container.cargo xtask precommitresult 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
packaging/npm/qualification/test/journey.test.cjs,crates/ripr/tests/npm_consumer.rspackaging/npm/qualification/lib/{registry,journey}.cjsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
Generated by Claude Code