Repository navigation
feat(pacquet): port resolution/versions settings (#12042) - #12052
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
🚧 Files skipped from review as they are similar to previous changes (14)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
📝 WalkthroughWalkthroughAdds ResolutionMode config and workspace YAML/env parsing; implements depth-aware resolver options (pick_lowest_direct, published_by cutoff), a workspace pre-pass computing time-based transitive cutoff, threads mode into install/resolver wiring, and adds unit and integration tests including CLI e2e cases. ChangesResolution mode and dependency selection
Depth-aware resolver architecture
Workspace resolution and time-based cutoff
Resolver behavior validation
Install flow integration
🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Installer
participant ResolveWorkspace
participant ComputeCutoff
participant Resolver
Installer->>ResolveWorkspace: run with pick_lowest_direct/time_based
ResolveWorkspace->>ComputeCutoff: compute_time_based_cutoff (if time_based)
ComputeCutoff->>Resolver: resolve direct deps (pick_lowest_direct)
Resolver-->>ComputeCutoff: ResolveResult with published_at
ComputeCutoff-->>ResolveWorkspace: subdep_published_by (newest+1h clamped)
ResolveWorkspace->>Resolver: resolve importers with per-importer options
Resolver-->>Installer: resolution results
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Review Summary by QodoPort resolution/versions settings and implement resolutionMode with time-based cutoff
WalkthroughsDescription• Port resolution/versions settings from pnpm parity tracking issue • Implement resolutionMode with three modes: highest, time-based, lowest-direct • Add registrySupportsTimeField to gate full-metadata fetches for time-based resolution • Parse and store config surface settings: allowedDeprecatedVersions, updateConfig, peerDependencyRules • Implement workspace-wide time-based cutoff pre-pass for transitive dependency constraints • Fix minimumReleaseAge: 0 to disable maturity cutoff (matching pnpm behavior) Diagramflowchart LR
Config["Config: resolutionMode<br/>registrySupportsTimeField<br/>allowedDeprecatedVersions<br/>updateConfig<br/>peerDependencyRules"]
ResMode["ResolutionMode enum<br/>highest/time-based/lowest-direct"]
DirectOpts["Direct deps options<br/>pick_lowest_version"]
SubdepOpts["Subdep options<br/>published_by cutoff"]
TimeCutoff["Time-based cutoff<br/>pre-pass"]
Resolver["Resolver per-depth<br/>options threading"]
Config --> ResMode
ResMode --> DirectOpts
ResMode --> SubdepOpts
SubdepOpts --> TimeCutoff
DirectOpts --> Resolver
SubdepOpts --> Resolver
TimeCutoff --> Resolver
File Changes1. pacquet/crates/config/src/lib.rs
|
Port the "Resolution / versions" section of the pnpm-parity tracking issue to pacquet. Full behavioral wiring: - `resolutionMode` (`highest` / `time-based` / `lowest-direct`): direct deps pick lowest under `time-based`/`lowest-direct`; `time-based` additionally constrains transitive deps to a publish-date cutoff (newest resolved direct dep + 1h, clamped by `minimumReleaseAge`), computed workspace-wide in a pre-pass. - `registrySupportsTimeField`: gates the full-metadata fetch the `time-based` cutoff (and the `no-downgrade` trust policy) need — `(time-based || no-downgrade) && !registrySupportsTimeField`. Config-surface parity (parsed + stored, consumed once the surrounding feature lands, as pacquet already does for other not-yet-active settings): - `allowedDeprecatedVersions` (no deprecation warnings yet), - `updateConfig.ignoreDependencies` (no `update`/`outdated` command yet), - `peerDependencyRules` (no peer-issue reporting pass yet). Also treat `minimumReleaseAge: 0` as disabled (matching pnpm's falsy `opts.minimumReleaseAge ? ... : undefined` check). While a maturity cutoff is active the picker always prefers the highest mature version, so this is what lets `lowest-direct`/`time-based` take effect on direct deps.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pacquet/crates/config/src/env_overlay.rs (1)
185-189: ⚡ Quick winAdd direct tests for the new env-overlay keys.
These mappings currently rely on helper coverage only. A suffix typo or wrong parser macro here would silently drop the override, so please add
from_pnpm_config_envassertions forRESOLUTION_MODE,REGISTRY_SUPPORTS_TIME_FIELD,ALLOWED_DEPRECATED_VERSIONS,UPDATE_CONFIG, andPEER_DEPENDENCY_RULES.🤖 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 `@pacquet/crates/config/src/env_overlay.rs` around lines 185 - 189, Add explicit unit tests that assert from_pnpm_config_env correctly maps the new env-overlay keys: "RESOLUTION_MODE", "REGISTRY_SUPPORTS_TIME_FIELD", "ALLOWED_DEPRECATED_VERSIONS", "UPDATE_CONFIG", and "PEER_DEPENDENCY_RULES"; specifically, write tests that set these env vars and call from_pnpm_config_env to verify the resulting Config/Overlay has the expected values (exercise parsing for enum_field! used for resolution_mode and json_field! used for the others), so any suffix typos or macro/parser regressions will fail the assertions.pacquet/crates/cli/tests/install.rs (1)
689-692: ⚡ Quick winMake YAML append resilient to missing trailing newline.
If
pnpm-workspace.yamlever loses its trailing newline, this append can produce invalid YAML. Add a separator newline before appending.Proposed fix
let workspace_yaml = workspace.join("pnpm-workspace.yaml"); let mut existing = fs::read_to_string(&workspace_yaml).expect("read pnpm-workspace.yaml"); +if !existing.ends_with('\n') { + existing.push('\n'); +} existing.push_str("resolutionMode: lowest-direct\nminimumReleaseAge: 0\n"); fs::write(&workspace_yaml, existing).expect("write pnpm-workspace.yaml");🤖 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 `@pacquet/crates/cli/tests/install.rs` around lines 689 - 692, The test appends configuration lines to the pnpm-workspace.yaml by reading into existing, calling existing.push_str(...), and writing back via fs::write, but if the file lacks a trailing newline this produces invalid YAML; update the logic around workspace_yaml/existing so you ensure a separating newline before appending (e.g., check if existing.ends_with('\n') and if not, append one) and then append the "resolutionMode: lowest-direct\nminimumReleaseAge: 0\n" string before calling fs::write to make the YAML append resilient.
🤖 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.
Nitpick comments:
In `@pacquet/crates/cli/tests/install.rs`:
- Around line 689-692: The test appends configuration lines to the
pnpm-workspace.yaml by reading into existing, calling existing.push_str(...),
and writing back via fs::write, but if the file lacks a trailing newline this
produces invalid YAML; update the logic around workspace_yaml/existing so you
ensure a separating newline before appending (e.g., check if
existing.ends_with('\n') and if not, append one) and then append the
"resolutionMode: lowest-direct\nminimumReleaseAge: 0\n" string before calling
fs::write to make the YAML append resilient.
In `@pacquet/crates/config/src/env_overlay.rs`:
- Around line 185-189: Add explicit unit tests that assert from_pnpm_config_env
correctly maps the new env-overlay keys: "RESOLUTION_MODE",
"REGISTRY_SUPPORTS_TIME_FIELD", "ALLOWED_DEPRECATED_VERSIONS", "UPDATE_CONFIG",
and "PEER_DEPENDENCY_RULES"; specifically, write tests that set these env vars
and call from_pnpm_config_env to verify the resulting Config/Overlay has the
expected values (exercise parsing for enum_field! used for resolution_mode and
json_field! used for the others), so any suffix typos or macro/parser
regressions will fail the assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 40664095-49e8-4265-bb97-83bc95be81b6
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
pacquet/crates/cli/tests/install.rspacquet/crates/config/src/env_overlay.rspacquet/crates/config/src/lib.rspacquet/crates/config/src/workspace_yaml.rspacquet/crates/config/src/workspace_yaml/tests.rspacquet/crates/package-manager/src/build_resolution_verifiers.rspacquet/crates/package-manager/src/install_package_from_registry/tests.rspacquet/crates/package-manager/src/install_with_fresh_lockfile.rspacquet/crates/resolving-deps-resolver/Cargo.tomlpacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rspacquet/crates/resolving-deps-resolver/src/resolve_importer.rspacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Compile & Lint
🧰 Additional context used
📓 Path-based instructions (2)
pacquet/**/*.rs
📄 CodeRabbit inference engine (pacquet/AGENTS.md)
pacquet/**/*.rs: Warnings are errors (--deny warningsin lint). Do not silence them with#[allow(...)]unless there is a specific, justified reason.
Choose owned vs. borrowed parameters to minimize copies; widen to the most encompassing type (&Pathover&PathBuf,&strover&String) when it doesn't force extra copies.
PreferArc::clone(&x)/Rc::clone(&x)overx.clone()for reference-counted types, so the cost is visible at the call site.
Follow Rust API Guidelines for naming: https://rust-lang.github.io/api-guidelines/naming.html
No star imports inside module bodies. Writeuse super::{Foo, bar}instead ofuse super::*;, and the same for any other glob whose target is a module you control. Two forms stay allowed: external-crate preludes such asuse rayon::prelude::*;and root-of-module re-exports such aspub use submodule::*;in alib.rs.
Doc comments (///,//!) document the contract: preconditions, postconditions, panics, the reason the function exists. They are not a re-narration of the body.
Do not restate at call sites what the callee's doc comment already says. If///on the function says 'no-op when …', the caller should not repeat that. Update the doc once; let every call site benefit.
Tests are documentation. Do not duplicate them in prose. If a behavioral scenario, edge case, failure mode, or worked example is already captured by a test, do not also narrate it in the doc comment on the implementation. The same applies in reverse: a test's own doc comment should not re-explain what the asserts already say, only the why if it is not obvious.
Use// SAFETY:,// TODO:, and similar prefixes to signal hidden invariants or known follow-ups that a reader cannot recover from the code alone.
When editing existing code, do not break a method chain (includingpipe-trait.pipe(...)chains) into intermediateletbindings unless you can justify the rewrite. Valid justifications include a chain that fails to compile after your...
Files:
pacquet/crates/package-manager/src/build_resolution_verifiers.rspacquet/crates/config/src/env_overlay.rspacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rspacquet/crates/cli/tests/install.rspacquet/crates/package-manager/src/install_package_from_registry/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspacquet/crates/package-manager/src/install_with_fresh_lockfile.rspacquet/crates/resolving-deps-resolver/src/resolve_importer.rspacquet/crates/config/src/workspace_yaml/tests.rspacquet/crates/config/src/lib.rspacquet/crates/config/src/workspace_yaml.rspacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
pacquet/**/{tests,test}/*.rs
📄 CodeRabbit inference engine (pacquet/AGENTS.md)
pacquet/**/{tests,test}/*.rs: Tests must not be tolerant of a missing build / runtime environment by silently returning early when a tool isn't found. If the test needs a tool, just call into it and let the existing.unwrap()/.expect(...)panic when the tool is absent.
Prefer platform-specific gates like#[cfg_attr(target_os = "windows", ignore = "...")]or#[cfg(unix)]over runtime probe-and-skip helpers for platform-locked tools, because the gate is visible tocargo testand shows up in the test report.
Follow the test-logging guidance in the style guide — log before non-assert_eq!assertions,dbg!complex structures, skip logging for simple scalarassert_eq!.
Files:
pacquet/crates/cli/tests/install.rs
🧠 Learnings (5)
📚 Learning: 2026-05-20T19:40:55.051Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11774
File: pacquet/crates/resolving-deps-resolver/src/resolve_peers.rs:0-0
Timestamp: 2026-05-20T19:40:55.051Z
Learning: In the pacquet Rust code, ensure the semver implementation uses the `node-semver` crate (not `nodejs-semver`). `node-semver`’s public API does not include a `satisfies_with_prerelease`-style method; prerelease-tolerant matching should be implemented inline by first calling `Range::satisfies`, and when it rejects a prerelease version, retry matching against a stripped `MAJOR.MINOR.PATCH` base of the prerelease version.
Applied to files:
pacquet/crates/package-manager/src/build_resolution_verifiers.rspacquet/crates/config/src/env_overlay.rspacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rspacquet/crates/cli/tests/install.rspacquet/crates/package-manager/src/install_package_from_registry/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspacquet/crates/package-manager/src/install_with_fresh_lockfile.rspacquet/crates/resolving-deps-resolver/src/resolve_importer.rspacquet/crates/config/src/workspace_yaml/tests.rspacquet/crates/config/src/lib.rspacquet/crates/config/src/workspace_yaml.rspacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
📚 Learning: 2026-05-22T00:08:44.646Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11837
File: pacquet/crates/resolving-npm-resolver/src/pick_package.rs:33-51
Timestamp: 2026-05-22T00:08:44.646Z
Learning: In the pnpm/pnpm repo’s pacquet Rust crates, do not flag Unicode ellipsis characters (U+2026, `…`) in Rust doc comments (`///` / `/** */`) as a lint violation. The pacquet crate’s `dylint.toml` only enables `perfectionist::derive_ordering`, and the Dylint `unicode-ellipsis` rule is not enabled for this project—so `…` in doc comments is an intentional, repo-consistent style.
Applied to files:
pacquet/crates/package-manager/src/build_resolution_verifiers.rspacquet/crates/config/src/env_overlay.rspacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rspacquet/crates/cli/tests/install.rspacquet/crates/package-manager/src/install_package_from_registry/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspacquet/crates/package-manager/src/install_with_fresh_lockfile.rspacquet/crates/resolving-deps-resolver/src/resolve_importer.rspacquet/crates/config/src/workspace_yaml/tests.rspacquet/crates/config/src/lib.rspacquet/crates/config/src/workspace_yaml.rspacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
📚 Learning: 2026-05-20T23:07:58.444Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11784
File: pacquet/crates/resolving-deps-resolver/src/hoist_peers.rs:120-133
Timestamp: 2026-05-20T23:07:58.444Z
Learning: When reviewing code in this pacquet Rust port, follow the upstream pnpm compatibility rule: only match pnpm’s behavior exactly. Do not propose review changes that intentionally deviate from pnpm’s documented/observed behavior, even if pnpm appears buggy. If you identify a real bug in pnpm behavior, the review should prioritize fixing it upstream in pnpm first, and avoid implementing a pnpm-behavior workaround here unless the same fix has already landed upstream.
Applied to files:
pacquet/crates/package-manager/src/build_resolution_verifiers.rspacquet/crates/config/src/env_overlay.rspacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rspacquet/crates/cli/tests/install.rspacquet/crates/package-manager/src/install_package_from_registry/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspacquet/crates/package-manager/src/install_with_fresh_lockfile.rspacquet/crates/resolving-deps-resolver/src/resolve_importer.rspacquet/crates/config/src/workspace_yaml/tests.rspacquet/crates/config/src/lib.rspacquet/crates/config/src/workspace_yaml.rspacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
📚 Learning: 2026-05-24T21:10:50.292Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11915
File: pacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs:553-617
Timestamp: 2026-05-24T21:10:50.292Z
Learning: When implementing dependency “revisit”/optional-folding in pacquet, mirror pnpm’s `resolveDependencies.ts` behavior: on revisit, update the `optional` flag only for the directly visited package, and do not automatically change `optional` for transitive descendants. pnpm corrects stale optional flags later via `copyDependencySubGraph` (a BFS in `lockfile/pruner/src/index.ts`/`copyDependencySubGraph`). Until pacquet has an equivalent pruner/copy-subgraph step, be aware that the raw `node.optional` can flow through to the lockfile/virtual store via `dependencies_graph_to_lockfile.rs` → `create_virtual_store.rs` → `installability.rs`, so review changes that affect optional flag propagation for this mismatch.
Applied to files:
pacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_importer.rspacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
📚 Learning: 2026-05-24T21:10:50.292Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11915
File: pacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs:553-617
Timestamp: 2026-05-24T21:10:50.292Z
Learning: In pacquet’s Rust resolver layer, the behavior of `ResolvedPackage.optional` “AND-folding”/revisit updates is intentionally aligned with pnpm: when a package is directly revisited, only that package’s `optional` flag is updated; transitive descendants are not re-walked/rescored in this stage. pnpm later corrects any stale optional flags downstream via its pruner/BFS logic (`copyDependencySubGraph` + `nonOptional` reachability stamping in the lockfile pruner). Since pacquet does not yet have that pruner equivalent, review should NOT flag the downstream/stale optional propagation as a bug in pacquet PRs; treat the resolver-layer optional propagation gap as expected parity until the pruning/stamping step is ported.
Applied to files:
pacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace.rspacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspacquet/crates/resolving-deps-resolver/src/resolve_importer.rspacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
🔇 Additional comments (10)
pacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs (1)
247-287: LGTM!Also applies to: 315-326, 461-541, 703-749
pacquet/crates/resolving-deps-resolver/src/resolve_importer.rs (1)
29-29: LGTM!Also applies to: 47-48, 97-113, 166-167, 245-271
pacquet/crates/resolving-deps-resolver/Cargo.toml (1)
25-25: LGTM!pacquet/crates/resolving-deps-resolver/src/resolve_workspace.rs (1)
23-28: LGTM!Also applies to: 68-81, 121-153, 204-269
pacquet/crates/resolving-deps-resolver/src/resolve_importer/tests.rs (1)
94-95: LGTM!Also applies to: 989-1132
pacquet/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs (1)
1-283: LGTM!pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs (1)
14-14: LGTM!Also applies to: 360-371, 400-407, 530-533, 616-617, 645-653
pacquet/crates/package-manager/src/build_resolution_verifiers.rs (1)
92-92: LGTM!pacquet/crates/package-manager/src/install_package_from_registry/tests.rs (1)
94-98: LGTM!pacquet/crates/cli/tests/install.rs (1)
645-671: LGTM!
9822b02 to
a444053
Compare
Micro-Benchmark ResultsLinux |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main pnpm/pnpm#12052 +/- ##
==========================================
+ Coverage 88.94% 88.99% +0.04%
==========================================
Files 235 235
Lines 30930 31067 +137
==========================================
+ Hits 27510 27647 +137
Misses 3420 3420 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.09311149996,
"stddev": 0.07859819367329422,
"median": 2.0807677022599997,
"user": 2.59384634,
"system": 3.37154854,
"min": 2.0033857662599996,
"max": 2.2506567782599998,
"times": [
2.0033857662599996,
2.2506567782599998,
2.1017026632599998,
2.16786828526,
2.04869939426,
2.0303756272599998,
2.08535452226,
2.0761808822599996,
2.01056353126,
2.15632754926
]
},
{
"command": "pacquet@main",
"mean": 2.09041328096,
"stddev": 0.05645458319202318,
"median": 2.0779106152599995,
"user": 2.67476554,
"system": 3.3596562399999996,
"min": 2.02349519026,
"max": 2.16770069826,
"times": [
2.06309880426,
2.02349519026,
2.07089742826,
2.16621616126,
2.16770069826,
2.0849238022599996,
2.1626421682599997,
2.0299068652599996,
2.0942056392599997,
2.04104605226
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6584509090799999,
"stddev": 0.02058717000436605,
"median": 0.65441862928,
"user": 0.35832169999999997,
"system": 1.33224084,
"min": 0.64084522678,
"max": 0.7129660397800001,
"times": [
0.7129660397800001,
0.65653732578,
0.6497118377800001,
0.65382725878,
0.64084522678,
0.64238145678,
0.6550099997800001,
0.66165189978,
0.6640572907800001,
0.64752075478
]
},
{
"command": "pacquet@main",
"mean": 0.6503880554799999,
"stddev": 0.010211095704321882,
"median": 0.6490170792800001,
"user": 0.3614345,
"system": 1.32375314,
"min": 0.63775642978,
"max": 0.6683277767800001,
"times": [
0.6603992107800001,
0.6570386057800001,
0.6483138217800001,
0.65818620378,
0.63775642978,
0.6416988867800001,
0.64251828678,
0.6399209957800001,
0.6683277767800001,
0.6497203367800001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.30665253922,
"stddev": 0.028074467890449373,
"median": 2.31755475792,
"user": 3.7252862799999997,
"system": 3.1425353800000004,
"min": 2.2570905074199996,
"max": 2.34319239342,
"times": [
2.3325632014199997,
2.28945170442,
2.31474041142,
2.3203691044199997,
2.27391811042,
2.3275435324199996,
2.2871352994199996,
2.2570905074199996,
2.3205211274199997,
2.34319239342
]
},
{
"command": "pacquet@main",
"mean": 2.33191823682,
"stddev": 0.034946488417464935,
"median": 2.3303125094199997,
"user": 3.8276687800000007,
"system": 3.12597648,
"min": 2.27209616642,
"max": 2.3906168264199996,
"times": [
2.3906168264199996,
2.3544939114199996,
2.31791967642,
2.37406271342,
2.27209616642,
2.33133518042,
2.3311026074199996,
2.3236725154199998,
2.3295224114199997,
2.2943603594199997
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.46451570864,
"stddev": 0.023218218432645595,
"median": 1.46371337274,
"user": 1.6651248199999997,
"system": 1.81947394,
"min": 1.4314434707400001,
"max": 1.51580602974,
"times": [
1.4403533987400001,
1.44971776774,
1.4314434707400001,
1.47781860774,
1.51580602974,
1.46214959174,
1.46527715374,
1.47121690674,
1.47253211674,
1.45884204274
]
},
{
"command": "pacquet@main",
"mean": 1.4812276972400003,
"stddev": 0.0189532640972597,
"median": 1.47804481524,
"user": 1.6825986199999998,
"system": 1.8207404399999998,
"min": 1.45541554874,
"max": 1.51658268874,
"times": [
1.51658268874,
1.46189541374,
1.45541554874,
1.4741603387400002,
1.48192929174,
1.49852816574,
1.4674668077400002,
1.47201379274,
1.4984980917400001,
1.4857868327400001
]
}
]
} |
|
| Branch | pr/12052 |
| Testbed | pacquet |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 2,306.65 ms(-1.96%)Baseline: 2,352.69 ms | 2,823.23 ms (81.70%) |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 1,464.52 ms(-0.29%)Baseline: 1,468.80 ms | 1,762.56 ms (83.09%) |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 2,093.11 ms(-0.29%)Baseline: 2,099.30 ms | 2,519.16 ms (83.09%) |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 658.45 ms(-3.62%)Baseline: 683.20 ms | 819.84 ms (80.31%) |
Port the "Resolution / versions" section of the pnpm-parity tracking issue to pacquet. Full behavioral wiring: - `resolutionMode` (`highest` / `time-based` / `lowest-direct`): direct deps pick lowest under `time-based`/`lowest-direct`; `time-based` additionally constrains transitive deps to a publish-date cutoff (newest resolved direct dep + 1h, clamped by `minimumReleaseAge`), computed workspace-wide in a pre-pass. - `registrySupportsTimeField`: gates the full-metadata fetch the `time-based` cutoff (and the `no-downgrade` trust policy) need — `(time-based || no-downgrade) && !registrySupportsTimeField`. Config-surface parity (parsed + stored, consumed once the surrounding feature lands, as pacquet already does for other not-yet-active settings): - `allowedDeprecatedVersions` (no deprecation warnings yet), - `updateConfig.ignoreDependencies` (no `update`/`outdated` command yet), - `peerDependencyRules` (no peer-issue reporting pass yet). Also treat `minimumReleaseAge: 0` as disabled (matching pnpm's falsy `opts.minimumReleaseAge ? ... : undefined` check). While a maturity cutoff is active the picker always prefers the highest mature version, so this is what lets `lowest-direct`/`time-based` take effect on direct deps.
Ports the Resolution / versions section of the pacquet-parity tracking issue (#12042) to pacquet.
Full behavioral wiring
resolutionMode(highest/time-based/lowest-direct)highest(default) — unchanged: highest satisfying version everywhere.lowest-direct— direct deps resolve to their lowest satisfying version; transitive deps stay highest.time-based— direct deps resolve lowest, and transitive deps are constrained to versions published no later than the newest resolved direct dep (+ 1h), clamped byminimumReleaseAge. The cutoff is computed workspace-wide in a pre-pass before the main tree walk.The deps-resolver now hands the npm resolver per-depth
ResolveOptions: importer (depth == 0) deps get the lowest-pick +minimumReleaseAgecutoff; transitive deps (depth > 0) get the highest-pick + the time-based cutoff. The wanted-dep memoization key was extended with the pick-affecting params so direct/transitive occurrences of the same spec don't collide (no change inhighestmode).registrySupportsTimeFieldGates the full-metadata fetch that
time-based(and theno-downgradetrust policy) need for per-version publish dates:(time-based || no-downgrade) && !registrySupportsTimeField, mirroring pnpm'screateNewStoreController.Config-surface parity
Parsed from
pnpm-workspace.yaml+PNPM_CONFIG_*env, stored onConfig, and consumed once the surrounding feature lands — the same "parse now, consume when the architecture arrives" posture pacquet already uses for other not-yet-active settings:allowedDeprecatedVersions— pacquet doesn't emit deprecation warnings yet.updateConfig.ignoreDependencies— pacquet has noupdate/outdatedcommand yet.peerDependencyRules(ignoreMissing/allowAny/allowedVersions) — pacquet has no missing/bad peer-issue reporting pass yet.Drive-by parity fix
minimumReleaseAge: 0now disables the maturity cutoff (matching pnpm's falsyopts.minimumReleaseAge ? ... : undefined). While a cutoff is active the picker always prefers the highest mature version (pnpm'spickRespectingMinReleaseAgeignores the lowest-version preference), so disabling it is what letslowest-direct/time-basedactually take effect on direct deps.Tests
apply_tofor all 5 settings (+ env overlay) and theminimumReleaseAge: 0disable helper.minimumReleaseAgeclamp.highestpicks@pnpm.e2e/[email protected],lowest-direct(withminimumReleaseAge: 0) picks@pnpm.e2e/[email protected].just ready+just dylintpass. Pacquet-only change, so no changeset.Written by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit
New Features
Tests