Skip to content

fix(lockfile-verification): reject integrity-less tarballs at the gate - #13408

Merged
zkochan merged 2 commits into
mainfrom
fix-13364
Jul 27, 2026
Merged

zkochan merged 2 commits into
mainfrom
fix-13364

Conversation

@zkochan

@zkochan zkochan commented Jul 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #13364.

pacquet's npm resolution verifier implemented three of its four violation codes. A lockfile entry whose tarball resolution records no integrity passed the verification gate — right after it printed ✓ Lockfile passes supply-chain policies for that same lockfile — and was refused later by the fetch path's tarball_url_and_integrity backstop, one entry per install.

This adds the missing MISSING_TARBALL_INTEGRITY rule to NpmResolutionVerifier, so the refusal now comes from the gate, batched, before anything is downloaded — the same layer the TypeScript CLI raises it from (createNpmResolutionVerifier):

Error: ERR_PNPM_MISSING_TARBALL_INTEGRITY

  × installing dependencies
  ╰─▶ 1 lockfile entries failed verification:
        pkg-from-tarball@http://127.0.0.1:38713/pkg-from-tarball-1.0.0.tgz has
      no "integrity" field, so its downloaded tarball cannot be verified
  help: The lockfile contains entries that the active policies reject. …

The fetch-path refusal stays as the backstop for entries that reach a fetch without having passed the gate, exactly as pnpm keeps assertFetchableResolution.

Two shapes that could have bought the exemption are closed along the way:

  • integrity: '' parses into an SRI with zero hashes. It pins nothing, and ssri's Integrity::check panics on hashes[0] for it, so a hand-edited lockfile could turn an unverified fetch into a TaskJoin error instead of a clean refusal. The new LockfileResolution::checkable_integrity reports it as absent, in the verifier and in the fetch-path backstop, matching pnpm's getExpectedIntegrity (typeof integrity === 'string' && integrity.length > 0).
  • The git-host archive exemption is now decided from the tarball URL alone (is_git_hosted_tarball_url) instead of the lockfile's own gitHosted marker, so an edited entry can't claim it for an arbitrary URL. This is what isRegistryTarballResolution and pacquet's own unverified_fetch_is_allowed already do.

integrityRequired: true joins the policy snapshot (alongside tarballUrlBinding), so a verification-cache record written before this rule existed fails can_trust_past_check and forces a re-verification instead of stat-fast-pathing around the new check. The TypeScript verifier already records the same flag.

Known remaining divergence (follow-up, not fixed here)

For a URL-keyed entry the two stacks label the offending entry differently:

  • pnpm: [email protected] — nameVerFromPkgSnapshot prefers the snapshot's version and carries the URL separately as nonSemverVersion.
  • pacquet: pkg-from-tarball@http://…/pkg-from-tarball-1.0.0.tgz — collect_candidates takes the version from the dep-path suffix.

Closing that gap means giving VerifyCtx a non_semver_version field (the verifier currently infers "skip the registry policies" from the version not parsing as semver), which also unlocks pnpm's TARBALL_URL_MISMATCH-for-a-non-semver-version rule. That is candidate-identity parity rather than a missing violation code, so it is left out of this PR — happy to fold it in if you'd rather have it here.

Two adjacent notes while in this code:

  • A single-code batch of TARBALL_URL_MISMATCH still surfaces as ERR_PNPM_LOCKFILE_RESOLUTION_VERIFICATION in pacquet, where pnpm throws ERR_PNPM_TARBALL_URL_MISMATCH (buildVerificationError uses the violation's own code). Untouched here; say the word and I'll add the variant.
  • A resolution: {} (both integrity and tarball deleted) is rejected by pacquet at lockfile-parse time — no LockfileResolution variant matches — rather than as a MISSING_TARBALL_INTEGRITY violation. Both refuse the install; only the message differs.

Squash Commit Body

The npm resolution verifier implemented three of its four violation
codes: a lockfile entry whose tarball resolution records no `integrity`
sailed through the verification gate — which had just printed its green
check for that same lockfile — and was only refused later, one entry at
a time, by the fetch path's `tarball_url_and_integrity` backstop.

Add the missing `MISSING_TARBALL_INTEGRITY` rule so the gate reports
every offending entry in one batched `ERR_PNPM_MISSING_TARBALL_INTEGRITY`
error before anything is downloaded, matching
`createNpmResolutionVerifier` in the TypeScript CLI. The check needs no
network, so it runs before the registry-metadata shortcuts and applies to
URL-keyed entries too, whose non-semver version otherwise skips the
registry policies. `integrityRequired` joins the policy snapshot so a
cache record written before the rule existed can't stat-fast-path around
it.

Two shapes that could have bought the exemption are closed along the
way. `integrity: ''` parses into an SRI with zero hashes, which pins
nothing and makes `Integrity::check` panic on `hashes[0]`; the new
`LockfileResolution::checkable_integrity` reports it as absent, both here
and in the fetch-path backstop, matching pnpm's `getExpectedIntegrity`.
And the git-host archive exemption is now read from the tarball URL alone
rather than the lockfile's own `gitHosted` marker, so an edited entry
can't claim it for an arbitrary URL — the same rule
`isRegistryTarballResolution` and `unverified_fetch_is_allowed` apply.

The fetch-path refusal stays as the backstop for entries that reach a
fetch without having passed the gate, as pnpm keeps
`assertFetchableResolution` for the same reason.

Closes pnpm/pnpm#13364

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • 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.
  • Updated the documentation if needed.

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

  • Bug Fixes
    • Lockfile verification now fails fast for remote tarball and registry entries that have missing or empty integrity, before any downloads.
    • All invalid lockfile entries are aggregated into a single ERR_PNPM_MISSING_TARBALL_INTEGRITY error with a remediation command.
    • Git-hosted archive exemptions are decided from the archive URL (not lockfile metadata).
    • Cached verification results are invalidated when integrity requirements change.
  • Tests
    • Added regression coverage for integrity: '' and missing-integrity handling across tarball/registry cases, including git-hosted URL scenarios.

The npm resolution verifier implemented three of its four violation
codes: a lockfile entry whose tarball resolution records no `integrity`
sailed through the verification gate — which had just printed its green
check for that same lockfile — and was only refused later, one entry at
a time, by the fetch path's `tarball_url_and_integrity` backstop.

Add the missing `MISSING_TARBALL_INTEGRITY` rule so the gate reports
every offending entry in one batched `ERR_PNPM_MISSING_TARBALL_INTEGRITY`
error before anything is downloaded, matching
`createNpmResolutionVerifier` in the TypeScript CLI. The check needs no
network, so it runs before the registry-metadata shortcuts and applies to
URL-keyed entries too, whose non-semver version otherwise skips the
registry policies. `integrityRequired` joins the policy snapshot so a
cache record written before the rule existed can't stat-fast-path around
it.

Two shapes that could have bought the exemption are closed along the
way. `integrity: ''` parses into an SRI with zero hashes, which pins
nothing and makes `Integrity::check` panic on `hashes[0]`; the new
`LockfileResolution::checkable_integrity` reports it as absent, both here
and in the fetch-path backstop, matching pnpm's `getExpectedIntegrity`.
And the git-host archive exemption is now read from the tarball URL alone
rather than the lockfile's own `gitHosted` marker, so an edited entry
can't claim it for an arbitrary URL — the same rule
`isRegistryTarballResolution` and `unverified_fetch_is_allowed` apply.

The fetch-path refusal stays as the backstop for entries that reach a
fetch without having passed the gate, as pnpm keeps
`assertFetchableResolution` for the same reason.

Closes #13364
Copilot AI review requested due to automatic review settings July 26, 2026 22:51

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 26, 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: 2e7c6939-8016-49e8-959f-c4d06cd17a19

📥 Commits

Reviewing files that changed from the base of the PR and between b1b668d and c992c4d.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/tarball_url_dependency.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/crates/cli/tests/tarball_url_dependency.rs

📝 Walkthrough

Walkthrough

The PR rejects missing or empty tarball integrity during lockfile verification, derives git-host exemptions from URLs, preserves fetch-path validation, adds aggregated diagnostics, and expands test coverage.

Changes

Tarball integrity enforcement

Layer / File(s) Summary
Integrity contract and fetch backstop
pnpm/crates/lockfile/src/resolution.rs, pnpm/crates/package-manager/src/install_package_by_snapshot.rs, pnpm/crates/.../tests.rs
Empty integrity values are treated as non-checkable, and tarball and registry fetch paths reject them.
Verifier rule and policy cache
pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs, pnpm/crates/resolving-npm-resolver/src/violation_codes.rs, pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier/tests.rs
The verifier rejects missing integrity before metadata checks, derives git-host exemptions from URLs, and records integrityRequired in policy snapshots.
Diagnostic surface and CLI validation
pnpm/crates/lockfile-verification/src/errors.rs, pnpm/crates/lockfile-verification/src/errors/tests.rs, pnpm/crates/cli/tests/tarball_url_dependency.rs, .changeset/*
Verifier violations map to ERR_PNPM_MISSING_TARBALL_INTEGRITY, with aggregated output and remediation assertions.

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

Assessment against linked issues

Objective Addressed Explanation
Add the missing MISSING_TARBALL_INTEGRITY verifier rule and emit it before network-dependent checks [#13364] ✅
Preserve exemptions for file tarballs and pinned git-host archive URLs while rejecting misleading gitHosted claims [#13364] ✅
Aggregate the verifier failure into the existing ERR_PNPM_MISSING_TARBALL_INTEGRITY diagnostic [#13364] ✅

Sequence Diagram(s)

sequenceDiagram
  participant LockfileResolution
  participant NpmResolutionVerifier
  participant LockfileVerification
  participant VerifyError
  LockfileResolution->>NpmResolutionVerifier: checkable_integrity()
  NpmResolutionVerifier-->>NpmResolutionVerifier: reject missing or empty integrity
  NpmResolutionVerifier->>LockfileVerification: emit MISSING_TARBALL_INTEGRITY
  LockfileVerification->>VerifyError: aggregate offending entries
Loading

Possibly related PRs

  • pnpm/pnpm#13091: Updates the missing-integrity diagnostic used by the fetch path.
  • pnpm/pnpm#13349: Modifies missing-integrity handling across lockfile verification and tarball fetching.

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-13364

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

Reject tarball resolutions without integrity during lockfile verification

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Fail lockfile verification for tarball entries missing a usable SRI integrity.
• Treat integrity: '' as missing and harden git-host tarball exemptions via URL detection.
• Extend policy snapshot caching and add regression tests across verifier and fetch backstop.
Diagram

graph TD
  A["Lockfile entries"] --> B["NpmResolutionVerifier gate"] --> C["Batched verify errors"]
  A --> F["Installer run"] --> G["tarball_url_and_integrity backstop"] --> C
  B --> D[("Verification cache policy")]
  B --> E["Registry metadata lookup"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Enforce integrity at lockfile parse/deserialize time
  • ➕ Fails even earlier than the verifier gate, before any verification workflow is constructed
  • ➕ Centralizes invariant: ‘tarball resolutions must be verifiable’
  • ➖ Risk of breaking older/hand-edited lockfiles more abruptly (less contextual error)
  • ➖ Harder to preserve git-host exemptions without pulling more policy/URL logic into lockfile crate
2. Rely solely on fetch-path refusal
  • ➕ Smallest change surface; no verifier/cache changes needed
  • ➖ Late failure (after ‘lockfile passes’), one-entry-at-a-time behavior
  • ➖ More wasted work; potential network/disk activity before failure
3. Auto-repair missing integrity by refetching and rewriting lockfile
  • ➕ More user-friendly; can heal lockfiles instead of hard failing
  • ➖ Requires network access and mutates lockfile as a side effect
  • ➖ Complicates ‘frozen’/reproducible installs and policy semantics

Recommendation: Keep the current approach: enforce the missing-integrity rule in the lockfile-verification gate (batched, pre-download, policy-aligned with pnpm), while retaining the fetch-path check as a defensive backstop. Alternatives either move policy-heavy logic into parsing layers, defer failure too late, or introduce lockfile mutation and network coupling.

Files changed (11) +311 / -32

Bug fix (5) +76 / -22
errors.rsIntroduce MissingTarballIntegrity VerifyError variant and mapping +13/-0

Introduce MissingTarballIntegrity VerifyError variant and mapping

• Adds a dedicated VerifyError variant for ERR_PNPM_MISSING_TARBALL_INTEGRITY and wires it into rendered-violation-code mapping. Extends the local list of pacquet violation code constants to include MISSING_TARBALL_INTEGRITY.

pnpm/crates/lockfile-verification/src/errors.rs

resolution.rsAdd LockfileResolution::checkable_integrity helper +9/-0

Add LockfileResolution::checkable_integrity helper

• Introduces checkable_integrity() to treat empty SRI (zero hashes) as effectively missing, avoiding unverifiable downloads and potential panics in integrity checking. Keeps raw integrity access unchanged while providing a safer gate/backstop predicate.

pnpm/crates/lockfile/src/resolution.rs

install_package_by_snapshot.rsHarden fetch backstop to reject empty SRI and enforce registry integrity +12/-7

Harden fetch backstop to reject empty SRI and enforce registry integrity

• Switches the tarball-path integrity check to use checkable_integrity(), treating empty SRI as missing. Also ensures registry resolutions without a checkable integrity are refused, keeping the fetch backstop consistent and defensive.

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

create_npm_resolution_verifier.rsAdd missing-integrity rule to NpmResolutionVerifier and cache policy snapshot +41/-15

Add missing-integrity rule to NpmResolutionVerifier and cache policy snapshot

• Implements an unconditional, network-free check that rejects any resolution lacking a checkable integrity, including URL-keyed dependencies. Tightens the git-host exemption to be URL-derived (is_git_hosted_tarball_url) rather than trusting the lockfile flag, and records 'integrityRequired: true' in the policy snapshot so old cache records are invalidated.

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

violation_codes.rsAdd MISSING_TARBALL_INTEGRITY violation code constant +1/-0

Add MISSING_TARBALL_INTEGRITY violation code constant

• Defines the MISSING_TARBALL_INTEGRITY_VIOLATION_CODE used by the resolver verifier and mapped by lockfile-verification error handling.

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

Tests (5) +230 / -10
tarball_url_dependency.rsUpdate CLI test expectations for gate-level missing integrity error +14/-4

Update CLI test expectations for gate-level missing integrity error

• Adjusts the test commentary to reflect that refusal comes from the verification gate (batched) rather than the per-fetch backstop. Tightens stderr assertions to match the new error wording and guidance text.

pnpm/crates/cli/tests/tarball_url_dependency.rs

tests.rsTest that missing-integrity violation selects the right error variant +11/-0

Test that missing-integrity violation selects the right error variant

• Adds a unit test ensuring VerifyError::from_rendered selects the new MissingTarballIntegrity variant for the corresponding violation code.

pnpm/crates/lockfile-verification/src/errors/tests.rs

tests.rsTest empty integrity string is not checkable +16/-0

Test empty integrity string is not checkable

• Adds a regression test demonstrating that 'integrity: ''' parses but yields no usable hashes, so checkable_integrity() returns None while integrity() is still Some.

pnpm/crates/lockfile/src/resolution/tests.rs

tests.rsAdd tests refusing empty integrity for tarball and registry resolutions +35/-0

Add tests refusing empty integrity for tarball and registry resolutions

• Adds coverage that an empty SRI integrity is refused equivalently to a missing integrity, for both tarball and registry resolution shapes.

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

tests.rsExtend verifier tests for missing/empty integrity, URL-keyed deps, and git-host rules +154/-6

Extend verifier tests for missing/empty integrity, URL-keyed deps, and git-host rules

• Adds multiple async tests verifying: missing integrity is rejected before metadata lookups, empty integrity counts as missing (tarball + registry), URL-keyed entries are still checked, and git-host exemptions are URL-based and not forgeable via the lockfile flag. Updates policy snapshot and can_trust_past_check tests to require integrityRequired.

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

Documentation (1) +5 / -0
verifier-rejects-integrity-less-tarballs.mdAdd changeset for missing-tarball-integrity gate behavior +5/-0

Add changeset for missing-tarball-integrity gate behavior

• Documents that integrity-less tarball entries are now rejected during lockfile verification with a batched ERR_PNPM_MISSING_TARBALL_INTEGRITY error. Notes that empty integrity strings are treated as missing and git-host exemptions are URL-based.

.changeset/verifier-rejects-integrity-less-tarballs.md

@greptile-apps

greptile-apps Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "test(cli): pin the missing-integrity ref..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     10.5±0.18ms    35.7 MB/sec    1.00     10.5±0.18ms    35.6 MB/sec
packument/parse                1.00     36.5±0.52µs  1816.9 MB/sec    1.04     37.8±1.47µs  1754.7 MB/sec
tarball/download_dependency    1.00      2.7±0.10ms  1583.2 KB/sec    1.00      2.7±0.09ms  1586.2 KB/sec

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@pnpm/crates/cli/tests/tarball_url_dependency.rs`:
- Around line 292-299: Update the tarball URL dependency test around the
baseline and frozen install commands to reset or separately track mock requests
after the baseline, then assert the frozen install makes no tarball request
before validating the existing verification-gate error details. Ensure the
regression coverage proves rejection occurs at the verification gate before any
download.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bac25140-257f-4892-871c-d4d91d78f416

📥 Commits

Reviewing files that changed from the base of the PR and between 5ed47dc and b1b668d.

📒 Files selected for processing (11)
  • .changeset/verifier-rejects-integrity-less-tarballs.md
  • pnpm/crates/cli/tests/tarball_url_dependency.rs
  • pnpm/crates/lockfile-verification/src/errors.rs
  • pnpm/crates/lockfile-verification/src/errors/tests.rs
  • pnpm/crates/lockfile/src/resolution.rs
  • pnpm/crates/lockfile/src/resolution/tests.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot/tests.rs
  • pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs
  • pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier/tests.rs
  • pnpm/crates/resolving-npm-resolver/src/violation_codes.rs

@qodo-code-review

qodo-code-review Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Remediation recommended

1. Mocks outlive server drop 🐞 Bug ☼ Reliability ⭐ New
Description
In frozen_install_refuses_a_remote_tarball_without_integrity, tarball_server is explicitly
dropped while head_mock/get_mock remain alive, so their destructors will run after the server is
gone. This cleanup order is inconsistent with the earlier teardown pattern in the same file and can
make test teardown dependent on mockito’s drop/unmount behavior.
Code

pnpm/crates/cli/tests/tarball_url_dependency.rs[R316-319]

+    head_mock.assert();
+    get_mock.assert();

-    drop((root, mock_instance, head_mock, get_mock, tarball_server));
+    drop((root, mock_instance, tarball_server));
Relevance

⭐⭐⭐ High

Test teardown order issues are low-risk; repo often enforces explicit drop/teardown patterns around
mockito servers.

PR-#13132
PR-#13176

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code drops tarball_server while the mocks are still live, whereas earlier in the same file
teardown drops mocks together with the server (mocks first), showing the inconsistency introduced by
this change.

pnpm/crates/cli/tests/tarball_url_dependency.rs[285-320]
pnpm/crates/cli/tests/tarball_url_dependency.rs[216-218]

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 test explicitly drops `tarball_server` while `head_mock` and `get_mock` are still in scope. This means the mocks will be dropped later (end of scope) after the server is already dropped, which is an inconsistent teardown order and can make cleanup depend on mockito’s internal drop/unmount behavior.

### Issue Context
Elsewhere in the same file, teardown drops mocks before the server, indicating the intended lifecycle ordering.

### Fix Focus Areas
- pnpm/crates/cli/tests/tarball_url_dependency.rs[316-320]

### Suggested fix
After `head_mock.assert(); get_mock.assert();`, explicitly `drop((head_mock, get_mock));` and then drop the server (and other resources), or restore the prior tuple drop ordering so mocks are dropped before `tarball_server`.

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


2. Historical phrasing in comments 📘 Rule violation ⚙ Maintainability
Description
New/modified comments describe behavior in terms of what happened “before this rule existed” / what
pnpm “never recorded”, which is disallowed historical framing. These comments should be rewritten to
describe the current invariant/contract without referencing past implementations.
Code

pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[R282-287]

            return false;
        }

+        // The missing-integrity check is also unconditional; a cached run
+        // without the flag cannot prove it rejected unverifiable tarballs.
+        if cached_policy.get("integrityRequired").and_then(JsonValue::as_bool) != Some(true) {
Relevance

⭐⭐⭐ High

Team often accepts rewrites removing “before/predates/used to” historical framing in comments to
state current contract.

PR-#13386
PR-#13072
PR-#13125

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids comments that reference prior behavior (e.g., "written before this
rule existed", "never recorded"). The cited added comments use that historical framing instead of
stating the current contract.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[278-287]
pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier/tests.rs[479-481]

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

## Issue description
Some newly added/modified comments use historical/temporal phrasing (e.g., "written before this rule existed", "pnpm never recorded") instead of describing the current behavior/contract.

## Issue Context
Repository guidance requires comments to document current behavior and invariants; historical notes belong in PR/commit messages or design docs.

## Fix Focus Areas
- pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[278-287]
- pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier/tests.rs[479-481]

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


3. Changeset omits pnpm entry 📘 Rule violation § Compliance
Description
The new changeset file lists only pacquet and does not include a pnpm bump entry, which violates
the requirement to explicitly declare the pnpm package in changesets. This can cause the pnpm
release tooling to miss or misclassify the required version bump.
Code

.changeset/verifier-rejects-integrity-less-tarballs.md[R1-3]

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

⭐⭐ Medium

Mixed precedent: some PRs added required pnpm changeset entry; many others left it out despite bot
warning.

PR-#13403
PR-#13337
PR-#13404

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each changeset to explicitly declare the pnpm package and a valid
bump type. The added changeset front-matter contains only "pacquet": patch and no pnpm entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/verifier-rejects-integrity-less-tarballs.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 does not include a `pnpm` entry, which is required by the repository compliance rules.

## Issue Context
This PR introduces a user-visible lockfile verification behavior change/error surfaced as `ERR_PNPM_MISSING_TARBALL_INTEGRITY`, so the changeset should explicitly declare the `pnpm` package bump type (patch/minor/major as appropriate).

## Fix Focus Areas
- .changeset/verifier-rejects-integrity-less-tarballs.md[1-3]

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


Grey Divider

Previous review results

Review updated until commit c992c4d ⚖️ Balanced

Results up to commit b1b668d ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Historical phrasing in comments 📘 Rule violation ⚙ Maintainability
Description
New/modified comments describe behavior in terms of what happened “before this rule existed” / what
pnpm “never recorded”, which is disallowed historical framing. These comments should be rewritten to
describe the current invariant/contract without referencing past implementations.
Code

pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[R282-287]

            return false;
        }

+        // The missing-integrity check is also unconditional; a cached run
+        // without the flag cannot prove it rejected unverifiable tarballs.
+        if cached_policy.get("integrityRequired").and_then(JsonValue::as_bool) != Some(true) {
Relevance

⭐⭐⭐ High

Team often accepts rewrites removing “before/predates/used to” historical framing in comments to
state current contract.

PR-#13386
PR-#13072
PR-#13125

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids comments that reference prior behavior (e.g., "written before this
rule existed", "never recorded"). The cited added comments use that historical framing instead of
stating the current contract.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[278-287]
pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier/tests.rs[479-481]

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

## Issue description
Some newly added/modified comments use historical/temporal phrasing (e.g., "written before this rule existed", "pnpm never recorded") instead of describing the current behavior/contract.

## Issue Context
Repository guidance requires comments to document current behavior and invariants; historical notes belong in PR/commit messages or design docs.

## Fix Focus Areas
- pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[278-287]
- pnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier/tests.rs[479-481]

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


2. Changeset omits pnpm entry 📘 Rule violation § Compliance
Description
The new changeset file lists only pacquet and does not include a pnpm bump entry, which violates
the requirement to explicitly declare the pnpm package in changesets. This can cause the pnpm
release tooling to miss or misclassify the required version bump.
Code

.changeset/verifier-rejects-integrity-less-tarballs.md[R1-3]

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

⭐⭐ Medium

Mixed precedent: some PRs added required pnpm changeset entry; many others left it out despite bot
warning.

PR-#13403
PR-#13337
PR-#13404

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each changeset to explicitly declare the pnpm package and a valid
bump type. The added changeset front-matter contains only "pacquet": patch and no pnpm entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/verifier-rejects-integrity-less-tarballs.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 does not include a `pnpm` entry, which is required by the repository compliance rules.

## Issue Context
This PR introduces a user-visible lockfile verification behavior change/error surfaced as `ERR_PNPM_MISSING_TARBALL_INTEGRITY`, so the changeset should explicitly declare the `pnpm` package bump type (patch/minor/major as appropriate).

## Fix Focus Areas
- .changeset/verifier-rejects-integrity-less-tarballs.md[1-3]

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


Qodo Logo

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

@codecov-commenter

codecov-commenter commented Jul 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.56%. Comparing base (5ed47dc) to head (c992c4d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13408   +/-   ##
=======================================
  Coverage   87.55%   87.56%           
=======================================
  Files         544      544           
  Lines       93464    93483   +19     
=======================================
+ Hits        81832    81854   +22     
+ Misses      11632    11629    -3     

☔ 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.

The frozen-install regression test asserted the batched verification
error but left the baseline install's tarball mocks unchecked, so it
would also have passed had the install downloaded the tarball first and
only then reported the gate's error.

Re-arm both endpoints with a zero-request expectation before the frozen
command and assert them afterwards. The mocks still answer, so a fetch
is observable rather than merely absent — flipping the expectation to
one request fails with "received 0", which is what makes the assertion
meaningful.
Copilot AI review requested due to automatic review settings July 26, 2026 22:59

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 26, 2026
@qodo-code-review

Copy link
Copy Markdown

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

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

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: c992c4d6fd7e

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.645 ± 0.171 2.355 2.787 1.82 ± 0.21
pacquet@main 2.434 ± 0.119 2.347 2.651 1.67 ± 0.18
pnpr@HEAD 1.457 ± 0.141 1.344 1.783 1.00
pnpr@main 1.541 ± 0.130 1.382 1.747 1.06 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6445029899200003,
      "stddev": 0.1708181524100744,
      "median": 2.71876110902,
      "user": 1.5138039799999998,
      "system": 1.29232196,
      "min": 2.35463258602,
      "max": 2.7870904860200003,
      "times": [
        2.7529267490200002,
        2.7870904860200003,
        2.7090906400200003,
        2.77677028602,
        2.71423834502,
        2.72328387302,
        2.77333190702,
        2.35463258602,
        2.39215974202,
        2.4615052850200003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.43399903312,
      "stddev": 0.1186679437443555,
      "median": 2.36924873402,
      "user": 1.5320598799999998,
      "system": 1.25493056,
      "min": 2.3472382360200004,
      "max": 2.65055761202,
      "times": [
        2.6382539530200004,
        2.47983566002,
        2.37076301402,
        2.34878364502,
        2.42833953002,
        2.34765455602,
        2.65055761202,
        2.3608296710200003,
        2.3472382360200004,
        2.3677344540200003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.45696143162,
      "stddev": 0.14146348431115738,
      "median": 1.38451339852,
      "user": 1.03239358,
      "system": 1.1304631600000001,
      "min": 1.34353435702,
      "max": 1.78281590902,
      "times": [
        1.37279853402,
        1.39490375902,
        1.54148539802,
        1.55884606402,
        1.34465928802,
        1.34353435702,
        1.50397170702,
        1.37412303802,
        1.35247626202,
        1.78281590902
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.54143409992,
      "stddev": 0.13006715767867183,
      "median": 1.51339805302,
      "user": 1.0617997799999999,
      "system": 1.12475776,
      "min": 1.38186097302,
      "max": 1.74710113302,
      "times": [
        1.60965811802,
        1.45539263802,
        1.4051921890199999,
        1.38186097302,
        1.71672431002,
        1.74710113302,
        1.63899546202,
        1.50296349402,
        1.43262007002,
        1.5238326120199999
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 257.8 ± 5.9 249.7 267.5 1.02 ± 0.03
pacquet@main 253.1 ± 6.4 239.3 262.0 1.00
pnpr@HEAD 272.9 ± 6.7 263.4 284.0 1.08 ± 0.04
pnpr@main 271.5 ± 10.9 254.3 292.9 1.07 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25781880214,
      "stddev": 0.0058550324892971675,
      "median": 0.25621993484,
      "user": 0.2159516,
      "system": 0.53225168,
      "min": 0.24967815784000005,
      "max": 0.26749690284,
      "times": [
        0.25231970384,
        0.25802125984,
        0.24967815784000005,
        0.25532659384,
        0.26749690284,
        0.25508101284,
        0.26049853684,
        0.26733983984,
        0.25531273784,
        0.25711327584
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25312572934,
      "stddev": 0.006376320927283774,
      "median": 0.25342787233999997,
      "user": 0.21022289999999993,
      "system": 0.51654638,
      "min": 0.23934982384000003,
      "max": 0.26200291684,
      "times": [
        0.25977208184,
        0.25666138784,
        0.25537930284,
        0.25147644184,
        0.26200291684,
        0.23934982384000003,
        0.25575049984,
        0.24948979484000003,
        0.25134494484,
        0.25003009884
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27287324694,
      "stddev": 0.00670560851161877,
      "median": 0.27098554784,
      "user": 0.213727,
      "system": 0.55118368,
      "min": 0.26339225384,
      "max": 0.28401915684,
      "times": [
        0.28282705084,
        0.27113861484,
        0.27079568184,
        0.27083248084,
        0.26961633984,
        0.27447677684,
        0.28401915684,
        0.26339225384,
        0.26541504884,
        0.27621906484
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27149225534,
      "stddev": 0.01094143775436827,
      "median": 0.27062208534,
      "user": 0.2266742,
      "system": 0.5179359800000001,
      "min": 0.25431405384,
      "max": 0.29288922684,
      "times": [
        0.25431405384,
        0.29288922684,
        0.26378090284,
        0.26885961984,
        0.26062253884,
        0.27010802084,
        0.28042683884,
        0.27863666084,
        0.27414854084,
        0.27113614984
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.770 ± 0.015 2.743 2.789 1.80 ± 0.15
pacquet@main 2.764 ± 0.019 2.737 2.797 1.80 ± 0.15
pnpr@HEAD 1.580 ± 0.126 1.424 1.771 1.03 ± 0.12
pnpr@main 1.535 ± 0.127 1.427 1.852 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.76980125474,
      "stddev": 0.014969540449375918,
      "median": 2.77186227224,
      "user": 1.6806085,
      "system": 1.32081742,
      "min": 2.74322161824,
      "max": 2.78917522824,
      "times": [
        2.74322161824,
        2.76474168724,
        2.77571775524,
        2.75368534624,
        2.76876826824,
        2.78917522824,
        2.78111125224,
        2.77495627624,
        2.78805430624,
        2.75858080924
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.76423175264,
      "stddev": 0.01904822823616466,
      "median": 2.76262077224,
      "user": 1.7076637,
      "system": 1.28326022,
      "min": 2.73684632924,
      "max": 2.79693161824,
      "times": [
        2.75229546024,
        2.79693161824,
        2.7629612362400002,
        2.73684632924,
        2.7949733452400003,
        2.76228030824,
        2.75309098824,
        2.74975619224,
        2.76452479324,
        2.76865725524
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.58046605404,
      "stddev": 0.12621864643902272,
      "median": 1.54295812924,
      "user": 1.04787,
      "system": 1.12260202,
      "min": 1.42444444724,
      "max": 1.7710402572400001,
      "times": [
        1.44500865824,
        1.48673186224,
        1.65727535124,
        1.7710402572400001,
        1.57480814224,
        1.7576377762400002,
        1.51110811624,
        1.42444444724,
        1.66994054724,
        1.50666538224
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.53531307274,
      "stddev": 0.12721700679308356,
      "median": 1.5069351582400001,
      "user": 1.0146153,
      "system": 1.18528482,
      "min": 1.42663153824,
      "max": 1.85180971024,
      "times": [
        1.59501547624,
        1.55652934524,
        1.46355366524,
        1.85180971024,
        1.42837132224,
        1.42663153824,
        1.55031665124,
        1.4632193682399999,
        1.56474881324,
        1.45293483724
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 595.1 ± 11.3 578.6 609.3 2.04 ± 0.10
pacquet@main 581.6 ± 7.1 569.1 591.6 1.99 ± 0.09
pnpr@HEAD 304.1 ± 4.7 297.5 310.2 1.04 ± 0.05
pnpr@main 291.6 ± 12.4 277.4 316.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5950720906,
      "stddev": 0.011317379988499448,
      "median": 0.5945680106,
      "user": 0.70738154,
      "system": 0.6959299,
      "min": 0.5786032576,
      "max": 0.6093338366000001,
      "times": [
        0.5946972926,
        0.5944387286,
        0.6046720126,
        0.5846289986000001,
        0.6083196746,
        0.6093338366000001,
        0.6024980356,
        0.5941026386,
        0.5794264306,
        0.5786032576
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5816272216,
      "stddev": 0.007079491646863832,
      "median": 0.5809754261,
      "user": 0.6897452399999999,
      "system": 0.6841213999999998,
      "min": 0.5690710386000001,
      "max": 0.5915772816,
      "times": [
        0.5821529246,
        0.5849273776,
        0.5915772816,
        0.5907824806,
        0.5755242426,
        0.5788698966,
        0.5868431906,
        0.5797979276,
        0.5690710386000001,
        0.5767258556
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3040822941,
      "stddev": 0.004678539656528314,
      "median": 0.3054998176,
      "user": 0.19950754,
      "system": 0.5325110999999999,
      "min": 0.29746599960000003,
      "max": 0.31023605060000004,
      "times": [
        0.3069228676,
        0.29746599960000003,
        0.3056218466,
        0.3082386656,
        0.2993508746,
        0.30537778860000003,
        0.3086613586,
        0.31023605060000004,
        0.2997287926,
        0.2992186966
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29163267769999995,
      "stddev": 0.012408953380774693,
      "median": 0.2884995406,
      "user": 0.19554953999999997,
      "system": 0.4967911000000001,
      "min": 0.2774226046,
      "max": 0.3160574506,
      "times": [
        0.3026497516,
        0.2827846016,
        0.2824127246,
        0.2919432796,
        0.2850558016,
        0.2774226046,
        0.2796009706,
        0.2990671426,
        0.3160574506,
        0.2993324496
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.899 ± 0.010 1.882 1.915 6.26 ± 0.11
pacquet@main 1.892 ± 0.014 1.867 1.911 6.24 ± 0.12
pnpr@HEAD 0.304 ± 0.007 0.294 0.313 1.00 ± 0.03
pnpr@main 0.303 ± 0.005 0.293 0.312 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.89912872154,
      "stddev": 0.009602573417486292,
      "median": 1.89741227644,
      "user": 0.9358619199999998,
      "system": 0.76818244,
      "min": 1.88231410544,
      "max": 1.9153042664400002,
      "times": [
        1.9153042664400002,
        1.8992110694400002,
        1.8956028634400002,
        1.9066355564400002,
        1.89561348344,
        1.8915032434400003,
        1.9034960984400002,
        1.88231410544,
        1.8930081644400003,
        1.9085983644400002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8924245019400001,
      "stddev": 0.014123402601901845,
      "median": 1.8906598389400002,
      "user": 0.9337495199999999,
      "system": 0.74846684,
      "min": 1.8670583734400001,
      "max": 1.91093393444,
      "times": [
        1.9013716304400001,
        1.8917069524400003,
        1.90964552844,
        1.8896127254400001,
        1.9044224124400002,
        1.88585507744,
        1.8670583734400001,
        1.8793588324400001,
        1.8842795524400002,
        1.91093393444
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3038801537400001,
      "stddev": 0.006824242462009328,
      "median": 0.30451868244,
      "user": 0.21110851999999997,
      "system": 0.5216641399999999,
      "min": 0.29393925944,
      "max": 0.31336697744,
      "times": [
        0.31336697744,
        0.30636699944,
        0.31001740644,
        0.31208031444,
        0.29904796144,
        0.29988271744,
        0.30370533644000003,
        0.29393925944,
        0.29506253644,
        0.30533202844
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30313480914,
      "stddev": 0.005326784917049374,
      "median": 0.30278856243999996,
      "user": 0.20236492,
      "system": 0.52953674,
      "min": 0.29344269944,
      "max": 0.31190417444,
      "times": [
        0.31190417444,
        0.29997259644,
        0.30338968544,
        0.30226657844,
        0.29967133044,
        0.30569561044,
        0.31034263544,
        0.29344269944,
        0.30331054644,
        0.30135223444
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 368.4 ± 12.6 359.4 400.3 4.26 ± 0.18
pacquet@main 361.1 ± 7.1 348.4 368.2 4.17 ± 0.13
pnpr@HEAD 86.5 ± 2.0 82.1 89.8 1.00
pnpr@main 86.8 ± 1.8 82.0 90.4 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.36836027081999995,
      "stddev": 0.012631555550319208,
      "median": 0.36379138872,
      "user": 0.36646638,
      "system": 0.04867124,
      "min": 0.35935046972,
      "max": 0.40026179072,
      "times": [
        0.40026179072,
        0.36262010072,
        0.36481014972,
        0.36278205572,
        0.35935046972,
        0.36230415972,
        0.36589637672,
        0.36480072172,
        0.38030832772,
        0.36046855572
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.36108722772,
      "stddev": 0.007055299588300311,
      "median": 0.36486733322,
      "user": 0.35148127999999995,
      "system": 0.05868154,
      "min": 0.34836144372,
      "max": 0.36816859472,
      "times": [
        0.35909149872,
        0.36543752272,
        0.36457993372,
        0.36515473272,
        0.36711485772,
        0.36816859472,
        0.34836144372,
        0.35294419872,
        0.35371335272,
        0.36630614172
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08651084836705884,
      "stddev": 0.002026111960134287,
      "median": 0.08656026072,
      "user": 0.020398327058823527,
      "system": 0.008808708235294116,
      "min": 0.08205244072000001,
      "max": 0.08981667372000002,
      "times": [
        0.08447194772000001,
        0.08851454172,
        0.08839872372000002,
        0.08931448172,
        0.08462275172000001,
        0.08731316772000002,
        0.08981667372000002,
        0.08507788472000001,
        0.08576627672,
        0.08351875972000002,
        0.08647568672000001,
        0.08422557572000001,
        0.08582734072,
        0.08963289872,
        0.08494375372000001,
        0.08903636972000001,
        0.08710954572000001,
        0.08715010172000001,
        0.08644812572,
        0.08749630172000002,
        0.08711369372000001,
        0.08282021972,
        0.08658560372000002,
        0.08306693272000001,
        0.08837432772,
        0.08653491772,
        0.08205244072000001,
        0.08835600372,
        0.08663394372000001,
        0.08504837972000001,
        0.08635587172,
        0.08754604372000001,
        0.08921383272000001,
        0.08650572372000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.0867809464169697,
      "stddev": 0.001829339226656898,
      "median": 0.08680053572000002,
      "user": 0.02126052848484848,
      "system": 0.008152856363636364,
      "min": 0.08203951572000001,
      "max": 0.09040814272000001,
      "times": [
        0.08650761672000001,
        0.08626853772000001,
        0.09040814272000001,
        0.08637614072000001,
        0.08779907872,
        0.08643874772000001,
        0.08680053572000002,
        0.08461459672,
        0.08534319272000002,
        0.09026010472000001,
        0.08689190672000001,
        0.08480833972000001,
        0.08310496472000001,
        0.08983587872000001,
        0.08565315372000001,
        0.08690574372000001,
        0.08634989072000002,
        0.08203951572000001,
        0.08426119272000002,
        0.08827646372000002,
        0.08815862272000001,
        0.08652838472,
        0.08806349472000001,
        0.08680014472000001,
        0.08658656472000001,
        0.08836849672000001,
        0.08744065672000001,
        0.08505881972000001,
        0.08844602172000002,
        0.08772050072000001,
        0.08703584772000002,
        0.08768125772000002,
        0.08693867472000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.542 ± 0.120 4.432 4.786 1.30 ± 0.05
pacquet@main 4.528 ± 0.112 4.435 4.732 1.29 ± 0.05
pnpr@HEAD 3.503 ± 0.094 3.442 3.726 1.00
pnpr@main 3.531 ± 0.121 3.434 3.782 1.01 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.541611163000001,
      "stddev": 0.12036187193627791,
      "median": 4.5201314165,
      "user": 1.6882810199999998,
      "system": 1.3846747799999997,
      "min": 4.432040328,
      "max": 4.786074264,
      "times": [
        4.667218001,
        4.437078809,
        4.569138005,
        4.471124828,
        4.435514805,
        4.4409496090000005,
        4.574327981,
        4.786074264,
        4.602645,
        4.432040328
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.5276300449,
      "stddev": 0.11217235395813083,
      "median": 4.4790550765,
      "user": 1.73327912,
      "system": 1.3506428799999999,
      "min": 4.434768226,
      "max": 4.732488941,
      "times": [
        4.505215476,
        4.463925217,
        4.441222511,
        4.494184936,
        4.438060561,
        4.732488941,
        4.46065419,
        4.705895029,
        4.599885362,
        4.434768226
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5025426809000004,
      "stddev": 0.0944727675842613,
      "median": 3.454788917,
      "user": 1.19310652,
      "system": 1.1781256799999997,
      "min": 3.441753561,
      "max": 3.72627367,
      "times": [
        3.4499197280000002,
        3.72627367,
        3.511980151,
        3.441753561,
        3.450608871,
        3.4522606590000002,
        3.4677504150000003,
        3.6153019200000003,
        3.456436142,
        3.453141692
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5306553121999995,
      "stddev": 0.12101618145867296,
      "median": 3.4794567195,
      "user": 1.18066352,
      "system": 1.21111058,
      "min": 3.433536735,
      "max": 3.781793654,
      "times": [
        3.455414936,
        3.723046707,
        3.781793654,
        3.50364662,
        3.48889527,
        3.433536735,
        3.451556488,
        3.465737891,
        3.470018169,
        3.532906652
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13408
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,743.22 ms
(+0.20%)Baseline: 2,737.68 ms
3,285.22 ms
(83.50%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,882.31 ms
(-0.48%)Baseline: 1,891.35 ms
2,269.62 ms
(82.94%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
578.60 ms
(+0.48%)Baseline: 575.84 ms
691.01 ms
(83.73%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
359.35 ms
(+1.94%)Baseline: 352.51 ms
423.01 ms
(84.95%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,354.63 ms
(-0.11%)Baseline: 2,357.14 ms
2,828.57 ms
(83.24%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,432.04 ms
(+0.19%)Baseline: 4,423.48 ms
5,308.18 ms
(83.49%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
249.68 ms
(+1.11%)Baseline: 246.94 ms
296.33 ms
(84.26%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13408
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,424.44 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
293.94 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
297.47 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
82.05 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,343.53 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,441.75 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
263.39 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit cd09b1c into main Jul 27, 2026
36 checks passed
@zkochan
zkochan deleted the fix-13364 branch July 27, 2026 08:43
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 27, 2026
pnpm#13408)

The npm resolution verifier implemented three of its four violation
codes: a lockfile entry whose tarball resolution records no `integrity`
sailed through the verification gate — which had just printed its green
check for that same lockfile — and was only refused later, one entry at
a time, by the fetch path's `tarball_url_and_integrity` backstop.

Add the missing `MISSING_TARBALL_INTEGRITY` rule so the gate reports
every offending entry in one batched `ERR_PNPM_MISSING_TARBALL_INTEGRITY`
error before anything is downloaded, matching
`createNpmResolutionVerifier` in the TypeScript CLI. The check needs no
network, so it runs before the registry-metadata shortcuts and applies to
URL-keyed entries too, whose non-semver version otherwise skips the
registry policies. `integrityRequired` joins the policy snapshot so a
cache record written before the rule existed can't stat-fast-path around
it.

Two shapes that could have bought the exemption are closed along the
way. `integrity: ''` parses into an SRI with zero hashes, which pins
nothing and makes `Integrity::check` panic on `hashes[0]`; the new
`LockfileResolution::checkable_integrity` reports it as absent, both here
and in the fetch-path backstop, matching pnpm's `getExpectedIntegrity`.
And the git-host archive exemption is now read from the tarball URL alone
rather than the lockfile's own `gitHosted` marker, so an edited entry
can't claim it for an arbitrary URL — the same rule
`isRegistryTarballResolution` and `unverified_fetch_is_allowed` apply.

The fetch-path refusal stays as the backstop for entries that reach a
fetch without having passed the gate, as pnpm keeps
`assertFetchableResolution` for the same reason.

Closes pnpm#13364
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's lockfile verifier has no MISSING_TARBALL_INTEGRITY rule, so the refusal comes from the fetch path

3 participants