Repository navigation
feat(install): decide a repeat install from the recorded manifests - #17637
Conversation
|
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. Walkthrough
Merge Risk:
|
Micro-Benchmark ResultsLinux |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #17637 +/- ##
==========================================
+ Coverage 92.80% 92.81% +0.01%
==========================================
Files 2068 2073 +5
Lines 267047 267326 +279
==========================================
+ Hits 247827 248129 +302
+ Misses 19220 19197 -23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Same-run syscall checkEach install runs 2 more times per revision, untimed, under
Integrated-Benchmark Report (Linux)Commit: Compared against main at: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo 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.5531478933000002,
"stddev": 0.14320239722609804,
"median": 2.5664741727000004,
"user": 2.55869928,
"system": 1.97385584,
"min": 2.3903898862000004,
"max": 2.8459595752
},
{
"command": "pacquet@main",
"mean": 2.4702653117000004,
"stddev": 0.08913674968523508,
"median": 2.4670211212,
"user": 2.2755667799999997,
"system": 1.80977414,
"min": 2.3538651012000003,
"max": 2.6256107162
},
{
"command": "pnpr@HEAD",
"mean": 1.4902341924,
"stddev": 0.1144784413829981,
"median": 1.4975531927,
"user": 2.1563476799999997,
"system": 1.7519946400000002,
"min": 1.3621952492,
"max": 1.7164141202
},
{
"command": "pnpr@main",
"mean": 1.429259989,
"stddev": 0.061247716794466986,
"median": 1.4254658317,
"user": 2.0636617800000003,
"system": 1.73642614,
"min": 1.3200648532,
"max": 1.5125685072
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24340673516,
"stddev": 0.005345330906078554,
"median": 0.24305865226,
"user": 0.28498021999999995,
"system": 0.58168322,
"min": 0.23440795426,
"max": 0.25253114026
},
{
"command": "pacquet@main",
"mean": 0.23639766946000002,
"stddev": 0.010116906025511874,
"median": 0.23870425476,
"user": 0.26078902,
"system": 0.59094402,
"min": 0.21757292826,
"max": 0.24683379826000001
},
{
"command": "pnpr@HEAD",
"mean": 0.26741593826,
"stddev": 0.006225239734829448,
"median": 0.26659858976,
"user": 0.31276741999999996,
"system": 0.6222813199999999,
"min": 0.25603886126000003,
"max": 0.28074997026
},
{
"command": "pnpr@main",
"mean": 0.28554770466,
"stddev": 0.01278215862055482,
"median": 0.28036482476,
"user": 0.31710101999999996,
"system": 0.6675020199999999,
"min": 0.27228339626,
"max": 0.31413398226
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.015442930043880594,
"stddev": 0.002367307542682369,
"median": 0.015089980820000001,
"user": 0.008310457910447752,
"system": 0.008436111641791045,
"min": 0.011082908820000001,
"max": 0.02710831382
},
{
"command": "pacquet@main",
"mean": 0.015041596479722218,
"stddev": 0.0019843114732984246,
"median": 0.015105424320000001,
"user": 0.009015935833333337,
"system": 0.0074149423611111105,
"min": 0.010448427820000002,
"max": 0.02094766082
},
{
"command": "pnpr@HEAD",
"mean": 0.015416068626249998,
"stddev": 0.0020277789908527202,
"median": 0.01503652982,
"user": 0.008705796249999998,
"system": 0.00800564775,
"min": 0.011288818820000001,
"max": 0.02397267182
},
{
"command": "pnpr@main",
"mean": 0.01623549432299402,
"stddev": 0.002486979335229171,
"median": 0.01601696982,
"user": 0.009277818203592816,
"system": 0.008032599401197603,
"min": 0.01140014882,
"max": 0.02514304282
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.01964260490985916,
"stddev": 0.0031150748391864137,
"median": 0.019503736100000002,
"user": 0.010488485352112682,
"system": 0.01019250422535211,
"min": 0.013640383600000002,
"max": 0.0345225916
},
{
"command": "pacquet@main",
"mean": 0.015419076529203544,
"stddev": 0.0030203103193519043,
"median": 0.015035154600000001,
"user": 0.009189184778761057,
"system": 0.007351355752212389,
"min": 0.010185322600000001,
"max": 0.023995648600000002
},
{
"command": "pnpr@HEAD",
"mean": 0.01878107921538462,
"stddev": 0.002870179257906505,
"median": 0.0186778816,
"user": 0.01063845230769231,
"system": 0.009208142377622377,
"min": 0.012111869600000002,
"max": 0.025684159600000003
},
{
"command": "pnpr@main",
"mean": 0.016758384811267617,
"stddev": 0.0026173982909260267,
"median": 0.0163789976,
"user": 0.009548034647887324,
"system": 0.008538886478873239,
"min": 0.0114777216,
"max": 0.0278331666
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.59863600178,
"stddev": 0.026453588080257637,
"median": 2.6022055435800002,
"user": 2.7160728599999997,
"system": 1.6646710800000002,
"min": 2.5401694700800004,
"max": 2.62336831608
},
{
"command": "pacquet@main",
"mean": 2.5860401649800004,
"stddev": 0.03139146051533662,
"median": 2.5824251835800003,
"user": 2.5688323599999996,
"system": 1.63329138,
"min": 2.54127947108,
"max": 2.64593404908
},
{
"command": "pnpr@HEAD",
"mean": 1.51976629128,
"stddev": 0.12239258372928584,
"median": 1.47724210558,
"user": 2.08103296,
"system": 1.4991109799999998,
"min": 1.40078872808,
"max": 1.7602185370799999
},
{
"command": "pnpr@main",
"mean": 1.55888393978,
"stddev": 0.11254834660534732,
"median": 1.53215828358,
"user": 2.10736016,
"system": 1.6021292800000002,
"min": 1.42513043508,
"max": 1.76368382608
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6378464144,
"stddev": 0.03402690421827446,
"median": 0.6398659022000001,
"user": 1.00775552,
"system": 1.09910048,
"min": 0.5825718572,
"max": 0.7062057332000001
},
{
"command": "pacquet@main",
"mean": 0.6197788822,
"stddev": 0.03800820106040181,
"median": 0.6059394757000001,
"user": 0.9630083199999998,
"system": 1.1106554800000004,
"min": 0.5657028502000001,
"max": 0.6821403662000001
},
{
"command": "pnpr@HEAD",
"mean": 0.41787505220000004,
"stddev": 0.029901342421511733,
"median": 0.41183071920000003,
"user": 0.42241092,
"system": 0.7325369799999999,
"min": 0.37281139420000003,
"max": 0.4810978772
},
{
"command": "pnpr@main",
"mean": 0.45077469290000005,
"stddev": 0.07304032320783237,
"median": 0.43844267820000005,
"user": 0.45061582000000006,
"system": 0.7963538800000001,
"min": 0.37348852120000003,
"max": 0.5926786052
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8114372838599997,
"stddev": 0.031038797437643147,
"median": 1.81481097896,
"user": 1.26545556,
"system": 1.15535742,
"min": 1.7509330234600002,
"max": 1.8607473384600002
},
{
"command": "pacquet@main",
"mean": 1.81590792636,
"stddev": 0.039559557061631015,
"median": 1.8130625444600001,
"user": 1.2700487599999999,
"system": 1.1371718199999998,
"min": 1.76357469046,
"max": 1.87342705546
},
{
"command": "pnpr@HEAD",
"mean": 0.37331747766,
"stddev": 0.018428213861079935,
"median": 0.37429588346000003,
"user": 0.36661906,
"system": 0.70962372,
"min": 0.34215455446000004,
"max": 0.40037273646000004
},
{
"command": "pnpr@main",
"mean": 0.36902030236000005,
"stddev": 0.015514644745376567,
"median": 0.36392819446,
"user": 0.37096396,
"system": 0.7119487199999999,
"min": 0.35553976346000005,
"max": 0.40995892846000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4192620638000001,
"stddev": 0.027372786027918598,
"median": 0.42202106110000004,
"user": 0.43322794,
"system": 0.5740597399999999,
"min": 0.36444985710000005,
"max": 0.46211220210000004
},
{
"command": "pacquet@main",
"mean": 0.42001262720000004,
"stddev": 0.03707810169578007,
"median": 0.4073683991,
"user": 0.43268233999999994,
"system": 0.59137274,
"min": 0.3862154621,
"max": 0.49715929010000004
},
{
"command": "pnpr@HEAD",
"mean": 0.12046899071538462,
"stddev": 0.007419357138976967,
"median": 0.1210162696,
"user": 0.05599030153846153,
"system": 0.04464204769230768,
"min": 0.10957339410000001,
"max": 0.1340553761
},
{
"command": "pnpr@main",
"mean": 0.1249892076652174,
"stddev": 0.0073413288329810394,
"median": 0.1256940501,
"user": 0.06363894869565216,
"system": 0.04363321826086958,
"min": 0.10782719610000001,
"max": 0.1359294781
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.3345348350511111,
"stddev": 0.046542391517769774,
"median": 0.31372910494,
"user": 0.3754722111111111,
"system": 0.09314371999999999,
"min": 0.28279929494,
"max": 0.43536395294
},
{
"command": "pacquet@main",
"mean": 0.2908313367177778,
"stddev": 0.024245881315954024,
"median": 0.28520039494,
"user": 0.32139843333333334,
"system": 0.08782160888888887,
"min": 0.25825482794,
"max": 0.32901597694
},
{
"command": "pnpm@HEAD",
"mean": 6.447707605273333,
"stddev": 0.8942506214481148,
"median": 6.11568124494,
"user": 10.160064988888887,
"system": 0.5485758311111112,
"min": 5.46793455294,
"max": 7.75838838394
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.09680079694551723,
"stddev": 0.005628341537617539,
"median": 0.09567625598,
"user": 0.0930752503448276,
"system": 0.0648983924137931,
"min": 0.08723148898,
"max": 0.11391436998
},
{
"command": "pacquet@main",
"mean": 0.09655392398000001,
"stddev": 0.00625033111727841,
"median": 0.09696507398,
"user": 0.08859286592592593,
"system": 0.06743588666666667,
"min": 0.08635802198,
"max": 0.10869463298
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.11175801594413794,
"stddev": 0.008990219629134799,
"median": 0.11017205822000001,
"user": 0.04188762275862068,
"system": 0.07843773862068965,
"min": 0.09713985822000001,
"max": 0.13218774322
},
{
"command": "pacquet@main",
"mean": 0.11717155206615383,
"stddev": 0.008574874549043408,
"median": 0.11674781922000002,
"user": 0.04279387076923077,
"system": 0.08346686461538463,
"min": 0.10239609122000001,
"max": 0.13358233122
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.6569015525,
"stddev": 0.22679240924841204,
"median": 4.5656486660999995,
"user": 2.3794742199999996,
"system": 1.66192298,
"min": 4.4566174306,
"max": 5.0398777256
},
{
"command": "pacquet@main",
"mean": 4.722815922700001,
"stddev": 0.16704999237682427,
"median": 4.7273970781,
"user": 2.3540006200000003,
"system": 1.6635174799999999,
"min": 4.4870150606,
"max": 4.9268369526
},
{
"command": "pnpr@HEAD",
"mean": 3.8015973464000004,
"stddev": 0.12172174378948523,
"median": 3.7692126201000002,
"user": 2.548734819999999,
"system": 1.76622458,
"min": 3.6769305846,
"max": 4.0155363886
},
{
"command": "pnpr@main",
"mean": 3.6047351686000004,
"stddev": 0.11003202475149775,
"median": 3.5852838416,
"user": 2.306728819999999,
"system": 1.5861014800000002,
"min": 3.4898196736,
"max": 3.8274903956
}
]
}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.19423334249333338,
"stddev": 0.02177528498754567,
"median": 0.19027673736000003,
"user": 0.24200368666666666,
"system": 0.17840528000000003,
"min": 0.15997025536,
"max": 0.24037351336
},
{
"command": "pacquet@main",
"mean": 0.19652937914571428,
"stddev": 0.018754417057285196,
"median": 0.19348512136,
"user": 0.25266979142857143,
"system": 0.17744775142857142,
"min": 0.16746172536000004,
"max": 0.23938376936000003
},
{
"command": "pnpr@HEAD",
"mean": 0.25659155936,
"stddev": 0.032334504602658735,
"median": 0.24772234286000003,
"user": 0.2999393033333333,
"system": 0.1917562633333333,
"min": 0.21685523936000003,
"max": 0.31322588036000004
},
{
"command": "pnpr@main",
"mean": 0.20923299852666669,
"stddev": 0.014177651280365028,
"median": 0.21104240386,
"user": 0.2511008866666667,
"system": 0.17182334666666665,
"min": 0.18300384736000003,
"max": 0.23513590836000003
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.43639574452,
"stddev": 0.0480122052153062,
"median": 1.43214674742,
"user": 0.85145898,
"system": 0.32012346,
"min": 1.37027499792,
"max": 1.52189800792
},
{
"command": "pacquet@main",
"mean": 1.4677083027199997,
"stddev": 0.07231091391250138,
"median": 1.4471382474199999,
"user": 0.90640788,
"system": 0.32980405999999995,
"min": 1.37012566992,
"max": 1.64054717892
}
]
}Scenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.047084410896666665,
"stddev": 0.0056395125920629605,
"median": 0.04654061528,
"user": 0.03210632666666667,
"system": 0.029437626666666668,
"min": 0.03701186428,
"max": 0.06805808528000001
},
{
"command": "pacquet@main",
"mean": 0.05017909225014925,
"stddev": 0.004151971129780339,
"median": 0.050882399280000004,
"user": 0.035607525671641785,
"system": 0.0303583943283582,
"min": 0.04179773328,
"max": 0.06035124228
}
]
} |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoSkip unchanged workspace manifests on repeat installs
AI Description
Diagram
High-Level Assessment
Files changed (20)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🟡 Changes recommended
Cached manifest data can expose private credentials, and missing change times can cause dependency changes to be missed.
7 open issues
Avoid caching credential-bearing manifest values in world-readable state · New Require change time before trusting manifest metadata · New Refresh unusable manifest records after file-based checks · New Avoid cloning the entire workspace state on repeat installs · New Collect project stats concurrently on the warm path · New Verify record-based checks skip opening unchanged manifests · New Test equal-length manifest edits with restored mtime · New
What changed in this PR
This PR adds a record-based shortcut to the Rust CLI’s repeat-install check, avoiding reads of unchanged workspace manifests when trusted file metadata matches the saved state.
Changes:
- Separates workspace manifest discovery from manifest reading.
- Records manifest fields and digests for reuse, falling back to file-based checks when records are unusable or state must be written.
- Adds discovery, validation, and CLI regression tests, plus a user-facing changeset.
| File | Description |
|---|---|
pnpm/crates/workspace/src/projects/tests/manifest_paths.rs |
Tests manifest listing and precedence without parsing. |
pnpm/crates/workspace/src/projects/tests.rs |
Registers manifest-listing tests. |
pnpm/crates/workspace/src/projects.rs |
Separates manifest-path discovery from reading. |
pnpm/crates/workspace/src/lib.rs |
Exports the manifest-listing API. |
pnpm/crates/workspace-state/src/lib.rs |
Stores checked manifest fields in validation records. |
pnpm/crates/package-manager/src/optimistic_repeat_install/validation/manifest_files/stand_ins.rs |
Rebuilds manifests from matching recorded metadata. |
pnpm/crates/package-manager/src/optimistic_repeat_install/validation/manifest_files.rs |
Records fields needed by repeat-install checks. |
pnpm/crates/package-manager/src/optimistic_repeat_install/validation.rs |
Exposes stand-in construction internally. |
pnpm/crates/package-manager/src/optimistic_repeat_install/tests/validation.rs |
Tests recorded fields and stand-in rejection cases. |
pnpm/crates/package-manager/src/optimistic_repeat_install/manifest_source.rs |
Associates stand-in manifests with recorded digests. |
pnpm/crates/package-manager/src/optimistic_repeat_install/manifest_agreement.rs |
Uses recorded digests when checking stand-ins. |
pnpm/crates/package-manager/src/optimistic_repeat_install/freshness/stand_in_writes.rs |
Rejects write-requiring checks on stand-ins. |
pnpm/crates/package-manager/src/optimistic_repeat_install/freshness/missing_lockfile.rs |
Extracts missing-lockfile handling and guards restoration. |
pnpm/crates/package-manager/src/optimistic_repeat_install/freshness.rs |
Adds fallback guards before state-writing operations. |
pnpm/crates/package-manager/src/install/workspace_state/stand_ins.rs |
Attempts the record-based check before reading projects. |
pnpm/crates/package-manager/src/install/workspace_state.rs |
Coordinates record-based and file-based checks. |
pnpm/crates/package-manager/src/install/lifecycle.rs |
Shares workspace discovery options. |
pnpm/crates/cli/tests/suite/repeat_install_records.rs |
Covers unchanged workspaces, edits, new projects, and missing links. |
pnpm/crates/cli/tests/suite/main.rs |
Registers repeat-install record tests. |
.changeset/repeat-install-skips-unchanged-manifests.md |
Documents the repeat-install optimization. |
Review effort: Balanced
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Replies to the Qodo review and the benchmark comment. Fixes are in 6a47963, and e580feb moves code to stay within the file size limit.
The CI row Written by an agent (Claude Code, claude-opus-5-5). |
|
Code review by qodo was updated up to the latest commit e580feb |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
find_workspace_projects walks the package patterns, groups the manifest paths it finds by directory, and then parses each directory's first existing manifest. find_workspace_project_manifests returns the result of the walk alone, so a caller can learn the project directories and their manifest paths without opening any manifest. Discovery now runs the read on top of it. A directory that a `<dir>/*` pattern matches lists every manifest basename without a check, as the walk always did, so a listed directory need not hold a project. The repeat-install fast path will use this to confirm the workspace's project set from stats alone (pnpm/tasks#256). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The repeat-install fast path read and parsed every project manifest on every run. The workspace state now records, with each manifest's stat, the values of the top-level fields the check reads: name, version, the dependency maps, peerDependenciesMeta, bin, directories, and publishConfig. These replace the derived facts recorded before, which left out the dependency aliases the link check stats, the specs the local file dependency scan classifies, and the bin fields. Before discovery reads anything, the CLI fast path lists the project directories and stats each one's first existing manifest. When every project has a record whose stat still matches and is trusted, it runs the usual check on manifests rebuilt from the records, with their recorded digests. The active project's manifest, which the command read anyway, takes the place of its stand-in. Any project without a usable record, or a check that would refresh the state or restore the wanted lockfile, sends the install to the check on the manifest files, which writes what a check on stand-ins cannot derive. Part of pnpm/tasks#256. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…k body The guards that send a check on manifest stand-ins to the check on the files move into one function in their own module, and the missing wanted lockfile policy moves into its own module, keeping freshness.rs within the file size limit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A record keeps only `directory` of publishConfig and `bin` of directories, so the workspace state copies no other publishConfig value, such as a registry with credentials. - A record without fields is never reused by a write. - A check on the manifest files that finds a record missing, without fields, or with a changed or untrusted stat refreshes the state, so a state an older pnpm wrote gets records instead of reading every manifest on every run. - The check borrows the workspace state, so the records attempt no longer copies it. - The stand-ins stat the manifests in parallel, and a check on the files after an undecided attempt reads the projects that attempt listed instead of walking the workspace again. - Tests cover a same-size edit with its mtime restored, the refresh, and that a decided run never enters discovery's read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…wn module Co-Authored-By: Claude Opus 5.5 <[email protected]>
e580feb to
1acd1dc
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Unchanged uncacheable or future-dated manifests trigger workspace-wide rebuilds on every repeat install, causing avoidable filesystem work without producing usable records.
No open issues 🎉
2 resolved since last review
Review effort: Balanced



Summary
Phase 2 of pnpm/tasks#256. A repeat
pnpm installin an up-to-date workspace no longer reads thepackage.jsonof each project whose file did not change since the last install.Listing projects without reading them.
find_workspace_projectsalready walked the package patterns and grouped manifest paths by directory before parsing. That walk is nowfind_workspace_project_manifests, and discovery reads on top of it. For a<dir>/*pattern the walk lists every manifest basename without checking which exist, so a listed directory need not hold a project.What a record keeps. A trace of the check found that phase 1's derived facts (#17625) did not cover everything the check reads on every run. It also stats every dependency alias for dangling links, classifies every spec for local file dependencies, and reads
bin. Eachvalidation.manifestFilesrecord now keeps the values the check reads:name,version, andbin;*;optionalflag frompeerDependenciesMeta;directories.binandpublishConfig.directory.No other value enters the state. The phase 1 format never shipped in a release.
The shortcut. Before discovery, the CLI fast path lists the project directories and stats each one's first existing manifest. It then needs every project to have a record whose stat still matches and is trusted. When that holds, it runs the usual check on manifests rebuilt from the records, with their recorded digests. The active project's manifest, which the command read anyway, replaces its stand-in. Otherwise it falls back to the check on the files, as before. These cases fall back:
pnpm-lock.yaml. The file check writes what stand-ins cannot derive.After the install's check on the files, any missing, field-less, or stale record is refreshed, but only when the refreshed records will be usable. A state written by an older pnpm then gets records on its next install. The run gate does not refresh records.
The run gate (phase 3) and the full
Install::runpath still read every manifest.Measured on release builds of the base and this branch, medians of 150 repeat
pnpm install --offlineruns on one machine:pnpm-workspace.yaml: 5.1 ms on the base, 4.9 ms here;Squash Commit Body
Checklist
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Tests:
pacquet::installdebug trace:No docs: the state file is internal.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Summary by CodeRabbit