Skip to content

fix(package-manager): stop verify-deps rejecting manifest edits beside a file: directory dependency - #17698

Merged
zkochan merged 3 commits into
pnpm:mainfrom
jahands:fix/verify-deps-file-directory-dep
Nov 4, 2026
Merged

zkochan merged 3 commits into
pnpm:mainfrom
jahands:fix/verify-deps-file-directory-dep

Conversation

@jahands

@jahands jahands commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With verify-deps-before-run, editing package.json in a project that has a file: directory dependency failed pnpm run / pnpm exec with "a linked package is out of date", even when no dependency changed. pnpm v11 lets the same edit pass.

The repeat-install content check treated a file: directory specifier as up to date only if the lockfile resolved it to link:. Such a dependency resolves to a file: copy. The check now treats that copy the way it already treats injected workspace projects: up to date, because the directory freshness check that runs first has already compared the directory's package.json with its lockfile snapshot. A real change to the directory's dependencies still fails the gate.

Fixes #17697

Proof: I reproduced the issue's steps against a binary built from main (single project and workspace --filter, both fail). With this change both pass, and a drifted lib dependency still fails. The new e2e test fails without the fix.

Squash Commit Body

When a project manifest's content changed since the last install, the
repeat-install content check called `linked_dep_is_up_to_date`, which
treated a `file:` directory specifier as up to date only if the lockfile
resolved it to `link:`. A `file:` directory dependency resolves to a
`file:` copy, so every content edit to such a project failed
`verify-deps-before-run` with "a linked package is out of date".

The `File` branch that injected workspace projects already take now runs
first. `check_importer_satisfies` has already compared the directory's
manifest with its lockfile snapshot by then, as v11's
`localDirectoryDepIsUpToDate` does. A drifted directory now reports "a
modified manifest is no longer satisfied by the lockfile", the same
message injected workspace copies report.

pnpm v11 is not affected.

Fixes https://github.com/pnpm/pnpm/issues/17697

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • 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.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved


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


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Improved dependency verification for local file: directory dependencies. Editing unrelated package manifest entries no longer causes verification to fail when the local dependency is unchanged.
    • Changes to a local dependency’s manifest are still detected and reported as verification errors.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: pnpm/pnpm
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 9d24a76
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96fb9597-fd3b-41f4-9b64-152b28baa260
Commits

Reviewing files that changed from the base of the PR and between e252487 and 4c0071b.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The dependency freshness check now accepts resolved file: dependencies before evaluating local-directory declarations. A Unix E2E test covers an unrelated project manifest edit with an unchanged local directory and verifies rejection after the local directory manifest changes.

Changes: File dependency verification

Layer / File(s) Summary
File dependency freshness check
pnpm/crates/package-manager/src/optimistic_repeat_install/manifest_agreement.rs, pnpm/crates/cli/tests/suite/verify_deps_before_run.rs, .changeset/17697-verify-deps-file-directory.md
The check accepts resolved file: dependencies. The E2E test verifies that an unrelated project manifest edit passes when the local directory is unchanged, and that changing the local directory manifest triggers the verify-deps error. A patch changeset records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
Allow pnpm exec after a project manifest edit that does not change a file: directory dependency [#17697] ✅
Reject verification when the local directory manifest changes [#17697] ✅

Suggested labels: product: pacquet

Merge Risk: Low · previous review e2524

Merge Risk: 🔵 Low · up to e2524

A script using a newly added local command may fail until dependencies are reinstalled. This is a bounded risk rather than a merge blocker.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: pnpm/pnpm
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 37ade57
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3211e529-1c2e-4f08-ba7b-dfc4ae71fcac
Commits

Reviewing files that changed from the base of the PR and between 37ade57 and 4e26d02.

Files selected for processing: 3
  • .changeset/17697-verify-deps-file-directory.md
  • pnpm/crates/cli/tests/suite/verify_deps_before_run.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install/manifest_agreement.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@jahands
jahands marked this pull request as ready for review November 4, 2026 16:18
@jahands
jahands requested a review from zkochan as a code owner November 4, 2026 16:18
Copilot AI balanced review requested due to automatic review settings November 4, 2026 16:18
@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 →

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; directory dependency changes still fail verification.

Reviews (4) · Last reviewed commit: "chore: retrigger CI after the pnpm/tasks..." · Reviewed by Greptile

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.

🟢 Approval recommended

No active review issues remain for the fix allowing unrelated manifest edits with file: directory dependencies.

No open issues 🎉

What changed in this PR

Fixes the Rust CLI’s verify-deps-before-run check rejecting unrelated package.json edits when a project has a file: directory dependency, addressing #17697.

Changes:

  • Accepts file: copies after the existing directory freshness check validates them.
  • Adds regression coverage for an unrelated manifest edit passing and changed directory dependencies failing.
  • Adds a patch release note.

No actionable findings remain. Tests were not run during this review.

File Description
pnpm/​crates/​package-manager/​src/​optimistic_repeat_install/​manifest_agreement.rs Checks file: copies before local-link handling and updates comments.
pnpm/​crates/​cli/​tests/​suite/​verify_deps_before_run.rs Tests acceptance of unrelated edits and rejection of dependency drift.
.changeset/​17697-verify-deps-file-directory.md Documents the verification fix for users.

Review effort: Balanced

@codecov-commenter

codecov-commenter commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.93%. Comparing base (9d24a76) to head (4c0071b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17698   +/-   ##
=======================================
  Coverage   92.92%   92.93%           
=======================================
  Files        2099     2099           
  Lines      270642   270642           
=======================================
+ Hits       251498   251508   +10     
+ Misses      19144    19134   -10     

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

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

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2377.26 ms 2500.79 ms 5.2% 118.86 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store pnpr 1417.41 ms 1394.64 ms -1.6% 70.87 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 428.37 ms 505.98 ms 18.1% 21.42 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pnpr 427.48 ms 413.97 ms -3.2% 21.37 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 15.88 ms 16.33 ms 2.8% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 16.52 ms 15.56 ms -5.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 12.10 ms 13.17 ms 8.9% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 19.48 ms 12.54 ms -35.6% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2596.31 ms 2758.01 ms 6.2% 129.82 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-cold-store pnpr 1575.83 ms 1565.59 ms -0.6% 78.79 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 567.17 ms 540.93 ms -4.6% 28.36 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 344.18 ms 355.76 ms 3.4% 17.21 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1862.39 ms 2015.13 ms 8.2% 93.12 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-hot-store pnpr 341.39 ms 315.56 ms -7.6% 17.07 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 305.53 ms 299.65 ms -1.9% 15.28 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 128.21 ms 105.28 ms -17.9% 6.41 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 197.84 ms 196.59 ms -0.6% 9.89 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 124.79 ms 119.80 ms -4.0% 6.24 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 122.22 ms 122.17 ms -0.0% 6.11 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4528.32 ms 4484.07 ms -1.0% 226.42 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3593.03 ms 3669.12 ms 2.1% 179.65 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 235.07 ms 201.32 ms -14.4% 11.75 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 201.11 ms 210.12 ms 4.5% 10.06 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1312.55 ms 1366.44 ms 4.1% 65.63 ms Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet 54.68 ms 54.46 ms -0.4% 2.73 ms Within tolerance

Same-run syscall check

Each install runs 2 more times per revision, untimed, under strace --follow-forks --summary-only. A file syscall regresses when HEAD's fewest calls exceed main's most by more than 2% of main or 50 calls, whichever is larger. mkdir and mkdirat count only the calls that created a directory, since concurrent installs fail a varying number with EEXIST. A syscall whose identical runs differ by more than that tolerance is reported unstable and not gated, unless HEAD's fewest calls also exceed main's most by more than the tolerance plus that difference. Each scenario lists its largest change relative to its tolerance and every row that is not within tolerance.

Scenario Engine Syscall main calls (max) HEAD calls (min) Change Tolerance Identical-run spread Result
isolated-fresh-restore-cold-cache-cold-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet readlink 16491 16445 -0.3% 329 456 Unstable (identical runs differ by 456, not gated)
isolated-fresh-install-cold-cache-cold-store pnpr ioctl 11 12 +9.1% 50 7 Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet openat 15644 15650 +0.0% 312 4 Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet openat 18268 17757 -2.8% 365 483 Unstable (identical runs differ by 483, not gated)
isolated-fresh-install-cold-cache-hot-store pnpr statx 48996 48998 +0.0% 979 8 Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet readlink 15330 15334 +0.0% 306 52 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr symlink 3889 3893 +0.1% 77 1 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet newfstatat 203 207 +2.0% 50 10 Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet access 22 22 +0.0% 50 0 Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 4c0071bb381a

Compared against main at: 9d24a764270f

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.456 ± 0.130 2.243 2.609 1.72 ± 0.16
pacquet@main 2.400 ± 0.130 2.259 2.598 1.68 ± 0.15
pnpr@HEAD 1.430 ± 0.105 1.305 1.653 1.00
pnpr@main 1.463 ± 0.124 1.331 1.673 1.02 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.45565130612,
      "stddev": 0.1300939332488557,
      "median": 2.5007868923200003,
      "user": 2.00686478,
      "system": 1.44478322,
      "min": 2.24268242182,
      "max": 2.60853911282
    },
    {
      "command": "pacquet@main",
      "mean": 2.3997007173200005,
      "stddev": 0.13033602337316566,
      "median": 2.37725937082,
      "user": 1.9177736800000003,
      "system": 1.4717464199999999,
      "min": 2.25932014982,
      "max": 2.59784724482
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.43003392532,
      "stddev": 0.10467581285495932,
      "median": 1.39464022232,
      "user": 1.8287912799999997,
      "system": 1.46644142,
      "min": 1.30452540782,
      "max": 1.65316605582
    },
    {
      "command": "pnpr@main",
      "mean": 1.4630773914200002,
      "stddev": 0.12350893326883658,
      "median": 1.4174081573200001,
      "user": 1.7692400799999999,
      "system": 1.40217262,
      "min": 1.33069537782,
      "max": 1.67298274582
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 481.4 ± 69.8 374.8 556.6 1.14 ± 0.21
pacquet@main 423.4 ± 59.6 341.3 514.9 1.00 ± 0.18
pnpr@HEAD 425.1 ± 58.4 373.1 566.8 1.01 ± 0.18
pnpr@main 422.8 ± 48.0 345.7 505.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.48143289688,
      "stddev": 0.06984012626840101,
      "median": 0.50597622538,
      "user": 0.57826704,
      "system": 0.9554923199999997,
      "min": 0.37482447138,
      "max": 0.55655678938
    },
    {
      "command": "pacquet@main",
      "mean": 0.42340195428000005,
      "stddev": 0.05963499231310591,
      "median": 0.42837082788,
      "user": 0.5153781399999999,
      "system": 0.88429092,
      "min": 0.34134189938000004,
      "max": 0.51490589138
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.42507384338000015,
      "stddev": 0.05837103528699361,
      "median": 0.41397112838000005,
      "user": 0.47285984000000003,
      "system": 0.89940842,
      "min": 0.37310495338000005,
      "max": 0.56675615738
    },
    {
      "command": "pnpr@main",
      "mean": 0.4227949647800001,
      "stddev": 0.047991969286021285,
      "median": 0.42748169388,
      "user": 0.4724715399999999,
      "system": 0.8609592199999998,
      "min": 0.34566827138000006,
      "max": 0.50551370738
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 16.8 ± 4.5 10.1 33.2 1.05 ± 0.33
pacquet@main 16.6 ± 2.6 12.2 23.9 1.04 ± 0.24
pnpr@HEAD 15.9 ± 2.6 11.6 23.6 1.00
pnpr@main 16.6 ± 1.7 12.4 25.3 1.04 ± 0.20
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.016763121602111807,
      "stddev": 0.004519029768923668,
      "median": 0.01632856154,
      "user": 0.010017573913043473,
      "system": 0.008148837018633538,
      "min": 0.01013951054,
      "max": 0.03320678954
    },
    {
      "command": "pacquet@main",
      "mean": 0.016575707442439025,
      "stddev": 0.0026339277869665578,
      "median": 0.01588112054,
      "user": 0.009333895934959351,
      "system": 0.008717383739837398,
      "min": 0.012218293540000001,
      "max": 0.023896490540000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.015910140332899402,
      "stddev": 0.0026064247294707845,
      "median": 0.015558251540000002,
      "user": 0.008359601183431957,
      "system": 0.008947980118343194,
      "min": 0.011557619540000001,
      "max": 0.02362734454
    },
    {
      "command": "pnpr@main",
      "mean": 0.016553926528235292,
      "stddev": 0.0016774464543182102,
      "median": 0.016522783040000003,
      "user": 0.009325129411764705,
      "system": 0.008673440235294115,
      "min": 0.012370199540000001,
      "max": 0.025265177540000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 13.4 ± 2.3 9.0 23.0 1.08 ± 0.23
pacquet@main 12.4 ± 1.6 9.4 17.2 1.00
pnpr@HEAD 12.7 ± 2.0 8.8 20.0 1.03 ± 0.21
pnpr@main 19.0 ± 4.0 10.3 29.4 1.53 ± 0.38
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.01338425553319149,
      "stddev": 0.0022700310871880463,
      "median": 0.01317233398,
      "user": 0.007224210212765955,
      "system": 0.007302377659574473,
      "min": 0.00899456398,
      "max": 0.02297074098
    },
    {
      "command": "pacquet@main",
      "mean": 0.012372493484098364,
      "stddev": 0.0016248679227866998,
      "median": 0.01209626198,
      "user": 0.007452646557377051,
      "system": 0.006071119344262295,
      "min": 0.00941226098,
      "max": 0.01716294998
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.012696399364955748,
      "stddev": 0.0020214717327950954,
      "median": 0.01254489248,
      "user": 0.007691159469026543,
      "system": 0.006095514690265482,
      "min": 0.00876736598,
      "max": 0.02003570198
    },
    {
      "command": "pnpr@main",
      "mean": 0.018958085007173907,
      "stddev": 0.004010213883978073,
      "median": 0.01947574698,
      "user": 0.010735398695652175,
      "system": 0.009528862608695654,
      "min": 0.01030393098,
      "max": 0.029443322980000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.760 ± 0.143 2.570 2.942 1.77 ± 0.16
pacquet@main 2.618 ± 0.079 2.516 2.787 1.67 ± 0.13
pnpr@HEAD 1.594 ± 0.089 1.455 1.765 1.02 ± 0.09
pnpr@main 1.563 ± 0.112 1.419 1.803 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.76005095022,
      "stddev": 0.1425596452955755,
      "median": 2.75800859852,
      "user": 3.2298350199999994,
      "system": 2.01625444,
      "min": 2.5701397830199997,
      "max": 2.94178991902
    },
    {
      "command": "pacquet@main",
      "mean": 2.6178973709199993,
      "stddev": 0.07866469699813941,
      "median": 2.59630624152,
      "user": 2.71981052,
      "system": 1.74683934,
      "min": 2.51569015502,
      "max": 2.78676925102
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.59396195822,
      "stddev": 0.08859686828990848,
      "median": 1.56558603402,
      "user": 1.9049023199999997,
      "system": 1.5077126399999998,
      "min": 1.45544384802,
      "max": 1.7651654820200002
    },
    {
      "command": "pnpr@main",
      "mean": 1.5630593938200001,
      "stddev": 0.11226672310338212,
      "median": 1.5758270740200002,
      "user": 2.0986341199999994,
      "system": 1.6239652399999998,
      "min": 1.41896669302,
      "max": 1.8029302100200002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 535.5 ± 17.8 509.3 562.2 1.54 ± 0.11
pacquet@main 561.4 ± 43.5 486.7 627.9 1.61 ± 0.16
pnpr@HEAD 355.9 ± 27.7 326.6 420.2 1.02 ± 0.10
pnpr@main 348.0 ± 22.5 325.5 394.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5354947678799999,
      "stddev": 0.017808606033941927,
      "median": 0.5409283925799999,
      "user": 0.8035550400000002,
      "system": 0.94282086,
      "min": 0.50927250858,
      "max": 0.56215830758
    },
    {
      "command": "pacquet@main",
      "mean": 0.56139334628,
      "stddev": 0.043514331592601575,
      "median": 0.5671663125799999,
      "user": 0.8563298399999999,
      "system": 1.0539113599999999,
      "min": 0.48667960758,
      "max": 0.62794575958
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.35592238128000003,
      "stddev": 0.0276631825120367,
      "median": 0.35576391608,
      "user": 0.35196843999999994,
      "system": 0.7050432599999998,
      "min": 0.32655050858,
      "max": 0.42015110558
    },
    {
      "command": "pnpr@main",
      "mean": 0.34802037488,
      "stddev": 0.02251039045362927,
      "median": 0.34418499108,
      "user": 0.34323213999999996,
      "system": 0.6604949600000001,
      "min": 0.32553425058,
      "max": 0.39438975258000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.026 ± 0.089 1.903 2.187 6.42 ± 0.46
pacquet@main 1.852 ± 0.089 1.705 1.983 5.87 ± 0.44
pnpr@HEAD 0.316 ± 0.018 0.293 0.348 1.00
pnpr@main 0.369 ± 0.067 0.319 0.539 1.17 ± 0.22
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.0263798129999997,
      "stddev": 0.08866888779590529,
      "median": 2.015126243,
      "user": 1.55000156,
      "system": 1.4378632999999998,
      "min": 1.9033232150000001,
      "max": 2.1866909760000004
    },
    {
      "command": "pacquet@main",
      "mean": 1.8519795085000001,
      "stddev": 0.0888331191409671,
      "median": 1.8623897255,
      "user": 1.33954416,
      "system": 1.2493459999999998,
      "min": 1.705067002,
      "max": 1.9832245370000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3157236615,
      "stddev": 0.018043679837962272,
      "median": 0.31555768,
      "user": 0.30882926,
      "system": 0.6149392,
      "min": 0.29317156800000005,
      "max": 0.34768366900000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.3686947071999999,
      "stddev": 0.06702199113971347,
      "median": 0.3413918735,
      "user": 0.37566816,
      "system": 0.7142967999999998,
      "min": 0.31902072400000003,
      "max": 0.539258335
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 320.4 ± 49.4 263.4 394.4 3.01 ± 0.51
pacquet@main 302.9 ± 24.1 268.9 338.7 2.85 ± 0.31
pnpr@HEAD 106.3 ± 7.6 96.1 131.2 1.00
pnpr@main 128.0 ± 7.6 117.0 142.3 1.20 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.32041566522000003,
      "stddev": 0.049368681648544105,
      "median": 0.29965085712,
      "user": 0.31249102000000006,
      "system": 0.27672624,
      "min": 0.26337154162000004,
      "max": 0.39440038662000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.30294928432,
      "stddev": 0.024117840378306988,
      "median": 0.30552676562000003,
      "user": 0.31204761999999997,
      "system": 0.24055224000000003,
      "min": 0.26889197462000003,
      "max": 0.33874529262
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10633355204857142,
      "stddev": 0.007622631610569305,
      "median": 0.10528382712,
      "user": 0.047100862857142864,
      "system": 0.024502575714285716,
      "min": 0.09612083162,
      "max": 0.13120280962
    },
    {
      "command": "pnpr@main",
      "mean": 0.12804366162,
      "stddev": 0.007627331584214919,
      "median": 0.12821308962,
      "user": 0.06291462,
      "system": 0.037409239999999996,
      "min": 0.11702195562,
      "max": 0.14229370362000002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 198.1 ± 4.0 194.2 205.8 1.01 ± 0.04
pacquet@main 197.0 ± 6.4 189.0 208.0 1.00
pnpm@HEAD 3494.4 ± 121.8 3414.1 3808.6 17.74 ± 0.84
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19811147768222226,
      "stddev": 0.003980409681254615,
      "median": 0.19658848346000002,
      "user": 0.22893996888888887,
      "system": 0.04979792,
      "min": 0.19424839246000003,
      "max": 0.20580599446000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.1970009060155556,
      "stddev": 0.006362822878770499,
      "median": 0.19784326146000003,
      "user": 0.22125641333333335,
      "system": 0.05612280888888889,
      "min": 0.18896299446,
      "max": 0.20795111646000003
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.494403241682222,
      "stddev": 0.12181940359283223,
      "median": 3.44520357246,
      "user": 5.294718635555555,
      "system": 0.3455643644444444,
      "min": 3.41410121146,
      "max": 3.80860493746
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 121.9 ± 8.8 109.0 137.1 1.00
pacquet@main 122.7 ± 12.5 100.8 141.7 1.01 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12185133520761905,
      "stddev": 0.008793841889944821,
      "median": 0.11980034616,
      "user": 0.10246553999999998,
      "system": 0.06869571904761904,
      "min": 0.10903952316,
      "max": 0.13708977216
    },
    {
      "command": "pacquet@main",
      "mean": 0.12273333196,
      "stddev": 0.012510162542868271,
      "median": 0.12479206816000002,
      "user": 0.11306183999999997,
      "system": 0.06100175000000001,
      "min": 0.10078459016,
      "max": 0.14171379416000002
    }
  ]
}

Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 125.6 ± 9.0 109.9 142.9 1.03 ± 0.12
pacquet@main 122.5 ± 10.9 105.0 155.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12564380410956524,
      "stddev": 0.008967666707577471,
      "median": 0.12216595424000001,
      "user": 0.047865559999999995,
      "system": 0.08796330260869566,
      "min": 0.10989901124000001,
      "max": 0.14292416124
    },
    {
      "command": "pacquet@main",
      "mean": 0.12245763544,
      "stddev": 0.010911766103557046,
      "median": 0.12222028424,
      "user": 0.04566092,
      "system": 0.08670388,
      "min": 0.10504595024000002,
      "max": 0.15538288424000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.580 ± 0.198 4.391 4.894 1.27 ± 0.07
pacquet@main 4.537 ± 0.113 4.404 4.698 1.26 ± 0.05
pnpr@HEAD 3.654 ± 0.114 3.489 3.846 1.01 ± 0.04
pnpr@main 3.611 ± 0.100 3.477 3.750 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.579668418899999,
      "stddev": 0.19815929368127108,
      "median": 4.484070329,
      "user": 2.3392859599999998,
      "system": 1.63268454,
      "min": 4.391237832,
      "max": 4.894268329
    },
    {
      "command": "pacquet@main",
      "mean": 4.5374925815000005,
      "stddev": 0.11339917683151096,
      "median": 4.5283230815,
      "user": 2.29610236,
      "system": 1.6205144400000002,
      "min": 4.40386541,
      "max": 4.69798136
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.654166978,
      "stddev": 0.11405096552280715,
      "median": 3.6691169425,
      "user": 2.2987110599999996,
      "system": 1.57322964,
      "min": 3.488540706,
      "max": 3.8464253540000004
    },
    {
      "command": "pnpr@main",
      "mean": 3.6105160532,
      "stddev": 0.0995918128162258,
      "median": 3.5930288185000006,
      "user": 2.15217656,
      "system": 1.58656754,
      "min": 3.476684182,
      "max": 3.7503155770000003
    }
  ]
}

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

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 202.5 ± 25.6 163.1 247.3 1.00
pacquet@main 255.8 ± 45.9 219.9 380.4 1.26 ± 0.28
pnpr@HEAD 213.7 ± 28.2 182.3 259.0 1.05 ± 0.19
pnpr@main 206.2 ± 20.2 184.8 263.8 1.02 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20254499428,
      "stddev": 0.025625673826735113,
      "median": 0.20132278048000002,
      "user": 0.26877516666666673,
      "system": 0.20983922666666663,
      "min": 0.16305163148000001,
      "max": 0.24726485148000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.25577940302545454,
      "stddev": 0.04586672270869393,
      "median": 0.23507020048000002,
      "user": 0.3379134090909091,
      "system": 0.23113083272727267,
      "min": 0.21986780948,
      "max": 0.38041798248
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.21367474358000002,
      "stddev": 0.02821110140335146,
      "median": 0.21011606848000003,
      "user": 0.26515449999999996,
      "system": 0.20943936000000002,
      "min": 0.18230166548,
      "max": 0.25903980348000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.20622748863384616,
      "stddev": 0.02022035843569504,
      "median": 0.20111375748000002,
      "user": 0.25630065384615386,
      "system": 0.19514709846153847,
      "min": 0.18481548548,
      "max": 0.26380056048000006
    }
  ]
}

Scenario: Store only: unlocked direct deps, cold cache + hot store

Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.376 ± 0.050 1.292 1.449 1.02 ± 0.08
pacquet@main 1.347 ± 0.097 1.259 1.512 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.37556065632,
      "stddev": 0.050300022907936164,
      "median": 1.36644162652,
      "user": 0.7531004799999999,
      "system": 0.32476469999999996,
      "min": 1.2921424320200001,
      "max": 1.44860702902
    },
    {
      "command": "pacquet@main",
      "mean": 1.34670217462,
      "stddev": 0.09718293355864167,
      "median": 1.3125530915199999,
      "user": 0.7205830799999998,
      "system": 0.30964310000000006,
      "min": 1.25926898202,
      "max": 1.5123973480200001
    }
  ]
}

Scenario: Cargo: repeat install, hot cache + hot store

Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 57.2 ± 13.0 39.3 93.8 1.02 ± 0.28
pacquet@main 55.8 ± 8.0 42.2 80.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.05716391668827587,
      "stddev": 0.01303718670688986,
      "median": 0.05445576424,
      "user": 0.038928768965517245,
      "system": 0.03640326137931036,
      "min": 0.03933560374,
      "max": 0.09380867474000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.05583024508482758,
      "stddev": 0.00804318874903181,
      "median": 0.054682045740000004,
      "user": 0.03908888965517241,
      "system": 0.03428503724137932,
      "min": 0.042228429740000004,
      "max": 0.08023783174000002
    }
  ]
}

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Nov 4, 2026
…linked check

When a project manifest's content changed since the last install, the
repeat-install content check called `linked_dep_is_up_to_date`, which
treated a `file:` directory specifier as up to date only if the lockfile
resolved it to `link:`. A `file:` directory dependency resolves to a
`file:` copy, so every content edit to such a project failed
`verify-deps-before-run` with "a linked package is out of date".

The `File` branch that injected workspace projects already take now runs
first. `check_importer_satisfies` has already compared the directory's
manifest with its lockfile snapshot by then, as v11's
`localDirectoryDepIsUpToDate` does.

Fixes pnpm#17697
@zkochan
zkochan force-pushed the fix/verify-deps-file-directory-dep branch from e252487 to 4c0071b Compare November 4, 2026 18:49
Copilot AI balanced review requested due to automatic review settings November 4, 2026 18:49
@qodo-code-review

qodo-code-review Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Auto-approved notes - no code review findings
- 'auto_approve_for_no_suggestions' flag enabled

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.

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.

🟢 Approval recommended

No active review issues were identified in the dependency-verification change.

No open issues 🎉

Review effort: Balanced

@zkochan
zkochan merged commit 34e09e9 into pnpm:main Nov 4, 2026
79 of 82 checks passed
@welcome

welcome Bot commented Nov 4, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

zkochan added a commit that referenced this pull request Nov 4, 2026
…est, and generate the oracle's edit axes from the read set (#17702)

The repeat-install oracle's edit axes now come from the input list the
read-set test checks. `repeat_install_oracle::Input` names each kind of
file a full install reads in the workspace outside `node_modules`. The
read-set test sorts every file it observes into one kind and requires
every kind to be observed. The oracle matrix has a test per kind that
runs its edit scenario, and a match over the kinds fails to compile when
one has no test, so a new kind of install input needs an oracle axis.

The local-directory axis found that `verifyDepsBeforeRun` let a command
run after a dependency was added to a `file:` directory dependency's
manifest, in both CLIs. The run gate lets local file dependencies
through and skips every project the last validation proved installed,
and no validation records a local directory's manifest. When the state
records a local directory that is no workspace project, the gate now
holds the proven projects too, so the content check compares the
directory's manifest with its lockfile snapshot. v12's content check
now reads that manifest through the resolver's hooks, as the frozen
install's check does, so a `readPackage` hook or `packageExtensions`
entry that changes it does not fail the gate.

v12's `linked_dep_is_up_to_date` matched a `file:` specifier before the
`file:` copy branch and reported every such dependency out of date. The
copy branch now runs first, as in #17698.

Part of pnpm/tasks#254.
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 state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v12: verifyDepsBeforeRun reports a file: directory dependency as out of date after any package.json edit (regression from v11)

4 participants