Repository navigation
perf(lockfile): drop removed dependencies without resolving - #13698
Conversation
|
Warning Review limit reached
Next review available in: 5 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughDependency removal now uses fast lockfile updates in Rust and TypeScript. Removed importer entries, unreachable packages, and orphaned catalog entries are pruned without registry access. Updates fall back to full resolution when surviving peer references depend on removed packages. ChangesDependency removal fast updates
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related 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 QodoFast-path lockfile updates when dependencies are removed from manifest
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains, and the previously reported narrating comment has been removed without changing behavior. Reviews (5): Last reviewed commit: "fix(lockfile): parse catalog references ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts (1)
105-106: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse string operations for peer delimiters.
After
peersIndexidentifies the suffix, useslice(1, -1)instead of two custom regular expressions.As per coding guidelines, prefer plain string operations over custom regular expressions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts` around lines 105 - 106, In the peer-suffix parsing logic after peersIndex identifies the suffix, replace the chained leading and trailing parenthesis regular-expression calls with a single slice(1, -1) operation. Preserve removal of exactly the outer peer delimiters.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/package-manager/src/fast_update_importers.rs`:
- Around line 36-40: Update the removal fast path in
pnpm/crates/package-manager/src/fast_update_importers.rs:36-40 and
pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts:75-87 to
create a detached candidate with importer edges removed, prune or compute
reachability first, then validate peer suffixes only against surviving
snapshots/packages. Fall back only when a reachable peer suffix references a
dropped dependency, while preserving the existing pruning, mutation, and removal
behavior.
In `@pnpm/crates/package-manager/src/fast_update_importers/tests.rs`:
- Around line 158-170: Add hashed peer-suffix regression coverage in
`rejects_dropping_a_dependency_another_package_resolves_as_a_peer` and the
equivalent `tryFastUpdateImporters` test: create fixtures whose peer suffix is
opaque/hashed, then assert `try_fast_update_importers()` returns `None` in
`tests.rs` and `tryFastUpdateImporters()` returns `false` in
`importerRemovalFastUpdate.ts`; update both affected files at the specified
ranges.
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts`:
- Around line 61-75: Stage the importer aliases to remove instead of deleting
them directly from lockfile.importers during the loop. Run
peerSuffixesAreIndependentOf() against the staged state or equivalent validation
input, return false without mutating lockfile when validation rejects, and apply
all removals only after validation succeeds. Add an assertion in the
peer-fallback test confirming subject remains unchanged.
- Around line 69-71: After deleting the alias in tryFastUpdateImporters, remove
any now-empty dependencies, devDependencies, or optionalDependencies group from
importer. Preserve non-empty groups and align the resulting lockfile shape with
the Rust implementation.
---
Nitpick comments:
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts`:
- Around line 105-106: In the peer-suffix parsing logic after peersIndex
identifies the suffix, replace the chained leading and trailing parenthesis
regular-expression calls with a single slice(1, -1) operation. Preserve removal
of exactly the outer peer delimiters.
🪄 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: 8ba08efa-c619-40d6-acd9-69399dfc8657
📒 Files selected for processing (6)
.changeset/drop-removed-dependencies-without-resolving.mdpnpm/crates/cli/tests/lockfile_resolution_reuse.rspnpm/crates/package-manager/src/fast_update_importers.rspnpm/crates/package-manager/src/fast_update_importers/tests.rspnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.tspnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts
Micro-Benchmark ResultsLinux |
Code Review by Qodo
1. Catalog:default pruned (TS)
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13698 +/- ##
==========================================
+ Coverage 88.19% 88.21% +0.01%
==========================================
Files 615 615
Lines 99955 100070 +115
==========================================
+ Hits 88157 88273 +116
+ Misses 11798 11797 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Moving this to draft: CI found three real regressions, and they point at something structural rather than a bug in the rewrite. All three are installs that remove packages, and all three now take the fast path where they used to resolve:
The rewritten lockfile itself is right, which is why the unit and integration tests I wrote all pass. What is missing is everything else an install does when packages disappear. Those steps live on the full-resolution path, and the fast path routes around them into headless materialization. That has a consequence beyond this PR, which is the part worth attention: the same reasoning applies to any fast path that removes packages, and So the question this PR has to answer first is not "how do I prune catalogs too" — it is whether removal bookkeeping belongs on the fast path at all, or whether the fast path needs to signal that packages were dropped so the install still does the removal work. I would rather settle that than bolt three fixes on. Leaving the transformation and its tests in place, since they are useful either way. Written by an agent (Claude Code, claude-opus-5). |
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.77870506784,
"stddev": 0.1332120236147204,
"median": 2.77270309534,
"user": 2.82189508,
"system": 2.1416986200000006,
"min": 2.60010733534,
"max": 2.98939825734,
"times": [
2.66148154834,
2.87005699934,
2.93448405634,
2.7388701483399998,
2.98939825734,
2.80653604234,
2.61537631634,
2.7223616963399997,
2.84837827834,
2.60010733534
]
},
{
"command": "pacquet@main",
"mean": 2.8815378901399997,
"stddev": 0.19175325261909817,
"median": 2.85594338184,
"user": 3.15813938,
"system": 2.3550964199999997,
"min": 2.61598778434,
"max": 3.21748833934,
"times": [
3.21748833934,
2.61598778434,
3.08618160734,
2.91770632734,
3.0379866883399997,
2.71578291334,
2.74334042834,
2.79418043634,
2.95004266634,
2.73668171034
]
},
{
"command": "pnpr@HEAD",
"mean": 1.70429361094,
"stddev": 0.1256561921698147,
"median": 1.71341802184,
"user": 2.0248186799999996,
"system": 1.9271801199999998,
"min": 1.5154695813399999,
"max": 1.85738680734,
"times": [
1.80936353434,
1.64258010634,
1.55643668434,
1.85738680734,
1.84441507034,
1.6691058773399998,
1.75773016634,
1.80108058734,
1.58936769434,
1.5154695813399999
]
},
{
"command": "pnpr@main",
"mean": 1.5967111943399999,
"stddev": 0.12339808476210815,
"median": 1.5516195163399997,
"user": 1.9511001799999999,
"system": 1.81621292,
"min": 1.50784741634,
"max": 1.90869308734,
"times": [
1.7045404783399998,
1.5434251803399999,
1.5441959393399998,
1.51735607034,
1.90869308734,
1.50784741634,
1.55904309334,
1.58643166834,
1.51631368934,
1.5792653203399998
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.39856557666000003,
"stddev": 0.013100973245284009,
"median": 0.39720797866,
"user": 0.34730472,
"system": 0.72282356,
"min": 0.38020713016,
"max": 0.42015312216,
"times": [
0.39220781716,
0.40135051816,
0.38020713016,
0.41737834616,
0.40154786816000004,
0.42015312216,
0.39274616016,
0.40387344216000004,
0.39306543916000003,
0.38312592316000005
]
},
{
"command": "pacquet@main",
"mean": 0.37622141496,
"stddev": 0.016636603744311432,
"median": 0.37283440166000004,
"user": 0.32962012,
"system": 0.7019557599999999,
"min": 0.35448577916,
"max": 0.40169102416,
"times": [
0.38013504516,
0.37062995416,
0.39981205216000004,
0.40169102416,
0.37503884916,
0.35951945116,
0.36023593916,
0.37040702416000004,
0.39025903116000005,
0.35448577916
]
},
{
"command": "pnpr@HEAD",
"mean": 0.39929702536000006,
"stddev": 0.02770367983174071,
"median": 0.3969541776600001,
"user": 0.32744752,
"system": 0.6991955599999999,
"min": 0.36129755016000004,
"max": 0.46155554216000005,
"times": [
0.40649184716000003,
0.40382571716000004,
0.38475774916000005,
0.38011935116,
0.36129755016000004,
0.39008263816000005,
0.37810270716000005,
0.41507041216,
0.41166673916,
0.46155554216000005
]
},
{
"command": "pnpr@main",
"mean": 0.4169027376600001,
"stddev": 0.024378695921940727,
"median": 0.42059490616000006,
"user": 0.35136611999999995,
"system": 0.7363527599999999,
"min": 0.38088581716000003,
"max": 0.44406119816,
"times": [
0.44195978516,
0.44406119816,
0.42084443916000003,
0.41720268716000003,
0.43917039116,
0.43206277316,
0.39142359416,
0.38107131816,
0.38088581716000003,
0.42034537316000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.91476424962,
"stddev": 0.07372248974317551,
"median": 2.92927661602,
"user": 2.7855126599999993,
"system": 2.1134421199999998,
"min": 2.75870943052,
"max": 2.99203416952,
"times": [
2.99203416952,
2.97962703552,
2.95956847952,
2.94162195552,
2.91693127652,
2.86614164252,
2.91536196452,
2.84094262452,
2.97670391752,
2.75870943052
]
},
{
"command": "pacquet@main",
"mean": 2.76780996932,
"stddev": 0.07185535662735479,
"median": 2.7449737025200003,
"user": 2.43225186,
"system": 1.85823112,
"min": 2.68160339152,
"max": 2.92930529452,
"times": [
2.74513780252,
2.72237257152,
2.74480960252,
2.71518554952,
2.80660053752,
2.68160339152,
2.72886360052,
2.77291408352,
2.92930529452,
2.83130725952
]
},
{
"command": "pnpr@HEAD",
"mean": 1.73547785232,
"stddev": 0.157750700598595,
"median": 1.69049520952,
"user": 1.8509898599999999,
"system": 1.7403537200000003,
"min": 1.56959375852,
"max": 2.03314795252,
"times": [
2.03314795252,
1.7022831575200001,
1.9783354805200002,
1.61901129652,
1.67870726152,
1.58501840552,
1.7556670895200002,
1.56959375852,
1.77654048652,
1.6564736345200002
]
},
{
"command": "pnpr@main",
"mean": 1.63309192032,
"stddev": 0.1644809201309766,
"median": 1.5548393365200002,
"user": 1.4754571600000002,
"system": 1.39724112,
"min": 1.48086128352,
"max": 1.8946910895200002,
"times": [
1.50904585852,
1.48086128352,
1.8946910895200002,
1.48573603952,
1.59610949452,
1.49017582452,
1.51356917852,
1.73956662352,
1.76391480552,
1.85724900552
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5253766385799999,
"stddev": 0.04770275971347447,
"median": 0.5280275888800001,
"user": 0.6847358399999999,
"system": 0.8708038,
"min": 0.45015053138,
"max": 0.61200357138,
"times": [
0.5272718213800001,
0.45982962538,
0.5052023723800001,
0.45015053138,
0.5287833563800001,
0.61200357138,
0.5374654373800001,
0.5741938553800001,
0.5336762033800001,
0.5251896113800001
]
},
{
"command": "pacquet@main",
"mean": 0.5296492339800001,
"stddev": 0.034797178335169696,
"median": 0.5253764948800002,
"user": 0.70289224,
"system": 0.8777595,
"min": 0.47984841838000003,
"max": 0.58059173738,
"times": [
0.5249003723800001,
0.5002153003800001,
0.49318091138000003,
0.51946892038,
0.47984841838000003,
0.5314244653800001,
0.5789879343800001,
0.58059173738,
0.5258526173800001,
0.5620216623800001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.36089513438000004,
"stddev": 0.009000598427713892,
"median": 0.35935529738,
"user": 0.25472474,
"system": 0.6079199,
"min": 0.34605104638,
"max": 0.37535634038,
"times": [
0.37229920838,
0.37535634038,
0.35742672438,
0.36712739738,
0.35209857738,
0.35578297338,
0.35905329238,
0.36409848138,
0.35965730238,
0.34605104638
]
},
{
"command": "pnpr@main",
"mean": 0.36708580678,
"stddev": 0.009474923085685379,
"median": 0.36948675238,
"user": 0.2600574399999999,
"system": 0.624101,
"min": 0.34858668838,
"max": 0.37620268238,
"times": [
0.37613575938,
0.35816945138,
0.35858683238,
0.37620268238,
0.34858668838,
0.36403108938,
0.37530643038,
0.36935940738,
0.36961409738,
0.37486562938
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.81922780644,
"stddev": 0.050481698581951395,
"median": 1.81128340674,
"user": 1.00097562,
"system": 0.9469894200000001,
"min": 1.75971028874,
"max": 1.90674617874,
"times": [
1.84604241374,
1.76541168074,
1.75971028874,
1.84824269074,
1.90674617874,
1.8804117067400001,
1.78118415774,
1.82818027574,
1.7943865377400001,
1.78196213374
]
},
{
"command": "pacquet@main",
"mean": 1.76744969824,
"stddev": 0.02232357382663734,
"median": 1.76717477874,
"user": 0.9057010200000001,
"system": 0.87836782,
"min": 1.7313480997400001,
"max": 1.8148905397400001,
"times": [
1.7313480997400001,
1.75497222074,
1.78100095374,
1.76247380074,
1.75325645974,
1.75307864074,
1.77187575674,
1.77585611974,
1.7757443907400001,
1.8148905397400001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31134318344000006,
"stddev": 0.009848834180836095,
"median": 0.31013624274,
"user": 0.19961271999999997,
"system": 0.5317372199999999,
"min": 0.29952603474,
"max": 0.32753286974,
"times": [
0.32440611974000005,
0.30405280774000004,
0.31300876274,
0.30494647274000003,
0.31449693674,
0.29952603474,
0.30726372274,
0.29995841574000004,
0.31823969174000005,
0.32753286974
]
},
{
"command": "pnpr@main",
"mean": 0.32282084064000005,
"stddev": 0.014124924489811896,
"median": 0.32573213674,
"user": 0.23026971999999998,
"system": 0.5384974199999999,
"min": 0.29059487074,
"max": 0.33900199174,
"times": [
0.29059487074,
0.32793552574,
0.30877188574000003,
0.33900199174,
0.32317132074000005,
0.33424400774,
0.32799151874000004,
0.31988671374000005,
0.33308182374,
0.32352874774
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23516882435333333,
"stddev": 0.015461019235245163,
"median": 0.23302735252,
"user": 0.17750971333333332,
"system": 0.08209989333333333,
"min": 0.21471230102000002,
"max": 0.26140433102,
"times": [
0.23950868302000003,
0.22654602202000002,
0.22234063102,
0.24926150902000002,
0.25212515702,
0.22285172202000003,
0.26140433102,
0.21471230102000002,
0.21929515502000002,
0.22272653902000003,
0.24651969102000001,
0.24473415102000004
]
},
{
"command": "pacquet@main",
"mean": 0.25927655185333337,
"stddev": 0.023021349465970908,
"median": 0.26074079902,
"user": 0.20475696333333335,
"system": 0.10394780999999999,
"min": 0.23003088602000002,
"max": 0.29099217502,
"times": [
0.24231193602000003,
0.25505565002,
0.26959849502,
0.29099217502,
0.28415576002,
0.28404310402,
0.26642594802,
0.28108156402,
0.24602454702000004,
0.23003088602000002,
0.23074425202,
0.23085430502000004
]
},
{
"command": "pnpr@HEAD",
"mean": 0.09090375423428573,
"stddev": 0.0027993448753564462,
"median": 0.09081375002,
"user": 0.02113623714285714,
"system": 0.012632774285714285,
"min": 0.08634069502,
"max": 0.09938801002,
"times": [
0.09938801002,
0.09163363602,
0.09040636902,
0.08663288502000001,
0.09078551802,
0.09127931602,
0.09046029802000001,
0.09578867602,
0.09051284702000001,
0.09002557702,
0.09228003702,
0.09285124802,
0.09223585602,
0.09235598602,
0.09375879002000001,
0.08951864002,
0.09147813702,
0.08694752102,
0.09115040402,
0.09084198202,
0.08654843902,
0.08634069502,
0.09380583602,
0.09005132002,
0.08900348502000001,
0.09118991602,
0.08903331702,
0.08900037702000001
]
},
{
"command": "pnpr@main",
"mean": 0.09119347689096778,
"stddev": 0.002527646281024512,
"median": 0.09085792402000001,
"user": 0.02292442838709677,
"system": 0.010878850322580642,
"min": 0.08512712002,
"max": 0.09560642902000001,
"times": [
0.08903581602,
0.09051091502,
0.08804150602000001,
0.09038468002,
0.09467876702,
0.08945591202,
0.09336372402,
0.08839379102,
0.09121996802,
0.09440619602,
0.09402492002,
0.09288561602,
0.09418689002,
0.09443147602,
0.08922623602,
0.09168926002000001,
0.09026962702,
0.08582952702,
0.08512712002,
0.08975021602000001,
0.09000033302,
0.09089903702,
0.09149039602,
0.09051905802,
0.09060697202000001,
0.09251099702,
0.09085792402000001,
0.09560642902000001,
0.09325719602,
0.09376414902,
0.09057312902
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7140545341577779,
"stddev": 0.12055056958438311,
"median": 0.71439352538,
"user": 0.648780031111111,
"system": 0.15710334444444443,
"min": 0.5227664413800001,
"max": 0.8776215673800001,
"times": [
0.72537000738,
0.85721936938,
0.71439352538,
0.81240540238,
0.5227664413800001,
0.62957610138,
0.8776215673800001,
0.59091931338,
0.69621907938
]
},
{
"command": "pacquet@main",
"mean": 0.8618564633800001,
"stddev": 0.23213315253222078,
"median": 0.9183695133800001,
"user": 0.7915569199999999,
"system": 0.1724507888888889,
"min": 0.56269887138,
"max": 1.16024518938,
"times": [
1.10699608338,
0.9183695133800001,
1.0588162113800001,
1.16024518938,
0.56269887138,
0.7329479303800001,
0.6236486383800001,
0.98165472738,
0.61133100538
]
},
{
"command": "pnpm@HEAD",
"mean": 2.90551175038,
"stddev": 0.018043188512289345,
"median": 2.90687330738,
"user": 4.190231364444444,
"system": 0.28667690000000007,
"min": 2.87844623438,
"max": 2.93038506538,
"times": [
2.88640310938,
2.8944631493800004,
2.92605612538,
2.87844623438,
2.91856724338,
2.9133773243800003,
2.89503419438,
2.90687330738,
2.93038506538
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.68569577396,
"stddev": 0.1398919787695273,
"median": 4.674456274460001,
"user": 2.5116119800000005,
"system": 1.9873386199999998,
"min": 4.50843051946,
"max": 4.88857493246,
"times": [
4.71101671346,
4.88857493246,
4.63789583546,
4.53445099246,
4.76141656946,
4.80031738746,
4.56350378546,
4.86840708146,
4.58294392246,
4.50843051946
]
},
{
"command": "pacquet@main",
"mean": 4.79927283186,
"stddev": 0.14767258959754545,
"median": 4.80070945246,
"user": 2.98221418,
"system": 2.2627349199999998,
"min": 4.5258523004599995,
"max": 5.0374898434599995,
"times": [
4.5258523004599995,
4.82712156446,
4.65916221346,
5.0374898434599995,
4.770433339459999,
4.97511393846,
4.7757259004599995,
4.82569300446,
4.87338370046,
4.72275251346
]
},
{
"command": "pnpr@HEAD",
"mean": 3.72442779446,
"stddev": 0.1332662329012653,
"median": 3.70775872046,
"user": 2.0774082799999998,
"system": 1.8757845200000003,
"min": 3.5859517344600005,
"max": 4.03466746246,
"times": [
3.6853266884600004,
3.8117802714600004,
3.5859517344600005,
3.61575140846,
3.6674804244600003,
3.5929628944600003,
3.7731785004600003,
3.73019075246,
3.7469878074600005,
4.03466746246
]
},
{
"command": "pnpr@main",
"mean": 3.6339179919600006,
"stddev": 0.09726785409017333,
"median": 3.6043760594600003,
"user": 1.7335309799999998,
"system": 1.5829256200000001,
"min": 3.52427909446,
"max": 3.77686427646,
"times": [
3.65300675146,
3.77250515546,
3.58484494246,
3.74016430746,
3.5462289354600003,
3.6239071764600004,
3.5460490794600004,
3.5713302004600003,
3.52427909446,
3.77686427646
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13698 |
| 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) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,468.31 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 294.99 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 293.62 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 88.40 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,404.76 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,456.36 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 294.90 ms |
|
The redesign landed as its own PR: #13700 fixes the underlying headless bug (#13699) that this PR's CI surfaced — the hoist layer and Once 13700 merges, this PR gets rebased on top of it; the remaining work here is the third failure, which is genuinely this PR's: pruning catalog snapshots that lose their last referent when an importer edge is dropped. Written by an agent (Claude Code, claude-opus-5). |
… review A dropped importer edge whose specifier was a catalog reference left the catalog snapshot behind once nothing referenced it, where a full resolution removes it. Prune unreferenced catalog entries after dropping edges, in the removal handler and in the ignored-optional handler, which had the same gap since it also removes importer edges. Both stacks. Stage the TypeScript removal on a cloned candidate so a rejected fast update leaves the callers lockfile untouched, matching the Rust handler, which already returned a fresh candidate. Check peer suffixes after pruning rather than before: a peer-dependent package that the removal itself makes unreachable needs no rekeying, so dropping a dependency together with its dependent now takes the fast path. Delete importer dependency groups the removal empties, matching the Rust handler, and cover the hashed-peer-suffix fallback in both stacks. Reported by CodeRabbit, Greptile, and Qodo on #13698.
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 `@pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts`:
- Around line 73-97: Update tryFastUpdateImporters() to reject the fast path
when dropped dependencies require install-side state changes, including
pendingBuilds or hoisting, rather than committing the candidate directly. Keep
the fast path limited to safe importer updates and use the existing full-install
fallback for removals; add an integration regression verifying installed state
and relevant .modules.yaml fields after removing a dependency.
🪄 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: ec54399d-5b40-4879-b6a9-4525ca8fe9ab
📒 Files selected for processing (12)
.changeset/drop-removed-dependencies-without-resolving.mdpnpm/crates/package-manager/src/fast_update_catalogs.rspnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rspnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies/tests.rspnpm/crates/package-manager/src/fast_update_importers.rspnpm/crates/package-manager/src/fast_update_importers/tests.rspnpm/crates/package-manager/src/fast_update_lockfile.rspnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.tspnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.tspnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.tspnpm11/installing/deps-installer/test/install/ignoredOptionalDependencies.tspnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- .changeset/drop-removed-dependencies-without-resolving.md
- pnpm/crates/package-manager/src/fast_update_importers.rs
|
Code review by qodo was updated up to the latest commit bb102fb |
|
Code review by qodo was updated up to the latest commit 4157267 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…tocol The referenced-check compared importer specifiers to a rebuilt protocol string, so the catalog:default spelling of the default catalog read as unreferenced. The range-only handler has carried that since it landed, where the miss only dropped a config-removed entry early; the pruning this PR adds turned it into losing a live entry. Parse the specifier with the catalog protocol parser on both sides instead. The sole-reference check of the exact-version rewrite had the same comparison with the opposite failure direction -- a catalog:default referent fell back needlessly -- so it parses now too. Reported by Qodo on #13698.
|
Code review by qodo was updated up to the latest commit 15062be |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
For the record on the Bencher alert ( If the main-branch trend for this benchmark stays elevated after the merge commit, that would falsify the noise reading and deserve a bisect — worth a glance at the next few main runs. Written by an agent (Claude Code, claude-opus-5). |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light.png)
Summary
Related to #13696, the first of the cases that still re-resolve even though the lockfile already answers them.
A dependency the lockfile records but the manifest no longer declares forced a full resolution. Answering it needs no registry access at all: drop the importer's entry and prune whatever that leaves unreachable. Both stacks already had the pruning, from the
ignoredOptionalDependencieshandler.hasChangedProjectSpecifiers, which only compared the manifest against the lockfile in one direction, so a removed dependency was never noticed as a change and the fast path was never offered the case.Scope, and what this does not do yet
This is the lockfile transformation
pnpm removeperforms, and it applies today to an install over a hand-editedpackage.json— which is the same operation a user reaches for when they delete a dependency by hand.Wiring the remove command itself still needs the mutation gate opened, and that is deliberately not in this PR. The gates differ between the stacks: the TypeScript CLI gates on
installsOnly(allMutationsAreInstalls) and feeds removals into resolution viaremovePackages, while pacquet'spacquet removeisProjectMutation::NoInstall, a variant it shares withlink,import,fetch, andrebuild. Opening either gate is its own change with its own risks, and it is easier to review once the transformation underneath it is settled.When it falls back
A surviving package that resolves a peer through the removed one has its id embedded in its own key, so the removal would rekey the dependent rather than only prune it. Peer suffixes are checked after pruning, so a peer-dependent package that the removal itself makes unreachable does not force a fallback. A peer suffix pnpm shortened into a hash cannot be read to rule the above out, so that falls back too.
What review and CI added
ignoredOptionalDependencieshandler, which had the same gap.pendingBuilds) were symptoms of a pre-existing headless bug, fixed separately in fix(deps-restorer): react to removed packages in the headless install #13700; this PR's tests now pass on top of it.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).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Bug Fixes
node_modules.