Skip to content

fix(pacquet): always record a tarball integrity in the lockfile - #13549

Merged
zkochan merged 3 commits into
mainfrom
fix-13547
Aug 1, 2026
Merged

zkochan merged 3 commits into
mainfrom
fix-13547

Conversation

@zkochan

@zkochan zkochan commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #13547.

pnpm add <pkg> --lockfile-only against a registry whose versions carry no dist.integrity wrote a lockfile with a bare tarball URL and no hash, and the first pnpm install --frozen-lockfile over it failed with ERR_PNPM_MISSING_TARBALL_INTEGRITY.

Reproducing the issue turned up two independent gaps, both fixed here. Only fixing the reported one would have left pacquet downloading every tarball of such a registry during --lockfile-only and writing sha512 hashes where the TypeScript CLI writes sha1 — a lockfile divergence.

1. dist.shasum was ignored (resolving-npm-resolver). pnpm's getIntegrity falls back to ssri.fromHex(dist.shasum, 'sha1') when dist.integrity is absent; that fallback is what pins every version published before subresource integrity, including all of https://node-registry.bit.cloud/. pacquet parsed dist.shasum into PackageDistribution and then dropped it. The new dist_integrity mirrors getIntegrity, including the ERR_PNPM_INVALID_TARBALL_INTEGRITY failure for a shasum that is not a hex digest. pnpr already assumed this fallback exists — its packument trimmer deliberately keeps shasum when integrity is missing "so pnpm's sha1 fallback still has a hash (pre-2017 publishes)".

This is also the more secure of the two behaviours: a registry-published hash pins the bytes, whereas hashing whatever the network returned pins nothing.

2. --lockfile-only skipped populate_missing_integrity (package-manager). The reported bug: the whole PrefetchingResolver was skipped under lockfileOnly (and under a filtered workspace selection), and that wrapper owns the only path that hashes a tarball no registry hash covers. The two jobs are now separated — the wrapper always sits in the resolver chain, and the new prefetch_downloads flag turns off only the speculative background download. So --lockfile-only still fetches nothing speculatively, but does fetch the few tarballs whose hash the lockfile cannot be written without. This is what pnpm does: packageRequester fetches when resolutionNeedsFetch is true even with skipFetch / dryRun set.

Verification

The issue's reproduction, before and after, against the real registry:

# before
'@teambit/[email protected]':
  resolution: {tarball: https://node-registry.bit.cloud/@teambit/design.ui.icon-button/-/design.ui.icon-button-1.0.16.tgz}
# after
'@teambit/[email protected]':
  resolution: {integrity: sha1-4guwxtPII430l1WuK5krEgo4PUY=}

The lockfile pacquet writes for that graph is now byte-identical to the one [email protected] writes (diff of the two pnpm-lock.yaml files is empty), and pnpm install --frozen-lockfile over it succeeds.

Parity

TypeScript side needs no change — it already has both behaviours (getIntegrity, and the resolutionNeedsFetch fetch under dryRun from #12491). This PR brings pacquet up to them.

Squash Commit Body

A registry version that carried no `dist.integrity` was recorded in the
lockfile with a bare tarball URL and no hash, and `--lockfile-only` never
computed one — so the very first `pnpm install --frozen-lockfile` over
that lockfile failed with `ERR_PNPM_MISSING_TARBALL_INTEGRITY`. Two
independent gaps produced it, and both are closed here.

First, `dist.shasum` was ignored. pnpm's `getIntegrity` promotes the
legacy hex digest to a `sha1-` SRI string when `dist.integrity` is
absent, which is what pins every version published before subresource
integrity — the whole of `https://node-registry.bit.cloud/`, for one.
pacquet parsed the field and dropped it, leaving those versions unpinned
and diverging from the lockfile the TypeScript CLI writes for the same
graph. `dist_integrity` now mirrors `getIntegrity`, including the
`ERR_PNPM_INVALID_TARBALL_INTEGRITY` failure for a shasum that is not a
hex digest. It also restores the stronger of the two behaviours: a
registry-published hash pins the bytes, where hashing whatever arrived
pins nothing.

Second, `--lockfile-only` skipped the `PrefetchingResolver` wholesale,
and that wrapper owns `populate_missing_integrity` — the only path that
hashes a tarball no registry hash covers. Background prefetching and
integrity completion are now separate concerns: the wrapper always sits
in the resolver chain, and `prefetch_downloads` turns off only the
speculative download. A run that materializes nothing (`--lockfile-only`)
or only part of the graph (a filtered workspace selection) still fetches
the few tarballs whose hash the lockfile cannot be written without, which
is what pnpm does with `resolutionNeedsFetch` under `dryRun`.

Closes pnpm/pnpm#13547

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
    (Rust-only: the TypeScript CLI already has both behaviours — see Parity above.)
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Tests added: computes_the_integrity_of_an_unpinned_tarball (CLI, end to end over a hand-built packument that pins nothing — verified to fail without the fix), shasum_only_metadata_resolves_to_a_sha1_integrity + unparsable_shasum_fails_the_resolve (npm resolver), and populates_integrity_with_prefetching_off / skips_the_background_download_with_prefetching_off / claims_the_background_download_with_prefetching_on (prefetching resolver). Full Rust suite green (7531 tests).


Written by an agent (Claude Code, claude-opus-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Lockfile-only installs now record tarball integrity for registry dependencies.
    • Legacy SHA-1 checksums are converted to standard integrity values.
    • Tarballs without integrity metadata are hashed automatically when needed.
  • Bug Fixes
    • Invalid checksum metadata now produces a clear, sanitized resolution error.
    • Lockfile-only resolution avoids creating node_modules while still supporting later frozen installs.
  • Tests
    • Added coverage for integrity generation, checksum conversion, invalid metadata, and download behavior.

A registry version that carried no `dist.integrity` was recorded in the
lockfile with a bare tarball URL and no hash, and `--lockfile-only` never
computed one — so the very first `pnpm install --frozen-lockfile` over
that lockfile failed with `ERR_PNPM_MISSING_TARBALL_INTEGRITY`. Two
independent gaps produced it, and both are closed here.

First, `dist.shasum` was ignored. pnpm's `getIntegrity` promotes the
legacy hex digest to a `sha1-` SRI string when `dist.integrity` is
absent, which is what pins every version published before subresource
integrity — the whole of `https://node-registry.bit.cloud/`, for one.
pacquet parsed the field and dropped it, leaving those versions unpinned
and diverging from the lockfile the TypeScript CLI writes for the same
graph. `dist_integrity` now mirrors `getIntegrity`, including the
`ERR_PNPM_INVALID_TARBALL_INTEGRITY` failure for a shasum that is not a
hex digest. It also restores the stronger of the two behaviours: a
registry-published hash pins the bytes, where hashing whatever arrived
pins nothing.

Second, `--lockfile-only` skipped the `PrefetchingResolver` wholesale,
and that wrapper owns `populate_missing_integrity` — the only path that
hashes a tarball no registry hash covers. Background prefetching and
integrity completion are now separate concerns: the wrapper always sits
in the resolver chain, and `prefetch_downloads` turns off only the
speculative download. A run that materializes nothing (`--lockfile-only`)
or only part of the graph (a filtered workspace selection) still fetches
the few tarballs whose hash the lockfile cannot be written without, which
is what pnpm does with `resolutionNeedsFetch` under `dryRun`.

Closes #13547

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 1, 2026 09:48
@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d0304e90-2782-45c7-8fe7-0f65b9a8ea10

📥 Commits

Reviewing files that changed from the base of the PR and between 897d251 and dff8954.

📒 Files selected for processing (7)
  • pnpm/crates/cli/tests/lockfile_only.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/prefetching_resolver.rs
  • pnpm/crates/package-manager/src/prefetching_resolver/tests.rs
  • pnpm/crates/resolving-npm-resolver/src/errors.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver/tests.rs
🚧 Files skipped from review as they are similar to previous changes (7)
  • pnpm/crates/cli/tests/lockfile_only.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver/tests.rs
  • pnpm/crates/resolving-npm-resolver/src/errors.rs
  • pnpm/crates/package-manager/src/prefetching_resolver/tests.rs
  • pnpm/crates/package-manager/src/prefetching_resolver.rs

📝 Walkthrough

Walkthrough

Registry resolution now derives tarball integrity from SRI or legacy SHA-1 metadata. Lockfile-only installs fetch tarballs only when required to compute missing integrity. Background prefetching remains configurable, and resolver and CLI tests cover the new behavior.

Changes

Registry integrity and lockfile-only resolution

Layer / File(s) Summary
Registry integrity derivation
pnpm/crates/resolving-npm-resolver/...
Resolution preserves SRI, converts valid shasum values to sha1- integrity, and returns sanitized InvalidTarballIntegrityError diagnostics for invalid values.
Integrity completion and prefetch control
pnpm/crates/package-manager/src/...
Install modes control background downloads through prefetch_downloads, while integrity completion can still fetch required tarballs.
Resolver and CLI validation
pnpm/crates/package-manager/src/prefetching_resolver/tests.rs, pnpm/crates/cli/tests/lockfile_only.rs, .changeset/...
Tests cover integrity completion, prefetch decisions, lockfile persistence, and a subsequent frozen installation. The changeset documents the behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#11966: Modifies tarball integrity handling for lockfiles.
  • pnpm/pnpm#13059: Modifies related lockfile resolution and PrefetchingResolver flows.
  • pnpm/pnpm#13349: Modifies related PrefetchingResolver tarball download handling.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13547

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix --lockfile-only by always recording tarball integrity in lockfile

🐞 Bug fix 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Promote registry dist.shasum to sha1- integrity when dist.integrity is absent
• Ensure --lockfile-only still computes integrity for unpinned tarballs without prefetching
• Add regression tests covering pinned, shasum-only, and fully unpinned registry metadata
Diagram

graph TD
  A(("pacquet install --lockfile-only")) --> B["InstallWithFreshLockfile"] --> C["PrefetchingResolver"] --> D["NpmResolver"] --> E{"dist has integrity?"}
  E -->|"yes"| F["Use dist.integrity"] --> G[("pnpm-lock.yaml")]
  E -->|"no; shasum hex"| H["Promote to sha1 SRI"] --> G
  E -->|"no integrity/shasum"| I["Download tarball"] --> J["Compute sha512 SRI"] --> G
  I --> K[("Store / cache")]
  subgraph Legend
    direction LR
    _start(("Entry")) ~~~ _proc["Process"] ~~~ _dec{"Decision"} ~~~ _db[("Artifact")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Compute missing integrity during lockfile serialization
  • ➕ Keeps resolution side-effect-free (no tarball downloads inside resolver wrappers)
  • ➕ Centralizes lockfile validity rules near the writer
  • ➖ Harder to plumb tarball fetching/hash computation into the lockfile builder cleanly
  • ➖ Would duplicate logic already living in PrefetchingResolver
  • ➖ Still needs caching/deduping to avoid repeated downloads across edges
2. Always prefetch tarballs even in --lockfile-only
  • ➕ Simpler control flow (no feature flag)
  • ➕ Maximizes cache warmth for subsequent installs
  • ➖ Violates expected behavior: --lockfile-only should not fill the store for the whole graph
  • ➖ Potentially large network and disk usage for big dependency graphs

Recommendation: Keep the PR’s approach: always run PrefetchingResolver to guarantee integrity completion, but gate background prefetching behind prefetch_downloads. This cleanly separates a correctness requirement (lockfile must be installable/frozen) from an optimization (speculative downloads), and matches pnpm’s behavior of fetching only when resolution requires fetch-derived data.

Files changed (10) +351 / -37

Enhancement (2) +22 / -2
prefetching_resolver.rsSplit correctness (integrity completion) from optimization (prefetch) +21/-1

Split correctness (integrity completion) from optimization (prefetch)

• Documents PrefetchingResolver’s dual responsibilities and introduces 'PrefetchContext::prefetch_downloads' plus an owned copy in the resolver context. Gates background tarball downloads on this flag, while still always running 'populate_missing_integrity' to ensure lockfile validity.

pnpm/crates/package-manager/src/prefetching_resolver.rs

lib.rsExport InvalidTarballIntegrityError from crate public API +1/-1

Export InvalidTarballIntegrityError from crate public API

• Re-exports the new integrity error alongside existing resolver errors so callers/tests can match on the concrete type.

pnpm/crates/resolving-npm-resolver/src/lib.rs

Bug fix (3) +73 / -34
install_with_fresh_lockfile.rsAlways include PrefetchingResolver; disable only background prefetch +34/-31

Always include PrefetchingResolver; disable only background prefetch

• Removes the conditional that previously skipped PrefetchingResolver entirely for '--lockfile-only' and filtered installs. Always wraps the resolver chain so integrity completion can run, while passing a new 'prefetch_downloads' flag to disable speculative downloads for lockfile-only/filtered cases.

pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs

errors.rsAdd InvalidTarballIntegrityError for non-hex shasum metadata +12/-0

Add InvalidTarballIntegrityError for non-hex shasum metadata

• Defines a new diagnostic error surfaced when 'dist.integrity' is absent and 'dist.shasum' cannot be parsed as a hex digest, matching pnpm’s behavior of failing on invalid integrity metadata.

pnpm/crates/resolving-npm-resolver/src/errors.rs

npm_resolver.rsDerive lockfile integrity from dist.integrity or legacy dist.shasum +27/-3

Derive lockfile integrity from dist.integrity or legacy dist.shasum

• Changes tarball resolution construction to compute integrity via a new 'dist_integrity()' helper. The helper prefers 'dist.integrity', otherwise promotes 'dist.shasum' to a 'sha1-' SRI string, returns None when truly unpinned, and errors when shasum is not hex.

pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs

Tests (3) +250 / -0
lockfile_only.rsAdd integration regression test for unpinned tarballs under --lockfile-only +77/-0

Add integration regression test for unpinned tarballs under --lockfile-only

• Adds a new CLI test that serves a packument with only a tarball URL (no 'integrity'/'shasum'), runs 'install --lockfile-only', and asserts the lockfile records a computed 'sha512-' integrity without creating 'node_modules'. Verifies that a subsequent 'install --frozen-lockfile' succeeds using the produced lockfile.

pnpm/crates/cli/tests/lockfile_only.rs

tests.rsAdd unit tests for prefetch flag and integrity completion +101/-0

Add unit tests for prefetch flag and integrity completion

• Refactors test helper construction to allow toggling prefetching. Adds coverage ensuring (1) integrity is computed even when prefetching is off, (2) pinned resolutions do not download when prefetching is off, and (3) prefetching-on claims background downloads.

pnpm/crates/package-manager/src/prefetching_resolver/tests.rs

tests.rsAdd tests for shasum-only metadata and invalid shasum failure +72/-0

Add tests for shasum-only metadata and invalid shasum failure

• Adds packument fixtures representing registries that only publish 'dist.shasum'. Verifies shasum is promoted to the expected 'sha1-' integrity and that non-hex shasum values fail resolution with InvalidTarballIntegrityError.

pnpm/crates/resolving-npm-resolver/src/npm_resolver/tests.rs

Documentation (1) +5 / -0
lockfile-only-records-tarball-integrity.mdAdd changeset documenting lockfile-only integrity fix +5/-0

Add changeset documenting lockfile-only integrity fix

• Introduces a patch changeset explaining the bug and the two-part fix: promoting 'dist.shasum' to 'sha1-' integrity and computing integrity for fully unpinned tarballs even under '--lockfile-only'.

.changeset/lockfile-only-records-tarball-integrity.md

Other (1) +1 / -1
Cargo.tomlPromote ssri to main dependencies for resolver integrity handling +1/-1

Promote ssri to main dependencies for resolver integrity handling

• Moves 'ssri' from dev-dependencies into regular dependencies so production code can derive integrity from legacy 'dist.shasum'.

pnpm/crates/resolving-npm-resolver/Cargo.toml

@greptile-apps

greptile-apps Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (3): Last reviewed commit: "style(pacquet): trim the comments added ..." | Re-trigger Greptile

@qodo-code-review

qodo-code-review Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (2) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Unsanitized integrity error output ✓ Resolved 🐞 Bug ⛨ Security
Description
InvalidTarballIntegrityError formats dist.tarball and dist.shasum verbatim into a user-facing
diagnostic; both values come from untrusted registry metadata and can include inline credentials or
control characters, leaking secrets into CI logs/terminals or enabling output injection. This
bypasses the repo’s existing redact_and_sanitize() pattern used for other URL-bearing resolver
errors.
Code

pnpm/crates/resolving-npm-resolver/src/errors.rs[R170-180]

+/// Raised when a registry version carries no `dist.integrity` and its
+/// `dist.shasum` is not a hex digest, so no SRI string can be derived
+/// from it.
+#[derive(Debug, Display, Error, Diagnostic)]
+#[display(r#"Tarball "{tarball}" has invalid shasum specified in its metadata: {shasum}"#)]
+#[diagnostic(code(ERR_PNPM_INVALID_TARBALL_INTEGRITY))]
+pub struct InvalidTarballIntegrityError {
+    #[error(not(source))]
+    pub tarball: String,
+    pub shasum: String,
+}
Relevance

●●● Strong

Team previously accepted redaction/sanitization for URL-bearing resolver diagnostics to prevent
credential/control-char leaks (PR pnpm/pnpm#13371).

PR-#13371

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new error’s Display string interpolates tarball and shasum without redaction/sanitization,
and the error is constructed from dist.tarball/dist.shasum values read from registry metadata.
This conflicts with the repo’s established contract for URL-bearing diagnostics, where
redact_and_sanitize() is used to strip control characters and inline credentials before printing.

pnpm/crates/resolving-npm-resolver/src/errors.rs[14-19]
pnpm/crates/resolving-npm-resolver/src/errors.rs[170-180]
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[865-886]
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[477-491]
pnpm/crates/network/src/auth.rs[784-800]
PR-#13371

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`InvalidTarballIntegrityError` currently renders registry-controlled `tarball` and `shasum` directly in its `Display`/`Diagnostic` output. This can leak inline `user:pass@` credentials and/or inject control characters into terminals/CI logs.

## Issue Context
The repo already has a dedicated helper `pacquet_network::redact_and_sanitize()` that strips control characters and redacts inline URL credentials, and other resolver errors use it when printing URLs.

## Fix Focus Areas
- Apply `redact_and_sanitize()` (or equivalent) to the tarball URL before it is stored/printed.
- Sanitize the displayed `shasum` (at minimum strip control characters; optionally truncate to a safe length).
- Add a regression test that constructs a packument with a tarball URL like `https://user:pass@host/pkg\u{7}\r\n` and asserts rendered diagnostics do not contain credentials/control chars.

### Code locations
- pnpm/crates/resolving-npm-resolver/src/errors.rs[170-180]
- pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[865-886]
- pnpm/crates/network/src/auth.rs[784-800]
- pnpm/crates/resolving-npm-resolver/src/npm_resolver/tests.rs[1544-1613]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. lockfile_only test uses mockito 📘 Rule violation ▣ Testability
Description
New registry-interacting tests start mocked registries via mockito::Server::new() /
mockito::Server::new_async() instead of using the standard pacquet-testing-utils mocked registry
helper, violating the required test infrastructure pattern and reducing consistency across registry
tests.
Code

pnpm/crates/cli/tests/lockfile_only.rs[R381-404]

+    let CommandTempCwd { root, workspace, .. } = CommandTempCwd::init();
+    let mut registry = mockito::Server::new();
+    let tarball_path = "/unpinned/-/unpinned-1.0.0.tgz";
+    let packument = serde_json::json!({
+        "name": "unpinned",
+        "dist-tags": { "latest": "1.0.0" },
+        "modified": "2020-01-15T12:00:00.000Z",
+        "time": { "1.0.0": "2020-01-10T08:30:00.000Z" },
+        "versions": {
+            "1.0.0": {
+                "name": "unpinned",
+                "version": "1.0.0",
+                "dist": { "tarball": format!("{}{tarball_path}", registry.url()) },
+            },
+        },
+    });
+    let packument_mock =
+        registry.mock("GET", "/unpinned").with_body(packument.to_string()).create();
+    let tarball_mock = registry
+        .mock("GET", tarball_path)
+        .with_body(minimal_tarball("unpinned", "1.0.0"))
+        .expect_at_least(1)
+        .create();
+    write_registry_workspace(&workspace, &registry.url());
Relevance

● Weak

Prior requests to replace direct mockito::Server usage with pacquet-testing-utils were rejected (PRs
#13250, pnpm/pnpm#13427).

PR-#13250
PR-#13427

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The compliance rule requires tests that interact with the registry to start and manage mocked
registries using pacquet-testing-utils, but the cited test additions instantiate a mock server
directly with mockito::Server::new() (CLI test) and mockito::Server::new_async() (prefetching
resolver test), demonstrating a deviation from the mandated helper-based lifecycle and behavior.

Rule 2254915: Use pacquet-testing-utils to start mocked registry in tests
pnpm/crates/cli/tests/lockfile_only.rs[381-404]
pnpm/crates/package-manager/src/prefetching_resolver/tests.rs[330-345]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Registry-interacting tests are creating mock registries directly with `mockito::Server` (`new`/`new_async`) instead of using the project-standard registry mock helpers from `pacquet-testing-utils`, which violates the required testing pattern.

## Issue Context
The compliance rule mandates that any tests interacting with the registry must use `pacquet-testing-utils` to ensure consistent mock registry lifecycle management and consistent behavior across the test suite.

## Fix Focus Areas
- pnpm/crates/cli/tests/lockfile_only.rs[381-404]
- pnpm/crates/package-manager/src/prefetching_resolver/tests.rs[330-345]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. pnpm missing in changeset 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and omits the required pnpm entry, which
breaks the repo’s changeset requirements for pnpm versioning metadata.
Code

.changeset/lockfile-only-records-tarball-integrity.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

● Weak

Similar “add pnpm entry to changeset” suggestions repeatedly rejected in PRs pnpm/pnpm#13491 and pnpm/pnpm#13459.

PR-#13491
PR-#13459

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance requires each changeset to explicitly include a pnpm package bump entry; the added
changeset front-matter includes only pacquet.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/lockfile-only-records-tarball-integrity.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset front-matter is missing a `pnpm` entry, which is required by the changeset compliance rule.

## Issue Context
This PR adds `.changeset/lockfile-only-records-tarball-integrity.md` but only lists `"pacquet": patch`.

## Fix Focus Areas
- .changeset/lockfile-only-records-tarball-integrity.md[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Copilot AI 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.

Pull request overview

Fixes pacquet lockfile parity and correctness when registry metadata lacks dist.integrity, ensuring --lockfile-only still produces an installable lockfile (matching pnpm TypeScript behavior).

Changes:

  • Add dist.shasum → sha1-... SRI fallback in the npm resolver (and error on unparsable shasum).
  • Keep PrefetchingResolver in the resolver chain even for --lockfile-only, while gating only the background prefetch via a new prefetch_downloads flag (integrity completion remains on).
  • Add targeted tests covering shasum-only metadata, unparsable shasum erroring, and integrity population with prefetching disabled.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm/crates/resolving-npm-resolver/src/npm_resolver/tests.rs Adds resolver tests for shasum-only metadata and invalid shasum failure mode.
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs Uses derived integrity for tarball resolutions; adds dist_integrity fallback logic.
pnpm/crates/resolving-npm-resolver/src/lib.rs Re-exports the new InvalidTarballIntegrityError.
pnpm/crates/resolving-npm-resolver/src/errors.rs Introduces InvalidTarballIntegrityError with a dedicated diagnostic code.
pnpm/crates/resolving-npm-resolver/Cargo.toml Promotes ssri to a normal dependency (now used in non-test code).
pnpm/crates/package-manager/src/prefetching_resolver/tests.rs Adds tests ensuring integrity completion occurs even when background prefetching is disabled.
pnpm/crates/package-manager/src/prefetching_resolver.rs Splits “integrity completion” from “background prefetch” via prefetch_downloads.
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs Always wraps resolver with PrefetchingResolver, disabling only background prefetch for lockfile-only/filtered runs.
pnpm/crates/cli/tests/lockfile_only.rs Adds an e2e test verifying --lockfile-only computes integrity for an unpinned tarball and supports frozen install.
.changeset/lockfile-only-records-tarball-integrity.md Adds a patch changeset documenting the fix for pacquet users.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
.changeset/lockfile-only-records-tarball-integrity.md (1)

5-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the changeset concise and user-facing.

Describe the lockfile behavior that users observe. Remove internal resolver details, the registry example, and the historical error explanation.

State that pacquet now records usable tarball integrity for registry packages that omit SRI metadata, including with --lockfile-only.

Based on learnings, changesets should describe user-visible behavior rather than internal resolver behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/lockfile-only-records-tarball-integrity.md at line 5, Rewrite the
changeset text to be concise and user-facing: state that pacquet records usable
tarball integrity for registry packages without SRI metadata, including when
using --lockfile-only. Remove resolver implementation details, the registry
example, and the historical error explanation.

Sources: Path instructions, Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.changeset/lockfile-only-records-tarball-integrity.md:
- Line 5: Rewrite the changeset text to be concise and user-facing: state that
pacquet records usable tarball integrity for registry packages without SRI
metadata, including when using --lockfile-only. Remove resolver implementation
details, the registry example, and the historical error explanation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b9e201ff-22e7-4854-947d-50a0cb5265a3

📥 Commits

Reviewing files that changed from the base of the PR and between a99b852 and 0e10db4.

📒 Files selected for processing (10)
  • .changeset/lockfile-only-records-tarball-integrity.md
  • pnpm/crates/cli/tests/lockfile_only.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/prefetching_resolver.rs
  • pnpm/crates/package-manager/src/prefetching_resolver/tests.rs
  • pnpm/crates/resolving-npm-resolver/Cargo.toml
  • pnpm/crates/resolving-npm-resolver/src/errors.rs
  • pnpm/crates/resolving-npm-resolver/src/lib.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver/tests.rs

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.0±0.24ms    31.3 MB/sec    1.13     13.5±1.58ms    27.7 MB/sec
packument/parse                                  1.00     38.6±0.29µs  1719.2 MB/sec    1.06     40.9±1.02µs  1623.3 MB/sec
tarball/download_dependency                      1.01      2.8±0.28ms  1525.1 KB/sec    1.00      2.8±0.29ms  1547.3 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   227.6±16.79ms 70.3 KElem/sec    1.05   239.8±21.63ms 66.7 KElem/sec

…rror

`InvalidTarballIntegrityError` quotes `dist.tarball` and `dist.shasum`
straight from a packument into a message that reaches the terminal, CI
logs, and reporters. A registry configured with inline `user:pass@host`
basic-auth would have leaked the credentials, and a metadata string
carrying control characters could rewrite the surrounding output. Both
fields now go through `redact_and_sanitize` at construction, the same
contract `FetchMetadataError` documents for its URL-bearing variants.

Also trims the changeset to the user-visible behaviour, per review.
Copilot AI review requested due to automatic review settings August 1, 2026 09:55
@zkochan

zkochan commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

Review round 1 addressed in 897d251.

Fixed — unsanitized integrity error output (Qodo, Copilot): real issue. InvalidTarballIntegrityError::new now runs both dist.tarball and dist.shasum through pacquet_network::redact_and_sanitize, so inline user:pass@host credentials and control characters cannot reach the terminal / CI logs / reporters. Covered by invalid_shasum_error_redacts_registry_metadata.

Fixed — changeset wording (CodeRabbit): trimmed to the user-visible behaviour.

Not changing — "pnpm" missing in the changeset (Qodo, rule 713436): this is a Rust-only change. AGENTS.md is explicit that pnpm in a changeset means the TypeScript CLI package and that a Rust-only changeset must omit it, targeting pacquet. Qodo itself rates the finding weak and notes the same suggestion was rejected on #13491 and #13459.

Not changing — mockito instead of pacquet-testing-utils (Qodo, rule 2254915): the scenario under test is a packument that carries neither dist.integrity nor dist.shasum. The shared pnpr fixture registry serves neither shape, so a hand-built packument is the only way to reach the code path — the same reason stage.rs documents for its own mockito use ("faults a well-behaved registry cannot produce"). Every test that can use the shared registry in this file still does.


Written by an agent (Claude Code, claude-opus-5).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 897d251

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Copilot AI 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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

pnpm/crates/resolving-npm-resolver/src/errors.rs:180

  • The Display message for InvalidTarballIntegrityError includes an extra trailing " after {shasum}, which will show up in user-facing output (and may break tests/assertions expecting the exact pnpm error text).
#[derive(Debug, Display, Error, Diagnostic)]
#[display(r#"Tarball "{tarball}" has invalid shasum specified in its metadata: {shasum}"#)]
#[diagnostic(code(ERR_PNPM_INVALID_TARBALL_INTEGRITY))]

Several of them restated the code, re-narrated a call site from the
callee's doc, or spelled out what a test's name and asserts already say.
The remaining prose is the contract of each new item plus the one design
note that has no other home: the module doc for the resolver wrapper now
states once that the prefetch is speculative while the integrity hashing
is not, and the call site just reads `prefetch_downloads`.
Copilot AI review requested due to automatic review settings August 1, 2026 10:02
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit dff8954

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Copilot AI 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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.92%. Comparing base (c2b7cfb) to head (dff8954).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   pnpm/pnpm#13549   +/-   ##
=======================================
  Coverage   87.92%   87.92%           
=======================================
  Files         550      550           
  Lines       96449    96464   +15     
=======================================
+ Hits        84800    84816   +16     
+ Misses      11649    11648    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: dff89548de85

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.596 ± 0.145 2.430 2.923 1.66 ± 0.17
pacquet@main 2.688 ± 0.153 2.522 2.977 1.72 ± 0.17
pnpr@HEAD 1.569 ± 0.123 1.404 1.727 1.00 ± 0.12
pnpr@main 1.563 ± 0.131 1.409 1.736 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5955342728399997,
      "stddev": 0.1451443442362219,
      "median": 2.5835138838400002,
      "user": 2.0829429800000003,
      "system": 1.6081102399999998,
      "min": 2.42964563434,
      "max": 2.92275676034,
      "times": [
        2.92275676034,
        2.68063230834,
        2.62711786634,
        2.53990990134,
        2.66745466634,
        2.48285859834,
        2.51043734834,
        2.63064750234,
        2.46388214234,
        2.42964563434
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6883529052399995,
      "stddev": 0.15341377823481067,
      "median": 2.63373618484,
      "user": 2.4955742799999996,
      "system": 1.86552984,
      "min": 2.52207685534,
      "max": 2.97691832734,
      "times": [
        2.57799996434,
        2.66979444434,
        2.56840436734,
        2.5976779253399997,
        2.55784418134,
        2.52207685534,
        2.78120852034,
        2.97691832734,
        2.87757282534,
        2.75403164134
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.56883555014,
      "stddev": 0.12293445029871546,
      "median": 1.62225073884,
      "user": 1.42381878,
      "system": 1.4215394399999999,
      "min": 1.40371053634,
      "max": 1.72707064134,
      "times": [
        1.40371053634,
        1.45891698334,
        1.61819876134,
        1.6263027163400001,
        1.42884881634,
        1.68324052634,
        1.6781658133400001,
        1.43569268334,
        1.72707064134,
        1.62820802334
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.56330853404,
      "stddev": 0.13075993246966658,
      "median": 1.5271548693399999,
      "user": 1.47328268,
      "system": 1.4086082400000002,
      "min": 1.40923518734,
      "max": 1.7361360483400001,
      "times": [
        1.7361360483400001,
        1.52923550834,
        1.50916705134,
        1.72683094934,
        1.40923518734,
        1.42811157634,
        1.52507423034,
        1.68005760834,
        1.67761217734,
        1.41162500334
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 334.3 ± 24.8 299.6 370.1 1.03 ± 0.09
pacquet@main 324.2 ± 11.8 305.3 344.6 1.00
pnpr@HEAD 349.5 ± 20.3 319.3 380.9 1.08 ± 0.07
pnpr@main 363.4 ± 16.3 340.8 392.8 1.12 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3343167037600001,
      "stddev": 0.02482913726198659,
      "median": 0.33597510665999997,
      "user": 0.30025667999999994,
      "system": 0.6610986000000001,
      "min": 0.29963956016,
      "max": 0.37007329316000004,
      "times": [
        0.35044522516000004,
        0.33927007016,
        0.34057238616,
        0.37007329316000004,
        0.36947862216,
        0.30625592916,
        0.29963956016,
        0.32583494216000003,
        0.33268014316,
        0.30891686616
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.32420645666,
      "stddev": 0.011780137540385921,
      "median": 0.32446487916,
      "user": 0.27136718,
      "system": 0.6716565000000001,
      "min": 0.30530260016,
      "max": 0.34463694216,
      "times": [
        0.32838176616000003,
        0.30530260016,
        0.32869727016,
        0.32117747916,
        0.34463694216,
        0.32775227916,
        0.31765125916000003,
        0.33788403616,
        0.31169884316,
        0.31888209116
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.34951219346,
      "stddev": 0.020279977897983126,
      "median": 0.34937474716000005,
      "user": 0.30831837999999995,
      "system": 0.6715429,
      "min": 0.31927398916,
      "max": 0.38091741516,
      "times": [
        0.33210009816,
        0.35538702516000004,
        0.32887413516,
        0.35107455316,
        0.33993525516,
        0.37718542616,
        0.31927398916,
        0.36269909616,
        0.34767494116000003,
        0.38091741516
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.36344062146,
      "stddev": 0.016270344633056225,
      "median": 0.36024975116,
      "user": 0.30547158,
      "system": 0.7096954999999999,
      "min": 0.34079073916,
      "max": 0.39282524116,
      "times": [
        0.36254483416,
        0.34079073916,
        0.34544755116000003,
        0.39282524116,
        0.37601633216,
        0.37097719716,
        0.35763170916000003,
        0.35101754516,
        0.35795466816,
        0.37920039716000004
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.003 ± 0.079 2.898 3.171 1.79 ± 0.19
pacquet@main 2.955 ± 0.084 2.810 3.064 1.76 ± 0.19
pnpr@HEAD 1.755 ± 0.166 1.573 1.979 1.04 ± 0.14
pnpr@main 1.681 ± 0.171 1.480 1.947 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.0032763173,
      "stddev": 0.07924761266550157,
      "median": 2.9790605732,
      "user": 2.75327284,
      "system": 2.1232406799999994,
      "min": 2.8975175187,
      "max": 3.1709099577,
      "times": [
        2.8975175187,
        2.9783419387000003,
        2.9768634187000003,
        3.1709099577,
        2.9635366367000002,
        2.9266176997,
        2.9797792077,
        3.0082476177,
        3.0740322727000002,
        3.0569169047
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.9549645372,
      "stddev": 0.08441871683304827,
      "median": 2.9623540962,
      "user": 2.62437074,
      "system": 2.0343757800000004,
      "min": 2.8100710417,
      "max": 3.0636360667,
      "times": [
        2.9885445187,
        2.9135742917000003,
        3.0217524977,
        3.0636360667,
        2.9361636737,
        3.0242351297,
        3.0245696997000002,
        2.9273475867000003,
        2.8397508657,
        2.8100710417
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.754737733,
      "stddev": 0.16621018520832984,
      "median": 1.6862256097000001,
      "user": 1.43950694,
      "system": 1.5032292799999998,
      "min": 1.5725255397,
      "max": 1.9786363257000001,
      "times": [
        1.6283766217000002,
        1.9786363257000001,
        1.5725255397,
        1.9781197517,
        1.5979574927,
        1.9538190617,
        1.6943293427000001,
        1.8439527317,
        1.6781218767000001,
        1.6215385857000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6805824813,
      "stddev": 0.17053247733037077,
      "median": 1.6232239182000001,
      "user": 1.43720234,
      "system": 1.5467333799999996,
      "min": 1.4802445147,
      "max": 1.9474689157,
      "times": [
        1.7394402477000002,
        1.8894883177000001,
        1.6409354557000002,
        1.5383259227,
        1.9474689157,
        1.5920762417,
        1.6055123807,
        1.5018808587,
        1.8704519577,
        1.4802445147
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 498.2 ± 33.4 474.7 588.3 1.41 ± 0.10
pacquet@main 563.7 ± 95.4 483.8 776.6 1.59 ± 0.27
pnpr@HEAD 354.3 ± 10.7 339.2 372.9 1.00
pnpr@main 371.2 ± 29.8 337.2 415.7 1.05 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.49823053451999993,
      "stddev": 0.03341789283342362,
      "median": 0.49269013742,
      "user": 0.6974239799999999,
      "system": 0.79732974,
      "min": 0.47467087492000004,
      "max": 0.58834096792,
      "times": [
        0.49382431592000003,
        0.58834096792,
        0.47759588092000005,
        0.48093552992000005,
        0.47467087492000004,
        0.49302336592,
        0.49490435392000004,
        0.50930712692,
        0.47734601992000003,
        0.49235690892000006
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5637463798199999,
      "stddev": 0.09538648643094326,
      "median": 0.51720133942,
      "user": 0.78380378,
      "system": 0.88402414,
      "min": 0.48379021292,
      "max": 0.7765868259200001,
      "times": [
        0.67116795492,
        0.7765868259200001,
        0.60646201292,
        0.5057333269200001,
        0.5647778599200001,
        0.50705972792,
        0.48379021292,
        0.49070722792000004,
        0.52734295092,
        0.50383569792
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.35429772602000004,
      "stddev": 0.010688042737309727,
      "median": 0.35198873442,
      "user": 0.25998708,
      "system": 0.60994594,
      "min": 0.33922675692000004,
      "max": 0.37287618792000005,
      "times": [
        0.35982030492,
        0.33922675692000004,
        0.34788881192000004,
        0.34942933792,
        0.37287618792000005,
        0.36687874692,
        0.35379408092000003,
        0.36062518992000003,
        0.35018338792000003,
        0.34225445492
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.37124733342000005,
      "stddev": 0.029830164337046775,
      "median": 0.36142081942000004,
      "user": 0.26944717999999995,
      "system": 0.66348484,
      "min": 0.33717779192,
      "max": 0.41569802592000005,
      "times": [
        0.34378548292,
        0.33932939892,
        0.33717779192,
        0.36405686092,
        0.35555745292,
        0.40132423892,
        0.41569802592000005,
        0.40997505292,
        0.35878477792,
        0.38678425092
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.868 ± 0.029 1.829 1.927 4.75 ± 0.61
pacquet@main 1.849 ± 0.014 1.825 1.865 4.70 ± 0.60
pnpr@HEAD 0.394 ± 0.050 0.338 0.497 1.00
pnpr@main 0.402 ± 0.029 0.336 0.429 1.02 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.86792533548,
      "stddev": 0.029090214874760573,
      "median": 1.86283639528,
      "user": 0.9910724799999999,
      "system": 0.9289696999999999,
      "min": 1.82862745328,
      "max": 1.92704603328,
      "times": [
        1.92704603328,
        1.85755820328,
        1.82862745328,
        1.90885656128,
        1.86026689928,
        1.8446740152799999,
        1.86540589128,
        1.8544772112799999,
        1.86691502728,
        1.8654260592799998
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8488404778799996,
      "stddev": 0.014449030351400173,
      "median": 1.85312905328,
      "user": 0.9806894799999999,
      "system": 0.9039976,
      "min": 1.82458072328,
      "max": 1.8648924142799999,
      "times": [
        1.85803059328,
        1.8505246892799998,
        1.8478912322799999,
        1.86231792728,
        1.86008287228,
        1.82807774728,
        1.85573341728,
        1.83627316228,
        1.82458072328,
        1.8648924142799999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3935698016800001,
      "stddev": 0.04995200783594351,
      "median": 0.37472120978,
      "user": 0.28691737999999994,
      "system": 0.6864545999999999,
      "min": 0.33771834028000003,
      "max": 0.49686991928000007,
      "times": [
        0.35639577128000005,
        0.37220939328,
        0.36457937428000003,
        0.37723302628000005,
        0.33771834028000003,
        0.35825599828000004,
        0.39089145428000005,
        0.4430760542800001,
        0.43846868528000005,
        0.49686991928000007
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.40249937408,
      "stddev": 0.028745476294234556,
      "median": 0.41280368028000003,
      "user": 0.2939479799999999,
      "system": 0.6790212999999999,
      "min": 0.33566300428000007,
      "max": 0.42877434328,
      "times": [
        0.37736500528000005,
        0.42372948028000007,
        0.40804194528000004,
        0.4175654152800001,
        0.42236033828,
        0.39222387628000005,
        0.39665046528000003,
        0.42261986728000006,
        0.42877434328,
        0.33566300428000007
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 276.5 ± 29.6 247.7 330.0 2.94 ± 0.32
pacquet@main 229.4 ± 19.5 209.1 263.4 2.44 ± 0.22
pnpr@HEAD 93.9 ± 2.3 89.1 99.6 1.00
pnpr@main 97.9 ± 4.4 90.9 112.3 1.04 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.27648932496727274,
      "stddev": 0.02957134434074048,
      "median": 0.26422437924000003,
      "user": 0.26759191454545456,
      "system": 0.09064676727272726,
      "min": 0.24769134224,
      "max": 0.32995935424000006,
      "times": [
        0.25998667924,
        0.32605911824000006,
        0.32995935424000006,
        0.30358337324,
        0.26422437924000003,
        0.25851291024,
        0.24769134224,
        0.27256022024000004,
        0.25480318324,
        0.25166763024000005,
        0.27233438424000006
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.22935115687636365,
      "stddev": 0.019463166890127104,
      "median": 0.22194583224,
      "user": 0.22540246,
      "system": 0.07222122181818182,
      "min": 0.20911936324,
      "max": 0.26340274024000004,
      "times": [
        0.26340274024000004,
        0.25018635724000005,
        0.23093232724,
        0.22194583224,
        0.21806493224,
        0.21610788124,
        0.26019509124,
        0.21319316524,
        0.22388354424,
        0.21583149124,
        0.20911936324
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09390876207333336,
      "stddev": 0.002345956358601712,
      "median": 0.09376442574000002,
      "user": 0.023912226666666665,
      "system": 0.012021771999999997,
      "min": 0.08907481224000001,
      "max": 0.09963723024000001,
      "times": [
        0.09360633824,
        0.09375289424000001,
        0.09335349124,
        0.09048213624000001,
        0.09187687524,
        0.09963723024000001,
        0.09464616924000001,
        0.09467886124000001,
        0.09315336324000001,
        0.09131026824,
        0.09175088824000001,
        0.09186037524000001,
        0.09127216624000001,
        0.09277265524,
        0.09526476524000001,
        0.09875753224000001,
        0.09460476124,
        0.09199306524,
        0.09384996724000001,
        0.09377595724000001,
        0.08907481224000001,
        0.09319379024,
        0.09536547524000001,
        0.09257056424000001,
        0.09485869024,
        0.09431743824000001,
        0.09713605424,
        0.09705439924,
        0.09532452824000001,
        0.09596734924000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.09791305007870968,
      "stddev": 0.0043783087951818275,
      "median": 0.09663580024000001,
      "user": 0.027533911612903226,
      "system": 0.011858749677419352,
      "min": 0.09088800224,
      "max": 0.11230995924,
      "times": [
        0.09124206924,
        0.10181270424000001,
        0.11230995924,
        0.09708172124,
        0.09088800224,
        0.09568569824,
        0.09554064524000001,
        0.09483937324000001,
        0.10341092824,
        0.09605899424000001,
        0.09295291524,
        0.09529714624,
        0.10309044324000001,
        0.09826117524000001,
        0.10077778124,
        0.09379702724000001,
        0.10416775524,
        0.09821408724000001,
        0.09467160624000001,
        0.10157273024,
        0.10253052724,
        0.09652266724000001,
        0.09652430024000001,
        0.09517470624,
        0.09727127924000001,
        0.09830148224,
        0.10136749324000001,
        0.09663580024000001,
        0.09630486624000001,
        0.09797221124000001,
        0.09502645624
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.632 ± 0.135 4.518 4.974 1.28 ± 0.05
pacquet@main 4.693 ± 0.133 4.567 4.950 1.29 ± 0.05
pnpr@HEAD 3.626 ± 0.109 3.513 3.793 1.00
pnpr@main 3.711 ± 0.107 3.583 3.907 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.6321721611,
      "stddev": 0.13482712570447666,
      "median": 4.5874190588,
      "user": 2.3215566,
      "system": 1.70848686,
      "min": 4.518193638800001,
      "max": 4.9738533588000005,
      "times": [
        4.7339672428,
        4.5993720708,
        4.564989248800001,
        4.5754660468,
        4.9738533588000005,
        4.6530896658000005,
        4.5611975078,
        4.5417110188,
        4.518193638800001,
        4.5998818118
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.6929535926,
      "stddev": 0.13285801420531576,
      "median": 4.628072897300001,
      "user": 2.2984201,
      "system": 1.7032346600000001,
      "min": 4.5666352828,
      "max": 4.9501258708,
      "times": [
        4.5733482328,
        4.8293526878,
        4.5849548318,
        4.625220507800001,
        4.8169515898,
        4.7384951508,
        4.9501258708,
        4.5666352828,
        4.6135264848,
        4.6309252868
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.6255816517,
      "stddev": 0.10869299015683057,
      "median": 3.6102876418,
      "user": 1.6464675999999998,
      "system": 1.52057436,
      "min": 3.5129935208,
      "max": 3.7928323118,
      "times": [
        3.5707898368,
        3.7928323118,
        3.5173385637999997,
        3.5129935208,
        3.5168758737999997,
        3.5289207397999998,
        3.7268385368,
        3.6948563898,
        3.7445852968,
        3.6497854467999997
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.7106762011999996,
      "stddev": 0.1073711130912091,
      "median": 3.6818912328,
      "user": 1.8390697,
      "system": 1.74493936,
      "min": 3.5830500867999997,
      "max": 3.9065729898,
      "times": [
        3.6090508428,
        3.9065729898,
        3.5830500867999997,
        3.7022503847999997,
        3.6615320808,
        3.7170830078,
        3.6514255908,
        3.6464260808,
        3.7556788788,
        3.8736920688
      ]
    }
  ]
}

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

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pacquet: --lockfile-only skips integrity calculation for registry tarballs

3 participants