Skip to content

fix(package-manager): run readPackage over the project manifests - #13773

Merged
zkochan merged 4 commits into
pnpm:mainfrom
lazerg:fix/issue-13769-pnpmfile-project-specifiers
Aug 10, 2026
Merged

zkochan merged 4 commits into
pnpm:mainfrom
lazerg:fix/issue-13769-pnpmfile-project-specifiers

Conversation

@lazerg

@lazerg lazerg commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #13769.

pacquet never ran the pnpmfile's readPackage over the workspace projects' own manifests, only over the manifests the resolver got back for their dependencies. A hook that rewrites one of the project's own specifiers was therefore ignored on the way in: the importer's wanted dependencies, and the specifier: the lockfile records for it, both came straight off package.json.

The divergence is wider than the recorded specifier. With "is-positive": "^1.0.0" in package.json and a .pnpmfile.cjs rewriting it to 3.1.0, pnpm installs 3.1.0 and records specifier: 3.1.0; pacquet installed 1.0.0 and recorded ^1.0.0.

The fix applies the hook where pnpm's getContext does — once over every project manifest, before anything reads them — so resolution, the freshness gates, and the lockfile importer entries all see the same hooked view and stay consistent with each other. Recording the hooked specifier without that would have broken --frozen-lockfile, since the gate compares the lockfile against the manifest. The optimistic repeat-install check stays on the on-disk manifests deliberately: it runs before the pnpmfile is loaded and must not spawn the Node worker.

The TypeScript CLI already behaves this way; its side of this PR is a test pinning it.

Verified against pnpm 11.20.0 on the issue's repro: the two lockfiles are now byte-identical, and repeat installs, --frozen-lockfile, and pnpm add all agree between the stacks (pnpm add still writes the raw range back to package.json in both).

Squash Commit Body

pacquet ran the pnpmfile's readPackage only over the manifests the
resolver returned for a project's dependencies, never over the project
manifests themselves, so a hook rewriting one of a project's own
specifiers was dropped: the importer's wanted dependencies and the
specifier the lockfile recorded for it both came from package.json.
A hook turning "^1.0.0" into "3.1.0" left pacquet installing 1.0.0 and
recording "^1.0.0" where pnpm installs 3.1.0 and records "3.1.0".

The hook now runs once over every project manifest at the point pnpm's
getContext runs it, before the freshness gates, the fast-update
candidate, and the resolver read them, so all three agree on the hooked
view. Recording the hooked specifier alone would have made every
--frozen-lockfile install fail with SpecifiersDiffer, since that gate
compares the lockfile against the manifest. The optimistic
repeat-install check keeps reading the on-disk manifests: it runs ahead
of the pnpmfile load and must not spawn the Node worker.

Closes pnpm/pnpm#13769.

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

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
    • Restored support for .pnpmfile.cjs readPackage hooks that rewrite a project’s own dependency specifications.
    • Rewritten specifications are now used during installation and recorded accurately in the lockfile, including the resolved version.
    • Installation now reports clear errors when a readPackage hook fails.
  • Tests
    • Added coverage for dependency-specifier rewrites in both standard and API-based installation workflows.

@lazerg
lazerg requested a review from zkochan as a code owner August 10, 2026 16:14
@welcome

welcome Bot commented Aug 10, 2026

Copy link
Copy Markdown

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The install pipeline now applies readPackage hooks to every project manifest before freshness checks and resolution. Hook failures use a dedicated install error. Rust and TypeScript tests verify rewritten project dependency specifiers in the lockfile.

Changes

Project manifest hook processing

Layer / File(s) Summary
Manifest hook processing
pnpm/crates/package-manager/src/install.rs, pnpm/crates/package-manager/src/install/run.rs, pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
readPackage hooks transform every project manifest before freshness inputs and installation processing. Hook failures use InstallError::ReadPackageHook.
Rewritten specifier validation
pnpm/crates/package-manager/src/install/tests.rs, pnpm11/installing/deps-installer/test/install/hooks.ts, .changeset/pnpmfile-hooks-project-specifiers.md
Tests verify rewritten project dependency specifiers and resolved versions in root and workspace importer entries, including repeat installs. The changeset documents the patch release.

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

Sequence Diagram(s)

sequenceDiagram
  participant ProjectManifest
  participant readPackageHook
  participant InstallPipeline
  participant LockfileImporter
  ProjectManifest->>readPackageHook: submit manifest
  readPackageHook-->>InstallPipeline: return transformed manifest
  InstallPipeline->>LockfileImporter: resolve rewritten dependency specifier
  LockfileImporter-->>InstallPipeline: record rewritten specifier and version
Loading

Assessment against linked issues

Objective Addressed Explanation
Apply the readPackage-rewritten specifier when pacquet records the project's own dependencies [#13769] ✅
Record the rewritten specifier and resolved version in the importer lockfile entry [#13769] ✅

Possibly related PRs

  • pnpm/pnpm#13770: Related readPackage handling in the installation and lockfile-update pipeline.
  • pnpm/pnpm#13492: Related pnpmfile hook processing in the install pipeline.
  • pnpm/pnpm#13081: Related manifest freshness handling during installation.

Suggested labels: product: pacquet, product: pnpm@11

Suggested reviewers: zkochan

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@greptile-apps

greptile-apps Bot commented Aug 10, 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: trim the workspace-member comment ..." | Re-trigger Greptile

@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: 3

🤖 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 @.changeset/pnpmfile-hooks-project-specifiers.md:
- Line 5: Update the release-note sentence to state that Pacquet resolves and
records the rewritten dependency specifier for the importer, matching pnpm,
rather than implying it records the raw specifier. Preserve the existing
is-positive and .pnpmfile.cjs example while describing the resulting lockfile or
install behavior.

In `@pnpm/crates/package-manager/src/install/tests.rs`:
- Around line 9851-9855: Remove the unconditional dbg!(recorded) call from the
test around root_deps and the recorded PkgName entry, leaving both assertions
unchanged; add failure-only diagnostic context only if needed for those
assertions.
- Around line 9824-9855: Extend the Rust test
read_package_hook_rewrites_the_project_own_specifier in
pnpm/crates/package-manager/src/install/tests.rs:9824-9855 with a workspace
child manifest whose dependency is rewritten, then assert its importer specifier
and resolved version after normal, repeat, and frozen installs. Add the matching
workspace-child fixture in
pnpm11/installing/deps-installer/test/install/hooks.ts:90-118 to maintain
TypeScript parity; both sites must cover rewritten importer metadata and
frozen-lockfile behavior.
🪄 Autofix

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: a38fed53-a9e5-4b93-a2d8-b5aad5f91de9

📥 Commits

Reviewing files that changed from the base of the PR and between 25e3fe9 and f81ea85.

📒 Files selected for processing (6)
  • .changeset/pnpmfile-hooks-project-specifiers.md
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/package-manager/src/install/run.rs
  • pnpm/crates/package-manager/src/install/tests.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm11/installing/deps-installer/test/install/hooks.ts

@codecov-commenter

codecov-commenter commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.14%. Comparing base (25e3fe9) to head (f1ab9ec).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/package-manager/src/install/run.rs 97.87% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13773   +/-   ##
=======================================
  Coverage   88.13%   88.14%           
=======================================
  Files         623      623           
  Lines      101380   101413   +33     
=======================================
+ Hits        89353    89391   +38     
+ Misses      12027    12022    -5     

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

Both regression tests only rewrote the root importer's specifier, so
they passed even when the hook reached no other project: restricting
the hook to the first project manifest left them green. Each stack
now also rewrites a workspace member's own specifier and asserts the
member's importer entry, plus a repeat install to pin that the
freshness gates compare hooked manifests rather than reading the raw
range back off package.json.

The changeset now states what the install does rather than narrating
the defect, and the leftover dbg! goes.
@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.

@zkochan

zkochan commented Aug 10, 2026

Copy link
Copy Markdown
Member

Pushed review fixes to this branch (f1ab9ec) — thanks for tackling the issue.

The load-bearing one was CodeRabbit's coverage finding, and it was right: both regression tests only rewrote the root importer, so they passed even when the hook reached no other project. I confirmed the gap by restricting the hook to the first project manifest (project_manifests.iter().take(1)) — the root test stayed green while the workspace case would have slipped through. Each stack now also rewrites a workspace member's own specifier, asserts the member's importer entry, and runs a second install to pin that the freshness gates compare hooked manifests rather than reading the raw range back off package.json. With that break in place the new tests go red, so they hold the behavior the fix adds.

Also: dropped the leftover dbg!, and rewrote the changeset — the original sentence never named its subject and read as though pnpm records the raw specifier. It now leads with what the install does.

Declined one finding: the changeset stays pacquet-only. Per CLAUDE.md a Rust-only change must not name "pnpm" (that means the TypeScript CLI package), and this PR's TypeScript side is a parity test, which gets no release note.

The implementation itself I did not change — applying the hook where getContext applies it, and keeping the optimistic repeat-install check on the raw on-disk manifests, both look right to me.


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

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

@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 (2)
pnpm/crates/package-manager/src/install/tests.rs (1)

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

Extract the shared Install setup.

This block duplicates the Install setup in install_with_pnpmfile_reporter. Extract one helper that accepts the fixture-specific Config and manifest. This prevents the root and workspace fixtures from drifting when Install changes.

As per coding guidelines, check shared helpers before adding duplicate code.

🤖 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 `@pnpm/crates/package-manager/src/install/tests.rs` around lines 9904 - 9940,
Extract the duplicated Install construction into a shared test helper near
install_with_pnpmfile_reporter, accepting the fixture-specific Config and
manifest references as parameters. Move the common field initialization into
that helper, then update both root and workspace fixtures to invoke it while
preserving their distinct configuration and manifest values.

Sources: Coding guidelines, Path instructions

pnpm11/installing/deps-installer/test/install/hooks.ts (1)

136-141: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Declare local functions after their call sites.

Move readPackageHook and readMemberEntry below the calls that use them. This follows the repository TypeScript convention.

As per coding guidelines, TypeScript code must “declare functions after use.”

Also applies to: 166-169

🤖 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 `@pnpm11/installing/deps-installer/test/install/hooks.ts` around lines 136 -
141, Move the local functions readPackageHook and readMemberEntry below the call
sites that invoke them, without changing their implementations or behavior.
Preserve the existing hook registration and execution flow while following the
repository convention of declaring functions after use.

Source: Coding guidelines

🤖 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 `@pnpm/crates/package-manager/src/install/tests.rs`:
- Around line 9904-9940: Extract the duplicated Install construction into a
shared test helper near install_with_pnpmfile_reporter, accepting the
fixture-specific Config and manifest references as parameters. Move the common
field initialization into that helper, then update both root and workspace
fixtures to invoke it while preserving their distinct configuration and manifest
values.

In `@pnpm11/installing/deps-installer/test/install/hooks.ts`:
- Around line 136-141: Move the local functions readPackageHook and
readMemberEntry below the call sites that invoke them, without changing their
implementations or behavior. Preserve the existing hook registration and
execution flow while following the repository convention of declaring functions
after use.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c171b376-76cb-470b-8ad8-cf403a4d98d4

📥 Commits

Reviewing files that changed from the base of the PR and between f81ea85 and f1ab9ec.

📒 Files selected for processing (3)
  • .changeset/pnpmfile-hooks-project-specifiers.md
  • pnpm/crates/package-manager/src/install/tests.rs
  • pnpm11/installing/deps-installer/test/install/hooks.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/pnpmfile-hooks-project-specifiers.md

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Unbounded hook IPC fanout ✗ Dismissed 🐞 Bug ➹ Performance
Description
install/run.rs applies the pnpmfile readPackage hook to all workspace manifests via
try_join_all, creating one in-flight IPC request per project at once. Because the Node worker
keeps a pending entry per request and enforces a fixed per-request timeout, large workspaces can see
elevated memory usage and spurious ERR_PNPM_PNPMFILE_FAIL timeouts when hooks are slow or
synchronous.
Code

pnpm/crates/package-manager/src/install/run.rs[R452-455]

+                futures_util::future::try_join_all(project_manifests.iter().map(
+                    |(project_dir, manifest)| {
+                        let ctx = pacquet_hooks::HookContext { log: Arc::clone(&log), dir: None };
+                        async move {
Relevance

●● Moderate

Team has mixed precedent: sometimes encourages join_all parallelism, sometimes rejects unbounded
fanout/memory concerns; unclear for IPC case.

PR-#12876
PR-#13652

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code fans out readPackage calls across all workspace manifests concurrently, while the
Node worker implementation keeps per-request state and applies a fixed timeout from request send to
response. This combination makes peak memory and timeout likelihood grow with the number of
workspace projects.

pnpm/crates/package-manager/src/install/run.rs[432-467]
pnpm/crates/hooks/src/worker.rs[35-94]
pnpm/crates/hooks/src/worker.rs[274-295]

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

### Issue description
`try_join_all(project_manifests.iter().map(...))` fires *all* `readPackage` calls concurrently, which scales linearly in in-flight IPC requests, pending entries, and cloned manifest payloads.

### Issue Context
The pnpmfile hooks are executed through a single long-lived Node worker process. Each request is tracked in a `pending` map and is guarded by a fixed timeout; large batches of concurrent requests increase memory retention and make timeouts more likely under load.

### Fix Focus Areas
- pnpm/crates/package-manager/src/install/run.rs[439-466]

### What to change
- Replace `futures_util::future::try_join_all(...)` with a bounded-concurrency stream (or a simple sequential loop).
 - Prefer sequential (`for ... { await ... }`) or `stream::iter(...).map(...).buffered(N).try_collect()` with a small `N`.
 - Rationale: the hook executor is a single Node worker; high parallelism here rarely improves throughput but increases peak memory and timeout risk.
- Keep output ordering stable (if needed) by using `buffered` (ordered) rather than `buffer_unordered`, or by carrying indices.

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



Remediation recommended

2. Changeset lacks pnpm bump 📘 Rule violation § Compliance
Description
The new changeset declares a release bump for pacquet but does not declare any bump for pnpm.
This violates the changeset policy and can lead to missing/incorrect releases for the affected
published package.
Code

.changeset/pnpmfile-hooks-project-specifiers.md[2]

+"pacquet": patch
Relevance

●●● Strong

Repo often accepts adding required pnpm bump to changesets; recent accepted precedents match this
exact issue.

PR-#13748
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 713436 requires changesets to explicitly include the pnpm package with an appropriate bump
type. The added changeset front-matter includes only "pacquet": patch and omits pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pnpmfile-hooks-project-specifiers.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 an explicit `pnpm` entry with a valid bump type (`patch`/`minor`/`major`). The PR describes a bug fix behavior change, so `pnpm: patch` is likely appropriate.

## Issue Context
Repo review guidance requires explicitly listing `pnpm` in changesets; this changeset currently lists only `pacquet`.

## Fix Focus Areas
- .changeset/pnpmfile-hooks-project-specifiers.md[1-3]

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


Grey Divider

Context used
✅ Compliance rules (platform): 26 rules

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

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.

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: f1ab9ecdbf4f

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. 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.582 ± 0.119 2.372 2.752 1.67 ± 0.15
pacquet@main 2.490 ± 0.103 2.363 2.640 1.61 ± 0.14
pnpr@HEAD 1.550 ± 0.122 1.382 1.724 1.00
pnpr@main 1.565 ± 0.135 1.397 1.765 1.01 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5819513350400003,
      "stddev": 0.11890867560090564,
      "median": 2.61725536594,
      "user": 1.5736044200000001,
      "system": 1.34910598,
      "min": 2.37179422194,
      "max": 2.7521413039400002,
      "times": [
        2.6904090639400002,
        2.51385638694,
        2.6422663339400003,
        2.5922443979400005,
        2.37179422194,
        2.6451255059400003,
        2.44120739894,
        2.5139687199400003,
        2.7521413039400002,
        2.6565000169400004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4901785999400006,
      "stddev": 0.10301735897238837,
      "median": 2.4585410164400003,
      "user": 1.57808522,
      "system": 1.3515279799999997,
      "min": 2.3625573459400004,
      "max": 2.64025163294,
      "times": [
        2.4577205719400004,
        2.38678847594,
        2.6234018549400004,
        2.5655935819400004,
        2.64025163294,
        2.38307013594,
        2.44751921894,
        2.5755217199400002,
        2.3625573459400004,
        2.4593614609400003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5496039535399997,
      "stddev": 0.12226803233670412,
      "median": 1.54123472494,
      "user": 1.0826392200000001,
      "system": 1.1734799800000002,
      "min": 1.3816385899399999,
      "max": 1.7240322129399999,
      "times": [
        1.53719442494,
        1.46946432594,
        1.7043021739400002,
        1.45732098794,
        1.54527502494,
        1.3816385899399999,
        1.7240322129399999,
        1.40353682994,
        1.6504144299399999,
        1.62286053494
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.56502438194,
      "stddev": 0.13524407286054463,
      "median": 1.57546029394,
      "user": 1.0635132200000001,
      "system": 1.19611868,
      "min": 1.39687794594,
      "max": 1.76499234194,
      "times": [
        1.45367034694,
        1.67338708194,
        1.40352187194,
        1.6662228269400001,
        1.45138552594,
        1.63597654394,
        1.76499234194,
        1.39687794594,
        1.68926528994,
        1.5149440439400002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 257.1 ± 12.4 225.7 271.2 1.00
pacquet@main 260.8 ± 6.1 248.2 268.0 1.01 ± 0.05
pnpr@HEAD 271.0 ± 8.3 258.7 283.4 1.05 ± 0.06
pnpr@main 277.3 ± 6.3 270.8 289.9 1.08 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.257128648,
      "stddev": 0.012442214120249763,
      "median": 0.2612233077,
      "user": 0.22099884000000003,
      "system": 0.52991334,
      "min": 0.2257383482,
      "max": 0.2712359492,
      "times": [
        0.2612086252,
        0.2597379562,
        0.2528722432,
        0.2612578372,
        0.2257383482,
        0.2712359492,
        0.2504799802,
        0.2629585182,
        0.2645590322,
        0.2612379902
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.26075347509999997,
      "stddev": 0.006053878867220998,
      "median": 0.2613149197,
      "user": 0.23088074,
      "system": 0.53121064,
      "min": 0.24818128320000002,
      "max": 0.2680390112,
      "times": [
        0.2646660032,
        0.2670558712,
        0.2633990382,
        0.2562974802,
        0.2592308012,
        0.24818128320000002,
        0.2648100242,
        0.2569083102,
        0.2589469282,
        0.2680390112
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2710334458,
      "stddev": 0.00834157527475172,
      "median": 0.2696472442,
      "user": 0.22207513999999998,
      "system": 0.52189714,
      "min": 0.2586841332,
      "max": 0.2833633272,
      "times": [
        0.2794689172,
        0.2646745602,
        0.2655599962,
        0.2743210282,
        0.2635514852,
        0.2687212762,
        0.2833633272,
        0.2814165222,
        0.2705732122,
        0.2586841332
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27733477689999997,
      "stddev": 0.00626760526080275,
      "median": 0.27497548920000003,
      "user": 0.22491553999999997,
      "system": 0.5374338399999999,
      "min": 0.2708263092,
      "max": 0.2899309192,
      "times": [
        0.2708263092,
        0.2774638732,
        0.2746492152,
        0.2714255672,
        0.2834892752,
        0.2741167322,
        0.2834069092,
        0.2727372052,
        0.2899309192,
        0.2753017632
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.630 ± 0.028 2.593 2.695 1.60 ± 0.17
pacquet@main 2.688 ± 0.044 2.625 2.783 1.63 ± 0.17
pnpr@HEAD 1.660 ± 0.167 1.440 1.889 1.01 ± 0.15
pnpr@main 1.645 ± 0.172 1.465 1.939 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6298981882800003,
      "stddev": 0.02824481238196867,
      "median": 2.6261404608800003,
      "user": 1.6254967999999999,
      "system": 1.3810281400000002,
      "min": 2.5931959193800003,
      "max": 2.6953965223800003,
      "times": [
        2.62163946838,
        2.62110960138,
        2.6094015933800003,
        2.60750252838,
        2.63619017838,
        2.5931959193800003,
        2.6953965223800003,
        2.6306414533800004,
        2.6334385083800003,
        2.6504661093800004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.68783058658,
      "stddev": 0.044261963810585475,
      "median": 2.67679100038,
      "user": 1.8218364,
      "system": 1.4705570399999999,
      "min": 2.6254695163800004,
      "max": 2.7826290723800002,
      "times": [
        2.7208749513800004,
        2.67664749038,
        2.7826290723800002,
        2.71219455138,
        2.65789213138,
        2.7061170483800003,
        2.66308911038,
        2.65645748338,
        2.67693451038,
        2.6254695163800004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.66001582898,
      "stddev": 0.16678705467803565,
      "median": 1.65262165538,
      "user": 1.2348215999999999,
      "system": 1.3421061400000003,
      "min": 1.44022234338,
      "max": 1.88854661438,
      "times": [
        1.44022234338,
        1.75633361938,
        1.50604510138,
        1.5871744993799999,
        1.47468494338,
        1.71806881138,
        1.8401601273800001,
        1.83409139038,
        1.88854661438,
        1.5548308393799999
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.64486286948,
      "stddev": 0.17192700308636602,
      "median": 1.62132498738,
      "user": 1.2071591,
      "system": 1.3115898400000001,
      "min": 1.46491580838,
      "max": 1.9392045183800002,
      "times": [
        1.9392045183800002,
        1.68751887838,
        1.55513109638,
        1.49933395438,
        1.48446802338,
        1.46491580838,
        1.79175858238,
        1.80499951238,
        1.46804419938,
        1.7532541213800001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 486.3 ± 46.7 431.9 549.7 1.43 ± 0.17
pacquet@main 490.8 ± 50.6 430.7 604.5 1.44 ± 0.18
pnpr@HEAD 360.2 ± 11.4 338.6 374.4 1.06 ± 0.08
pnpr@main 341.0 ± 24.7 312.9 398.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4863215049800001,
      "stddev": 0.046714635195344675,
      "median": 0.48943112388000004,
      "user": 0.6453255400000001,
      "system": 0.75509156,
      "min": 0.43190332538000004,
      "max": 0.5496886533800001,
      "times": [
        0.45562067238000004,
        0.43190332538000004,
        0.43368614138,
        0.43423714938,
        0.47710726938000003,
        0.50175497838,
        0.5496886533800001,
        0.52805670138,
        0.54892944338,
        0.5022307153800001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.49083823348000005,
      "stddev": 0.050590514006194506,
      "median": 0.48240180388000004,
      "user": 0.65772024,
      "system": 0.7901057600000001,
      "min": 0.43065678838000004,
      "max": 0.60452954238,
      "times": [
        0.44816182838,
        0.52728923638,
        0.60452954238,
        0.5113354183800001,
        0.47108315638000003,
        0.49372045138000004,
        0.5064761373800001,
        0.43065678838000004,
        0.45210366938,
        0.46302610638
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36017490058,
      "stddev": 0.011405085036134174,
      "median": 0.36080344088000005,
      "user": 0.26240404,
      "system": 0.6299988599999999,
      "min": 0.33860448238,
      "max": 0.37436015638000003,
      "times": [
        0.35174026538000003,
        0.37436015638000003,
        0.36308855338,
        0.37076971738000003,
        0.35851832838000003,
        0.37162814238,
        0.36792066238000004,
        0.35365150538,
        0.33860448238,
        0.35146719238
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.34096035008000003,
      "stddev": 0.024699967359456433,
      "median": 0.33626163288,
      "user": 0.25783694,
      "system": 0.54933266,
      "min": 0.31286368538000003,
      "max": 0.39860752238,
      "times": [
        0.32596179638,
        0.31286368538000003,
        0.34621036338,
        0.36264954738000005,
        0.39860752238,
        0.33550690038000003,
        0.34298181438,
        0.32044361838,
        0.32736188738,
        0.33701636538
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.753 ± 0.016 1.734 1.778 5.49 ± 0.18
pacquet@main 1.756 ± 0.013 1.735 1.778 5.50 ± 0.18
pnpr@HEAD 0.319 ± 0.010 0.300 0.333 1.00
pnpr@main 0.325 ± 0.010 0.311 0.339 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.75306217308,
      "stddev": 0.015799926952390395,
      "median": 1.74921127528,
      "user": 0.8068891999999999,
      "system": 0.79633914,
      "min": 1.73398040728,
      "max": 1.77823031528,
      "times": [
        1.74246612428,
        1.7634183562799999,
        1.7571567962799999,
        1.73529078428,
        1.73398040728,
        1.77823031528,
        1.7768374522800001,
        1.7450759682800001,
        1.74481894428,
        1.75334658228
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.75626894518,
      "stddev": 0.013367210197019646,
      "median": 1.7530511102800002,
      "user": 0.8353921,
      "system": 0.8059766399999999,
      "min": 1.7345823302799999,
      "max": 1.77841899028,
      "times": [
        1.77841899028,
        1.76656082228,
        1.7681547742800001,
        1.76661375228,
        1.7345823302799999,
        1.74898163228,
        1.7569604762800002,
        1.74787950828,
        1.74539542128,
        1.7491417442800001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31923396567999995,
      "stddev": 0.010181050463092955,
      "median": 0.31948279327999995,
      "user": 0.23661159999999998,
      "system": 0.5411130399999999,
      "min": 0.29958372928,
      "max": 0.33312098828,
      "times": [
        0.31668705428,
        0.33083873028,
        0.33312098828,
        0.31926807428,
        0.29958372928,
        0.32078217527999997,
        0.31969751228,
        0.32901203128,
        0.31133083828,
        0.31201852328
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.32514752208,
      "stddev": 0.010362609083039775,
      "median": 0.32646893678,
      "user": 0.23621139999999996,
      "system": 0.54329694,
      "min": 0.31082671028,
      "max": 0.33869537428,
      "times": [
        0.32349901928,
        0.33045055928,
        0.33869537428,
        0.32080719128,
        0.33732291928,
        0.32943885427999997,
        0.31337651028,
        0.31309608128,
        0.31082671028,
        0.33396200128
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 211.4 ± 11.4 194.9 232.5 2.38 ± 0.14
pacquet@main 216.3 ± 15.5 185.1 235.6 2.43 ± 0.19
pnpr@HEAD 89.1 ± 2.9 85.2 97.2 1.00 ± 0.04
pnpr@main 88.8 ± 2.5 85.5 95.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21141617652285719,
      "stddev": 0.01140110805382304,
      "median": 0.20864997588000003,
      "user": 0.17045075714285715,
      "system": 0.058994579999999984,
      "min": 0.19486694738000002,
      "max": 0.23245925138000004,
      "times": [
        0.20904099738000004,
        0.23245925138000004,
        0.20224997038000003,
        0.21844463238000003,
        0.20088022038000003,
        0.22021431438000003,
        0.20230797838000003,
        0.21858475638000002,
        0.22546364838000002,
        0.19486694738000002,
        0.20825895438000003,
        0.19946566638000002,
        0.22245110638,
        0.20513802738000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.21625770653384618,
      "stddev": 0.015537432439989321,
      "median": 0.22046605938000002,
      "user": 0.17920416923076926,
      "system": 0.05787854153846154,
      "min": 0.18506723638000003,
      "max": 0.23562380038000003,
      "times": [
        0.22654256038000004,
        0.21575557038,
        0.22040812938,
        0.19519860238000003,
        0.18506723638000003,
        0.19159878338000003,
        0.22852372138000002,
        0.22046605938000002,
        0.21938958238000003,
        0.22365527338000002,
        0.23562380038000003,
        0.22591642138000004,
        0.22320444438000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08907082625096774,
      "stddev": 0.002851711999311545,
      "median": 0.08899589338,
      "user": 0.023227593548387094,
      "system": 0.008907305806451615,
      "min": 0.08518226338,
      "max": 0.09721054038,
      "times": [
        0.09089294538,
        0.09338806438,
        0.09179198838000001,
        0.09051865038000001,
        0.09125664038,
        0.09721054038,
        0.08787309038,
        0.08672972638,
        0.08703913838,
        0.09317745638000001,
        0.09198405038,
        0.09085486338,
        0.08518226338,
        0.08677407038,
        0.08991931238,
        0.09129654538,
        0.08601247638000001,
        0.08664835338,
        0.08722343538,
        0.08939837238000001,
        0.08533071238,
        0.09003248538,
        0.08982765938000001,
        0.08696406838000001,
        0.08716916438,
        0.08537597738000001,
        0.08867655138,
        0.08590097638000001,
        0.08899589338,
        0.09106690238000001,
        0.08668323938
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08881658731333332,
      "stddev": 0.0025153820732668843,
      "median": 0.08827235088,
      "user": 0.0229451,
      "system": 0.008928544000000002,
      "min": 0.08549907938000001,
      "max": 0.09504334038000001,
      "times": [
        0.09458752138,
        0.08969524138,
        0.09038242438,
        0.08821259838,
        0.08580185938,
        0.08716487638,
        0.08626753638000001,
        0.08833210338,
        0.08664444538,
        0.08817214338,
        0.08678118438,
        0.09504334038000001,
        0.08895193038,
        0.08985671438000001,
        0.08937427538,
        0.08662196438,
        0.08901880738000001,
        0.09177829238,
        0.08989744038,
        0.08549907938000001,
        0.09039849438,
        0.08943385738000001,
        0.09422271638,
        0.08994873838,
        0.08661935938,
        0.08710295838,
        0.08750453538,
        0.08640746038000001,
        0.08729035138,
        0.08748536938
      ]
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 831.3 ± 150.5 632.7 1112.1 1.00
pacquet@main 1108.8 ± 344.4 687.0 1723.9 1.33 ± 0.48
pnpm@HEAD 3255.9 ± 142.0 3088.4 3533.9 3.92 ± 0.73
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.8313027443644444,
      "stddev": 0.1505055948438005,
      "median": 0.7723050879200001,
      "user": 0.7993379422222222,
      "system": 0.1382078711111111,
      "min": 0.63266859392,
      "max": 1.11213320892,
      "times": [
        0.9084159299200001,
        1.11213320892,
        0.74312185692,
        0.89856110292,
        0.63266859392,
        0.76978216692,
        0.95879243392,
        0.7723050879200001,
        0.68594431792
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.1088262683644445,
      "stddev": 0.34437232755129343,
      "median": 1.02041207792,
      "user": 1.0837276088888887,
      "system": 0.20697853777777778,
      "min": 0.68696658192,
      "max": 1.72390375292,
      "times": [
        0.78499557192,
        1.72390375292,
        1.02041207792,
        0.86336927092,
        1.5066862329200001,
        0.68696658192,
        0.99022499892,
        1.32392759792,
        1.07895032992
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.2559074003644444,
      "stddev": 0.14200324458768612,
      "median": 3.26213628192,
      "user": 5.024686053333333,
      "system": 0.28327442666666663,
      "min": 3.0884227169200003,
      "max": 3.53391864192,
      "times": [
        3.53391864192,
        3.26213628192,
        3.2627772789200002,
        3.26638195592,
        3.15409034292,
        3.0884227169200003,
        3.11935773292,
        3.20475970792,
        3.41132194392
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.738 ± 0.088 4.616 4.877 1.30 ± 0.06
pacquet@main 4.737 ± 0.149 4.555 4.965 1.30 ± 0.07
pnpr@HEAD 3.728 ± 0.140 3.540 3.930 1.02 ± 0.06
pnpr@main 3.654 ± 0.150 3.500 3.909 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.73823455712,
      "stddev": 0.087970642027112,
      "median": 4.72180620852,
      "user": 2.71282038,
      "system": 1.9801827799999998,
      "min": 4.61646570352,
      "max": 4.87695467252,
      "times": [
        4.684921327520001,
        4.75869108952,
        4.61646570352,
        4.68430313152,
        4.76611367752,
        4.6644421865200005,
        4.87695467252,
        4.770529751520001,
        4.68336669652,
        4.87655733452
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.73725153392,
      "stddev": 0.14911980794437718,
      "median": 4.741821406520001,
      "user": 2.6350194799999995,
      "system": 1.95948298,
      "min": 4.5549163985200005,
      "max": 4.96532516152,
      "times": [
        4.60472656752,
        4.58214163652,
        4.720394740520001,
        4.96532516152,
        4.763248072520001,
        4.896790177520001,
        4.78918741952,
        4.59972295752,
        4.89606220752,
        4.5549163985200005
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.7276591814199995,
      "stddev": 0.14038149002387132,
      "median": 3.7356834455200003,
      "user": 1.76379958,
      "system": 1.6756497799999999,
      "min": 3.53996958952,
      "max": 3.93000845252,
      "times": [
        3.8356108515200003,
        3.7536443895200002,
        3.6161235135200003,
        3.6040787555200002,
        3.8484334325200003,
        3.93000845252,
        3.86743451252,
        3.53996958952,
        3.5635658155200005,
        3.7177225015200004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.65378777332,
      "stddev": 0.14951891186375973,
      "median": 3.5946430085200003,
      "user": 1.4734976799999997,
      "system": 1.42661198,
      "min": 3.49966398952,
      "max": 3.9086785175200003,
      "times": [
        3.6902594975200005,
        3.5395390675200002,
        3.9086785175200003,
        3.85461813652,
        3.5224774625200004,
        3.49966398952,
        3.62243656052,
        3.7924711355200005,
        3.5668494565200004,
        3.54088390952
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13773
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,593.20 ms
(-1.80%)Baseline: 2,640.65 ms
3,168.77 ms
(81.84%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,733.98 ms
(-1.80%)Baseline: 1,765.73 ms
2,118.88 ms
(81.83%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
431.90 ms
(-3.28%)Baseline: 446.56 ms
535.87 ms
(80.60%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
194.87 ms
(-10.62%)Baseline: 218.02 ms
261.62 ms
(74.48%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,371.79 ms
(-1.86%)Baseline: 2,416.63 ms
2,899.96 ms
(81.79%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,616.47 ms
(+1.85%)Baseline: 4,532.61 ms
5,439.14 ms
(84.87%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
225.74 ms
(-18.20%)Baseline: 275.97 ms
331.17 ms
(68.16%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
632.67 ms
(-11.37%)Baseline: 713.85 ms
856.62 ms
(73.86%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13773
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,440.22 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
299.58 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
338.60 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.18 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,381.64 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,539.97 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
258.68 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit e7e79d9 into pnpm:main Aug 10, 2026
40 checks passed
@welcome

welcome Bot commented Aug 10, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

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

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pacquet records raw project specifiers where the TypeScript CLI records pnpmfile-hooked ones

3 participants