Skip to content

fix(deps-resolver): record an injected workspace dependency as it resolves - #17075

Merged
zkochan merged 1 commit into
mainfrom
fix-injected-peer-provider
Oct 18, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-injected-peer-provider

Conversation

@zkochan

@zkochan zkochan commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #17057. Bug in both v11 and v12; both are fixed here.

A plain install kept a workspace dependency's previously recorded link: whenever the run did not target it. That held even when the injected copy now binds a peer the linked project does not provide. So after a consumer started providing that peer, the importer kept pointing at the project directory, where the peer is missing, while a fresh install records the injected copy.

That guard came from #10433 (#13112, gated in #13755). The PRs describe its flips as spurious, with two causes:

What the guard does today

I disabled it in each stack and ran the #10433 scenarios:

Scenario Guard on Guard off Fresh install
#10433: pnpm update [email protected] --recursive (v11 test; same scenario run against v12) link: link: —
Consumer adds a foo that diverges from the ancestor's (v11 test) link: file:n(@pnpm.e2e/[email protected]) file:n(@pnpm.e2e/[email protected])
#17057 (peer convergence harness) stale link: converges converges

Dedupe alone now keeps #10433's case linked. The guard's only remaining effect was that an incremental install disagrees with a fresh one.

Change

The guard is removed in both stacks, together with the inputs only it consumed:

  • v12: preserved_link_version and PreservedLinkLookup; LockfileImporterReuse and its previous_importers / update-scope plumbing; the install path's guard_* fields (ResolutionReuseGuard becomes ResolutionReuse).
  • v11: the preserve-prior-link branch in updateLockfileImporters.ts, with its previous-ref and targeted-alias bookkeeping.

The importer entry now follows the dedupe pass, which is the rule docs/workspaces.md already describes: symlinked "unless multiple dependency graphs are required due to mismatched peer dependencies".

User-visible effect: when a consumer starts providing a peer, at a version the injected package's own workspace context lacks, the next install turns that package's link: into the copy a fresh install writes.

Tests

  • v11: the ancestor-divergence test now expects the copy. The winston update test is unchanged and still passes.
  • v12: new CLI test injected_workspace_dep_turns_into_a_copy_when_its_peer_diverges checks that an incremental install records the same copy as a fresh one. Unit tests that asserted when the guard fires are removed.
  • Harness: the A workspace package stays linked after its peer provider is added under injectWorkspacePackages #17057 divergence entry is gone. Two rows still differ because of Editing one project moves another project's auto-installed peer to a lower version #17058: lib's auto-installed foo moves, and the injected entries follow that pick. Its divergence entry now owns those paths.
  • Locally: the v12 resolver, package-manager and CLI injection / dedupe / peer / deploy / update suites (2923 tests), clippy, and the v11 deps-resolver tests (228). The deps-installer suite passes (1332) except for three catalogs.ts tests. Those fail only alongside the rest of the suite, because other files set @pnpm.e2e/bar's latest dist-tag concurrently, and catalogs.ts passes on its own (63).

Squash Commit Body

fix(deps-resolver): record an injected workspace dependency as it resolves

A plain install kept a workspace dependency's previously recorded
`link:` whenever the run did not target it, even when the injected copy
now binds a peer the linked project does not provide. The guard was
added for pnpm/pnpm#10433, whose flips came from two spurious
mismatches: a same-version peer-suffix decoration, which the dedupe
pass now absorbs (pnpm/pnpm#12800), and re-resolution paths the dedupe
pass did not reach. With the guard off, the update scenario from
pnpm/pnpm#10433 keeps its `link:` in both stacks, so dedupe alone now
covers it. The guard's only remaining effect was that an incremental
install recorded a stale `link:` that a fresh install does not, which
left the injected package unable to find the peer its consumer provides.

The guard and the inputs only it consumed are removed in both stacks:
v12's `preserved_link_version`, `LockfileImporterReuse` and the
install path's `guard_*` fields, and v11's preserve-prior-link branch
with its previous-ref and targeted-alias bookkeeping. The importer entry
now follows the dedupe pass, which the workspaces docs already describe.

The v11 ancestor-divergence test now expects the injected copy, a new
v12 CLI test checks that an incremental install records the copy a
fresh one does, and the peer convergence harness drops this divergence.
The two rows still differing there come from pnpm/pnpm#17058's moved
auto-installed peer, whose divergence now owns the injected entries
that follow from it.

Closes pnpm/pnpm#17057

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.

🤖 Generated with Claude Code


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


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

Summary by CodeRabbit

  • Bug Fixes
    • Injected workspace packages now resolve as copies when their consumers use peer dependency versions that differ from the versions available in the package’s workspace context. Lockfile results are consistent between incremental and fresh installs.
    • Injected packages remain linked when the consumer and package resolve the peer dependency to the same version.

…olves

A plain install kept a workspace dependency's previously recorded
`link:` whenever the run did not target it, even when the injected copy
now binds a peer the linked project does not provide. The guard was
added for #10433, whose flips came from two spurious
mismatches: a same-version peer-suffix decoration, which the dedupe
pass now absorbs (#12800), and re-resolution paths the dedupe
pass did not reach. With the guard off, the update scenario from
#10433 keeps its `link:` in both stacks, so dedupe alone now
covers it. The guard's only remaining effect was that an incremental
install recorded a stale `link:` that a fresh install does not, which
left the injected package unable to find the peer its consumer provides.

The guard and the inputs only it consumed are removed in both stacks:
v12's `preserved_link_version`, `LockfileImporterReuse` and the
install path's `guard_*` fields, and v11's preserve-prior-link branch
with its previous-ref and targeted-alias bookkeeping. The importer entry
now follows the dedupe pass, which the workspaces docs already describe.

The v11 ancestor-divergence test now expects the injected copy, a new
v12 CLI test checks that an incremental install records the copy a
fresh one does, and the peer convergence harness drops this divergence.
The two rows still differing there come from #17058's moved
auto-installed peer, whose divergence now owns the injected entries
that follow from it.

Closes #17057

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f48a8a7b-b7ae-4576-bbb2-81a5a7618910
📥 Commits

Reviewing files that changed from the base of the PR and between 07ab9fa and 74b1a79.

📒 Files selected for processing: 17
  • .changeset/injected-link-follows-peers.md
  • pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs
  • pnpm/crates/cli/tests/suite/peer_convergence.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/importers.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/catalogs.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/importer_records.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/lockfile.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/runtimes.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/workspace_injection.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/lockfile_build.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolution.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolution/completion.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolution_inputs.rs
  • pnpm11/installing/deps-installer/test/install/injectWorkspacePackagesPersistence.test.ts
  • pnpm11/installing/deps-resolver/src/updateLockfileImporters.ts
💤 Files with no reviewable changes: 2
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolution_inputs.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/lockfile_build.rs

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

📝 Walkthrough

The PR removes prior-link preservation from Rust and pnpm v11 importer generation. When peer resolution produces a divergent injected package, the importer records the resolved file: reference. Regression tests and a patch changeset are updated.

Changes: Injected workspace peer resolution

Layer / File(s) Summary
Rust lockfile generation
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile*, pnpm/crates/package-manager/src/install_with_fresh_lockfile/*
Rust lockfile generation no longer uses prior importer snapshots or update-reuse scopes to preserve link: references over resolved file: references.
pnpm v11 importer generation
pnpm11/installing/deps-resolver/src/updateLockfileImporters.ts
Direct dependency references are derived from the resolved dependency path, alias, and package name, without retaining a previous link: reference.
Regression coverage and release note
pnpm/crates/cli/tests/suite/*, pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/*, pnpm11/installing/deps-installer/test/install/injectWorkspacePackagesPersistence.test.ts, .changeset/injected-link-follows-peers.md
Tests cover divergent peer contexts and expect the resolved file: reference. The changeset records patch releases for three packages.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
Issue #17057: After a project adds a peer provider, the injected workspace package uses the peer-bound injected reference instead of remaining linked. ✅

Possibly related PRs

  • pnpm/pnpm#13112: Added the prior-link preservation guard in the same Rust and v11 importer paths that this PR changes.

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

Suggested reviewers: ksxgithub

Merge Risk: ⚪ Minimal · up to 74b1a

Injected workspace dependencies now follow peer resolution as a fresh install would, which fixes the stale link behavior. The change is covered by updated regression tests and is ready to merge.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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

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

@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.05     12.1±0.05ms    30.9 MB/sec    1.00     11.5±0.09ms    32.5 MB/sec
packument/parse                                  1.00     41.4±0.21µs  1603.3 MB/sec    1.01     41.6±0.09µs  1595.0 MB/sec
tarball/download_dependency                      1.00   738.7±78.13µs     5.7 MB/sec    4.40      3.2±0.10ms  1335.1 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    180.1±3.43ms 88.8 KElem/sec    1.02    183.0±2.16ms 87.4 KElem/sec
version_pick/repeated_ranges_file                1.00      4.1±0.04ms  7.6 KElem/sec    1.00      4.1±0.03ms  7.6 KElem/sec
version_pick/repeated_ranges_raw                 1.00      4.3±0.04ms  7.3 KElem/sec    1.00      4.3±0.03ms  7.3 KElem/sec
workspace_resolution/hoist_heavy                 1.02    209.1±1.06ms        ? ?/sec    1.00    205.5±0.64ms        ? ?/sec
workspace_sort/chained_projects                  1.06     14.3±0.82ms        ? ?/sec    1.00     13.5±1.25ms        ? ?/sec

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.57%. Comparing base (7151c3e) to head (74b1a79).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main   #17075     +/-   ##
=========================================
  Coverage   92.56%   92.57%             
=========================================
  Files        1788     1803     +15     
  Lines      229505   230903   +1398     
=========================================
+ Hits       212447   213762   +1315     
- Misses      17058    17141     +83     

☔ 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

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 2413.68 ms 2333.21 ms -3.3% 120.68 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1393.52 ms 1434.97 ms 3.0% 69.68 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 466.25 ms 299.53 ms -35.8% 23.31 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 310.90 ms 315.72 ms 1.6% 15.54 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 7.69 ms 8.00 ms 4.1% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 8.19 ms 8.30 ms 1.3% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 14.34 ms 9.47 ms -34.0% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 9.47 ms 14.01 ms 47.9% 2.00 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-cold-store pacquet 2508.98 ms 2517.55 ms 0.3% 125.45 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1463.96 ms 1563.16 ms 6.8% 73.20 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pacquet 606.86 ms 458.07 ms -24.5% 30.34 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 302.86 ms 311.49 ms 2.8% 15.14 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1658.14 ms 1666.77 ms 0.5% 82.91 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 332.07 ms 325.71 ms -1.9% 16.60 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 288.13 ms 234.00 ms -18.8% 14.41 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 92.04 ms 91.85 ms -0.2% 4.60 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 217.93 ms 220.15 ms 1.0% 10.90 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 236.72 ms 240.34 ms 1.5% 11.84 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 110.61 ms 80.12 ms -27.6% 5.53 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4487.10 ms 4480.68 ms -0.1% 224.36 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3557.94 ms 3540.71 ms -0.5% 177.90 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 119.06 ms 112.74 ms -5.3% 5.95 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 134.52 ms 137.15 ms 2.0% 6.73 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1151.79 ms 1175.73 ms 2.1% 57.59 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 74b1a793c14a

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked and injected 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.362 ± 0.093 2.294 2.612 1.65 ± 0.15
pacquet@main 2.440 ± 0.124 2.305 2.667 1.70 ± 0.17
pnpr@HEAD 1.467 ± 0.121 1.341 1.733 1.02 ± 0.12
pnpr@main 1.433 ± 0.120 1.307 1.678 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.36230935788,
      "stddev": 0.0933952581400964,
      "median": 2.33320982798,
      "user": 1.41272974,
      "system": 1.3612978200000003,
      "min": 2.29440437548,
      "max": 2.61164727548
    },
    {
      "command": "pacquet@main",
      "mean": 2.44040931258,
      "stddev": 0.12437629531157368,
      "median": 2.41368125048,
      "user": 1.42557924,
      "system": 1.44091712,
      "min": 2.30480316948,
      "max": 2.66669365048
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4674202967800003,
      "stddev": 0.12073134790465345,
      "median": 1.4349653104800002,
      "user": 1.3896544399999997,
      "system": 1.3569854200000002,
      "min": 1.34148912248,
      "max": 1.73268292248
    },
    {
      "command": "pnpr@main",
      "mean": 1.4333741678800003,
      "stddev": 0.1200424655162851,
      "median": 1.39351704148,
      "user": 1.23891574,
      "system": 1.28171162,
      "min": 1.3073990964800002,
      "max": 1.67759284648
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 301.0 ± 10.2 285.1 324.5 1.00
pacquet@main 428.6 ± 114.0 298.0 555.0 1.42 ± 0.38
pnpr@HEAD 316.8 ± 11.4 303.4 335.5 1.05 ± 0.05
pnpr@main 312.1 ± 8.6 297.1 330.0 1.04 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30103832406,
      "stddev": 0.010204027808915977,
      "median": 0.29953090016000006,
      "user": 0.34953819999999997,
      "system": 0.7602505599999999,
      "min": 0.28505564016000007,
      "max": 0.32451062716000006
    },
    {
      "command": "pacquet@main",
      "mean": 0.4285568354600001,
      "stddev": 0.11400367421743818,
      "median": 0.46625322816000003,
      "user": 0.524478,
      "system": 1.09326646,
      "min": 0.29803007916,
      "max": 0.55501080116
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31682900496000005,
      "stddev": 0.011399954094674985,
      "median": 0.31572165366000005,
      "user": 0.3599358,
      "system": 0.7776341600000001,
      "min": 0.30337205116000004,
      "max": 0.33550840016000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.31210933986,
      "stddev": 0.008641705715586243,
      "median": 0.31089690216000004,
      "user": 0.36305579999999993,
      "system": 0.74508966,
      "min": 0.29712338816000006,
      "max": 0.32996270916000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.3 ± 1.1 6.9 13.5 1.07 ± 0.16
pacquet@main 7.7 ± 0.5 6.6 10.9 1.00
pnpr@HEAD 8.6 ± 1.0 6.7 13.6 1.11 ± 0.15
pnpr@main 8.3 ± 0.5 7.3 10.9 1.07 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.008301540917592592,
      "stddev": 0.0011170305674949178,
      "median": 0.0080049017,
      "user": 0.0048987738888888865,
      "system": 0.004200951388888891,
      "min": 0.0069093672000000005,
      "max": 0.0135000402
    },
    {
      "command": "pacquet@main",
      "mean": 0.007743918510650891,
      "stddev": 0.0005068234287616744,
      "median": 0.0076885777,
      "user": 0.004590292544378697,
      "system": 0.003930873372781066,
      "min": 0.0066289612,
      "max": 0.010942841200000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008627671354098362,
      "stddev": 0.0010352210625300389,
      "median": 0.0082986602,
      "user": 0.004925192786885241,
      "system": 0.004486341639344266,
      "min": 0.006680406200000001,
      "max": 0.0136362062
    },
    {
      "command": "pnpr@main",
      "mean": 0.008271266212738855,
      "stddev": 0.000531345180564437,
      "median": 0.0081941132,
      "user": 0.005053081656050954,
      "system": 0.004077763057324843,
      "min": 0.007258234200000001,
      "max": 0.0109086882
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.7 ± 1.1 8.2 14.9 1.00
pacquet@main 14.0 ± 2.8 8.1 22.3 1.45 ± 0.33
pnpr@HEAD 13.6 ± 2.3 8.9 18.8 1.40 ± 0.29
pnpr@main 9.7 ± 1.1 8.0 13.2 1.00 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009713726304489792,
      "stddev": 0.001106529104664491,
      "median": 0.00946983208,
      "user": 0.005647735918367347,
      "system": 0.004879280816326531,
      "min": 0.008171438080000001,
      "max": 0.014897939080000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.014048620060694987,
      "stddev": 0.002758743488454596,
      "median": 0.014344381080000001,
      "user": 0.007511932277992276,
      "system": 0.00761135907335907,
      "min": 0.00805579208,
      "max": 0.022295447080000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.013635816523661968,
      "stddev": 0.002319441454131725,
      "median": 0.01400587658,
      "user": 0.00792017943661972,
      "system": 0.006845328169014086,
      "min": 0.008926995080000001,
      "max": 0.018791969080000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.009716432348000004,
      "stddev": 0.0010936599957002064,
      "median": 0.00947137458,
      "user": 0.005853139999999995,
      "system": 0.004700348000000001,
      "min": 0.007991531080000001,
      "max": 0.013199524080000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.556 ± 0.119 2.475 2.862 1.69 ± 0.14
pacquet@main 2.514 ± 0.029 2.485 2.585 1.66 ± 0.12
pnpr@HEAD 1.566 ± 0.126 1.401 1.726 1.03 ± 0.11
pnpr@main 1.516 ± 0.107 1.416 1.702 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5562800447800003,
      "stddev": 0.11930944814864977,
      "median": 2.51755056198,
      "user": 2.02353238,
      "system": 1.6793738999999994,
      "min": 2.47507820298,
      "max": 2.8623857679799998
    },
    {
      "command": "pacquet@main",
      "mean": 2.51359140278,
      "stddev": 0.028940527975973396,
      "median": 2.50897747548,
      "user": 1.87031408,
      "system": 1.5500079999999998,
      "min": 2.48505003398,
      "max": 2.5850385549799997
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.56644862398,
      "stddev": 0.12560497795441972,
      "median": 1.56315797048,
      "user": 1.28622758,
      "system": 1.2781723,
      "min": 1.4008798119800001,
      "max": 1.72565178498
    },
    {
      "command": "pnpr@main",
      "mean": 1.51612014408,
      "stddev": 0.10717292071930709,
      "median": 1.46395619648,
      "user": 1.17944568,
      "system": 1.2720119,
      "min": 1.41590894698,
      "max": 1.70216988898
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 459.1 ± 23.0 431.7 505.8 1.51 ± 0.12
pacquet@main 607.6 ± 142.4 442.0 874.4 2.00 ± 0.49
pnpr@HEAD 303.5 ± 19.1 273.3 325.8 1.00
pnpr@main 313.7 ± 39.6 283.3 419.8 1.03 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.45907068966000003,
      "stddev": 0.023036471238501142,
      "median": 0.45806590556000004,
      "user": 0.64855084,
      "system": 0.75308334,
      "min": 0.43167774606000003,
      "max": 0.5058452080600001
    },
    {
      "command": "pacquet@main",
      "mean": 0.6075704441600001,
      "stddev": 0.14238545305757178,
      "median": 0.6068612805600001,
      "user": 0.8849609399999998,
      "system": 0.9907754399999998,
      "min": 0.44202022306000005,
      "max": 0.8743733820600001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30348213185999995,
      "stddev": 0.019108944003358205,
      "median": 0.31148722556,
      "user": 0.27266844,
      "system": 0.5717121399999999,
      "min": 0.27328742606,
      "max": 0.32576309906
    },
    {
      "command": "pnpr@main",
      "mean": 0.31368689806,
      "stddev": 0.03960716581734326,
      "median": 0.30286080156000006,
      "user": 0.28784434,
      "system": 0.5785489399999999,
      "min": 0.28325819406,
      "max": 0.41980538906000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.694 ± 0.085 1.620 1.909 5.25 ± 0.32
pacquet@main 1.650 ± 0.021 1.613 1.674 5.11 ± 0.18
pnpr@HEAD 0.323 ± 0.011 0.301 0.337 1.00
pnpr@main 0.330 ± 0.008 0.320 0.340 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.6936818179000004,
      "stddev": 0.08501939016281371,
      "median": 1.6667698887,
      "user": 1.10005436,
      "system": 1.0973047599999999,
      "min": 1.6195295867000001,
      "max": 1.9089428807000002
    },
    {
      "command": "pacquet@main",
      "mean": 1.6504295719000002,
      "stddev": 0.0214532272222284,
      "median": 1.6581403772,
      "user": 0.9427601600000001,
      "system": 0.9935954599999999,
      "min": 1.6134366437,
      "max": 1.6741027097
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3228498994000001,
      "stddev": 0.01070934265577488,
      "median": 0.3257111502,
      "user": 0.26929746,
      "system": 0.64794956,
      "min": 0.30121247970000004,
      "max": 0.33673951370000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.3304424316000001,
      "stddev": 0.007623326462030638,
      "median": 0.33206668070000006,
      "user": 0.28426725999999997,
      "system": 0.64540676,
      "min": 0.31960133770000004,
      "max": 0.3399729477
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 250.7 ± 59.7 195.1 400.0 2.74 ± 0.65
pacquet@main 272.2 ± 42.3 185.7 330.1 2.97 ± 0.47
pnpr@HEAD 91.6 ± 1.9 87.0 93.8 1.00
pnpr@main 91.8 ± 2.0 86.9 95.4 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25072425218,
      "stddev": 0.05973084947768006,
      "median": 0.23400294248,
      "user": 0.22684410000000002,
      "system": 0.09404471999999998,
      "min": 0.19510960498000002,
      "max": 0.39997493898
    },
    {
      "command": "pacquet@main",
      "mean": 0.2721511396466667,
      "stddev": 0.04225035053305688,
      "median": 0.28812524898,
      "user": 0.2515163666666667,
      "system": 0.10572395333333334,
      "min": 0.18573820698000001,
      "max": 0.33006556298000006
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09156671749612902,
      "stddev": 0.0018611528650539666,
      "median": 0.09184561998000002,
      "user": 0.03282746774193548,
      "system": 0.015757490967741934,
      "min": 0.08698210198000002,
      "max": 0.09380192798
    },
    {
      "command": "pnpr@main",
      "mean": 0.09179835724666668,
      "stddev": 0.0019597538345757282,
      "median": 0.09203924698000002,
      "user": 0.03372666666666667,
      "system": 0.014667865999999998,
      "min": 0.08688661298000001,
      "max": 0.09541905898000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 217.0 ± 9.5 203.0 228.8 1.00
pacquet@main 220.2 ± 8.6 211.4 234.5 1.02 ± 0.06
pnpm@HEAD 3482.4 ± 66.8 3318.4 3542.5 16.05 ± 0.77
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2169513106422222,
      "stddev": 0.009476326321347185,
      "median": 0.22015228442,
      "user": 0.21371842000000002,
      "system": 0.055056615555555556,
      "min": 0.20302457542,
      "max": 0.22878159142
    },
    {
      "command": "pacquet@main",
      "mean": 0.22021408541999998,
      "stddev": 0.008615944827312575,
      "median": 0.21793330142,
      "user": 0.2219736422222222,
      "system": 0.04810850444444444,
      "min": 0.21141375142,
      "max": 0.23452074742
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.482422074308889,
      "stddev": 0.06675173167818989,
      "median": 3.5024370174199997,
      "user": 5.314214086666667,
      "system": 0.38132772666666664,
      "min": 3.31839466242,
      "max": 3.54245666642
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 240.3 ± 9.3 226.7 263.2 1.02 ± 0.05
pacquet@main 236.3 ± 8.6 226.2 251.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.24025665014333333,
      "stddev": 0.009291372488950555,
      "median": 0.24034375006000003,
      "user": 0.19738051,
      "system": 0.09906276666666665,
      "min": 0.22670733206000002,
      "max": 0.26319804806
    },
    {
      "command": "pacquet@main",
      "mean": 0.23626958556000002,
      "stddev": 0.008623863246771071,
      "median": 0.23672298606000003,
      "user": 0.18826876000000003,
      "system": 0.10259185,
      "min": 0.22621872206000002,
      "max": 0.25185932706
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 89.0 ± 21.7 72.1 141.4 1.00
pacquet@main 112.4 ± 32.4 75.7 163.7 1.26 ± 0.48
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.0889587039618182,
      "stddev": 0.021741848203620705,
      "median": 0.08011941178,
      "user": 0.033608807272727276,
      "system": 0.062138463030303015,
      "min": 0.07207370578,
      "max": 0.14144185878
    },
    {
      "command": "pacquet@main",
      "mean": 0.11238584439111114,
      "stddev": 0.032396638099936495,
      "median": 0.11060660278000001,
      "user": 0.04616596888888889,
      "system": 0.07501321555555555,
      "min": 0.07572509578,
      "max": 0.16374642978
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.502 ± 0.088 4.407 4.639 1.27 ± 0.03
pacquet@main 4.557 ± 0.167 4.416 4.870 1.28 ± 0.05
pnpr@HEAD 3.553 ± 0.068 3.470 3.667 1.00
pnpr@main 3.585 ± 0.102 3.473 3.815 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.50205050614,
      "stddev": 0.08820483224996246,
      "median": 4.48068336464,
      "user": 1.73244112,
      "system": 1.9577853,
      "min": 4.407186193139999,
      "max": 4.63874637414
    },
    {
      "command": "pacquet@main",
      "mean": 4.55714166894,
      "stddev": 0.16670933839663807,
      "median": 4.487100634139999,
      "user": 1.68166132,
      "system": 2.0176935,
      "min": 4.41566436914,
      "max": 4.87036552214
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5532362777400004,
      "stddev": 0.06829916947933223,
      "median": 3.54071217014,
      "user": 1.60556932,
      "system": 1.8009024,
      "min": 3.46974343414,
      "max": 3.66701218814
    },
    {
      "command": "pnpr@main",
      "mean": 3.58522800804,
      "stddev": 0.10181288148482077,
      "median": 3.55794473164,
      "user": 1.51426432,
      "system": 1.8431683999999997,
      "min": 3.4731241601400002,
      "max": 3.81535705914
    }
  ]
}

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 151.2 ± 56.5 107.5 238.4 1.21 ± 0.46
pacquet@main 124.6 ± 9.7 109.6 145.4 1.00
pnpr@HEAD 137.6 ± 7.8 126.1 147.3 1.10 ± 0.11
pnpr@main 136.3 ± 8.5 124.7 155.0 1.09 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1512218182872727,
      "stddev": 0.05645847644367564,
      "median": 0.11274086256000002,
      "user": 0.17430902,
      "system": 0.14648830363636364,
      "min": 0.10751805756,
      "max": 0.23838868456
    },
    {
      "command": "pacquet@main",
      "mean": 0.12463034001454548,
      "stddev": 0.009705218942904952,
      "median": 0.11906216556000002,
      "user": 0.15554165636363637,
      "system": 0.11676862181818178,
      "min": 0.10955207356,
      "max": 0.14537786256000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13764020261555557,
      "stddev": 0.007822136181076382,
      "median": 0.13714896706000002,
      "user": 0.15491818666666668,
      "system": 0.13958427333333331,
      "min": 0.12605828456,
      "max": 0.14729724456
    },
    {
      "command": "pnpr@main",
      "mean": 0.13631423728222222,
      "stddev": 0.008504765642219907,
      "median": 0.13452443506,
      "user": 0.1597297422222222,
      "system": 0.13420327333333332,
      "min": 0.12465448556,
      "max": 0.15501167556
    }
  ]
}

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.208 ± 0.087 1.111 1.328 1.05 ± 0.08
pacquet@main 1.149 ± 0.022 1.109 1.184 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.20822776808,
      "stddev": 0.08737803899050864,
      "median": 1.17573216298,
      "user": 0.7016525600000001,
      "system": 0.3123582,
      "min": 1.1114754839799998,
      "max": 1.32771932898
    },
    {
      "command": "pacquet@main",
      "mean": 1.1491016186799998,
      "stddev": 0.021600774423738648,
      "median": 1.15179109248,
      "user": 0.5705571599999999,
      "system": 0.2643976,
      "min": 1.10893809698,
      "max": 1.18433283998
    }
  ]
}

@zkochan
zkochan marked this pull request as ready for review October 18, 2026 00:07
@zkochan

zkochan commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

Copilot AI balanced review requested due to automatic review settings October 18, 2026 00:07

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

Your trial has ended. Reactivate Greptile to resume code reviews.

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Record injected workspace dependencies according to resolved peers

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Remove link-preservation guards in v11 and v12 so importer entries follow the resolved dependency.
• Record an injected copy when a consumer’s peer context diverges from the workspace package’s own
 context.
• Add incremental-install coverage and a patch changeset for the affected packages.
Diagram

graph TD
  M["Consumer manifest"] --> R["v11/v12 resolver"] --> D{"Peer contexts match?"} -->|Yes| L["Workspace link"] --> I["Importer entry"] --> W["Wanted lockfile"]
  D -->|No| F["Injected copy"] --> I
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Make prior-link preservation peer-aware
  • ➕ Could retain the old guard for re-resolution paths it was intended to protect.
  • ➖ Requires detecting peer-context changes across both stacks.
  • ➖ Keeps importer output dependent on prior lockfile state despite dedupe covering the original scenario.

Recommendation: Remove the guard as proposed. The existing dedupe pass preserves links when peer contexts match, while writing the resolved copy makes incremental and fresh installs agree when they diverge.

Files changed (17) +109 / -625

Bug fix (4) +8 / -250
dependencies_graph_to_lockfile.rsDrop importer-reuse configuration from lockfile conversion +1/-27

Drop importer-reuse configuration from lockfile conversion

• Removes 'LockfileImporterReuse' and its previous-importer and update-scope inputs from 'GraphToLockfileOptions'.

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

importers.rsWrite v12 importer versions from resolved dependencies +2/-129

Write v12 importer versions from resolved dependencies

• Removes the prior-link override and its lookup, targeting, and update-scope helpers. Direct importer entries now retain the version produced from the resolved dependency.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/importers.rs

lockfile_build.rsStop passing prior importer state into lockfile building +0/-10

Stop passing prior importer state into lockfile building

• Removes previous-importer and update-scope forwarding from the fresh-lockfile build path and its graph-to-lockfile options.

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

updateLockfileImporters.tsRecord v11 importer refs without preserving stale links +5/-84

Record v11 importer refs without preserving stale links

• Writes each direct dependency ref from its resolved dep path. Removes prior-ref collection, targeted-alias bookkeeping, the conditional link override, and its unused 'dedupeInjectedDeps' option.

pnpm11/installing/deps-resolver/src/updateLockfileImporters.ts

Refactor (3) +4 / -25
resolution.rsNarrow resolution reuse state to its remaining field +3/-8

Narrow resolution reuse state to its remaining field

• Renames 'ResolutionReuseGuard' to 'ResolutionReuse' and removes the prior-importer and update-scope fields used only by link preservation.

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

completion.rsStop collecting link-guard inputs after resolution +1/-6

Stop collecting link-guard inputs after resolution

• Constructs resolution reuse state with only 'full_resolution', without collecting prior importers or update scopes for lockfile finalization.

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

resolution_inputs.rsRemove guard-only fresh-lockfile prior inputs +0/-11

Remove guard-only fresh-lockfile prior inputs

• Drops prior importer entries and update scopes from 'FreshLockfilePrior'; the prior lockfile itself remains available for its other uses.

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

Tests (9) +90 / -350
dedupe_injected_deps.rsTest v12’s incremental link-to-copy transition +51/-4

Test v12’s incremental link-to-copy transition

• Adds a CLI regression test that starts with a deduped workspace link, introduces a divergent consumer-provided peer, and verifies that incremental and fresh installs record the same injected copy. Updates the dedupe-disabled test comment to reflect removal of link preservation.

pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs

peer_convergence.rsRemove the resolved peer-convergence divergence +13/-17

Remove the resolved peer-convergence divergence

• Removes the issue #17057 expected divergence. Extends the remaining auto-installed-peer divergence paths to include injected importer entries and snapshots affected by that separate issue.

pnpm/crates/cli/tests/suite/peer_convergence.rs

tests.rsSimplify lockfile test fixtures after reuse removal +3/-33

Simplify lockfile test fixtures after reuse removal

• Removes the obsolete prior-link fixture and importer-reuse options from shared test setup.

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

catalogs.rsRemove obsolete reuse options from catalog test +1/-6

Remove obsolete reuse options from catalog test

• Adapts catalog lockfile test setup to 'GraphToLockfileOptions' without importer-reuse configuration.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/catalogs.rs

importer_records.rsAssert divergent injected entries record a copy +6/-48

Assert divergent injected entries record a copy

• Removes the unit test requiring an untargeted dependency to keep its previous link. Retains and renames the assertion that a divergent injected dependency records its resolved 'file:' entry.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/importer_records.rs

lockfile.rsAdapt lockfile tests to the simplified options +1/-26

Adapt lockfile tests to the simplified options

• Removes unused importer-reuse configuration from lockfile settings, patch, and workspace test cases.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/lockfile.rs

runtimes.rsRemove a test of guard-only package-name lookup +1/-27

Remove a test of guard-only package-name lookup

• Deletes the test for the removed update-scope package-name matcher and its unused imports.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/runtimes.rs

workspace_injection.rsRemove obsolete link-preservation guard tests +4/-168

Remove obsolete link-preservation guard tests

• Deletes tests for targeted updates, specifier changes, recursive scopes, and untargeted installs that exercised only the removed prior-link guard. Keeps the remaining multi-importer workspace coverage.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/workspace_injection.rs

injectWorkspacePackagesPersistence.test.tsExpect a copy after v11 peer-context divergence +10/-21

Expect a copy after v11 peer-context divergence

• Changes the plain-install regression test to expect a peer-suffixed 'file:' entry after the consumer adds a divergent peer. Revises comments for that case and the dedupe-disabled scenario.

pnpm11/installing/deps-installer/test/install/injectWorkspacePackagesPersistence.test.ts

Documentation (1) +7 / -0
injected-link-follows-peers.mdAnnounce the injected-dependency peer fix +7/-0

Announce the injected-dependency peer fix

• Adds patch changesets for the v11 resolver, pnpm, and pacquet, describing the link-to-copy transition when a consumer starts providing a divergent peer.

.changeset/injected-link-follows-peers.md

@qodo-code-review

qodo-code-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Release notes mix two version targets 📘 Rule violation § Compliance
Description
The injected-link-follows-peers.md changeset lists both the TypeScript pnpm package and the Rust
pacquet package in one front matter block. Because this PR changes both stacks, release tooling
cannot keep their version-specific changeset entries separate if either package later needs distinct
release metadata or wording.
Code

.changeset/injected-link-follows-peers.md[R2-4]

+"@pnpm/installing.deps-resolver": patch
+"pnpm": patch
+"pacquet": patch
Relevance

● Weak

Recent exact precedents rejected splitting pnpm and pacquet changesets, despite similar compliance
guidance.

PR-#17003
PR-#16997
PR-#17006

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR modifies both the pnpm v11 TypeScript resolver and the pnpm v12 Rust/pacquet resolver, while
the changeset places pnpm and pacquet together in a single front matter block. Compliance ID
713436 requires separate changeset files when a single PR touches both stacks, with each file
targeting the appropriate package.

Rule 713436: Changesets for pnpm v11 vs v12 (pacquet) must target the correct package and bump type
.changeset/injected-link-follows-peers.md[1-7]
pnpm11/installing/deps-resolver/src/updateLockfileImporters.ts[1-78]
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/importers.rs[1-166]

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 combines the `pnpm` v11 and `pacquet` v12 package targets in one file, but changes affecting both stacks must use separate changeset files with each file targeting only the appropriate package.

## Fix Focus Areas
- .changeset/injected-link-follows-peers.md[1-7]

## Recommended Fix
Replace the combined changeset with separate changeset files: one targeting `pnpm` with a patch bump and one targeting `pacquet` with the appropriate patch bump. Keep the release-note text accurate for the behavior changed in each stack, and include `@pnpm/installing.deps-resolver` only in the TypeScript package changeset if it is an affected published package.

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

Dismiss ↗ | View ↗


Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 66 rules
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: 2457663d) — View relationship
Review mode: Auto: 🧠 Deep: Cross-stack resolver changes span many independent peer and lockfile paths.

Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

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 github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Oct 18, 2026
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

A workspace package stays linked after its peer provider is added under injectWorkspacePackages

3 participants