Repository navigation
fix(package-manager): record which projects each install proved installed - #17030
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 1
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #17030 +/- ##
========================================
Coverage 92.55% 92.55%
========================================
Files 1778 1784 +6
Lines 228533 228911 +378
========================================
+ Hits 211521 211872 +351
- Misses 17012 17039 +27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD 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.
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 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.44617719644,
"stddev": 0.0919728918163283,
"median": 2.4342116576399997,
"user": 1.2176171399999998,
"system": 1.3107253,
"min": 2.27175413114,
"max": 2.57734715614
},
{
"command": "pacquet@main",
"mean": 2.34538253774,
"stddev": 0.11136341792562898,
"median": 2.28708470014,
"user": 1.1979692400000002,
"system": 1.3157321999999998,
"min": 2.2408251031399997,
"max": 2.55318049414
},
{
"command": "pnpr@HEAD",
"mean": 1.4802143548399997,
"stddev": 0.13253280556862332,
"median": 1.4737701531399998,
"user": 1.11845994,
"system": 1.2224431,
"min": 1.3053986441399998,
"max": 1.6816954391399999
},
{
"command": "pnpr@main",
"mean": 1.36865067524,
"stddev": 0.08355217615743538,
"median": 1.33235156514,
"user": 1.1458502400000001,
"system": 1.1419621000000002,
"min": 1.29965448614,
"max": 1.5629311551399998
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23816085187999997,
"stddev": 0.011559710507222347,
"median": 0.23776896918,
"user": 0.27158819999999995,
"system": 0.5726200799999999,
"min": 0.22340846768,
"max": 0.25813623668
},
{
"command": "pacquet@main",
"mean": 0.23877081608,
"stddev": 0.009440815724486048,
"median": 0.23877982218,
"user": 0.27334329999999996,
"system": 0.58130848,
"min": 0.22175535568,
"max": 0.26058453568
},
{
"command": "pnpr@HEAD",
"mean": 0.23515615478,
"stddev": 0.011697338272070902,
"median": 0.23241544868,
"user": 0.2629481,
"system": 0.5158449799999999,
"min": 0.22088845368,
"max": 0.26532099868000003
},
{
"command": "pnpr@main",
"mean": 0.30974139788,
"stddev": 0.09011651998809346,
"median": 0.26065426518,
"user": 0.3464573,
"system": 0.6870351799999999,
"min": 0.24201681268,
"max": 0.44206513568000005
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.00914635455355263,
"stddev": 0.0009439665986185516,
"median": 0.008901940820000002,
"user": 0.005214765,
"system": 0.004825233421052628,
"min": 0.00805711482,
"max": 0.014380164820000001
},
{
"command": "pacquet@main",
"mean": 0.009375449289798658,
"stddev": 0.0011718054419661867,
"median": 0.009011162320000002,
"user": 0.0051775103355704705,
"system": 0.005128015302013423,
"min": 0.008150226820000002,
"max": 0.01511582782
},
{
"command": "pnpr@HEAD",
"mean": 0.009934412411836738,
"stddev": 0.0011434025700314309,
"median": 0.009633738320000002,
"user": 0.005551078775510206,
"system": 0.0053398669387755135,
"min": 0.008140732820000001,
"max": 0.013802996820000002
},
{
"command": "pnpr@main",
"mean": 0.009552499997083335,
"stddev": 0.0011663334681899752,
"median": 0.00920076832,
"user": 0.00530289,
"system": 0.0051758162500000005,
"min": 0.008147492820000001,
"max": 0.014536825820000002
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.007785774073333332,
"stddev": 0.0008089596975390785,
"median": 0.007652018240000001,
"user": 0.0049401280808080835,
"system": 0.003467878888888887,
"min": 0.006998403740000001,
"max": 0.013332994740000001
},
{
"command": "pacquet@main",
"mean": 0.007686694676507934,
"stddev": 0.0003106207508794497,
"median": 0.00766907474,
"user": 0.004851935873015874,
"system": 0.003536516634920636,
"min": 0.006978266740000001,
"max": 0.00943499574
},
{
"command": "pnpr@HEAD",
"mean": 0.007884333377037036,
"stddev": 0.00038393108196475335,
"median": 0.00785403824,
"user": 0.005051231111111108,
"system": 0.003581536444444443,
"min": 0.0071147137400000005,
"max": 0.00988647374
},
{
"command": "pnpr@main",
"mean": 0.007828116061543416,
"stddev": 0.00032014188828351567,
"median": 0.00783692174,
"user": 0.00454050327974276,
"system": 0.004069104694533763,
"min": 0.006988966740000001,
"max": 0.00966424674
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.51241926964,
"stddev": 0.010828299146958072,
"median": 2.5081714136400004,
"user": 1.8857484800000002,
"system": 1.6390030600000003,
"min": 2.49990700114,
"max": 2.53266374414
},
{
"command": "pacquet@main",
"mean": 2.5129886637400007,
"stddev": 0.02103287890166235,
"median": 2.50787889314,
"user": 1.89669478,
"system": 1.6356736600000001,
"min": 2.49169335814,
"max": 2.56458266814
},
{
"command": "pnpr@HEAD",
"mean": 1.5345993747400004,
"stddev": 0.09161342241876613,
"median": 1.5319672676400002,
"user": 1.22228078,
"system": 1.32021236,
"min": 1.40833781214,
"max": 1.7350794551400002
},
{
"command": "pnpr@main",
"mean": 1.57690852034,
"stddev": 0.09915507153165502,
"median": 1.5529120926400002,
"user": 1.20967018,
"system": 1.30547046,
"min": 1.4306044531400002,
"max": 1.73077805514
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7028436908400001,
"stddev": 0.10600625258992212,
"median": 0.7306254354400001,
"user": 1.10951136,
"system": 1.2658316200000002,
"min": 0.5726555909400001,
"max": 0.8513043359400001
},
{
"command": "pacquet@main",
"mean": 0.5760911251400002,
"stddev": 0.016593310730587642,
"median": 0.57564187194,
"user": 0.8377565600000001,
"system": 1.0806596199999998,
"min": 0.54424419794,
"max": 0.6050331759400001
},
{
"command": "pnpr@HEAD",
"mean": 0.37343927764000007,
"stddev": 0.008011973459865429,
"median": 0.37598305094000006,
"user": 0.35586735999999997,
"system": 0.80123512,
"min": 0.36026375294,
"max": 0.38519700594
},
{
"command": "pnpr@main",
"mean": 0.40675542104000006,
"stddev": 0.09351525243052893,
"median": 0.36416882594,
"user": 0.38679995999999994,
"system": 0.87258982,
"min": 0.35309245794,
"max": 0.61003236394
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6138405282600001,
"stddev": 0.01280672508646285,
"median": 1.61259058526,
"user": 0.8721250399999999,
"system": 0.9000722000000001,
"min": 1.60097848926,
"max": 1.6430416722599999
},
{
"command": "pacquet@main",
"mean": 1.6522702293600002,
"stddev": 0.11063877438975438,
"median": 1.62059287626,
"user": 0.9919197399999999,
"system": 0.9663628,
"min": 1.55829501426,
"max": 1.94989865726
},
{
"command": "pnpr@HEAD",
"mean": 0.28590061616000007,
"stddev": 0.010079134724355168,
"median": 0.28595530976000005,
"user": 0.25527774,
"system": 0.5347230000000001,
"min": 0.27167167926,
"max": 0.30809910926000006
},
{
"command": "pnpr@main",
"mean": 0.2872732266600001,
"stddev": 0.00913154725156901,
"median": 0.28876294276000003,
"user": 0.23800154,
"system": 0.5723812,
"min": 0.27109002426000006,
"max": 0.30226520426000003
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22222055487846154,
"stddev": 0.011761750670734209,
"median": 0.21945564634,
"user": 0.20660556769230767,
"system": 0.07796248923076923,
"min": 0.20673152034,
"max": 0.24119619534000003
},
{
"command": "pacquet@main",
"mean": 0.23292110988545459,
"stddev": 0.011748326407722715,
"median": 0.22990228234,
"user": 0.1989356236363636,
"system": 0.08865853818181818,
"min": 0.21793121834,
"max": 0.25536209634
},
{
"command": "pnpr@HEAD",
"mean": 0.0990664128757143,
"stddev": 0.013029610728638088,
"median": 0.09318357034000001,
"user": 0.03642961714285715,
"system": 0.018186612857142855,
"min": 0.08899508334,
"max": 0.13311792434
},
{
"command": "pnpr@main",
"mean": 0.12530585670363636,
"stddev": 0.004858724707545139,
"median": 0.12535074084,
"user": 0.06117444181818181,
"system": 0.024766310909090906,
"min": 0.11778061734,
"max": 0.13319276434000002
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21912200787111114,
"stddev": 0.011905111358230516,
"median": 0.21820425176000002,
"user": 0.21790348888888886,
"system": 0.04814182222222222,
"min": 0.20010937476000001,
"max": 0.24203338176000003
},
{
"command": "pacquet@main",
"mean": 0.20995727731555558,
"stddev": 0.010723230461406618,
"median": 0.20798612676000003,
"user": 0.2109419333333333,
"system": 0.05401804444444445,
"min": 0.19713338976000003,
"max": 0.22639404076000003
},
{
"command": "pnpm@HEAD",
"mean": 3.397098857204444,
"stddev": 0.053854195086652366,
"median": 3.38283816976,
"user": 5.281912044444445,
"system": 0.3314454888888888,
"min": 3.31441383076,
"max": 3.46659900076
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.20483415942461536,
"stddev": 0.005766439445666588,
"median": 0.20319832004000002,
"user": 0.1580881123076923,
"system": 0.08054629999999999,
"min": 0.19725439304,
"max": 0.21745207104
},
{
"command": "pacquet@main",
"mean": 0.20602439239714282,
"stddev": 0.004801454611702065,
"median": 0.20417210104,
"user": 0.1537072057142857,
"system": 0.08672851428571429,
"min": 0.20046351804,
"max": 0.21857325904000002
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.09882820810500002,
"stddev": 0.025404756276863224,
"median": 0.08660324048000001,
"user": 0.0366610375,
"system": 0.06978334250000003,
"min": 0.08143808298,
"max": 0.16223969298000002
},
{
"command": "pacquet@main",
"mean": 0.14616088848,
"stddev": 0.015120262271665295,
"median": 0.14726539648000003,
"user": 0.06107726666666666,
"system": 0.0962270022222222,
"min": 0.12130534498000001,
"max": 0.18318134898000002
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.504677570580001,
"stddev": 0.13865937001966666,
"median": 4.45907811378,
"user": 1.61463496,
"system": 1.8986562399999998,
"min": 4.38626643178,
"max": 4.78847642678
},
{
"command": "pacquet@main",
"mean": 4.48269603838,
"stddev": 0.09221383200658045,
"median": 4.44566064678,
"user": 1.6012918600000003,
"system": 1.9252512400000001,
"min": 4.41154702478,
"max": 4.71431501278
},
{
"command": "pnpr@HEAD",
"mean": 3.543344657080001,
"stddev": 0.06628470555920507,
"median": 3.5228225762800003,
"user": 1.56433936,
"system": 1.76649454,
"min": 3.47617891778,
"max": 3.68524834278
},
{
"command": "pnpr@main",
"mean": 3.62261168798,
"stddev": 0.08555700682776429,
"median": 3.6241049112800003,
"user": 1.52501586,
"system": 1.80848244,
"min": 3.46898797978,
"max": 3.7511039747800003
}
]
}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.12472459740952381,
"stddev": 0.02015636257309643,
"median": 0.11877819860000001,
"user": 0.15041633523809522,
"system": 0.11747480285714283,
"min": 0.11232969660000001,
"max": 0.20677351260000001
},
{
"command": "pacquet@main",
"mean": 0.14987609670000002,
"stddev": 0.03697643205560811,
"median": 0.12975682309999997,
"user": 0.18144543999999999,
"system": 0.14852326,
"min": 0.11403562860000001,
"max": 0.2176281336
},
{
"command": "pnpr@HEAD",
"mean": 0.21717432768333333,
"stddev": 0.021506344823022945,
"median": 0.2126120716,
"user": 0.25395240666666663,
"system": 0.18756641,
"min": 0.1856520196,
"max": 0.26029956760000006
},
{
"command": "pnpr@main",
"mean": 0.23138399750909092,
"stddev": 0.03273524847899002,
"median": 0.2325719236,
"user": 0.2659694218181818,
"system": 0.1947521145454546,
"min": 0.1709970226,
"max": 0.27595821360000006
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.15206012224,
"stddev": 0.024344271150513852,
"median": 1.14774320124,
"user": 0.5357356,
"system": 0.20889602,
"min": 1.11754813074,
"max": 1.2047874457399999
},
{
"command": "pacquet@main",
"mean": 1.1579242449399998,
"stddev": 0.06337112157174235,
"median": 1.14299552274,
"user": 0.5691185,
"system": 0.21739441999999998,
"min": 1.1194314937399998,
"max": 1.33279904374
}
]
} |
Add an end-to-end harness that runs sequences of installs, filtered installs, and edits across lockfile layouts, linkers, and injected workspace packages, and checks each gate in both directions after every step. The install fast path must be taken exactly when a full install with optimisticRepeatInstall off changes nothing in node_modules or the lockfiles. A filtered run gate must let its command through exactly when a clean install of a copy of the sources resolves the selection the same way and records the same wanted and current lockfile entries for it. Right after an install, every gate it satisfied must pass without installing again. On the parent commit the harness fails for an edit to a project that a later filtered install left out, for a manifest or lockfile edit that kept its mtime, and for repeated filtered installs and full installs after filtered commands, which never took the fast path. Part of pnpm/tasks#141 and pnpm/tasks#142. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lled The repeat-install fast path and the verifyDepsBeforeRun gate compared the mtimes of the manifests, the lockfile, patches, and pnpmfiles with one workspace-wide lastValidatedTimestamp, plus a filteredInstall flag. That could not say which projects an install had validated: a filtered install refreshed the timestamp for the projects it left out too, so an edit to one of them went unnoticed, and an edit that kept its mtime was never seen at all. Every fix taught one decider one more case. The workspace state now records, under a validation key pnpm v11 ignores, the content digest of each project's manifest and of the lockfile it was proven against, keyed by importer id, plus a stat signature (mtime, inode change time, size) and digest for the lockfile, patches, and pnpmfiles. A project is proven installed while both digests still match. Manifests are hashed from the parsed value, so a rewrite that keeps the content keeps the fast path. A shared input file is read again only when its stat no longer matches or falls inside the window a racy write could hide in. The gates hold only the projects their install can fix: every project for an unfiltered install, the selection and the workspace projects it links for a filtered install or command, and for an unfiltered command every stale project plus the never-installed ones the selection needs. A held project is checked against the lockfile, and against the current lockfile when its lockfile changed or it was never proven, comparing every group the current lockfile records. A filtered install vouches only for what it materialized and carries the other records forward unless a workspace-wide input changed. Every state write goes through one assembler, recorded_workspace_state, so carried fields cannot be dropped by one writer. A state without validation records, as pnpm v11 writes it, is proven again from the lockfiles once. After a pnpm v11 filtered install the install gate still refuses it, since that current lockfile lists the projects the install left out as installed. ManifestFreshness is gone: in-memory manifests are judged by content like every other one, and are no longer all content-checked on every run. Part of pnpm/tasks#142. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three gates kept reporting stale dependencies after the install they spawned, so every command installed again: - In a workspace with one shared lockfile and no root package.json, the gate treated the missing root manifest as unreadable. It now checks the workspace projects without a root importer, as the install does. - Under dedicated per-project lockfiles, a filtered command verified only the selected projects, not the workspace projects they link. It now verifies and installs those too, one project at a time, unless the workspace injects its packages. - When the install the gate spawned still leaves the dependencies out of date, the gate now warns instead of looping silently, so a gate that cannot converge is reported. Part of pnpm/tasks#142. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…side its test Co-Authored-By: Claude Opus 5.5 <[email protected]>
… same A lockfile stat'd in the clock tick its validation was recorded in is not trusted, so the next check reads it. When its content was unchanged that check left the state as it was, so every later run read the file again. It now records the state, after which the stat stands for the content. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-path refusal #17025 makes the repeat-install check refuse its fast path for any project whose dedicated lockfile injects a workspace package, since nothing compares the file: snapshot with the injected package. The oracle still checks that layout's install gate for soundness and every run gate, but no longer requires it to take the fast path (pnpm/tasks#145). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
aaa27a7 to
771cfa8
Compare
A check that re-read a lockfile or patch whose recorded stat fell in the racy window recorded it again. When that check ran in the same filesystem clock tick as the file's last change, the new record was just as untrusted, so every check in that tick wrote the state again and Code Coverage caught a run gate that never converged. Such a write now happens only when every file it records will be trusted. Otherwise the next check reads the file again, which it would have done anyway. Tests that assert convergence wait for the filesystem clock to pass the setup's writes, as a real install and the next command never share a tick. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@coderabbitai review |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoRecord per-project install proofs for repeat-install and run gates
AI Description
Diagram
High-Level Assessment
Files changed (65)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Latest suggestions up to 2c0ace0 Warning
Previous suggestionsSuggestions up to commit 79cdfc8
Suggestions up to commit 51f2516
Suggestions up to commit da1b80d
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
…heck The stand-in check, the restore of a missing wanted lockfile, the patch hash comparison, the manifest check, and the selection's reachability each loaded node_modules/.pnpm/lock.yaml again when the wanted lockfile was missing, as with lockfile: false. They now share one lazily loaded copy carried by InputDrift. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… only when up to date Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Code review by qodo was updated up to the latest commit 2c0ace0 |
…s in the repeat-install check (#17471) The workspace state's validation records a digest of each project manifest, and the next run compares it with the manifest on disk. Since #17030 the install recorded the manifests after `packageExtensions` and the pnpmfile's `readPackage` hook, so with any hook every project looked modified. The content check then compared the raw manifest with an importer resolved from the hooked one and failed whenever the hook rewrote a specifier, and the full install recorded the hooked digests again. The fix separates the two views: - The state records only declared manifests (read from disk, or as a mutating command writes them). `DeclaredManifests` carries them to every state writer and to the check. Nothing converts a hooked slice into one, so a digest can no longer come from the wrong view. - The content check, which compares a modified manifest with the lockfile, now reads it as the resolver does: `packageExtensions`, then the pnpmfile's `readPackage` through the install's `hook_one_manifest`, then the overrides. Comparing the raw manifest could also report a false "up to date", when the raw specifier equals the locked one but the hook rewrites it. The pnpmfile loads lazily, so the Node worker starts only when a manifest changed. The check is synchronous, so it blocks on the hooks with `block_in_place` on the multi-thread runtime, or on a runtime of its own outside one, and defers to the install on a current-thread runtime. `ManifestHooks::InMemory` carries a caller's in-memory hooks (deploy, pnpr lockfiles, the Node-API binding) to the check. pnpm v11 clones each project manifest before hooking it, so it records the declared ones. It already runs the hooks in its own content check (#17148), so it is not affected. Closes #17468
Summary
Redesigns how pnpm v12 decides that
node_modulesis up to date, in the repeat-install fast path and theverifyDepsBeforeRungate. This follows the "is node_modules up to date?" loop in pnpm/tasks#142 and adds the test harness pnpm/tasks#141 asks for. That loop had 14 fixes in 90 days, #17019 being the latest.Both checks compared file mtimes with one workspace-wide
lastValidatedTimestampand afilteredInstallflag. That state can't say which projects an install validated, and mtime ordering misses edits that keep their mtime.What changes
validationkey, which pnpm v11 neither reads nor writes. It records, for each importer id, the content digest of the manifest that project was proven installed with and of the lockfile it was proven against. A project is proven while both digests still match. A filtered install vouches only for the projects it materialized and carries the other records forward, unless a workspace-wide input changed (settings, catalogs, pnpmfiles, config dependencies, patches).cp -p,rsync -a, ortouch -rrestoring an mtime.run/execholds the selection plus the workspace projects it links;run/execholds every stale project anywhere (a root script may touch them), but a never-installed project only where the selection needs it.--prodfiltered install doesn't pass. A project the current lockfile doesn't list keeps v11's wording: "Workspace package … has dependencies but was not installed".recorded_workspace_state. The fields a writer carries over (autoDedupe, kept dependency groups, which projects it vouches for) are required inputs, so no writer can drop one (the class behind fix: stop the pre-run install for a dedupe baseline a frozen install cannot record #16396 and fix: settle single-project lockfile checks #16996).package.json, the gate treated the missing root manifest as unreadable;sharedWorkspaceLockfile: false, a filtered command didn't verify the workspace projects its selection links. They are now verified and installed project by project, except injected ones, which live inside the dependent's own install.ManifestFreshnessremoved. In-memory manifests (@pnpm/napi) are judged by content like any other, instead of every project being content-checked on every run.States written by older pnpm v12 releases or by pnpm v11 have no records. Every project is then proven once from the lockfiles and recorded. After a pnpm v11 filtered install, the install gate still refuses, because v11's current lockfile lists the projects that install left out as installed (pnpm/tasks#139).
It overlaps #16588, which changes the same state writers. Whichever lands second rebases onto the other.
Bugs this fixes
The new harness (
repeat_install_oracle, 14 scenarios × 8 layouts) failed 38 of 112 tests on the commit this PR started from, and passes all 112 here. #17025 has since made the install fast path refuse every project whose dedicated lockfile injects a workspace package (pnpm/tasks#145). In those two layouts, the harness still checks that every gate is sound but no longer requires the install fast path. The failures before this PR:install --filterleft out: the run gate passed with the new dependency missing;cp -p,rsync -a, archive extraction, DockerCOPY) went unseen by both gates;install --filter, a repeat of the same filtered install, and a full install after filtered commands had installed every project, never took the fast path;package.jsonreinstalled before everyrun/exec;Performance
A synthetic 1000-project workspace (3 workspace links each), release builds, median of 150 interleaved runs (60 for the touch rows). The machine was under load from other jobs, so CPU time (user+sys) is listed next to wall time. All times in ms.
rungaterungateSteady state is unchanged. A rewrite that keeps the content no longer costs a content check. Manifests are hashed sequentially: parallel hashing on the rayon pool cost about 3 ms more CPU per run for 1000 projects, from waking the workers. The state file grows from 119 KB to 180 KB for 1000 projects, because records are keyed by importer id and the lockfile digest is stored once.
Limitations
Tests that changed meaning
These asserted the old mtime behavior and now assert the content behavior. Each still pins what it was written for:
*_mtime_collision,single_project_*_converges_*) asserted that a same-size edit with its mtime restored stayed up to date. They now assert that a converged check writes nothing, and a Unix test asserts the poisoned lockfile is detected;dedupe_peers_lockfile_regeneration…relied on an identical regenerated lockfile still triggering an install. An identical lockfile now needs none. The test reaches the spawned install through a layout-only rewrite and keeps its reporter-order assertions;pnpm-lock.yamltoo.Hand-written states in the unit tests now get their
validationfrom the realrecord_validation. The harness builds its states from real installs only.pnpm v11
v11 has the same mtime and filtered-install bugs. #17034 fixes them there and writes this
validationformat. A test in each stack pins the same manifest digest, so each CLI reuses the other's records. The v11/v12 differential test from pnpm/tasks#141 needs a harness that runs both binaries. It follows once both PRs land.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version. (v11 half: fix(deps.status): record which projects each install proved installed #17034.)
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-5).
🤖 Generated with Claude Code
Summary by CodeRabbit
pnpm runandpnpm execcheck dependencies for selected projects and their workspace dependencies, including in workspaces without a root manifest.