Repository navigation
Conversation
pacquet's `Lockfile` had no `time` field, so serde discarded the section on load and never wrote it back: a `pnpm-lock.yaml` carrying the publish dates a `resolutionMode: time-based` install records lost them the first time pacquet rewrote it. Model the section, fill it from the `time-based` pre-pass (the prior lockfile's entries with this run's freshly resolved ones layered over them), prune it to the importers' direct dependencies on save the way `pruneTimeInLockfile` does, and read it back as the fallback publish date for a direct dependency whose packument carries none — so against a registry whose abbreviated metadata omits publish times, a later resolution derives the cutoff the lockfile was written under rather than a different one. The write-time prune also runs ahead of the verification cache's content hash, so an in-memory lockfile still hashes to what it will hash to once saved and read back. Closes #13776
PR Summary by QodoFix lockfile time section round-tripping for time-based installs
AI Description
Diagram
High-Level Assessment
Files changed (28)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "test(lockfile): pin the `time` section's..." | Re-trigger Greptile |
|
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 (8)
📝 WalkthroughWalkthroughThe lockfile now stores direct dependency publish dates in an optional ChangesLockfile time metadata
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13787 +/- ##
==========================================
+ Coverage 88.16% 88.19% +0.03%
==========================================
Files 623 624 +1
Lines 101537 101608 +71
==========================================
+ Hits 89520 89618 +98
+ Misses 12017 11990 -27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`crate::prune_time` names both the re-exported function and the module it lives in, which `cargo doc --document-private-items` — what Rust CI runs — rejects as an ambiguous intra-doc link. The pre-push gate omits that flag, so the module stays invisible there and the link resolves. Also drops the test doc comments that only narrate what the test name and assertions already state, and skips cloning the lockfile's recorded publish dates on an install that will not consult them.
|
Responses to the Qodo findings: Unneeded time map clone — fixed in 47663ef. Changeset missing Also addressed Greptile's redundant-test-narration finding in the same commit, and fixed the Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 47663ef |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
pnpm/crates/lockfile/src/save_lockfile/tests.rs (1)
119-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winLog the rendered lockfile before each multiline assertion.
saved_byteswitheprintln!before eachassert_eq!. This makes lockfile-format failures readable in CI output.Proposed change
let saved_bytes = std::fs::read_to_string(&path).expect("read saved lockfile"); +eprintln!("SAVED LOCKFILE:\n{saved_bytes}\n"); assert_eq!(saved_bytes, format!("{LOCKFILE_YAML}\n{DIRECT_TIME}\n"));As per path instructions, “log complex values before non-equality assertions.”
Also applies to: 145-146
🤖 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 `@pnpm/crates/lockfile/src/save_lockfile/tests.rs` around lines 119 - 120, In the lockfile save tests, add an eprintln! of saved_bytes immediately before each multiline assert_eq! at the shown location and the additional occurrence around lines 145-146, so the rendered lockfile appears in CI output before assertion failures.Sources: Path instructions, Learnings
pnpm/crates/cli/src/cli_args/install.rs (1)
1023-1029: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftAdd a pnpr fallback regression test.
Test an install with an existing lockfile that contains direct-dependency
time:data. Make the pnpr response omittime:. Verify that the saved lockfile retains the prior direct entry and prunes obsolete entries.As per path instructions, include “regression and meaningful unit/e2e coverage” and prefer real CLI fixtures for lockfile paths.
🤖 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 `@pnpm/crates/cli/src/cli_args/install.rs` around lines 1023 - 1029, Add regression and meaningful unit/e2e coverage for the install flow around the pnpr fallback in the relevant test suite. Use a real CLI fixture with an existing lockfile containing direct-dependency time data, mock or configure the pnpr response without a time section, then assert the saved lockfile preserves the prior direct time entry while pruning obsolete entries.Source: Path instructions
pnpm/crates/lockfile-verification/src/hash_lockfile.rs (1)
33-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd hash regression coverage for
prune_time.Test that a pruned transitive
time:entry does not changehash_lockfile, while a retained directtime:entry changes the digest.🤖 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 `@pnpm/crates/lockfile-verification/src/hash_lockfile.rs` around lines 33 - 35, Extend the hash regression tests around hash_lockfile to cover pacquet_lockfile::prune_time: verify that changing a pruned transitive time: entry leaves the digest unchanged, while changing a retained direct time: entry produces a different digest. Reuse the existing lockfile fixtures and hashing helpers, and keep the assertions focused on these two behaviors.Source: Path instructions
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs (1)
281-281: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd direct output coverage for
time.The changed tests only pass
BTreeMap::new(). Add a test that passes a non-empty map and asserts thatLockfile.timecontains the same entries. This protects the new graph-to-lockfile boundary.As per path instructions, “Ensure the change remains scoped, uses the owning lockfile/resolver layers, includes regression and meaningful unit/e2e coverage.”
🤖 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 `@pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs` at line 281, Add direct regression coverage for the graph-to-lockfile conversion around the time field: pass a non-empty BTreeMap through the owning resolver/lockfile test path and assert that the resulting Lockfile.time preserves the same entries. Keep existing empty-map coverage and limit the change to meaningful unit or end-to-end boundary coverage.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/suite/install.rs`:
- Around line 1530-1534: Strengthen the assertions in the test around the
recorded publish dates by requiring recorded.len() == 1 in addition to verifying
the direct `@pnpm.e2e/foo`@ key count. Keep the existing direct-key assertion and
ensure the test covers pruning all transitive timestamp entries from the time:
data.
---
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/install.rs`:
- Around line 1023-1029: Add regression and meaningful unit/e2e coverage for the
install flow around the pnpr fallback in the relevant test suite. Use a real CLI
fixture with an existing lockfile containing direct-dependency time data, mock
or configure the pnpr response without a time section, then assert the saved
lockfile preserves the prior direct time entry while pruning obsolete entries.
In `@pnpm/crates/lockfile-verification/src/hash_lockfile.rs`:
- Around line 33-35: Extend the hash regression tests around hash_lockfile to
cover pacquet_lockfile::prune_time: verify that changing a pruned transitive
time: entry leaves the digest unchanged, while changing a retained direct time:
entry produces a different digest. Reuse the existing lockfile fixtures and
hashing helpers, and keep the assertions focused on these two behaviors.
In `@pnpm/crates/lockfile/src/save_lockfile/tests.rs`:
- Around line 119-120: In the lockfile save tests, add an eprintln! of
saved_bytes immediately before each multiline assert_eq! at the shown location
and the additional occurrence around lines 145-146, so the rendered lockfile
appears in CI output before assertion failures.
In `@pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs`:
- Line 281: Add direct regression coverage for the graph-to-lockfile conversion
around the time field: pass a non-empty BTreeMap through the owning
resolver/lockfile test path and assert that the resulting Lockfile.time
preserves the same entries. Keep existing empty-map coverage and limit the
change to meaningful unit or end-to-end boundary coverage.
🪄 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: 127fc20d-5781-4765-b48a-c1042afe4d77
📒 Files selected for processing (28)
.changeset/lockfile-time-section-round-trips.mdpnpm/crates/cli/src/cli_args/install.rspnpm/crates/cli/src/cli_args/patch_commit/tests.rspnpm/crates/cli/tests/suite/install.rspnpm/crates/deps-restorer/src/current_lockfile.rspnpm/crates/deps-restorer/src/current_lockfile/tests.rspnpm/crates/deps-restorer/src/hoisted_dep_graph/tests.rspnpm/crates/deps-restorer/src/package_map/tests.rspnpm/crates/deps-restorer/src/prune_direct_deps/tests.rspnpm/crates/lockfile-verification/src/hash_lockfile.rspnpm/crates/lockfile/src/lib.rspnpm/crates/lockfile/src/prune_time.rspnpm/crates/lockfile/src/prune_time/tests.rspnpm/crates/lockfile/src/save_lockfile/tests.rspnpm/crates/lockfile/src/serialize_yaml.rspnpm/crates/lockfile/src/yaml_emit.rspnpm/crates/lockfile/src/yaml_emit/tests.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rspnpm/crates/package-manager/src/install/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/lockfile_diff/tests.rspnpm/crates/package-manager/src/patch/tests.rspnpm/crates/real-hoist/src/tests.rspnpm/crates/resolving-deps-resolver/src/lockfile_reuse/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_importer/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs
Adds the coverage the review asked for, and drops a redundant guard the new tests exposed. The pnpr-assisted install path needed no carry-over of its own: the server resolves through the same fresh-lockfile pipeline, so the input lockfile's recorded dates already reach its answer. An end-to-end test against an in-process pnpr pins that, and fails when the pipeline's merge is broken. Also pins that a pruned `time:` entry leaves the verification cache's content hash where it was while a retained one moves it, that a non-empty map reaches `Lockfile.time` through the graph-to-lockfile boundary while an empty one leaves the section out, and narrows the end-to-end assertion to the exact recorded key so a stray transitive entry cannot pass.
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Follow-ups to the review nitpicks, all in 7536a5c: pnpr fallback regression test — added Writing it turned up something better than coverage: the client-side carry-over I had added to Hash regression coverage for Direct output coverage for Logging before the multiline assertions — skipped. The style guide asks to log before non- Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 7536a5c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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.41807348268,
"stddev": 0.0902880130456796,
"median": 2.39416152608,
"user": 1.62821304,
"system": 1.29488126,
"min": 2.34933364608,
"max": 2.6436990640799998,
"times": [
2.39476061508,
2.35768020608,
2.41866083608,
2.3621566820799997,
2.34933364608,
2.6436990640799998,
2.39356243708,
2.49277924408,
2.41503970808,
2.35306238808
]
},
{
"command": "pacquet@main",
"mean": 2.5721893717800004,
"stddev": 0.1486125454637103,
"median": 2.4996584085799998,
"user": 1.8454289400000001,
"system": 1.4352758599999997,
"min": 2.43490266508,
"max": 2.81967963608,
"times": [
2.43490266508,
2.5035427760799998,
2.75811123708,
2.44291970608,
2.48653792208,
2.58577801508,
2.81967963608,
2.49577404108,
2.75233769108,
2.44231002808
]
},
{
"command": "pnpr@HEAD",
"mean": 1.53483344278,
"stddev": 0.15395064560003957,
"median": 1.5294216605799997,
"user": 1.22035034,
"system": 1.2221571599999999,
"min": 1.37247819908,
"max": 1.76096769408,
"times": [
1.5673841630799998,
1.69654233308,
1.4104515810799998,
1.49778135808,
1.5610619630799998,
1.37247819908,
1.37413288608,
1.76096769408,
1.7333899170799998,
1.3741443330799998
]
},
{
"command": "pnpr@main",
"mean": 1.79458542778,
"stddev": 0.1184320268972205,
"median": 1.81178822308,
"user": 1.85364444,
"system": 1.8139037599999994,
"min": 1.60539426808,
"max": 1.94767409408,
"times": [
1.92362946708,
1.90299951308,
1.8241288250799998,
1.7615445380799999,
1.82138993608,
1.61179810008,
1.60539426808,
1.74510902608,
1.8021865100799999,
1.94767409408
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.45374121976000004,
"stddev": 0.013668755340732551,
"median": 0.45315974886,
"user": 0.42021571999999996,
"system": 0.78272206,
"min": 0.43315491736,
"max": 0.47587764036,
"times": [
0.45395295836,
0.47587764036,
0.47132212736,
0.45236653936000004,
0.43315491736,
0.45491658336,
0.44615138136000004,
0.45206560236000004,
0.46195691536,
0.43564753236000003
]
},
{
"command": "pacquet@main",
"mean": 0.45803071626,
"stddev": 0.02215312602400602,
"median": 0.44726900186,
"user": 0.41271701999999993,
"system": 0.7953482599999999,
"min": 0.43669564736,
"max": 0.50321210236,
"times": [
0.43669564736,
0.50321210236,
0.44005657836,
0.44431107436,
0.44788501736,
0.45996544436000003,
0.48791567636,
0.44665298636,
0.44504265236,
0.46856998336
]
},
{
"command": "pnpr@HEAD",
"mean": 0.44202036465999994,
"stddev": 0.05669623108615842,
"median": 0.41980006936,
"user": 0.39638191999999994,
"system": 0.7628276599999999,
"min": 0.37004363636,
"max": 0.53628927536,
"times": [
0.53628927536,
0.48865951936,
0.37004363636,
0.38928762036000003,
0.48294141536,
0.5059146343600001,
0.41426983136,
0.41771637436000003,
0.39319757536,
0.42188376436
]
},
{
"command": "pnpr@main",
"mean": 0.43160768926,
"stddev": 0.03315536104970928,
"median": 0.43103502436,
"user": 0.37008212,
"system": 0.7625238599999998,
"min": 0.38972287936,
"max": 0.49598099136,
"times": [
0.49598099136,
0.39944578636,
0.38972287936,
0.40269103936,
0.44406256636,
0.47253893136,
0.43469671136,
0.42966134636000003,
0.43240870236,
0.41486793836
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.0839792721399997,
"stddev": 0.04536326306186489,
"median": 3.1003836492400003,
"user": 2.84348036,
"system": 2.2026307599999995,
"min": 2.98134581374,
"max": 3.12356171574,
"times": [
3.0683228547400003,
3.1166797707400002,
3.12356171574,
3.0936491157400003,
3.11835226174,
3.1026224897400003,
2.98134581374,
3.03109595574,
3.10601793474,
3.0981448087400003
]
},
{
"command": "pacquet@main",
"mean": 3.0248823958399997,
"stddev": 0.04397349648928377,
"median": 3.0146043382400003,
"user": 2.6576678599999997,
"system": 2.1511373600000003,
"min": 2.95462669774,
"max": 3.10463312774,
"times": [
3.08229955574,
2.95462669774,
3.0229615887400003,
3.10463312774,
3.00527796174,
3.03713802774,
2.98873104474,
3.04097222474,
3.0062470877400003,
3.00593664174
]
},
{
"command": "pnpr@HEAD",
"mean": 1.67297408044,
"stddev": 0.06423340516994637,
"median": 1.6524048362400001,
"user": 1.81203316,
"system": 1.82969556,
"min": 1.6215313387399999,
"max": 1.83698386574,
"times": [
1.6215313387399999,
1.62238935474,
1.64266080174,
1.83698386574,
1.70275163574,
1.6283066077400001,
1.68548272874,
1.64588107074,
1.65892860174,
1.68482479874
]
},
{
"command": "pnpr@main",
"mean": 1.7076471220399998,
"stddev": 0.16488322724363788,
"median": 1.64926026374,
"user": 1.6371563599999999,
"system": 1.6861122599999998,
"min": 1.50860130674,
"max": 2.0031496517400003,
"times": [
1.5561014017400001,
1.6175634807400001,
1.50860130674,
1.86505969974,
1.66040099574,
1.91917283774,
1.63811953174,
1.60754433674,
2.0031496517400003,
1.7007579777400001
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.505771967,
"stddev": 0.06461156349943332,
"median": 0.4928729115,
"user": 0.67832584,
"system": 0.8212132799999999,
"min": 0.437387197,
"max": 0.66269022,
"times": [
0.5575155549999999,
0.66269022,
0.498172019,
0.486682645,
0.511678355,
0.500052794,
0.437387197,
0.447827825,
0.46813925600000006,
0.48757380400000006
]
},
{
"command": "pacquet@main",
"mean": 0.6662253332,
"stddev": 0.1912466541490859,
"median": 0.6329005305,
"user": 0.89178424,
"system": 0.9205595799999999,
"min": 0.47887765000000004,
"max": 1.031725781,
"times": [
1.031725781,
0.905969422,
0.747972618,
0.744692716,
0.638793081,
0.62700798,
0.47887765000000004,
0.49008293900000005,
0.516378109,
0.480753036
]
},
{
"command": "pnpr@HEAD",
"mean": 0.33697651879999996,
"stddev": 0.01816443820388675,
"median": 0.33989891000000005,
"user": 0.23816843999999998,
"system": 0.5633721799999999,
"min": 0.304368344,
"max": 0.362547076,
"times": [
0.314786359,
0.304368344,
0.3236579,
0.33338910000000005,
0.34910603300000004,
0.362547076,
0.338826018,
0.35289056500000004,
0.349221991,
0.34097180200000005
]
},
{
"command": "pnpr@main",
"mean": 0.3374247617000001,
"stddev": 0.005678608182122518,
"median": 0.33501231500000006,
"user": 0.23889654,
"system": 0.5752856799999999,
"min": 0.33014535700000003,
"max": 0.34539190200000003,
"times": [
0.344715879,
0.34539190200000003,
0.334033746,
0.33300919500000004,
0.33862837500000004,
0.33381879000000003,
0.333495772,
0.33014535700000003,
0.33599088400000005,
0.345017717
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7498196659799998,
"stddev": 0.030785428069862415,
"median": 1.74659893268,
"user": 0.8225432000000001,
"system": 0.7863619199999999,
"min": 1.71921966968,
"max": 1.82710053768,
"times": [
1.82710053768,
1.76344960268,
1.75780894068,
1.7401108836799999,
1.71921966968,
1.7473565606800001,
1.7458413046799999,
1.72647598568,
1.72326325068,
1.74756992368
]
},
{
"command": "pacquet@main",
"mean": 1.7731876671800002,
"stddev": 0.028840255971458565,
"median": 1.75980160718,
"user": 0.8435413,
"system": 0.8306670199999999,
"min": 1.74139448368,
"max": 1.82018908268,
"times": [
1.76476877968,
1.75270914968,
1.82018908268,
1.79995888268,
1.79995505568,
1.80115303368,
1.74886872168,
1.74139448368,
1.74804504768,
1.75483443468
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31037708368,
"stddev": 0.007893625314160699,
"median": 0.30865215168000004,
"user": 0.21140849999999997,
"system": 0.5246027200000001,
"min": 0.30018832868,
"max": 0.32536572268,
"times": [
0.30390932268,
0.31216018368,
0.32230612668,
0.31058309068,
0.32536572268,
0.30878253768,
0.30633014467999997,
0.30018832868,
0.30852176568,
0.30562361368
]
},
{
"command": "pnpr@main",
"mean": 0.30545551917999997,
"stddev": 0.009754699983690832,
"median": 0.30459537068,
"user": 0.20097569999999995,
"system": 0.52020962,
"min": 0.29125366968,
"max": 0.32373044068,
"times": [
0.30912812968,
0.31425102468,
0.29662715768,
0.30606160968,
0.32373044068,
0.30312913168,
0.31212763268,
0.29584904168,
0.30239735368,
0.29125366968
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2052489377584616,
"stddev": 0.016147530237970668,
"median": 0.20512469522000001,
"user": 0.1678522646153846,
"system": 0.05251678461538461,
"min": 0.17184859822,
"max": 0.23140827422000002,
"times": [
0.21159249622,
0.21461206722,
0.20755247122,
0.19970329822000002,
0.20512469522000001,
0.22233700622000002,
0.23140827422000002,
0.19586150722,
0.19284817822,
0.17184859822,
0.19151252122,
0.22521227622,
0.19862280122
]
},
{
"command": "pacquet@main",
"mean": 0.20968819779142864,
"stddev": 0.01588978141998269,
"median": 0.20549333072000003,
"user": 0.17198680857142853,
"system": 0.05626132857142858,
"min": 0.18951179022,
"max": 0.23614133522000003,
"times": [
0.20206372722000002,
0.21762462522,
0.18951179022,
0.20447540222000002,
0.23575666922000002,
0.19456772922,
0.20976620322,
0.20651125922000002,
0.21486998322,
0.23614133522000003,
0.20194956122000002,
0.23277330722,
0.18998567222,
0.19963750422
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08790187140181817,
"stddev": 0.0019450500337461175,
"median": 0.08749942222,
"user": 0.020187667878787875,
"system": 0.010355151515151515,
"min": 0.08493897522,
"max": 0.09335942622,
"times": [
0.08550364022000001,
0.08749942222,
0.08651345322000001,
0.08714226822,
0.08749278822,
0.08836242722,
0.08551285722,
0.08699613422000001,
0.08730149822000001,
0.08770090122,
0.09335942622,
0.08770019022,
0.08723220822000001,
0.08756673722000001,
0.08725597322,
0.08663434122000001,
0.08766709822,
0.08708970922,
0.08752341822000001,
0.09201072422,
0.08493897522,
0.08772061822,
0.08760772622,
0.08897345122,
0.09089604322,
0.08594732622000001,
0.08908076222,
0.09100100122,
0.08707846822000001,
0.09052857122,
0.09040591022000001,
0.08523096522000001,
0.08728672122
]
},
{
"command": "pnpr@main",
"mean": 0.08724056128249998,
"stddev": 0.0006500425452898928,
"median": 0.08722966372,
"user": 0.018609661250000003,
"system": 0.011253025,
"min": 0.08580213222000001,
"max": 0.08906533422,
"times": [
0.08722508522,
0.08758382022,
0.08604053222000001,
0.08721362322000001,
0.08828290822,
0.08701547922,
0.08794378922,
0.08619264822,
0.08668254322,
0.08723591422,
0.08736626122,
0.08772888422,
0.08652612722,
0.08713430422,
0.08774141722,
0.08692465822,
0.08693924622,
0.08671418122,
0.08779300422,
0.08906533422,
0.08580213222000001,
0.08700860622,
0.08742634422000001,
0.08733142522000001,
0.08791519422,
0.08732908122000001,
0.08719659022000001,
0.08715651622000001,
0.08737178022,
0.08723424222000001,
0.08669221122000001,
0.08788407622000001
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7676616319266666,
"stddev": 0.13956679104909214,
"median": 0.72336651626,
"user": 0.7168896844444443,
"system": 0.12901854444444444,
"min": 0.67340984926,
"max": 1.10832042026,
"times": [
0.67373718526,
0.67340984926,
0.68557492426,
0.72336651626,
0.69852272626,
0.73224709326,
0.7607066772600001,
1.10832042026,
0.8530692952600001
]
},
{
"command": "pacquet@main",
"mean": 0.9218647919266668,
"stddev": 0.2558249659222507,
"median": 0.8553666442600001,
"user": 0.8787679066666667,
"system": 0.17310943333333334,
"min": 0.62143150026,
"max": 1.3284639932600002,
"times": [
1.2989435092600001,
0.77997632326,
0.9567560822600001,
1.02432520326,
0.8553666442600001,
1.3284639932600002,
0.76356982226,
0.66795004926,
0.62143150026
]
},
{
"command": "pnpm@HEAD",
"mean": 3.250905237482222,
"stddev": 0.10879611013243037,
"median": 3.22647532426,
"user": 5.028713906666667,
"system": 0.2898003222222222,
"min": 3.11976385526,
"max": 3.3826413132599997,
"times": [
3.35784222626,
3.11976385526,
3.32245664126,
3.1775779212599997,
3.37452680126,
3.17419429426,
3.22647532426,
3.3826413132599997,
3.12266876026
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.60341839964,
"stddev": 0.13374824048045691,
"median": 4.540467292739999,
"user": 2.36163988,
"system": 1.6647606400000001,
"min": 4.48911191774,
"max": 4.87611094474,
"times": [
4.48911191774,
4.494063530739999,
4.550514648739999,
4.5304199367399995,
4.76207788974,
4.70188507174,
4.614415945739999,
4.517936016739999,
4.87611094474,
4.49764809374
]
},
{
"command": "pacquet@main",
"mean": 4.552141741039999,
"stddev": 0.0462967733968137,
"median": 4.5543807767399995,
"user": 2.28025378,
"system": 1.7105493399999996,
"min": 4.4813673207399995,
"max": 4.63568656774,
"times": [
4.5739223847399995,
4.545739438739999,
4.4813673207399995,
4.53550573374,
4.48163160974,
4.55856773774,
4.550193815739999,
4.58122858374,
4.63568656774,
4.57757421774
]
},
{
"command": "pnpr@HEAD",
"mean": 3.77151089304,
"stddev": 0.11178642402226922,
"median": 3.79311410624,
"user": 2.0743813799999997,
"system": 1.99849524,
"min": 3.5961215547400003,
"max": 3.95873955274,
"times": [
3.6227170277400003,
3.5961215547400003,
3.8198685617400003,
3.70351405574,
3.7253079057400003,
3.86557046474,
3.83367365974,
3.95873955274,
3.76635965074,
3.8232364967400003
]
},
{
"command": "pnpr@main",
"mean": 3.8224259109400003,
"stddev": 0.08852456315147264,
"median": 3.7905734517400003,
"user": 2.20310528,
"system": 2.14091274,
"min": 3.73502001574,
"max": 4.019064052739999,
"times": [
3.75006873874,
3.8350159767400003,
3.78881578474,
4.019064052739999,
3.93478377974,
3.7682360207400003,
3.73502001574,
3.78937581974,
3.79177108374,
3.81210783674
]
}
]
} |
Summary
pacquet's
Lockfilestruct had notimefield, so serde discarded the section on load and never wrote it back. Anypnpm-lock.yamlcarrying the publish dates aresolutionMode: time-basedinstall records lost them the first time pacquet rewrote it.That is not only lockfile churn. In the TypeScript CLI,
getPublishedByDatebuilds each direct dependency's publish date from the resolver'spublishedAtand falls back to the lockfile'stimeentry when the registry's abbreviated metadata carries none. The newest of those dates (plus an hour) is the cutoff every subdependency is resolved under, so dropping the section can make a later time-based resolution pick different subdependency versions.This PR:
time: Option<BTreeMap<String, String>>toLockfile, so the section round-trips;time-basedpre-pass — the prior lockfile's entries with this run's freshly resolved publish dates layered over them, matching upstream's{...wantedLockfile.time, ...time};pruneTimeInLockfile(peer suffix stripped,link:deps contribute nothing, npm aliases match their target's depPath);compute_time_based_cutoffas the fallback publish date for a direct dependency whose packument carries none.The prune runs where pnpm's
normalizeLockfileruns — on the serialized document, on the way to disk — so it covers every write path (fresh resolve, the fast lockfile update, the current lockfile undernode_modules/.pnpm, and anafterAllResolvedresult) rather than one lockfile-building site. It also runs ahead of the verification cache's content hash, so an in-memory lockfile still hashes to what it will hash to once saved and read back.The pnpr-assisted install path needs nothing of its own: the server resolves through the same fresh-lockfile pipeline, so the input lockfile's recorded dates already reach its answer. An end-to-end test against an in-process pnpr pins that.
This is a pacquet-only fix — the TypeScript CLI already models, writes, prunes, and reads the section. No TypeScript changes are needed for parity.
Closes #13776
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).