Repository navigation
Conversation
…dundant `dedupeDirectDeps` only decided which direct-dependency links to create, never which existing ones to retire. Once the workspace root started providing a dependency a project already had linked, that project's now-redundant symlink survived every later install, so the on-disk layout depended on install history rather than on the manifests. The prune pass now folds the same root comparison pnpm's `modules-cleaner` prune applies into its diff, so an incremental install converges on the layout a clean install of the same manifests produces. Close #13775 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesDirect dependency deduplication
Estimated code review effort: 3 (Moderate) | ~20 minutes Assessment against linked issues
Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoFix dedupeDirectDeps pruning: remove project links made redundant by root deps
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (5): Last reviewed commit: "test(deps-restorer): write the dedupe fi..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs`:
- Around line 491-500: Update the dedupe test around dup_link and dup_bin to use
fs::symlink_metadata and assert an ErrorKind::NotFound result, so dangling
symlinks and bin shims cannot evade removal checks. Then remove the root
dependency, run a third install, and assert that both the project link and bin
shim are restored.
🪄 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: 586db446-45e2-41f6-8be5-7369a0749444
📒 Files selected for processing (3)
.changeset/dedupe-removes-redundant-project-links.mdpnpm/crates/cli/tests/suite/dedupe_direct_deps.rspnpm/crates/deps-restorer/src/prune_stale_modules.rs
…on test The test name, setup, and assertion messages already carry what the comments restated; keep only the why and the upstream anchor. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
`Path::exists` follows the link, so the removal assertions would have passed on a leftover whose target the install also pruned. Stat the entry instead, and drop the root's declaration again to pin that the project gets its link and bin shim back. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13780 +/- ##
=======================================
Coverage 88.15% 88.15%
=======================================
Files 623 623
Lines 101492 101506 +14
=======================================
+ Hits 89470 89484 +14
Misses 12022 12022 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… prune `link:` versions are stored relative to their own importer, so the version-string dedupe can fire on two importers that resolve the string to different directories. The relink behind the prune is what keeps each importer pointing at its own target; assert that rather than leave it to inspection. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Re: the The comparison is deliberately on raw The over-prune the finding describes is real but self-healing, and that is the documented contract of this pass: The "install errors between prune and link" window is not introduced here — every removal this pass already performs shares it, and it is called out in the module docs ("over-removal of a still-wanted entry is self-healing because everything wanted is re-linked right after"). Separately, the same string comparison means a genuinely redundant Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Code review by qodo was updated up to the latest commit 0e63922 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…h the guard `append_workspace_yaml_key` asserts the key is absent before appending, so a harness that starts writing `packages:` or `dedupeDirectDeps:` itself fails on the duplicate rather than on pnpm's YAML parse. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Re: the two new findings on Brittle YAML key append — fixed in 7b3e8c9. Both tests added by this PR now go through Unneeded mocked registry — not applying. Link/file dedupe over-prunes — same finding as before, re-emitted against the new commit; answered in #13780 (comment) and now pinned by Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Code review by qodo was updated up to the latest commit 7b3e8c9 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Changeset missing
This PR's implementation is entirely under Written by an agent (Claude Code, claude-opus-5[1m]). |
Integrated-Benchmark Report (Linux)Commit: 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.74231445618,
"stddev": 0.1822059141547437,
"median": 2.67093746858,
"user": 2.86201646,
"system": 2.26083664,
"min": 2.5236567490799997,
"max": 2.99384637408,
"times": [
2.5236567490799997,
2.97695026308,
2.83817485308,
2.55960830108,
2.95760639408,
2.99384637408,
2.60365754908,
2.62776914108,
2.64643842008,
2.6954365170799996
]
},
{
"command": "pacquet@main",
"mean": 2.9171131672799997,
"stddev": 0.23643256281675568,
"median": 2.93830352458,
"user": 3.1162075599999994,
"system": 2.4279325399999996,
"min": 2.63252275808,
"max": 3.28081306008,
"times": [
3.0877189910799996,
2.68356801708,
3.28081306008,
2.89378386408,
3.1648131820799996,
2.68590188708,
2.67502952808,
2.63252275808,
2.98282318508,
3.08415720008
]
},
{
"command": "pnpr@HEAD",
"mean": 1.75710364288,
"stddev": 0.13606861801103132,
"median": 1.7231940030800001,
"user": 2.08221856,
"system": 1.9411639399999996,
"min": 1.55240120908,
"max": 1.9842173260800002,
"times": [
1.8226136530800001,
1.9842173260800002,
1.69002433708,
1.7044683010800001,
1.9487961790800001,
1.55240120908,
1.63271149008,
1.8137632650800002,
1.7419197050800002,
1.68012096308
]
},
{
"command": "pnpr@main",
"mean": 1.7229513816800004,
"stddev": 0.14113739867598118,
"median": 1.7140181835800001,
"user": 2.1217318599999997,
"system": 1.9570680399999998,
"min": 1.53164385208,
"max": 1.9195206870800001,
"times": [
1.81359482508,
1.6771929360800002,
1.53164385208,
1.6421828470800002,
1.75084343108,
1.91377722708,
1.8146080350800002,
1.9195206870800001,
1.5478473220800002,
1.61830265408
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.41831241224,
"stddev": 0.014880526370157562,
"median": 0.42546362874,
"user": 0.38537256,
"system": 0.7709396799999999,
"min": 0.38990324374,
"max": 0.43540472874,
"times": [
0.42701931974,
0.43051249774,
0.40551353974000004,
0.42732229274,
0.38990324374,
0.42737797574,
0.40096950374,
0.42390793774,
0.41519308274,
0.43540472874
]
},
{
"command": "pacquet@main",
"mean": 0.4120753155400001,
"stddev": 0.032457336626468526,
"median": 0.40507002674000003,
"user": 0.37976326,
"system": 0.7520451799999999,
"min": 0.37058364674,
"max": 0.46700008674000004,
"times": [
0.39858448574,
0.37058364674,
0.39311839174,
0.46616851574,
0.46700008674000004,
0.41200143174000003,
0.40971669574,
0.42295425074000004,
0.40042335774000004,
0.38020229274
]
},
{
"command": "pnpr@HEAD",
"mean": 0.46533036414000006,
"stddev": 0.03633170152792961,
"median": 0.47061224724,
"user": 0.39951726,
"system": 0.8096337800000001,
"min": 0.41758129274,
"max": 0.5187290557400001,
"times": [
0.42049044074,
0.41758129274,
0.5187290557400001,
0.46254688974,
0.5041955367400001,
0.46545922674,
0.41818891674,
0.47806892774000004,
0.47576526774,
0.49227808674
]
},
{
"command": "pnpr@main",
"mean": 0.45604210884,
"stddev": 0.03018097496598746,
"median": 0.45073431074000003,
"user": 0.41739516,
"system": 0.7802400799999998,
"min": 0.40011229174,
"max": 0.5034990827400001,
"times": [
0.43941870574,
0.46925231474,
0.5034990827400001,
0.47934006374000004,
0.43995779174,
0.43730339074,
0.49006882574000005,
0.45091171774,
0.45055690374,
0.40011229174
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.96719805108,
"stddev": 0.08530626745146645,
"median": 2.95959457228,
"user": 2.9453916399999995,
"system": 2.34668736,
"min": 2.84052585278,
"max": 3.1802246077799996,
"times": [
2.92772991378,
2.96433779278,
2.9727510267799997,
2.94534014478,
2.98615201278,
2.92890518378,
2.9711626237799997,
3.1802246077799996,
2.95485135178,
2.84052585278
]
},
{
"command": "pacquet@main",
"mean": 2.8722398472800004,
"stddev": 0.03352639154312987,
"median": 2.86927470228,
"user": 2.7213226399999995,
"system": 2.12660716,
"min": 2.80159238178,
"max": 2.9196230527799996,
"times": [
2.90712950978,
2.9007573557799997,
2.80159238178,
2.8677889997799997,
2.84959471178,
2.9196230527799996,
2.86315994378,
2.8602941557799997,
2.88169795678,
2.87076040478
]
},
{
"command": "pnpr@HEAD",
"mean": 1.74666197138,
"stddev": 0.17865772720586967,
"median": 1.67194825328,
"user": 1.91139824,
"system": 1.8657900600000001,
"min": 1.57145682178,
"max": 2.0741700917799997,
"times": [
1.87997340278,
1.57145682178,
2.01742951578,
1.65953524378,
1.6039931607800002,
1.67843741478,
2.0741700917799997,
1.66545909178,
1.69891894278,
1.61724602778
]
},
{
"command": "pnpr@main",
"mean": 1.6712617613800003,
"stddev": 0.0959826999949998,
"median": 1.63218898828,
"user": 2.0144498399999997,
"system": 1.8657496599999999,
"min": 1.58247253178,
"max": 1.85755102878,
"times": [
1.7447034947800002,
1.59766780878,
1.6035474677800001,
1.5983099437800001,
1.66083050878,
1.58247253178,
1.69596034678,
1.85755102878,
1.78188388078,
1.5896906017799999
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6618096042,
"stddev": 0.02941995820780961,
"median": 0.6610512362000001,
"user": 0.88149102,
"system": 1.0980035799999999,
"min": 0.6152900412,
"max": 0.7104279122,
"times": [
0.7104279122,
0.6152900412,
0.6618962692,
0.6525372722,
0.6602062032,
0.6368363522,
0.6424075802,
0.7081705732,
0.6642889992,
0.6660348392
]
},
{
"command": "pacquet@main",
"mean": 0.6564380579000001,
"stddev": 0.03935843472875003,
"median": 0.6617994892000001,
"user": 0.90375412,
"system": 1.0322228799999997,
"min": 0.5927396572,
"max": 0.7256597572,
"times": [
0.6370125932,
0.6633450802,
0.6286342692,
0.7040759162,
0.6700550082,
0.6617453152,
0.6618536632,
0.5927396572,
0.6192593192,
0.7256597572
]
},
{
"command": "pnpr@HEAD",
"mean": 0.4101222803000001,
"stddev": 0.010470245877276057,
"median": 0.41090258020000003,
"user": 0.31365292,
"system": 0.71194928,
"min": 0.38842870320000006,
"max": 0.42436077920000004,
"times": [
0.41641667620000006,
0.4134884072,
0.4074795372,
0.42436077920000004,
0.42204220620000005,
0.40188980320000006,
0.40831675320000005,
0.4048616722,
0.38842870320000006,
0.41393826520000004
]
},
{
"command": "pnpr@main",
"mean": 0.4292872925000001,
"stddev": 0.016025608439759354,
"median": 0.42769333620000005,
"user": 0.33713112,
"system": 0.70794548,
"min": 0.40680127120000004,
"max": 0.45380089320000006,
"times": [
0.44210332120000007,
0.41527273420000005,
0.42230541520000003,
0.43308125720000007,
0.45380089320000006,
0.44701993520000005,
0.40680127120000004,
0.43913849620000006,
0.41160521420000007,
0.4217443872
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7924214486000003,
"stddev": 0.12714800527258346,
"median": 1.7263727416,
"user": 0.9204176800000001,
"system": 0.8973570800000001,
"min": 1.7152639511,
"max": 2.0499837761,
"times": [
2.0028298981,
2.0499837761,
1.8141656241,
1.7207365951000002,
1.7184692861000002,
1.7295387381,
1.7255877691000001,
1.7271577141,
1.7152639511,
1.7204811341000001
]
},
{
"command": "pacquet@main",
"mean": 1.7360741054000002,
"stddev": 0.06523606537874713,
"median": 1.7013239666,
"user": 0.8312125800000001,
"system": 0.81945198,
"min": 1.6848707931000002,
"max": 1.8492498181,
"times": [
1.7052262751,
1.7153982951000002,
1.6974216581000001,
1.6848707931000002,
1.6949153671000001,
1.6912452481000002,
1.8490812061,
1.8492498181,
1.7786370991000002,
1.6946952941
]
},
{
"command": "pnpr@HEAD",
"mean": 0.2946825971,
"stddev": 0.008797497697670704,
"median": 0.2931141216,
"user": 0.18167888,
"system": 0.5093418800000001,
"min": 0.2856470131,
"max": 0.3141396271,
"times": [
0.2987218361,
0.2856470131,
0.2858750851,
0.2905815811,
0.2924357671,
0.3141396271,
0.2863100501,
0.2999116891,
0.2994108461,
0.2937924761
]
},
{
"command": "pnpr@main",
"mean": 0.28860669559999996,
"stddev": 0.006851939225308695,
"median": 0.2880530281,
"user": 0.19059127999999997,
"system": 0.49028647999999997,
"min": 0.2777072641,
"max": 0.3036974901,
"times": [
0.2910730901,
0.2870983531,
0.2777072641,
0.2843275311,
0.2837036031,
0.2890077031,
0.2900999131,
0.3036974901,
0.2864647081,
0.2928873001
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22243454286615386,
"stddev": 0.0459109992103619,
"median": 0.20772707202000001,
"user": 0.18421265384615382,
"system": 0.08064176769230769,
"min": 0.18292148602,
"max": 0.34426633002000007,
"times": [
0.22190762402,
0.19866734802,
0.34426633002000007,
0.28168894602000005,
0.21829661402,
0.18292148602,
0.20718734502,
0.24725623102,
0.18354587302,
0.20772707202000001,
0.18997857102000001,
0.18839482402,
0.21981079302
]
},
{
"command": "pacquet@main",
"mean": 0.2087679027123077,
"stddev": 0.011735695124194595,
"median": 0.20936540202,
"user": 0.16330642307692306,
"system": 0.06995446,
"min": 0.18394914502,
"max": 0.22612617602,
"times": [
0.20974220602000002,
0.22612617602,
0.21578994502,
0.21728699302,
0.20591264002,
0.20756956502,
0.21310918002,
0.19314222502,
0.18394914502,
0.20936540202,
0.22546013602,
0.20279200302,
0.20373711902
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08839802092322578,
"stddev": 0.0027924441501656844,
"median": 0.08772729902000001,
"user": 0.020236822580645162,
"system": 0.01142062387096774,
"min": 0.08452869202,
"max": 0.09535547502000001,
"times": [
0.08860736002000001,
0.08755537802,
0.08523675602000001,
0.08720393102000001,
0.08927576802000001,
0.08841307302000001,
0.09535547502000001,
0.08603579302000001,
0.09044422502,
0.09007757502000001,
0.09066441902000001,
0.08452869202,
0.08687912202,
0.08623311902000001,
0.09227645902,
0.08621130302,
0.08615191402000001,
0.09319992702,
0.08956786302000001,
0.08772729902000001,
0.09088572202,
0.08786292802000001,
0.08505925102,
0.08605202602,
0.08547662902000001,
0.09240867702000001,
0.08559522202000001,
0.08744714202000001,
0.08572607302000002,
0.09267253102,
0.08950699602000001
]
},
{
"command": "pnpr@main",
"mean": 0.08981167232303032,
"stddev": 0.002818435653997128,
"median": 0.09022583602,
"user": 0.020734136363636364,
"system": 0.011921793333333333,
"min": 0.08537194502,
"max": 0.09581594902000001,
"times": [
0.08565064302000001,
0.08537194502,
0.08713826502000001,
0.09022583602,
0.08813694502000001,
0.08885213102000002,
0.08807124602000001,
0.09207369802000001,
0.09024574702,
0.09048315002000001,
0.08624147602000001,
0.09446103002,
0.08764408402000001,
0.09229464102000001,
0.09286051502,
0.08893843002000001,
0.09144890102000001,
0.08708306402,
0.08730904702000002,
0.09558189502000002,
0.09233735002000001,
0.08650821402000002,
0.09062375902000001,
0.09317245402,
0.09042182702000001,
0.09140887702000002,
0.08673255802,
0.08987117602000001,
0.09104463302000002,
0.08632346202,
0.09581594902000001,
0.08901485902,
0.09039737902000002
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7954427917977779,
"stddev": 0.15641438256440038,
"median": 0.8547167450200001,
"user": 0.7496859866666665,
"system": 0.14756264444444442,
"min": 0.58120449602,
"max": 0.9764982710200001,
"times": [
0.93215457702,
0.58120449602,
0.60456322902,
0.6719321770200001,
0.97071875102,
0.8547167450200001,
0.7056596620200001,
0.86153721802,
0.9764982710200001
]
},
{
"command": "pacquet@main",
"mean": 0.6419429051311112,
"stddev": 0.11620792366593248,
"median": 0.6235931980200001,
"user": 0.5965185422222221,
"system": 0.11482931111111111,
"min": 0.49692304502,
"max": 0.80757198502,
"times": [
0.8034064730200001,
0.6235931980200001,
0.80757198502,
0.68804848502,
0.6009548410200001,
0.5133939690200001,
0.5442695930200001,
0.6993245570200001,
0.49692304502
]
},
{
"command": "pnpm@HEAD",
"mean": 2.8840448239088885,
"stddev": 0.11330568429866314,
"median": 2.86248564902,
"user": 4.132120431111111,
"system": 0.28876442222222226,
"min": 2.77480332302,
"max": 3.16798279502,
"times": [
2.89716192702,
2.8241204560199997,
2.86248564902,
2.8991070950199997,
2.86634725402,
2.83403958002,
3.16798279502,
2.77480332302,
2.83035533602
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.644113354499999,
"stddev": 0.17422411824725498,
"median": 4.686144050599999,
"user": 1.8355415599999998,
"system": 1.3858702600000001,
"min": 4.4089733886,
"max": 4.8486214526,
"times": [
4.829581762599999,
4.414417279599999,
4.6611549216,
4.4114592456,
4.8486214526,
4.4089733886,
4.7911540466,
4.7111331796,
4.7345822796,
4.6300559886
]
},
{
"command": "pacquet@main",
"mean": 4.5501938208,
"stddev": 0.12637812588323125,
"median": 4.5106324366,
"user": 1.9650300600000001,
"system": 1.4381181599999997,
"min": 4.4357735946,
"max": 4.7683193846,
"times": [
4.452195198599999,
4.4432017026,
4.7683193846,
4.4357735946,
4.4424547595999995,
4.7146029646,
4.607504533599999,
4.6324995426,
4.5690696746,
4.4363168526
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5277423706,
"stddev": 0.11061529159478378,
"median": 3.5004944346,
"user": 1.46454306,
"system": 1.32410156,
"min": 3.4354151836,
"max": 3.8194666896,
"times": [
3.4354151836,
3.5144440336000002,
3.5127833046,
3.4720637136000003,
3.8194666896,
3.4596203636,
3.4683697386000003,
3.5224234046,
3.4882055646000003,
3.5846317096
]
},
{
"command": "pnpr@main",
"mean": 3.7100212748,
"stddev": 0.1579349150064631,
"median": 3.6752987371000003,
"user": 1.9761869599999997,
"system": 1.81649466,
"min": 3.5014221136,
"max": 4.053944964599999,
"times": [
3.7140086436,
3.8602398316,
3.6142677646,
3.5864534686000002,
3.5014221136,
3.7069099686,
3.6345911606,
3.6436875056,
4.053944964599999,
3.7846873266000003
]
}
]
} |
|
The red Bencher Report is runner variance, not a regression from this PR. Evidence: I re-ran the integrated benchmark on the same commit (
It also cannot be this diff on the merits: both alerting scenarios resolve offline from a hot metadata mirror with no lockfile and no linking (see the I have kicked off one more re-run to try to land the check green. Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Third run of the same commit, third different set of alerting benchmarks:
No code changed between any of these — all three ran against For the record on the merits: the changed code is a per-direct-dependency comparison inside Happy to re-run again if you would rather see the check green before merging. Written by an agent (Claude Code, claude-opus-5[1m]). |
Summary
Closes #13775.
With
dedupeDirectDeps: true, a project's direct-dependency symlink that becomesredundant — because the workspace root later starts providing the same dependency
at the same resolution — was never removed.
dedupeDirectDepswas only consultedwhen creating links (
SymlinkDirectDependencies), so a link an earlier installlegitimately wrote survived every subsequent install, and the on-disk layout
depended on install history rather than on the manifests. A clean install of the
same manifests produced a different tree.
The removal half lives in the prune pass.
PruneStaleModulesalready diffs eachimporter's current direct deps against the wanted lockfile; it now also drops a
non-root importer's entry whose alias the wanted root importer resolves to the
same version — the same condition pnpm's
modules-cleanerprune folds into thatdiff:
Removal goes through the existing
remove_direct_dep_link, so the dep's binshims are retired with it, and a
pnpm:root removedevent fires as for any otherpruned link. Over-removal stays self-healing: everything the install still wants
is re-linked by
SymlinkDirectDependenciesright after.This is a Rust-only fix. The behavior is a pacquet regression against pnpm 10 and
11 — the TypeScript CLI already applies this condition, so there is nothing to
mirror.
Note on the remaining gap (pre-existing, present in both stacks): the
comparison is on lockfile version strings, so it does not fire for
link:workspace deps whose root and importer entries spell the same directory
differently (
link:packages/sharedvslink:../shared). Link-time dedupecompares resolved paths and does catch those, so a
link:dep that becomesredundant still leaves a stale link in pnpm 10/11/12 alike. Fixing that means
resolving
link:targets in both prunes; out of scope here, happy to follow up.Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5[1m]).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
Tests
Documentation