Repository navigation
Conversation
|
💖 Thanks for opening this pull request! 💖 |
|
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: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe global ownership scanners now treat a wholly missing ChangesGlobal node_modules recovery
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Suggested labels: ✨ Finishing Touches 💡 1🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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 |
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; the linked-workspace scenario compares current Rust against main Rust. 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.41104052354,
"stddev": 0.14033760455663458,
"median": 2.3180441816400004,
"user": 1.47437112,
"system": 1.8636293799999997,
"min": 2.30888606964,
"max": 2.62111640664
},
{
"command": "pacquet@main",
"mean": 2.39761005444,
"stddev": 0.1182954292675506,
"median": 2.3552289266399997,
"user": 1.52199522,
"system": 1.88609868,
"min": 2.29651254564,
"max": 2.62479515264
},
{
"command": "pnpr@HEAD",
"mean": 1.47887098584,
"stddev": 0.09493972967893788,
"median": 1.48635571714,
"user": 1.4043379200000001,
"system": 1.79659968,
"min": 1.32116397064,
"max": 1.66289206764
},
{
"command": "pnpr@main",
"mean": 1.44179233864,
"stddev": 0.09377976006323734,
"median": 1.45039095114,
"user": 1.45181702,
"system": 1.7786096800000002,
"min": 1.33094989264,
"max": 1.59120171264
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24141572838000003,
"stddev": 0.043944287425339734,
"median": 0.22148706318,
"user": 0.2720308799999999,
"system": 0.5746758599999999,
"min": 0.19976517168,
"max": 0.31793593268000003
},
{
"command": "pacquet@main",
"mean": 0.20948495378000004,
"stddev": 0.007920973070045944,
"median": 0.20770595818,
"user": 0.23616547999999998,
"system": 0.49423705999999995,
"min": 0.19771243268,
"max": 0.22392094168
},
{
"command": "pnpr@HEAD",
"mean": 0.22465726937999997,
"stddev": 0.007002328586923826,
"median": 0.22275903118,
"user": 0.23718697999999994,
"system": 0.5324063600000001,
"min": 0.21674208968,
"max": 0.23892921768
},
{
"command": "pnpr@main",
"mean": 0.22012617148000002,
"stddev": 0.009520859602314842,
"median": 0.22097672668,
"user": 0.21951408,
"system": 0.51417506,
"min": 0.20626648568,
"max": 0.23428999468
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.007896425000000002,
"stddev": 0.000948886378292733,
"median": 0.007666236120000001,
"user": 0.004673882222222224,
"system": 0.003802863288888889,
"min": 0.006508623120000001,
"max": 0.012112527120000001
},
{
"command": "pacquet@main",
"mean": 0.007239779395862068,
"stddev": 0.00042760157541891895,
"median": 0.00718478512,
"user": 0.004090223009404392,
"system": 0.0036605079623824458,
"min": 0.006357663120000001,
"max": 0.008929889120000001
},
{
"command": "pnpr@HEAD",
"mean": 0.007072338873541078,
"stddev": 0.00037194684395233283,
"median": 0.00702915512,
"user": 0.004220006175637396,
"system": 0.0033080294617563724,
"min": 0.00637194212,
"max": 0.009139029120000001
},
{
"command": "pnpr@main",
"mean": 0.006985191933031155,
"stddev": 0.0003409790275596044,
"median": 0.006953243120000001,
"user": 0.004484977847025491,
"system": 0.002954473427762039,
"min": 0.00632072312,
"max": 0.008809608120000001
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009101963807619054,
"stddev": 0.0007759255649586587,
"median": 0.00891824736,
"user": 0.004993405714285712,
"system": 0.004774629238095234,
"min": 0.00792900486,
"max": 0.011479043860000001
},
{
"command": "pacquet@main",
"mean": 0.008035625763474904,
"stddev": 0.0006454070318715971,
"median": 0.00792854186,
"user": 0.004712889111969111,
"system": 0.0038995068725868757,
"min": 0.00681744586,
"max": 0.010680182860000002
},
{
"command": "pnpr@HEAD",
"mean": 0.007778616552307688,
"stddev": 0.0006474890625348096,
"median": 0.00768265536,
"user": 0.004564477692307692,
"system": 0.0037333525384615385,
"min": 0.006782056860000001,
"max": 0.010669933860000001
},
{
"command": "pnpr@main",
"mean": 0.007690191291578946,
"stddev": 0.0003830569351827275,
"median": 0.00764231586,
"user": 0.004856176140350873,
"system": 0.0033786861052631577,
"min": 0.006863785860000001,
"max": 0.00943729586
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.48422092696,
"stddev": 0.053692317755753574,
"median": 2.46550541976,
"user": 1.7466663399999998,
"system": 1.5985963800000003,
"min": 2.43688846776,
"max": 2.59759701476
},
{
"command": "pacquet@main",
"mean": 2.47740985306,
"stddev": 0.03635475946183834,
"median": 2.4737707792599997,
"user": 1.7244697399999995,
"system": 1.54448388,
"min": 2.42110795476,
"max": 2.53338480676
},
{
"command": "pnpr@HEAD",
"mean": 1.5558023113600001,
"stddev": 0.12354196130731315,
"median": 1.5688103822600001,
"user": 1.09540774,
"system": 1.2517693799999998,
"min": 1.36722667276,
"max": 1.77531012376
},
{
"command": "pnpr@main",
"mean": 1.4871802249600001,
"stddev": 0.08109475333076507,
"median": 1.4745543367600003,
"user": 1.08867824,
"system": 1.2318809800000001,
"min": 1.3939419157600001,
"max": 1.65132251976
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.3458612458,
"stddev": 0.015251525209419919,
"median": 0.3474634407,
"user": 0.53965904,
"system": 0.7788179000000001,
"min": 0.3189320157,
"max": 0.36548290170000003
},
{
"command": "pacquet@main",
"mean": 0.34361806110000004,
"stddev": 0.0221850534667646,
"median": 0.33810287920000004,
"user": 0.53646804,
"system": 0.7667375000000001,
"min": 0.3126887037,
"max": 0.3829623777
},
{
"command": "pnpr@HEAD",
"mean": 0.2727508012,
"stddev": 0.005362410830085399,
"median": 0.2740514087,
"user": 0.22014103999999998,
"system": 0.5265556,
"min": 0.2652611847,
"max": 0.2796666507
},
{
"command": "pnpr@main",
"mean": 0.27462127370000006,
"stddev": 0.016550704003593694,
"median": 0.2762748312,
"user": 0.20613124,
"system": 0.5207507,
"min": 0.2477659387,
"max": 0.3011439207
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.5393829082000001,
"stddev": 0.013637298907403487,
"median": 1.5387889659000002,
"user": 0.7608548199999999,
"system": 0.9197061199999998,
"min": 1.5180392834,
"max": 1.5653561214
},
{
"command": "pacquet@main",
"mean": 1.6123679266,
"stddev": 0.05943207671741553,
"median": 1.5977393594,
"user": 0.94724372,
"system": 1.04346392,
"min": 1.5553575114000002,
"max": 1.7545945654000001
},
{
"command": "pnpr@HEAD",
"mean": 0.27637967990000006,
"stddev": 0.008266638895651827,
"median": 0.27708301690000003,
"user": 0.23176332,
"system": 0.50868172,
"min": 0.26391178940000004,
"max": 0.28901293940000006
},
{
"command": "pnpr@main",
"mean": 0.2674696952000001,
"stddev": 0.01780441768216463,
"median": 0.2614972419,
"user": 0.19578282,
"system": 0.50592642,
"min": 0.24640001540000003,
"max": 0.29646224740000005
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.28044984316000005,
"stddev": 0.018604284940032963,
"median": 0.27465545676,
"user": 0.30926109999999996,
"system": 0.08327401999999999,
"min": 0.25820911676,
"max": 0.30952186776
},
{
"command": "pacquet@main",
"mean": 0.26288368439636367,
"stddev": 0.011582997516001454,
"median": 0.26153315176,
"user": 0.2837436545454545,
"system": 0.08795868363636362,
"min": 0.24587272276000002,
"max": 0.28065368376000005
},
{
"command": "pnpr@HEAD",
"mean": 0.10617843568307693,
"stddev": 0.004646371362850326,
"median": 0.10583547875999999,
"user": 0.041714046153846156,
"system": 0.022175961538461537,
"min": 0.10004387176,
"max": 0.11602032976
},
{
"command": "pnpr@main",
"mean": 0.10549393887111115,
"stddev": 0.005286029487534922,
"median": 0.10418815376,
"user": 0.047420977777777755,
"system": 0.016816097777777775,
"min": 0.09853779576,
"max": 0.11580326776
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7878407729733333,
"stddev": 0.09835373803706161,
"median": 0.78572998764,
"user": 0.7939390488888889,
"system": 0.20676200222222219,
"min": 0.6575857016400001,
"max": 0.9253694046400001
},
{
"command": "pacquet@main",
"mean": 0.6842941810844444,
"stddev": 0.05696610764325263,
"median": 0.70327861764,
"user": 0.6786220488888888,
"system": 0.1798498911111111,
"min": 0.59402483464,
"max": 0.74188762064
},
{
"command": "pnpm@HEAD",
"mean": 3.2666152163066666,
"stddev": 0.15420354254376098,
"median": 3.20599389564,
"user": 4.74878016,
"system": 0.28444755777777775,
"min": 3.11585489464,
"max": 3.58503542564
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.16610917859176474,
"stddev": 0.005243602820882894,
"median": 0.16348462418,
"user": 0.12344714352941176,
"system": 0.07780077647058822,
"min": 0.16097265218,
"max": 0.17863195118000003
},
{
"command": "pacquet@main",
"mean": 0.16701422829111112,
"stddev": 0.0056738197627776476,
"median": 0.16583124718000003,
"user": 0.12724248666666668,
"system": 0.07602204444444446,
"min": 0.16018865018,
"max": 0.18034184618000001
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.391230848599999,
"stddev": 0.15357464721386996,
"median": 4.3145308713,
"user": 1.317345,
"system": 1.46198114,
"min": 4.2685995268,
"max": 4.7150609798
},
{
"command": "pacquet@main",
"mean": 4.385979022500001,
"stddev": 0.12465337440213434,
"median": 4.3548601077999995,
"user": 1.2757676999999998,
"system": 1.4745896399999996,
"min": 4.2598392308,
"max": 4.5958457267999995
},
{
"command": "pnpr@HEAD",
"mean": 3.3861892092,
"stddev": 0.03881417948115253,
"median": 3.3811491998000003,
"user": 1.238772,
"system": 1.3483178399999998,
"min": 3.3406596728,
"max": 3.4570509888000003
},
{
"command": "pnpr@main",
"mean": 3.3926224976000006,
"stddev": 0.05439076036964842,
"median": 3.3717476958,
"user": 1.2399565000000001,
"system": 1.4475946399999997,
"min": 3.3453024798,
"max": 3.5268126698000004
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame 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.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.11460238104666667,
"stddev": 0.0039010853610643085,
"median": 0.11448958138000001,
"user": 0.14110981904761905,
"system": 0.12533174666666666,
"min": 0.10637829538,
"max": 0.12110220538000001
},
{
"command": "pacquet@main",
"mean": 0.10419622242347826,
"stddev": 0.00395125703176602,
"median": 0.10449296338000001,
"user": 0.13477585217391305,
"system": 0.11300642782608694,
"min": 0.09595247738,
"max": 0.11382988438000001
},
{
"command": "pnpr@HEAD",
"mean": 0.12090924395142859,
"stddev": 0.004672166187411529,
"median": 0.12213417438,
"user": 0.14267248571428567,
"system": 0.1156073180952381,
"min": 0.11410444438,
"max": 0.12934542038000002
},
{
"command": "pnpr@main",
"mean": 0.1166414254752381,
"stddev": 0.0032007914462819486,
"median": 0.11587982738000001,
"user": 0.14547053333333332,
"system": 0.11836155619047621,
"min": 0.11180175238000001,
"max": 0.12327269538
}
]
} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15151 +/- ##
=======================================
Coverage 91.38% 91.38%
=======================================
Files 1362 1362
Lines 182929 182930 +1
=======================================
+ Hits 167166 167175 +9
+ Misses 15763 15755 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| Project | pnpm's project |
| Branch | pr/15151 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 115.56 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,365.66 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 264.70 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 261.50 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.30 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,287.81 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,339.64 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 233.35 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 5.80 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 5.65 ms |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
`pnpm update -g` and `pnpm remove -g` can recover a global package group whose entire `node_modules` directory was deleted: the group is treated as owning no bins. A group with a present-but-incomplete tree still fails closed, so unknown ownership is never mistaken for an unowned bin. Fixes pnpm#15093
…dules The previous version of this test locked the pre-fix behavior: `update -g` over a group whose node_modules was deleted had to fail with ERR_PNPM_PACKAGE_MANIFEST_IO_ERROR. This PR changes that behavior on purpose (pnpm#15093): a wholly-absent node_modules now means the group owns no bins, the preflight lets the command through, and the update reinstalls the group from its surviving manifest. The test now asserts the new contract: the update succeeds, is not reported as "Already up to date", and the tree is restored.
6a1e74b to
5b083bb
Compare
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Addresses review feedback on pnpm#15151. Add a v11 command-level regression test proving `remove -g` recovers a group whose whole `node_modules` directory is absent: the handler tears down the damaged group without attempting to delete bins it cannot account for, leaves the stray shim alone, and a repeat removal reports ERR_PNPM_GLOBAL_PKG_NOT_FOUND. Trim comments that merely narrate test behavior in the Rust e2e and unit tests; the test names and assertions carry that meaning. Source comments explaining the wholly-absent vs present-but-incomplete distinction are left untouched.
Review follow-ups for the deleted-node_modules recovery: - Give the v11 `global remove` recovery test a healthy sibling target, so it shows what the issue asks for: one damaged group no longer blocks the other packages named in the same command, and only the healthy group's shim reaches the deletion sink. - Model the real scenario in the v11 scanner test: the install dir and its group manifest survive, only node_modules is deleted. - Fold the ownership-suite update test into global_update_restores_group_with_deleted_node_modules, which covers the same scenario, and assert there that the group is reinstalled under a new install dir with its command still in the global bin dir. - State the enumeration contract on `getInstalledBinNames` itself instead of at the call site. - Name `pnpm add -g` in the changeset: it reaches the same ownership preflight, so it recovers too. Say what the unattributable shim costs. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 5ff5651 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
A surviving group whose node_modules is gone reports no bins too, so it no longer protects a bin it shares with the group being removed. That is the reverse of the target-side trade-off and it was unasserted in both stacks. Nothing that worked stops working, because the survivor's own tree is already unusable, but the decision belongs in a test rather than only in the diff. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 5d46c9c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The changeset led the trade-off with the implementation reason pnpm can no longer attribute the shims. A release note states what pnpm does, so it now names the outcome alone. The test doc comment keeps the part a reader cannot recover from the assertions, that the resolution is unchanged, and drops the sentence the assertions already make. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Thanks — two of the three hold and are fixed in 844f811. Release note includes internal rationale. Valid.
Update test comment repeats behavior. Valid for the second sentence, which the assertions already make. It is gone. The first sentence stays, because it is the part a reader cannot recover from the setup: the resolution is unchanged, which is exactly what makes Version 11 recovery lacks command tests. The finding still quotes
Both mirror Rust tests of the same name shape in
Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 844f811 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The update test asserted only that the shim file still existed in the global bin directory. The shim is a shell script that the deletion of node_modules never touches, so that assertion held whether or not the update put anything back. Verified by deleting the restored package: the old assertion passed, the new one fails. The shim reaches its target through the hash link rather than through the install dir the group currently resolves to, so that is the path the restored package has to be reachable by. Asserting it also covers the case where the tree comes back under a new install dir the hash link was never repointed at. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 3501b72 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Bencher Report is red on this head, and the benchmark runner is the reasonFlagging this rather than leaving a red check unexplained.
Two further reasons this PR cannot be the cause:
I have not pushed anything to chase this, because there is nothing in the diff to change. Re-running the workflow when the runner is quieter should clear it; the call on whether to do that before merge is yours. Written by an agent (Claude Code, claude-opus-5). |
Enumerating a global group's bins read every declared dependency's manifest and propagated any error, so deleting a group's node_modules made `pnpm add -g`, `pnpm update -g` and `pnpm remove -g` abort with ERR_PNPM_PACKAGE_MANIFEST_IO_ERROR before touching any group. One damaged group blocked every other package named in the same command, with manual directory deletion as the only way out. A group whose node_modules is wholly absent is definitively not installed: no bin can resolve through it and no further reading can recover what it owned. Only that case now reads as "owns no bins". A present-but-incomplete tree still fails closed, which keeps the preflight property the e2e tests lock in: unknown ownership is never treated as an unowned bin, and `remove -g victim-a victim-b` still refuses to delete victim-a while victim-b's ownership cannot be established. The v12 probe goes through the existing FsReadDir filesystem capability instead of std::fs, so the fake-filesystem unit tests keep exercising the per-manifest error paths; only NotFound is absorbed and every other I/O error still surfaces. The residual hazard is that a stale bin left by the vanished group is no longer attributable and may survive removal, and that a surviving group in the same state stops protecting a bin it shares with the group being removed; both are accepted because such a group is otherwise unrepairable, and both are asserted in each stack. Closes pnpm#15093. --------- Co-authored-by: Dextheking1 <[email protected]> Co-authored-by: Dextheking1 <[email protected]> Co-authored-by: Zoltan Kochan <[email protected]>
Summary
pnpm add -g,pnpm update -g, andpnpm remove -gcan now recover a global package group whose entirenode_modulesdirectory was deleted. Previously all three aborted withERR_PNPM_PACKAGE_MANIFEST_IO_ERRORbefore touching any group, so one damaged group blocked every other global package named in the same command and the only way out was deleting directories by hand.Fixes #15093.
The change draws the line the issue proposes: a group whose
node_modulesis wholly absent is definitively not installed, so it owns no bins and the command can proceed. A group whosenode_modulesexists but has a missing, unreadable, or malformed dependency manifest still fails closed, so the preflight that guards against mistaking unknown ownership for an unowned bin is unchanged. Both preflight e2e tests (global_update_preflights_incomplete_target_ownership_before_activation,global_remove_preflights_all_targets_before_mutating_any_group) pass unmodified.Implemented in both stacks, since the bug is present in both:
pnpm11/global/packages/src/scanGlobalPackages.ts):getInstalledBinNamesstatsnode_modulesfirst;ENOENTreturns an empty set and any other error is rethrown.pnpm/crates/global/src/scan.rs):get_installed_bin_names_with_fsprobes the tree through the existingFsReadDirfilesystem capability.NotFoundmaps to an empty bin set; any other I/O error still surfaces asPackageManifestError::Read. The probe goes through the capability rather thanstd::fsso the fake-filesystem unit tests keep exercising the per-manifest read error paths.Trade-off, as the issue calls out: a bin left behind in the global bin dir by the vanished group is no longer attributable to it, so
remove -gof such a group may leave a stale shim. That is accepted because the group is otherwise unrepairable.The same applies in reverse, and both stacks now assert it: a surviving group whose
node_modulesis gone no longer protects a bin it shares with the group being removed, so that shim goes with the removal. Nothing that worked stops working, because the survivor's own tree is already unusable.Squash Commit Body
Verification
pnpm-global: unit tests for the absent-tree case, the partial-tree fail-closed case, a non-NotFoundprobe failure, and preserved permission-denied manifest reads.pnpm-cli: theglobal,global::ownershipandcli_args::globalmodules, all passing. They include the update that restores a group with a deletednode_modules, theremove -gthat tears a damaged group down alongside a healthy one, and the survivor case below. Both preflight tests pass unchanged.@pnpm/global.commands: the full package suite, all passing. It includes thegetInstalledBinNamescase for a deleted tree and the twohandleGlobalRemovecases below.Checklist
pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users, it becomes a release note.Written by an agent (AGI, Muse Spark 1.3). Revised by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
node_modulesdirectory has been deleted.pnpm add -gandpnpm update -grestore missing dependencies and command-line binaries.pnpm remove -gcan remove affected global groups without failing; command shims from damaged groups may remain.