Skip to content

perf(npm-resolver): cache disk-loaded metadata in memory on offline resolution - #12760

Merged
zkochan merged 13 commits into
pnpm:mainfrom
astegmaier:ansteg/dedupe-offline-metacache
Jul 4, 2026
Merged

zkochan merged 13 commits into
pnpm:mainfrom
astegmaier:ansteg/dedupe-offline-metacache

Conversation

@astegmaier

@astegmaier astegmaier commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When resolving with --offline or --prefer-offline, pickPackage loaded a package's metadata from the on-disk cache mirror but never stored it in the in-memory metaCache, so every subsequent resolution of the same package — once per dependent that references it — re-read and re-parsed the full packument from disk. On a large monorepo at Microsoft this meant 23,746 metadata loads for 5,124 distinct packages (66.8 GB of JSON parsed), and pnpm dedupe --offline dropped from ~140 s to ~75 s (~1.9×) with a byte-identical lockfile once fixed. The pathological case is high fan-in to shared packages combined with very large packuments (30–42 MB abbreviated documents for internal packages with thousands of versions).

This PR stores the parsed metadata in the in-memory cache on the offline and prefer-offline disk-return paths, so each package's metadata is parsed at most once per command. The cache is the existing bounded LRU (max 10,000 entries, 120 s TTL); the online and network paths are untouched.

Review of the change surfaced follow-up work that also landed here:

  • Stale-cache fall-through (TypeScript, 9279c8a). Promoted disk metadata made the top-of-function cache hit terminal: a promoted packument that predated a later-requested range turned a previously-recoverable network fallback into ERR_PNPM_NO_MATCHING_VERSION. Registry-unverified disk promotions are now tracked in a WeakSet, and a cache hit whose pick fails on such an entry falls through to the regular network-validating flow (unless offline). The pre-existing exact-version fast path had the same latent failure mode and is covered by the same marking. Each package revalidates at most once — a 304-revalidated or network-fetched packument is never marked.
  • Pacquet counterpart (e30f7cc, 23b9ac8, e1a308f). The same promotion and fall-through semantics for pacquet, with the verification state carried inside the cache value (CachedPackument { meta, registry_verified }) so a reader can never pair a packument with the verification state of a concurrent overwrite. PackageMetaCache::set_unverified is a required trait method so custom cache implementations can't silently inherit the terminal cache-hit behavior. Pacquet's version-spec and publishedBy-mtime fast paths — which already promoted disk metadata into the memory cache — gain the same recovery.
  • Verifier shared-cache reads registry-qualified (5580124). Pacquet's read_shared_meta queried bare name/name:full keys while the resolver stores registry-qualified ones, so the verifier's shared-cache fast path could never hit; it now mirrors the TypeScript readSharedMeta (:full → :full:filtered → abbreviated). Pre-existing, found by review of the touched reads.
  • Benchmark coverage (30d02b0, 0303fc8). No existing scenario exercised --offline/--prefer-offline. A new isolated-linker.fresh-resolve.hot-cache.offline scenario measures install --offline --lockfile-only against a warm mirror (with an untimed online pre-warm pass, since --offline can't prime a cold mirror), wired into the shared orchestrator, pnpm11/benchmarks/bench.sh, and the pacquet CI benchmark + Bencher uploads. Getting it to measure real work also revived the pnpm benchmark pipeline, silently dead since the pnpm11/ move (REPO_ROOT mis-resolution, pre-move bundle path, continue-on-error masking), and taught the scenario to wipe node_modules so the up-to-date short-circuit can't skip the measured resolution. With that in place the scenario shows this PR directly: pnpm@HEAD 2.41 s vs pnpm@main 3.17 s (1.31×), mirror reads 2,625 → 1,297. The pacquet arms tie by design — pacquet's deps-resolver memoizes per wanted dependency, so the redundant-parse amplification never occurs there.

Verified end-to-end: byte-identical pnpm-lock.yaml on the large monorepo, regression tests on both stacks that fail without their fixes, full dependent-package suites green (925 TS tests; 282 resolver + 677 verifier/package-manager Rust tests), and a live-registry benchmark run of the new scenario.

Squash Commit Body

When resolving with --offline or --prefer-offline, pickPackage loaded a
package's metadata from the on-disk cache mirror but never stored it in
the in-memory metaCache, so every subsequent resolution of the same
package (once per dependent that references it) re-read and re-parsed
the full packument from disk. Store the parsed metadata in the
in-memory cache on those disk-return paths, so each package's metadata
is parsed at most once per command. On a large monorepo this collapses
23,746 metadata loads to 5,124 (66.8 GB of JSON parsed to 8.8 GB) and
takes pnpm dedupe --offline from ~140s to ~75s with a byte-identical
lockfile. The cache is the existing bounded LRU; online and network
paths are untouched.

Promotion alone would have made the top-of-function cache hit terminal:
a disk-promoted packument that predates a later-requested range would
turn a previously-recoverable network fallback into
ERR_PNPM_NO_MATCHING_VERSION. Track registry-unverified disk promotions
(a WeakSet keyed by object identity in TypeScript; a registry_verified
flag carried inside the cache value in pacquet, so meta and state are
read atomically) and let a cache hit whose pick fails on such an entry
fall through to the regular network-validating flow unless offline. The
revalidating fetch stores a verified entry, so each package revalidates
at most once. The pre-existing exact-version fast paths on both stacks
had the same latent failure mode and are covered by the same marking.
Pacquet's PackageMetaCache::set_unverified is a required trait method
so custom cache implementations cannot silently inherit the terminal
behavior, and the TypeScript PackageMetaCache documents the
object-identity contract its WeakSet relies on.

Also registry-qualify pacquet's verifier shared-meta-cache reads
(read_shared_meta queried bare name keys while the resolver stores
registry-qualified ones, so the fast path could never hit), mirroring
the TypeScript readSharedMeta lookup order.

Add an isolated-linker.fresh-resolve.hot-cache.offline benchmark
scenario (install --offline --lockfile-only against a warm mirror, with
an untimed online pre-warm pass and per-iteration node_modules +
lockfile wipes so the up-to-date short-circuit cannot skip the measured
resolution) to guard offline resolution on all Bencher testbeds. Fixing
it to measure real work also revived the pnpm benchmark pipeline,
silently dead since the pnpm11/ move: bench.sh resolved REPO_ROOT to
pnpm11/ where no Cargo.toml exists, the orchestrator probed the
pre-move pnpm/dist bundle path, and continue-on-error masked every
failure as a green run. The scenario measures this change directly:
pnpm@HEAD resolves the fixture offline in 2.41s vs 3.17s for pnpm@main
(1.31x), with metadata-mirror reads dropping from 2625 to 1297.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pacquet/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Description restructured per the PR template by an agent (Claude Code, claude-fable-5); the Summary incorporates the original author's measurements and analysis.

Summary by CodeRabbit

  • Performance

    • Improved package resolution speed for offline and --prefer-offline workflows in large workspaces by reusing cached package metadata within a single command, reducing repeated parsing.
  • Bug Fixes

    • Offline and --prefer-offline resolutions now properly promote disk-loaded package metadata into the in-memory cache, keeping it available for subsequent lookups.
  • Tests

    • Added coverage to ensure metadata cache promotion works for both offline and prefer-offline resolution paths.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Resolvers now track whether cached packuments came from verified registry fetches or disk promotions, reuse unverified entries in memory, and fall back to revalidation when an unverified hit cannot satisfy a spec. Tests cover offline, prefer-offline, and stale-mirror flows, and a changeset records the release.

Changes

Offline metadata caching

Layer / File(s) Summary
Cache promotion and fallback in pickPackage
pnpm11/resolving/npm-resolver/src/pickPackage.ts, .changeset/offline-metadata-in-memory-cache.md
Disk-loaded metadata is cached in memory as unverified, offline and abbreviated-metadata paths promote disk metadata into ctx.metaCache, and unverified cache hits can fall through to validated resolution when they cannot satisfy the requested spec.
Cache shape and promotion in pacquet
pacquet/crates/resolving-npm-resolver/src/pick_package.rs, pacquet/crates/resolving-npm-resolver/src/lib.rs
The package metadata cache now carries registry verification state, the in-memory cache stores verified and unverified entries separately, and disk-promoted metadata is written back as unverified across offline and fast-path branches.
Verifier cache access updates
pacquet/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs
The resolver verifier reads the new cached-packument shape by accessing the underlying packument metadata before name filtering and trust projection.
Cache promotion tests
pnpm11/resolving/npm-resolver/test/metaCache.test.ts, pacquet/crates/resolving-npm-resolver/src/pick_package/tests.rs
New tests cover offline cache reuse, prefer-offline cache reuse, stale promoted metadata falling back to the registry, and registry verification state updates in the in-memory cache.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • pnpm/pnpm#11856: Both PRs modify pacquet/crates/resolving-npm-resolver/src/pick_package.rs to change how disk-loaded packument metadata is promoted into the in-memory meta cache.
  • pnpm/pnpm#11878: Both PRs change the resolver cache shape and verifier access patterns around cached packument metadata.
  • pnpm/pnpm#12458: Both PRs promote disk-loaded packument metadata into the in-memory resolver cache and adjust fallback behavior around cached metadata.

Suggested labels: product: pnpm@11, product: pacquet

Suggested reviewers: zkochan

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@astegmaier
astegmaier marked this pull request as ready for review July 2, 2026 16:33
@astegmaier
astegmaier requested a review from zkochan as a code owner July 2, 2026 16:33
Copilot AI review requested due to automatic review settings July 2, 2026 16:33
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Cache disk-loaded packument metadata in memory for offline npm resolution

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Promote disk-loaded packuments into metaCache for --offline and --prefer-offline.
• Avoid repeated disk reads/JSON parsing when the same package is resolved many times.
• Add regression tests proving second resolution succeeds after deleting the on-disk mirror.
Diagram

flowchart TD
  A["pickPackage()"] --> B{"metaCache hit?"} -->|Yes| C["upgrade abbrev meta"] --> D["pick matching ver"] --> E["return result"]
  B -->|No| F[("disk meta mirror")] --> G["load meta JSON"] --> H["cache set key"] --> D

  subgraph Legend
    direction LR
    _fn["Function"] ~~~ _dec{"Decision"} ~~~ _db[("Disk cache")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Centralize read-through caching inside `loadMeta()`
  • ➕ Guarantees all call sites get consistent caching behavior
  • ➕ Reduces chance of future regressions when new offline paths are added
  • ➖ Harder to enforce conditional behavior (e.g., updateChecksums bypass, prefer-offline nuances)
  • ➖ May couple disk I/O helpers to resolver context (ctx.metaCache, cacheKey)
2. Refactor `pickPackage` to a single 'getMeta()' helper (memory → disk → network)
  • ➕ Eliminates duplicated return paths and makes cache writes harder to forget
  • ➕ Improves readability of offline/prefer-offline branching
  • ➖ Larger code churn in a performance-critical and behavior-sensitive function
  • ➖ Higher risk of subtle behavior changes compared to a minimal fix
3. Increase `metaCache` TTL/size for offline workloads
  • ➕ May further reduce re-parsing when commands exceed current TTL window
  • ➕ No logic changes to resolver flow
  • ➖ Higher memory retention/GC pressure and potentially worse peak memory
  • ➖ Does not fix the underlying bug of not populating the cache on disk-hit paths

Recommendation: Keep the PR’s minimal fix: explicitly metaCache.set() on the two offline disk-return paths. It directly addresses the regression (missing cache population), minimizes behavioral risk, and the added tests lock in the expected read-through behavior (second resolve works without disk), making future refactors safer.

Files changed (3) +80 / -3

Enhancement (1) +16 / -3
pickPackage.tsPopulate 'metaCache' after loading metadata from disk in offline modes +16/-3

Populate 'metaCache' after loading metadata from disk in offline modes

• Updates the 'ctx.offline' and 'ctx.preferOffline' disk-hit paths to store the parsed 'PackageMeta' into the in-memory 'metaCache' before returning. This turns the offline disk mirror into a read-through cache and prevents repeated 'fs.readFile'/'JSON.parse' for the same package across many dependents.

pnpm11/resolving/npm-resolver/src/pickPackage.ts

Tests (1) +58 / -0
metaCache.test.tsAdd regression tests for offline/prefer-offline metaCache promotion +58/-0

Add regression tests for offline/prefer-offline metaCache promotion

• Adds two tests ensuring that, after an initial offline/prefer-offline resolve from the on-disk mirror, the packument is present in the in-memory cache. Each test deletes the mirror file and verifies a second resolve still succeeds, proving results are served from memory.

pnpm11/resolving/npm-resolver/test/metaCache.test.ts

Documentation (1) +6 / -0
offline-metadata-in-memory-cache.mdAdd changeset describing offline resolver performance improvement +6/-0

Add changeset describing offline resolver performance improvement

• Introduces a patch changeset for '@pnpm/resolving.npm-resolver' and 'pnpm'. Documents that offline/prefer-offline resolution now retains disk-loaded metadata in memory to avoid repeated parsing.

.changeset/offline-metadata-in-memory-cache.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves offline (--offline) and prefer-offline (--prefer-offline) npm package resolution performance by ensuring packuments loaded from the on-disk metadata mirror are also promoted into the in-memory metaCache, avoiding repeated disk reads and JSON.parse for the same package within a command.

Changes:

  • Promote disk-loaded packument metadata into ctx.metaCache on the offline disk-hit path.
  • Promote disk-loaded packument metadata into ctx.metaCache on the preferOffline disk-hit path (when a package is successfully picked).
  • Add regression tests proving the second resolution succeeds even after the on-disk mirror is removed (verifying the in-memory cache is used).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pnpm11/resolving/npm-resolver/src/pickPackage.ts Stores disk-loaded metadata in the in-memory cache for offline/prefer-offline flows to prevent repeated disk parsing.
pnpm11/resolving/npm-resolver/test/metaCache.test.ts Adds regression tests covering offline and prefer-offline disk-hit promotion into metaCache.
.changeset/offline-metadata-in-memory-cache.md Adds a patch changeset documenting the offline/prefer-offline performance improvement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 2, 2026
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (15) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Partial move breaks build 🐞 Bug ≡ Correctness
Description
handle_cache_hit() moves cached.meta into maybe_upgrade_abbreviated_meta_for_release_age(...)
and then reads cached.registry_verified, which is illegal after a partial move of a non-Copy
field and should fail to compile. This blocks building pacquet-resolving-npm-resolver.
Code

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[R763-768]

let upgrade =
-        maybe_upgrade_abbreviated_meta_for_release_age(ctx, spec, opts, full_metadata, cached)
+        maybe_upgrade_abbreviated_meta_for_release_age(ctx, spec, opts, full_metadata, cached.meta)
        .await?;
let meta = upgrade.meta;
+    // The upgrade fetch (re)validated the packument against the registry.
+    let registry_verified = cached.registry_verified || upgrade.upgraded;
Evidence
CachedPackument stores meta: Arc (non-Copy) and registry_verified: bool;
handle_cache_hit() passes cached.meta by value, moving it, then immediately accesses
cached.registry_verified, which is a partial-move compile error in Rust.

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[79-89]
pacquet/crates/resolving-npm-resolver/src/pick_package.rs[752-769]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`handle_cache_hit()` currently moves `cached.meta` (an `Arc<Package>`) out of `CachedPackument` and then later accesses `cached.registry_verified`. In Rust, moving a non-`Copy` field out of a struct makes the struct partially moved, so subsequent field access on the original variable is a compile-time error.
### Issue Context
`CachedPackument` contains a non-`Copy` `Arc<Package>` plus a `bool`. `maybe_upgrade_abbreviated_meta_for_release_age(...)` takes the `Arc<Package>` by value.
### Fix Focus Areas
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[752-779]
### Suggested fix
Destructure `cached` up front (or clone the `Arc`) so you don’t access `cached` after moving out `meta`.
Example:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Unverified marker TOCTOU race 🐞 Bug ☼ Reliability
Description
InMemoryPackageMetaCache::set() clears the “unverified” marker before inserting the new meta,
while handle_cache_hit() checks is_unverified(cache_key) separately from the Arc it used.
Under concurrent resolves, the marker and cached value can be observed out of sync, causing a stale
disk-promoted packument to be treated as verified and making a no-match cache hit terminal instead
of falling through to registry revalidation.
Code

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[R218-221]

fn set(&self, key: String, meta: Arc<Package>) {
+        self.unverified.remove(&key);
self.inner.insert(key, meta);
}
Evidence
The cache explicitly updates unverified and inner non-atomically, and the resolver consults
is_unverified(cache_key) after it already used a cached Arc; with the current set() ordering,
concurrent writers can clear the marker before the new value is observable, making readers
misclassify an old unverified value as verified.

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[202-231]
pacquet/crates/resolving-npm-resolver/src/pick_package.rs[760-786]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`InMemoryPackageMetaCache` updates the `unverified` marker and the cached `inner` entry in separate operations. Because `handle_cache_hit()` consults `is_unverified(key)` independently from the `Arc<Package>` it already read, a concurrent writer can make readers observe an inconsistent (meta, marker) pair. This can suppress the intended fallback-to-registry behavior for stale disk-promoted entries.
## Issue Context
The code comment says the non-atomic update can cause at most a “stale marker”, but the current ordering in `set()` (`remove` then `insert`) allows a false-negative unverified read for an *old* cached value.
## Fix Focus Areas
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[202-231]
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[760-786]
## Suggested fix directions
- Make (meta, unverified) an atomic unit:
- Store a small struct in the `DashMap` value, e.g. `DashMap<String, CacheEntry { meta: Arc<Package>, unverified: bool }>`; or
- Use a single `DashMap` and encode verification state in the value, avoiding a second map/set.
- If keeping `DashSet`, at minimum change the ordering in `set()` to `inner.insert(...)` *then* `unverified.remove(...)`, so races bias toward false-positives (extra revalidation) rather than false-negatives (terminal behavior).
- Ensure `handle_cache_hit()`’s terminal-vs-fallthrough decision is based on verification state that corresponds to the same cached value it picked from.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Prewarm overdoes work 🐞 Bug ➹ Performance ⭐ New
Description
The new offline benchmark scenario’s prewarm step runs a plain install, which can perform linking
and tarball fetching even though the scenario’s measured command is `install --offline
--lockfile-only` (resolution-only). This adds avoidable, untimed overhead to benchmark runs and can
skew CI benchmark cost/latency.
Code

pacquet/tasks/integrated-benchmark/src/cli_args.rs[R268-279]

+    /// Arguments of the online install that primes `cache-dir` /
+    /// `store-dir` before hyperfine runs, for scenarios whose measured
+    /// command can't do its own priming (an `--offline` run against the
+    /// freshly wiped mirror fails). `None` for every other scenario:
+    /// hyperfine's warmup run primes whatever their per-iteration
+    /// cleanup preserves.
+    pub fn prewarm_install_args(self) -> Option<&'static [&'static str]> {
+        match self {
+            BenchmarkScenario::IsolatedFreshResolveHotCacheOffline => Some(&["install"]),
+            _ => None,
        }
    }
Evidence
The scenario is explicitly “no linking” and measures install --offline --lockfile-only, but
prewarm_install_args() currently returns install only, and WorkEnv executes that prewarm
script once per target before running hyperfine—so the prewarm pass does more work than required to
prime the metadata mirror.

pacquet/tasks/integrated-benchmark/src/cli_args.rs[221-231]
pacquet/tasks/integrated-benchmark/src/cli_args.rs[268-279]
pacquet/tasks/integrated-benchmark/src/work_env.rs[527-548]
pacquet/tasks/integrated-benchmark/src/work_env.rs[1911-1926]
pacquet/tasks/integrated-benchmark/src/work_env.rs[1963-1969]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The offline benchmark scenario prewarm currently uses `pnpm install` (online) which can do extra work (linking + tarball fetches) even though the scenario is designed to measure offline *resolution-only* (`install --offline --lockfile-only`).

### Issue Context
The scenario docs explicitly describe the measured command as `install --offline --lockfile-only` and note the prewarm exists only to prime the metadata mirror before offline runs.

### Fix Focus Areas
- pacquet/tasks/integrated-benchmark/src/cli_args.rs[268-279]
- pacquet/tasks/integrated-benchmark/src/work_env/tests.rs[9-28]

### Proposed change
- Change `BenchmarkScenario::IsolatedFreshResolveHotCacheOffline => Some(&["install"])` to `Some(&["install", "--lockfile-only"])`.
- Update the unit test that asserts the generated prewarm script ends with `exec pnpm install\n` to expect `exec pnpm install --lockfile-only\n`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. 304 not marked verified 🐞 Bug ➹ Performance
Description
handle_cache_hit() treats a cache entry as registry-verified only when `cached.registry_verified
|| upgrade.upgraded, but maybe_upgrade_abbreviated_meta_for_release_age()` can perform a
conditional registry request that returns 304 Not Modified with upgraded=false. When the
subsequent pick yields no match, this misclassification triggers an unnecessary fallthrough into the
disk+network path, adding redundant work (and potentially an extra conditional GET) on a miss.
Code

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[R763-777]

   let upgrade =
-        maybe_upgrade_abbreviated_meta_for_release_age(ctx, spec, opts, full_metadata, cached)
+        maybe_upgrade_abbreviated_meta_for_release_age(ctx, spec, opts, full_metadata, cached.meta)
           .await?;
   let meta = upgrade.meta;
+    // The upgrade fetch (re)validated the packument against the registry.
+    let registry_verified = cached.registry_verified || upgrade.upgraded;
   if upgrade.upgraded && !opts.dry_run {
       if let Some(path) = pkg_mirror {
           persist_upgraded_to_mirror(path, &meta, use_filtered_full_metadata);
       }
       ctx.meta_cache.set(cache_key.to_string(), Arc::clone(&meta));
   }
   let (meta, picked) = pick_from_meta(picker_opts, spec, meta, opts.blocked_versions)?;
-    Ok(PickPackageResult { meta, picked_package: picked })
+    if picked.is_none() && !ctx.offline && !registry_verified {
+        return Ok(None);
Evidence
The upgrade helper’s docs and implementation show it can perform a conditional registry request and
receive a 304 Not Modified while returning upgraded=false. handle_cache_hit() then uses
upgrade.upgraded (only true on 200 Modified) to decide registry_verified, so 304 validations are
misclassified as unverified and can trigger a redundant fallback when picked.is_none().

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[752-780]
pacquet/crates/resolving-npm-resolver/src/pick_package.rs[1167-1228]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`handle_cache_hit()` uses `upgrade.upgraded` as the signal that the registry verified the packument. But `maybe_upgrade_abbreviated_meta_for_release_age()` can hit the registry and get `FetchFullMetadataOutcome::NotModified` (304), returning `upgraded=false` even though the registry round-trip happened.
On a pick miss, this causes `handle_cache_hit()` to return `Ok(None)` and forces the caller into the disk+network flow, duplicating work.
### Issue Context
- `maybe_upgrade_abbreviated_meta_for_release_age()` explicitly forwards conditional headers and handles 304.
- The upgrade outcome currently tracks only `{ meta, upgraded }`, losing whether a registry validation occurred.
### Fix Focus Areas
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[752-780]
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[1173-1228]
### Suggested fix
1. Extend `UpgradeOutcome` with an additional boolean like `registry_validated` (or `did_registry_roundtrip`).
 - Set it to `true` for both `Modified(_)` and `NotModified` outcomes.
2. In `handle_cache_hit()`, compute:
 - `let registry_verified = cached.registry_verified || upgrade.registry_validated;`
 (or include `upgrade.upgraded` if you prefer, but `registry_validated` is the key).
3. Keep the existing `if upgrade.upgraded { persist + ctx.meta_cache.set(...) }` behavior unchanged; only the “should we fall through?” decision should treat 304 as verified.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Pnpm bundle path no-check 🐞 Bug ☼ Reliability
Description
WorkEnv::install_command() may produce node "" when none of the hard-coded pnpm bundle
candidates exist, yielding a confusing failure mode (or unintended behavior) instead of a clear,
early error. This makes the integrated benchmark harness brittle for pnpm revisions/layouts that
don’t emit one of the expected bundle paths.
Code

pacquet/tasks/integrated-benchmark/src/work_env.rs[R222-239]

+                // Take the first bundle that exists: `pnpm.mjs` over
+                // `pnpm.cjs`, and the `pnpm11/` layout (where the
+                // TypeScript CLI lives) over the pre-move root layout
+                // (still produced by revisions that predate the move,
+                // e.g. a `pnpm@v10` target). Resolved at script runtime
+                // so the existence check sees the bundle produced by
+                // `pnpm run compile-only`, not the empty tree visible
+                // during `init()`.
+                let candidates = [
+                    "./pnpm-source/pnpm11/pnpm/dist/pnpm.mjs",
+                    "./pnpm-source/pnpm11/pnpm/dist/pnpm.cjs",
+                    "./pnpm-source/pnpm/dist/pnpm.mjs",
+                    "./pnpm-source/pnpm/dist/pnpm.cjs",
+                ]
+                .join(" ");
+                format!(
+                    r#"node "$(for f in {candidates}; do if [ -f "$f" ]; then echo "$f"; break; fi; done)""#,
+                )
Evidence
The command substitution has no fallback when the for loop finds no existing file, so it can
expand to an empty string and still be passed to node.

pacquet/tasks/integrated-benchmark/src/work_env.rs[221-240]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`install_command()` builds a shell `for` loop that echoes the first pnpm bundle path that exists, but it does not handle the case where none exist. In that case the command substitution expands to an empty string and the benchmark scripts execute `node ""`, producing a confusing failure.
### Issue Context
This was introduced when expanding the pnpm bundle search to cover both `pnpm11/` and legacy layouts.
### Fix Focus Areas
- Add an explicit non-empty guard and a clear error message/exit when no bundle file is found.
- Keep paths quoted and avoid introducing shell-injection surface.
### Fix Focus Areas (code)
- pacquet/tasks/integrated-benchmark/src/work_env.rs[221-240]
### Suggested approach
Change the generated bash snippet to `exit 1` if no candidate is found, e.g.:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (9)
6. Bench failures skip Bencher upload 🐞 Bug ◔ Observability
Description
Removing continue-on-error: true from the benchmark step makes any non-zero bench.sh exit fail
the job before bench_dir is recorded, which can prevent later Bencher upload steps from running
and reduce benchmark failure observability. This makes it harder to inspect artifacts/results for
failed benchmark runs.
Code

.github/workflows/benchmark.yml[R84-88]

  - name: Run benchmarks
    id: bench
-      continue-on-error: true
    run: |
      set -o pipefail
      ./pnpm11/benchmarks/bench.sh 2>&1 | tee bench-output.txt
Evidence
The step writes bench_dir only after bench.sh finishes; later Bencher steps are conditional on
that output, so a failure prevents uploads and reduces diagnostics visibility.

.github/workflows/benchmark.yml[84-107]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow previously allowed the benchmark step to fail while still proceeding to subsequent steps (notably Bencher upload). With `continue-on-error` removed, a failing benchmark run may stop the job before `bench_dir` is written to outputs, so the upload steps gated on `steps.bench.outputs.bench_dir` will be skipped.
### Issue Context
The `bench_dir` output is only set after `bench.sh` completes; a failure earlier in the step prevents setting outputs.
### Fix Focus Areas
- Preserve failure visibility *and* still upload artifacts/results when possible.
- Ensure `bench_dir` is set even when benchmarks fail.
### Fix Focus Areas (code)
- .github/workflows/benchmark.yml[84-116]
### Suggested approach
Either:
1) Restore `continue-on-error: true` for the benchmark step and add an explicit final step that fails the job if desired (after uploads), or
2) Capture the benchmark exit code inside the step (`set +e; ...; code=$?; ...; echo bench_dir=...; exit $code`) and make upload steps use `if: always()` with appropriate guards so they still run when the benchmark step fails.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Fallback re-parses packument 🐞 Bug ➹ Performance
Description
When handle_cache_hit() returns Ok(None) for an unverified cache hit that can’t satisfy the
spec, pick_package() falls through and (under prefer_offline / pick_lowest_version) re-reads
and re-parses the mirror via load_meta_async() before the network fetch. This adds avoidable
spawn_blocking + JSON parse work on the exact “stale disk entry → registry revalidate” path this
PR introduces.
Code

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[R776-778]

+    if picked.is_none() && !ctx.offline && !registry_verified {
+        return Ok(None);
+    }
Evidence
handle_cache_hit() explicitly returns Ok(None) on an unverified entry with no matching version,
forcing the caller to continue into the later disk/network flow. In that flow, the
prefer-offline/pick-lowest branch performs a full disk load+parse (load_meta_async) which becomes
redundant because the packument was already present in memory on the cache-hit path.

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[730-780]
pacquet/crates/resolving-npm-resolver/src/pick_package.rs[517-576]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`handle_cache_hit()` can intentionally fall through (`Ok(None)`) when the cached entry is registry-unverified and the pick fails. On `prefer_offline`/`pick_lowest_version` calls, `pick_package()` then executes the disk-first branch and calls `load_meta_async()` (disk read + `serde_json::from_str`) even though we already had the packument in memory.
### Issue Context
This is a performance-only inefficiency on the stale-disk fallback path introduced by the new “unverified cache hit may not be terminal” behavior.
### Fix Focus Areas
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[752-780]
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[517-576]
### Suggested fix
Change the fallthrough contract so the caller can reuse the already-loaded packument:
- Option A: Make `handle_cache_hit()` return an enum like `CacheHit::{Terminal(PickPackageResult), Fallthrough { meta: Arc<Package> }}` and when falling through, set `meta_cached_in_store = Some(meta)` (or otherwise skip `load_meta_async`).
- Option B: Keep `Option<PickPackageResult>` but add an out-param / secondary return value that carries `meta` for reuse when returning `None`.
Either way, avoid a second disk parse before the registry revalidation fetch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Verifier cache key mismatch 🐞 Bug ➹ Performance
Description
NpmResolutionVerifier::read_shared_meta() queries the shared PackageMetaCache using bare keys
like name / name:full, but the resolver stores entries under registry- and scope-qualified keys
(e.g. {registry}\x00{name} with :full suffixes). This makes verifier-side shared-cache hits
unlikely, causing redundant disk reads / registry requests even when the resolver already fetched
the packument in the same install.
Code

pacquet/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[R703-707]

  cache
      .get(&format!("{name_str}:full"))
      .or_else(|| cache.get(&name_str))
+            .map(|cached| cached.meta)
      .filter(|meta| meta.name == name_str)
Evidence
The verifier probes meta_cache with name-only keys, while the resolver’s metadata_cache_key()
(and tests) show that cache entries are stored under {registry}\x00{name} (and potentially
private-namespaced) keys. Because these key spaces don’t overlap, the verifier’s shared-cache fast
path won’t find resolver-populated entries.

pacquet/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[639-708]
pacquet/crates/resolving-npm-resolver/src/pick_package.rs[996-1029]
pacquet/crates/resolving-npm-resolver/src/pick_package/tests.rs[190-205]
pacquet/crates/resolving-npm-resolver/src/lookup_context.rs[83-87]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`NpmResolutionVerifier::read_shared_meta()` looks up packuments in the shared `PackageMetaCache` using keys that don’t match the resolver’s cache-key schema (which includes registry + scope). This prevents the verifier from reusing resolver-populated in-memory metadata and can force redundant disk/network work.
### Issue Context
- Resolver cache keys are `{registry}\x00{name}` (plus `:full` / `:full:filtered`), and may be namespaced for private routes.
- Verifier currently probes `name` / `name:full`, which won’t match resolver keys.
### Fix Focus Areas
- pacquet/crates/resolving-npm-resolver/src/create_npm_resolution_verifier.rs[639-708]
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[996-1029]
### Suggested fix
1. Change `read_shared_meta` to accept `registry: &str` (and, if needed, derive `MetadataCacheScope` similarly to other verifier paths).
2. Compute the key using the same scheme as resolver entries for at least the public scope:
- `let key = package_key(registry, &name_str);`
- try `format!("{key}:full")` then `key`.
3. Update the surrounding comment to reflect the actual key format (`{registry}\x00{name}...`) so future changes don’t reintroduce drift.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. WeakSet identity dependency 🐞 Bug ≡ Correctness
Description
pickPackage uses a module-level WeakSet to remember disk-promoted (registry-unverified)
packuments, but PackageMetaCache does not guarantee that get() returns the same object instance
previously passed to set(). Custom caches that clone/deserialize on read can lose the WeakSet
marker, causing a no-match cache hit to return terminally instead of falling through to registry
revalidation under preferOffline.
Code

pnpm11/resolving/npm-resolver/src/pickPackage.ts[R267-278]

+    const pickedPackage = pickMatchingVersionFinal(pickerOpts, spec, metaForCache)
+    if (pickedPackage != null || ctx.offline === true || !unverifiedDiskPackuments.has(metaForCache)) {
+      return {
+        meta: metaForCache,
+        pickedPackage,
+      }
}
+    // The cached packument came from the disk mirror without registry
+    // validation and can't satisfy this spec — it may simply predate the
+    // wanted version. Fall through to the regular flow, which revalidates
+    // against the registry (see unverifiedDiskPackuments).
}
Evidence
The new fallback logic depends on WeakSet membership of the cached PackageMeta object. However,
PackageMetaCache is an exported interface intended for caller-supplied implementations and does
not require returning the same object instance, so the marker can be dropped even when the cache
still contains an unverified disk entry.

pnpm11/resolving/npm-resolver/src/pickPackage.ts[27-31]
pnpm11/resolving/npm-resolver/src/pickPackage.ts[183-206]
pnpm11/resolving/npm-resolver/src/pickPackage.ts[267-278]
pnpm11/resolving/npm-resolver/src/index.ts[218-226]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`unverifiedDiskPackuments` tracks registry-unverified entries by `PackageMeta` object identity. Since `PackageMetaCache` is caller-supplied and its contract doesn’t require identity preservation, a valid custom cache can return a different object on `get()`, causing the unverified marker to be lost and changing `preferOffline` semantics (no-match becomes terminal instead of falling through to registry revalidation).
### Issue Context
The resolver explicitly allows `opts.metaCache` to be supplied by callers and to outlive the resolver instance, so compatibility with different cache implementations matters.
### Fix Focus Areas
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[183-278]
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[27-31]
- pnpm11/resolving/npm-resolver/src/index.ts[218-226]
### Suggested fix
Replace the `WeakSet<PackageMeta>` with a key-based marker (e.g. `const unverifiedDiskPackumentKeys = new Set<string>()`).
- On disk promotion: `unverifiedDiskPackumentKeys.add(cacheKey)`.
- On any registry-validated cache write path (200 response, 304 path that revalidates, and the “upgrade fetched full metadata” path): `unverifiedDiskPackumentKeys.delete(cacheKey)` before/after `metaCache.set(...)`.
- On cache hit: treat as unverified only when `unverifiedDiskPackumentKeys.has(cacheKey)`.
- (Optional) Add opportunistic cleanup: if `!metaCache.has(cacheKey)`, delete from the set.
This avoids relying on object identity and keeps behavior consistent across cache implementations.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Custom cache breaks fallback 🐞 Bug ≡ Correctness
Description
The new PackageMetaCache::set_unverified/is_unverified defaults treat disk-promoted entries as
verified, so a stale in-memory hit that can’t satisfy a spec becomes terminal instead of falling
through to the conditional registry fetch. Downstream implementations of the publicly re-exported
PackageMetaCache can therefore resolve incorrectly under prefer_offline (reporting no match even
though the registry has one).
Code

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[R112-134]

+    /// Like [`PackageMetaCache::set`], but remembers the entry as
+    /// registry-unverified: it was parsed straight from the on-disk
+    /// mirror without a validating registry round-trip, so it may
+    /// predate versions the registry has. [`pick_package`] uses the
+    /// marker to fall through to a conditional registry request —
+    /// instead of failing the pick — when a cache hit on such an entry
+    /// can't satisfy the requested spec and the resolver isn't offline.
+    /// The verified [`PackageMetaCache::set`] the fetch then performs
+    /// clears the marker, so each package revalidates at most once.
+    ///
+    /// The default implementation drops the marker (every entry reads
+    /// as verified), which keeps custom caches on the terminal
+    /// cache-hit behavior: a failed pick on a hit is a failed pick.
+    fn set_unverified(&self, key: String, meta: Arc<Package>) {
+        self.set(key, meta);
+    }
+
+    /// Whether the entry under `key` was stored via
+    /// [`PackageMetaCache::set_unverified`] and hasn't since been
+    /// replaced through a verified [`PackageMetaCache::set`].
+    fn is_unverified(&self, _key: &str) -> bool {
+        false
+    }
Evidence
The resolver’s fallthrough decision depends on is_unverified(cache_key), but the trait’s provided
defaults make every entry appear verified unless downstream implementers override the new methods;
since the trait is re-exported publicly, this changes behavior for custom caches.

pacquet/crates/resolving-npm-resolver/src/pick_package.rs[87-135]
pacquet/crates/resolving-npm-resolver/src/pick_package.rs[760-786]
pacquet/crates/resolving-npm-resolver/src/lib.rs[62-67]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`PackageMetaCache` is public and can be implemented downstream. With the current default implementations, `set_unverified()` does not preserve any marker state and `is_unverified()` always returns false, which disables the new “fallback to registry when an unverified cache hit can’t satisfy the spec” behavior.
### Issue Context
The fallback is now keyed exclusively off `ctx.meta_cache.is_unverified(cache_key)` in `handle_cache_hit`. If a downstream cache doesn’t override the new methods, disk-promoted packuments are effectively treated as verified and a failed pick becomes terminal, which differs from the pre-promotion behavior (where the resolver would proceed to disk/network paths).
### Fix Focus Areas
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[112-135]
- pacquet/crates/resolving-npm-resolver/src/pick_package.rs[760-786]
Potential fix directions:
- Add an explicit opt-in capability (e.g. `fn supports_unverified(&self)->bool { false }`) and only promote disk-loaded metadata into memory when true; keep old behavior for caches that don’t support the marker.
- Or make the marker semantics mandatory (no-op defaults removed) in a semver-appropriate release, with clear docs/tests.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Unverified flag never cleared 🐞 Bug ➹ Performance
Description
Disk-promoted packuments stay in unverifiedDiskPackuments even after a subsequent 304 Not Modified
response revalidates the on-disk mirror and the result is re-cached. Later cache hits where
pickMatchingVersionFinal(...) returns null will keep falling through to the network path, causing
repeated conditional registry requests and contradicting the comment that 304-revalidated packuments
are never in the set.
Code

pnpm11/resolving/npm-resolver/src/pickPackage.ts[R267-277]

+    const pickedPackage = pickMatchingVersionFinal(pickerOpts, spec, metaForCache)
+    if (pickedPackage != null || ctx.offline === true || !unverifiedDiskPackuments.has(metaForCache)) {
+      return {
+        meta: metaForCache,
+        pickedPackage,
+      }
}
+    // The cached packument came from the disk mirror without registry
+    // validation and can't satisfy this spec — it may simply predate the
+    // wanted version. Fall through to the regular flow, which revalidates
+    // against the registry (see unverifiedDiskPackuments).
Evidence
The PR adds a WeakSet marker for disk-sourced metas and uses it to decide whether to fall through to
the registry on cache hits that can’t satisfy a spec; but the 304-revalidation path re-caches the
same meta object without removing it from the WeakSet, so it remains “unverified” indefinitely.

pnpm11/resolving/npm-resolver/src/pickPackage.ts[183-206]
pnpm11/resolving/npm-resolver/src/pickPackage.ts[247-278]
pnpm11/resolving/npm-resolver/src/pickPackage.ts[387-423]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`unverifiedDiskPackuments` is used to decide whether a cache hit that can’t satisfy a spec should fall through to the network path. However, when the registry responds `304 Not Modified`, the code re-caches `metaCachedInStore` but does not remove that meta object from `unverifiedDiskPackuments`. As a result, a packument can remain treated as “disk-unverified” forever even after registry revalidation, leading to repeated conditional fetches on subsequent unsatisfiable cache hits.
### Issue Context
- Disk-loaded metas are marked unverified via `cacheDiskLoadedMeta()`.
- Cache-hit logic uses `unverifiedDiskPackuments.has(metaForCache)` to decide whether to fall through to the network.
- The `fetchResult.notModified` path re-caches `metaCachedInStore` but never clears the unverified mark.
### Fix Focus Areas
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[183-206]
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[247-278]
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[387-423]
### Suggested fix
In the `fetchResult.notModified` (304) branch, before/after `ctx.metaCache.set(cacheKey, metaCachedInStore)`, call:
- `unverifiedDiskPackuments.delete(metaCachedInStore)`
This aligns behavior with the comment (“304-revalidated packuments are never in this set”) and avoids repeated network fallthroughs once the registry has vouched for the cached packument.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. Redundant disk reload 🐞 Bug ➹ Performance
Description
When an unverified disk-promoted packument is returned from ctx.metaCache but cannot satisfy the
requested spec, pickPackage falls through; under preferOffline/pickLowestVersion it then
immediately calls loadMeta(pkgMirror) again, re-reading and re-parsing the same mirror metadata.
This adds an avoidable fs.readFile + JSON.parse on the fallback path that is still
performance-sensitive on large packuments.
Code

pnpm11/resolving/npm-resolver/src/pickPackage.ts[R267-278]

+    const pickedPackage = pickMatchingVersionFinal(pickerOpts, spec, metaForCache)
+    if (pickedPackage != null || ctx.offline === true || !unverifiedDiskPackuments.has(metaForCache)) {
+      return {
+        meta: metaForCache,
+        pickedPackage,
+      }
}
+    // The cached packument came from the disk mirror without registry
+    // validation and can't satisfy this spec — it may simply predate the
+    // wanted version. Fall through to the regular flow, which revalidates
+    // against the registry (see unverifiedDiskPackuments).
}
Evidence
The new unverified-disk cache-hit logic intentionally falls through when pickedPackage is null,
but the downstream preferOffline/pickLowestVersion branch still loads the packument from disk
via loadMeta(). loadMeta() reads and parses the full cached file, so this is a redundant and
avoidable cost when the same PackageMeta object is already in memory from the cache hit.

pnpm11/resolving/npm-resolver/src/pickPackage.ts[183-278]
pnpm11/resolving/npm-resolver/src/pickPackage.ts[280-328]
pnpm11/resolving/npm-resolver/src/pickPackage.ts[771-782]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
When `pickPackage()` hits `ctx.metaCache` with a disk-promoted (unverified) `PackageMeta` that cannot satisfy the spec, it falls through to the regular flow.
In the `preferOffline` / `pickLowestVersion` branch, the regular flow unconditionally calls `loadMeta(pkgMirror)`, which does a full disk read and `JSON.parse` of the packument. This is redundant because the same packument is already present in memory as `metaForCache`.
### Issue Context
- The fallthrough is intentional for unverified disk meta (so a miss can revalidate against the registry).
- The optimization is specifically to avoid re-loading the *same* on-disk mirror packument when we already have it in memory.
### Fix Focus Areas
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[183-278]
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[280-328]
### Suggested approach
- When falling through due to an unverified disk meta cache hit that can’t satisfy the spec, seed the later `runLimited()` flow with that in-memory meta so the `preferOffline`/`pickLowestVersion` disk-load path can skip `loadMeta(pkgMirror)`.
- For example, capture `metaForCache` in an outer variable (e.g. `diskMetaFromCacheHit`) before entering `runLimited`, and inside the `if (ctx.offline === true || ctx.preferOffline === true || opts.pickLowestVersion)` block do something like:
- `metaCachedInStore = metaCachedInStore ?? diskMetaFromCacheHit ?? await limit(() => loadMeta(pkgMirror))`
- Ensure this only applies to the fallthrough case (unverified-disk cache hit miss), not to registry-fetched cache hits.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. Verifier uses disk metadata 🐞 Bug ⛨ Security
Description
By caching disk-loaded packuments into the shared metaCache on preferOffline/offline paths,
the lockfile verifier can hit its shared-cache fast path and skip fetchAbbreviatedMetadataCached
(the conditional registry GET). This makes the tarball-URL binding and related checks depend on
potentially stale/unvalidated on-disk metadata under --prefer-offline when the registry is
reachable.
Code

pnpm11/resolving/npm-resolver/src/pickPackage.ts[R284-288]

+          // Cache the (possibly abbreviated) parsed metadata in memory so repeat
+          // resolutions of the same package don't re-read and re-parse the mirror.
+          // On a later cache hit the top-level path re-runs the same
+          // maybeUpgradeAbbreviatedMetaForReleaseAge check, so behavior is unchanged.
+          ctx.metaCache.set(cacheKey, metaCachedInStore)
Evidence
The PR adds metaCache.set() on disk-hit paths, while the verifier is wired to reuse the same cache
and explicitly skips its conditional registry fetch when that shared cache contains an entry.

pnpm11/resolving/npm-resolver/src/pickPackage.ts[248-293]
pnpm11/installing/client/src/index.ts[69-85]
pnpm11/resolving/npm-resolver/src/createNpmResolutionVerifier.ts[739-789]
pnpm11/resolving/npm-resolver/src/fetchFullMetadataCached.ts[55-70]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`pickPackage()` now calls `ctx.metaCache.set(cacheKey, metaCachedInStore)` on disk-hit paths for `--offline` and `--prefer-offline`. Because the install client shares this `metaCache` with the lockfile `ResolutionVerifier`, the verifier’s `fetchAbbreviatedMeta()` may treat the disk-loaded packument as a shared-cache hit and skip its normal conditional registry GET. That reduces the verifier’s ability to validate against *current* registry state when `--prefer-offline` is used.
## Issue Context
- `createClient()` builds one LRU `metaCache` and passes it to both the resolver and `createResolutionVerifiers()`.
- The npm verifier’s `fetchAbbreviatedMeta()` checks `sharedMetaCache` first; on hit it does not call `fetchAbbreviatedMetadataCached()`, which otherwise performs a conditional registry request.
- With this PR, `sharedMetaCache` can now contain *disk-only* metadata from prefer-offline/offline disk-hit resolution.
## Fix Focus Areas
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[248-293]
- pnpm11/resolving/npm-resolver/src/createNpmResolutionVerifier.ts[739-789]
- pnpm11/resolving/npm-resolver/src/fetchFullMetadataCached.ts[55-70]
- pnpm11/installing/client/src/index.ts[69-85]
## Suggested fix directions (pick one)
1) **Track metadata provenance**: tag `PackageMeta` objects loaded from disk vs fetched/validated from registry (e.g. a non-enumerable Symbol field) and in the verifier only use shared-cache entries that are registry-validated for tarball-URL binding.
2) **Verifier-specific behavior**: for the tarball-URL binding check, always use `fetchAbbreviatedMetadataCached()` even if `sharedMetaCache` has an entry (or gate it behind a new verifier option such as `allowSharedMetaCacheForTarballBinding`, defaulting to true only when offline).
3) **Narrow caching on prefer-offline**: if provenance tracking isn’t feasible, consider not promoting disk-loaded metadata into the shared `metaCache` when `ctx.preferOffline === true` (keep it for `ctx.offline === true` only), so the verifier continues to do its conditional GET under prefer-offline.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


14. Heap growth from metaCache 🐞 Bug ☼ Reliability
Description
Promoting disk-loaded packuments into the in-memory LRU can retain many large PackageMeta objects
concurrently in offline/prefer-offline runs, increasing peak heap usage and GC overhead compared to
the prior behavior where disk-loaded packuments could be collected between resolutions. The default
cache is count-bounded (max 10k) rather than size-bounded, so a small number of very large
packuments can still cause memory pressure.
Code

pnpm11/resolving/npm-resolver/src/pickPackage.ts[R255-264]

+          // Cache the parsed metadata in memory so repeat resolutions of the
+          // same package (common across a large dependency graph) don't re-read
+          // and re-parse the on-disk mirror. maybeUpgradeAbbreviatedMetaForReleaseAge
+          // short-circuits when offline, so the top-level cache hit path returns
+          // the same meta without any network access.
+          ctx.metaCache.set(cacheKey, metaCachedInStore)
+          return {
+            meta: metaCachedInStore,
+            pickedPackage: pickMatchingVersionFinal(pickerOpts, spec, metaCachedInStore),
+          }
Evidence
The PR adds new cache insertions on disk-hit paths, while the default cache is only entry-count
bounded and the codebase already calls out that metadata can be very large and that holding registry
metadata in memory can OOM large workspaces.

pnpm11/resolving/npm-resolver/src/pickPackage.ts[248-293]
pnpm11/resolving/npm-resolver/src/pickPackage.ts[339-345]
pnpm11/resolving/npm-resolver/src/index.ts[1095-1099]
pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts[228-242]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `ctx.metaCache.set(cacheKey, metaCachedInStore)` calls on offline/prefer-offline disk-hit paths intentionally retain parsed packuments. Because packuments can be very large, retaining many of them at once can increase heap/GC cost or OOM in large workspaces.
## Issue Context
- The default meta cache is `LRUCache(max: 10000, ttl: 120s)` and is shared across the resolver and verifier.
- `pickPackage()` itself documents that cached metadata files can be “megabytes” in size.
## Fix Focus Areas
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[248-293]
- pnpm11/resolving/npm-resolver/src/index.ts[1095-1099]
## Suggested fix directions (pick one)
1) **Size-bounded LRU**: switch the default `LRUCache` config to use `maxSize` + `sizeCalculation` (e.g. approximate by number of versions, or by the on-disk JSON byte size when available) so a few huge packuments can’t monopolize heap.
2) **Prefer-offline-only mitigation**: keep the caching but reduce retention for disk-sourced entries (smaller max, shorter ttl) to avoid worst-case heap spikes.
3) **Operational escape hatch**: add an option/env to disable disk→memory promotion for offline flows in memory-constrained environments.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

15. Duplicate cache write 🐞 Bug ➹ Performance
Description
In the prefer-offline disk-hit path, when abbreviated metadata gets upgraded (upgrade.upgradedFrom
!= null), the code writes the same packument into ctx.metaCache twice before returning, adding
unnecessary LRU churn on a hot path. This is small but avoidable overhead in the exact scenario
(publishedBy/minimumReleaseAge) that already adds extra work.
Code

pnpm11/resolving/npm-resolver/src/pickPackage.ts[R284-288]

+          // Cache the (possibly abbreviated) parsed metadata in memory so repeat
+          // resolutions of the same package don't re-read and re-parse the mirror.
+          // On a later cache hit the top-level path re-runs the same
+          // maybeUpgradeAbbreviatedMetaForReleaseAge check, so behavior is unchanged.
+          ctx.metaCache.set(cacheKey, metaCachedInStore)
Evidence
The prefer-offline path already caches inside the upgrade branch, and the PR adds a second
unconditional cache set before returning a picked package; when an upgrade happens both execute for
the same call.

pnpm11/resolving/npm-resolver/src/pickPackage.ts[270-293]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
In `pickPackage`, the prefer-offline disk-load path can call `ctx.metaCache.set(cacheKey, metaCachedInStore)` twice for the same resolution:
1) once inside the `upgrade.upgradedFrom != null` block, and
2) again in the new `if (pickedPackage) { ... }` return block.
This happens only when `maybeUpgradeAbbreviatedMetaForReleaseAge(...)` performs an upgrade (which requires `publishedBy`/minimumReleaseAge logic and missing per-version `time`). The second set is redundant because the first already stored the upgraded meta.
### Issue Context
This is a micro-optimization but it sits on a hot path during large resolutions.
### Fix Focus Areas
- pnpm11/resolving/npm-resolver/src/pickPackage.ts[270-293]
Suggested change:
- In the `if (pickedPackage)` block, only call `ctx.metaCache.set(...)` if the earlier upgrade path did not already set it, e.g.:
- `if (upgrade.upgradedFrom == null) ctx.metaCache.set(cacheKey, metaCachedInStore)`
This preserves the existing behavior where upgraded meta is cached even when `pickedPackage` is null, while avoiding the duplicate write when it is non-null.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e8ab4e6

…esolution

When resolving with --offline or --prefer-offline, pickPackage loaded a package's
metadata from the on-disk cache mirror but never stored it in the in-memory
metaCache. Every later resolution of the same package (once per dependent that
references it) therefore re-read and re-parsed the packument from disk.

On a large workspace this dominated wall time: a warm-cache `dedupe --offline`
issued ~23,700 metadata loads for ~5,100 distinct packages (~4.6x redundancy),
re-parsing ~67 GB of JSON.

Store the parsed metadata in the in-memory cache after a successful disk load so
each package is parsed once per command. maybeUpgradeAbbreviatedMetaForReleaseAge
short-circuits when offline and re-runs identically for prefer-offline, so
resolution output is unchanged. Cuts the above run from ~140s to ~75s.
@zkochan
zkochan force-pushed the ansteg/dedupe-offline-metacache branch from e8ab4e6 to b37f3f7 Compare July 4, 2026 09:41
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit b37f3f7

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit b37f3f7

…a cannot satisfy the spec

Promoting disk-loaded packuments into the in-memory metaCache made the
top-of-function cache-hit path terminal for them: when the promoted
(possibly stale) packument could not satisfy a later request's range,
pickPackage returned a null pick and the caller threw
ERR_PNPM_NO_MATCHING_VERSION, where it previously fell through to a
conditional registry request and succeeded.

Track registry-unverified disk promotions in a WeakSet and let a cache
hit on such an entry fall through to the regular network-validating flow
when its pick fails and the resolver is not offline. Network-fetched and
304-revalidated packuments are never marked, so their cache hits behave
as before. Also skip the redundant second metaCache.set on the
prefer-offline path when the abbreviated-meta upgrade branch already
cached the registry-validated document.
Copilot AI review requested due to automatic review settings July 4, 2026 10:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9279c8a

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9279c8a

…esolution in pacquet

Promote packuments loaded from the on-disk mirror during offline and
prefer-offline resolution into the install-scoped in-memory cache, so
each package's metadata is parsed once per command instead of once per
dependent that references it — the pacquet counterpart of the
TypeScript-side change in this PR.

Disk promotions are stored as registry-unverified via the new
PackageMetaCache::set_unverified: the mirror may predate versions the
registry has, so a cache hit on such an entry that cannot satisfy the
requested spec falls through to the disk + network flow instead of
returning a null pick, mirroring the TypeScript-side fall-through fix.
This also repairs the pre-existing version-spec and publishedBy-mtime
fast paths, whose disk promotions could previously turn a recoverable
miss into a hard no-matching-version failure. The verified set() a
fetch performs clears the marker, so each package revalidates at most
once.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pacquet/crates/resolving-npm-resolver/src/pick_package.rs (1)

646-650: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Mark the publishedBy disk shortcut as unverified too.

This branch also promotes metadata loaded from the on-disk mirror, but set marks it registry-verified. A later request for a version absent from that mirror can then fail terminally instead of revalidating. Use set_unverified here like the other disk-promotion paths.

As per path instructions, “unverified disk-promotion” must not cause incorrect trust/selection, and pacquet must mirror pnpm resolver semantics.

Proposed fix
 if !opts.dry_run {
-    ctx.meta_cache.set(cache_key.clone(), Arc::clone(meta));
+    ctx.meta_cache.set_unverified(cache_key.clone(), Arc::clone(meta));
 }
🤖 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/resolving-npm-resolver/src/pick_package.rs` around lines 646 -
650, The publishedBy disk promotion path in pick_package::resolve_package is
using meta_cache.set, which incorrectly marks on-disk mirror metadata as
registry-verified. Update this branch to use meta_cache.set_unverified, matching
the other disk-loaded promotion paths, so cached metadata from the mirror can be
revalidated instead of causing terminal failures for missing versions.

Source: Path instructions

🧹 Nitpick comments (1)
pacquet/crates/resolving-npm-resolver/src/pick_package/tests.rs (1)

55-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid rustdoc comments for private test explanations.

These are not item contracts and mostly restate the test names/assertions. Prefer no comment, or a short // only for non-obvious fixture intent.

As per path instructions, pacquet’s Rust style says “Use doc comments for item contracts only” and not to duplicate test explanations.

Also applies to: 292-294, 336-339, 385-390

🤖 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/resolving-npm-resolver/src/pick_package/tests.rs` around lines
55 - 56, The test explanation currently uses rustdoc-style documentation for
private test setup, which should be reserved for item contracts only. In the
affected tests in pick_package/tests.rs, replace these `///` comments with
either no comment or a brief `//` note only where fixture intent is not obvious,
keeping the surrounding test names and assertions to explain behavior.

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 `@pacquet/crates/resolving-npm-resolver/src/pick_package.rs`:
- Around line 218-220: The set method in Package cache handling is clearing the
unverified marker before the verified metadata is fully stored, which can let
concurrent readers treat stale promoted data as verified. Update set so it
inserts the new Package into inner first, and only then removes the key from
unverified, keeping the cache state consistent for callers of set and the early
cache-check path.

---

Outside diff comments:
In `@pacquet/crates/resolving-npm-resolver/src/pick_package.rs`:
- Around line 646-650: The publishedBy disk promotion path in
pick_package::resolve_package is using meta_cache.set, which incorrectly marks
on-disk mirror metadata as registry-verified. Update this branch to use
meta_cache.set_unverified, matching the other disk-loaded promotion paths, so
cached metadata from the mirror can be revalidated instead of causing terminal
failures for missing versions.

---

Nitpick comments:
In `@pacquet/crates/resolving-npm-resolver/src/pick_package/tests.rs`:
- Around line 55-56: The test explanation currently uses rustdoc-style
documentation for private test setup, which should be reserved for item
contracts only. In the affected tests in pick_package/tests.rs, replace these
`///` comments with either no comment or a brief `//` note only where fixture
intent is not obvious, keeping the surrounding test names and assertions to
explain behavior.
🪄 Autofix (Beta)

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: a0ae24da-1164-4e90-b0f7-f9d4e0457447

📥 Commits

Reviewing files that changed from the base of the PR and between 9279c8a and e30f7cc.

📒 Files selected for processing (2)
  • pacquet/crates/resolving-npm-resolver/src/pick_package.rs
  • pacquet/crates/resolving-npm-resolver/src/pick_package/tests.rs

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e30f7cc

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e30f7cc

…e entry

The registry-unverified marker lived in a DashSet beside the DashMap
holding the packument, so the two were updated non-atomically: a
concurrent reader could pair a stale disk-promoted packument with the
cleared marker of a verified overwrite and treat a recoverable no-match
cache hit as terminal. Fold the state into the cache value
(CachedPackument) so a reader always observes the packument and its
verification state as one unit — the same object-identity semantics the
TypeScript side gets from its WeakSet — and drop the separate
is_unverified lookup.

Addresses the CodeRabbit and Qodo review comments on the marker/value
race in InMemoryPackageMetaCache.
@codecov-commenter

codecov-commenter commented Jul 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.02%. Comparing base (ce5d5a5) to head (0fb9bca).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...npm-resolver/src/create_npm_resolution_verifier.rs 64.28% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12760      +/-   ##
==========================================
- Coverage   85.62%   85.02%   -0.60%     
==========================================
  Files         413      415       +2     
  Lines       64343    65418    +1075     
==========================================
+ Hits        55093    55622     +529     
- Misses       9250     9796     +546     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 30d02b0

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 30d02b0

zkochan added 2 commits July 4, 2026 16:30
…asure real resolution

The pnpm benchmark pipeline had been silently dead since the
TypeScript CLI moved into pnpm11/: bench.sh resolved REPO_ROOT to
pnpm11/ (where no Cargo.toml exists, so the orchestrator build died
immediately), the orchestrator's pnpm run command probed the pre-move
pnpm/dist bundle path, and continue-on-error on the workflow's run
step swallowed the failure while every downstream step (Bencher
upload, PR comment) reported skipped on a green run. REPO_ROOT now
points at the git root, the bundle probe prefers the pnpm11 layout
with a fallback for revisions that predate the move, and the run step
fails loudly.

The offline fresh-resolve scenario also measured a no-op: node_modules
left behind by the pre-warm pass let both CLIs take the up-to-date
short-circuit ('Already up to date') instead of resolving. The
per-iteration cleanup now wipes node_modules alongside the lockfile,
and the same cleanup runs once before the pre-warm itself — a reused
work-env can carry a lockfile from a previous scenario, which would
turn the priming install into a locked install that fetches tarballs
without populating the metadata mirror.

With both fixed, the scenario shows the offline metadata promotion of
this PR directly: pnpm@HEAD resolves the fixture offline in 2.41s vs
3.17s for pnpm@main (1.31x), with mirror reads dropping from 2625 to
1297.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7ef9e7b

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7ef9e7b

zkochan added 2 commits July 4, 2026 16:45
…reads

The verifier's read_shared_meta queried the shared PackageMetaCache
with bare name / name:full keys, but the resolver stores entries under
registry-qualified keys ({registry}\x00{name} plus :full /
:full:filtered suffixes — see metadata_cache_key), so the shared-cache
fast path could never hit and the verifier always re-fetched or
re-read metadata the resolver already held. Build the key with
package_key and try full, filtered full, then abbreviated, mirroring
the TypeScript verifier's readSharedMeta. The trust-check site gains
the :full:filtered fallback too: clear_meta keeps time, per-version
_npmUser, and dist, which is everything fail_if_trust_downgraded
reads.

Found by review on pnpm#12760; the mismatch predates this PR but
sits on the exact reads it touched.
Copilot AI review requested due to automatic review settings July 4, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@zkochan

zkochan commented Jul 4, 2026

Copy link
Copy Markdown
Member

Disposition of the latest Qodo findings:

  1. Partial move breaks build — declined as a false positive (replied on the thread): Rust tracks initialization per field, so reading cached.registry_verified (a Copy bool) after moving cached.meta out is legal for a Drop-less struct. The crate builds — clippy -D warnings, nextest, rustdoc, and dylint pass on every pushed commit via the pre-push hook.

  2. Verifier cache key mismatch — valid, fixed in 5580124. read_shared_meta queried bare name/name:full keys while the resolver stores registry-qualified ones, so the verifier's shared-cache fast path could never hit. It now builds the key with package_key and tries :full → :full:filtered → abbreviated, mirroring the TypeScript verifier's readSharedMeta; the trust-check site gains the :full:filtered fallback too (clear_meta keeps time, per-version _npmUser, and dist — everything fail_if_trust_downgraded reads). The mismatch predates this PR but sits on the exact reads it touched. 282 resolver-crate tests plus the lockfile-verification and package-manager suites (677 total) pass.

  3. Fallback re-parses packument (pacquet) — declined, same rationale as the TypeScript sibling finding: the extra mirror parse happens at most once per package per install (the revalidating fetch re-caches a verified entry), only on the previously-failing path, and keeping the fall-through re-enter the ordinary flow preserves the flow-shape parity between the two stacks. Threading the in-memory packument past the fall-through isn't worth the contract complexity for a cold path.

Findings 4–10 in the current numbering are the previously dispositioned items, unchanged.


Written by an agent (Claude Code, claude-fable-5).

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0fb9bca

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0fb9bca

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

# Scenario main HEAD
1 Isolated linker: fresh restore, hot cache + hot store 2.457s ± 0.058s 2.466s ± 0.08s
2 Isolated linker: fresh add new dep, hot cache + hot store 5.239s ± 0.049s 5.198s ± 0.051s
3 Isolated linker: fresh install, hot cache + hot store 6.261s ± 0.052s 6.261s ± 0.065s
4 Isolated linker: fresh restore, cold cache + cold store 7.467s ± 0.079s 7.53s ± 0.13s
5 Isolated linker: fresh install, cold cache + cold store 12.808s ± 0.113s 12.805s ± 0.112s
6 Isolated linker: fresh resolve, hot cache, offline 4.866s ± 0.068s 3.683s ± 0.029s
7 GVS linker: fresh restore, hot cache + hot store 1.231s ± 0.061s 1.209s ± 0.046s

Run 28709506085 · 10 runs per scenario · triggered by @zkochan

@zkochan
zkochan merged commit 11a7fdd into pnpm:main Jul 4, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants