Skip to content

fix(store-dir): key non-registry store-index rows by the bare resolution id - #13417

Merged
zkochan merged 5 commits into
mainfrom
fix-13365
Jul 27, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix-13365

Conversation

@zkochan

@zkochan zkochan commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the store-index pkgId divergence reported in #13365: for every non-registry dependency, the TypeScript CLI keys its index.db row by the bare resolution id while pacquet keyed it by the lockfile-shaped <name>@<id>. Registry entries already agreed exactly.

dependency shape before (pacquet) after
remote tarball URL sha512-…\ttarball-pkg@http://…/tarball-pkg-1.0.0.tgz sha512-…\thttp://…/tarball-pkg-1.0.0.tgz
git-host archive ci-info@https://codeload.github.com/…\tbuilt https://codeload.github.com/…\tbuilt
type: git hi@git+file:///…/repo#a0c17e86…\tbuilt git+file:///…/repo#a0c17e86…\tbuilt

Verified end to end by installing the same git+file:// dependency with [email protected] and with this build into separate stores: both now write the byte-identical key, and a pacquet install against the TS-warmed store reuses the row instead of adding a second one.

The second finding in the issue is fixed too: a remote tarball occupied two rows because the resolve-time fetch keyed by the bundled manifest's name@version while the install pass keyed by name@<url>. It now occupies one.

Closes #13365

Review also surfaced a neighbouring gap in the side-effects cache: git-hosted tarballs upload to a row the warm path never reads, and type: git never uploads at all. That changes which key shape a package is filed under rather than the pkgId inside a key, so it is tracked separately in #13420.

Squash Commit Body

The v11 store index is an on-disk contract shared between the TypeScript
CLI and pacquet, but the two stacks disagreed on `pkgId` for every
non-registry dependency: pnpm writes the bare resolution id (the tarball
URL, the git-host archive URL, the `git+…#<commit>` spec) while pacquet
wrote the lockfile-shaped `<name>@<id>`. Registry entries — the
overwhelming majority — already agreed. The cost was reuse: a store
warmed by one stack was cold for the other for every URL / git
dependency, so switching between pnpm 11 and pnpm 12 re-downloaded,
re-extracted, and re-imported all of them, and `cat-index` in one stack
could not see the other's rows.

`PkgNameVerPeer::pkg_id` now derives that id from a lockfile key, reusing
`pacquet_deps_path::try_get_package_id` (pnpm's `tryGetPackageId`), and
every store-index keying site goes through it — the install dispatcher,
the warm-key prefetch in `create_virtual_store`, the fresh-lockfile
reuse map and graph prefetch, the side-effects upload, `pnpm patch`, and
`pnpm cat-index`.

A remote tarball also occupied two rows rather than one: the resolve-time
fetch keyed its row by the bundled manifest's `name@version` while the
install pass keyed one by `name@<url>`. `FetchTarballForResolution` now
keys by the caller's `package_id`, and the tarball resolver passes the
normalized bare specifier (the id the lockfile records) rather than the
post-redirect URL, so both passes address one row.

The git fetchers hand `prepare_package` a resolution id now, so it
synthesizes the `<name>@<id>` dep path it gates on from the fetched
manifest's name — exactly what pnpm's `preparePackage` does, keeping the
`allowBuilds` identity unchanged while the store key moves.

Closes pnpm/pnpm#13365

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ 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.

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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Improved shared-store compatibility across pnpm versions by normalizing store index keys for non-registry Git/URL dependencies (so warmed stores don’t get invalidated across versions).
    • Fixed warm-store reuse for remote tarballs to ensure stable store index entries (including immutable redirect scenarios) and avoid duplicated indexing/extraction.
    • Corrected build/allow-build gating for aliased Git dependencies to use the dependency’s manifest identity consistently.
  • Tests
    • Added integration coverage for Git hosted alias/manifest gating and bare-resolution-id indexing.
    • Added end-to-end tests for remote tarball single-entry store indexing and immutable redirect lockfile behavior.

Copilot AI review requested due to automatic review settings July 27, 2026 09:25

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.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: aabfcf95-83f9-4d74-b128-4deaf3607033

📥 Commits

Reviewing files that changed from the base of the PR and between 05a7aaa and 4ef8ddd.

📒 Files selected for processing (1)
  • pnpm/crates/git-fetcher/src/fetcher.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/crates/git-fetcher/src/fetcher.rs

📝 Walkthrough

Walkthrough

The PR standardizes non-registry package identities around bare resolution IDs across lockfile parsing, fetch preparation, tarball indexing, installation, caching, CLI lookup, and progress reporting. Tests cover git dependencies and remote tarballs.

Changes

Store-index resolution ID alignment

Layer / File(s) Summary
Package ID contract
pnpm/crates/lockfile/..., pnpm/crates/deps-path/...
Adds PkgNameVerPeer::pkg_id() and documents its identifier behavior across registry, URL, git, peer, and runtime key shapes.
Fetch preparation identity
pnpm/crates/git-fetcher/...
Passes pkg_resolution_id through git and hosted-tarball fetchers and synthesizes build-policy dependency paths from manifest names and resolution IDs.
Store-index writes and cache keys
pnpm/crates/tarball/..., pnpm/crates/resolving-tarball-resolver/..., pnpm/crates/package-manager/...
Uses bare package IDs for tarball rows, warm-store reuse, installation, prefetching, patching, build side effects, and progress identifiers.
Lookup and regression coverage
pnpm/crates/cli/..., pnpm/crates/cli/tests/..., .changeset/...
Updates CLI index lookup and verifies aliased git builds, bare git keys, single-row remote-tarball indexing, and immutable redirect reuse.

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

Sequence Diagram(s)

sequenceDiagram
  participant TarballResolver
  participant FetchTarballForResolution
  participant StoreIndex
  TarballResolver->>FetchTarballForResolution: pass normalized bare specifier as package_id
  FetchTarballForResolution->>StoreIndex: write package_id and integrity index row
Loading

Possibly related issues

  • pnpm/pnpm#13365 — Concerns non-registry store-index mismatches and duplicate tarball rows.

Possibly related PRs

  • pnpm/pnpm#13059 — Shares git-hosted dependency identity and manifest-derived key behavior.
  • pnpm/pnpm#13160 — Shares bare git resolution identifiers and git-hosted install coverage.
  • pnpm/pnpm#13349 — Overlaps tarball and git-hosted store-index key computation.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13365

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix store-index keying for non-registry deps to use bare resolution id

🐞 Bug fix 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Align pacquet store-index pkgId for URL/git deps with pnpm 11 (bare resolution id).
• Eliminate duplicate store-index rows for remote tarballs across resolve vs install passes.
• Add regression tests covering git and remote-tarball store-index key shapes.
Diagram

graph TD
  LF["Lockfile key (name@id)"] --> PID["PkgNameVerPeer::pkg_id"] --> TGP["deps-path: try_get_package_id"] --> PM["Install/warm/prefetch"] --> IDX[("Store index (index.db)")]
  PM --> FCH["Tarball/Git fetchers"] --> IDX
  LF --> CAT["cli cat-index"] --> IDX
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Write both key variants (bare id + name@id) for non-registry deps
  • ➕ Maximizes cross-version reuse even if some consumers still use the old lockfile-shaped key
  • ➕ Could ease rollback because both key forms would exist
  • ➖ Doubles rows for affected deps (more DB size and extra extraction/import work in some paths)
  • ➖ Ambiguity about which row is canonical; risks divergent metadata over time
2. Read-time fallback: if bare-id key miss, try name@id key
  • ➕ Avoids adding duplicate rows while improving reuse when only one side is updated
  • ➖ Does not fix the root cause for write paths; the other stack will still write a second row
  • ➖ More complex read logic and harder-to-reason cache behavior

Recommendation: The PR’s approach (centralize pkgId derivation and make every keying site use it) is the best long-term fix: it restores the shared on-disk contract and prevents duplicate rows at the source. The alternatives either preserve duplication (writing both keys) or only partially mitigate misses (read fallback) without guaranteeing convergence.

Files changed (21) +224 / -78

Enhancement (1) +19 / -0
pkg_name_ver_peer.rsCentralize external pkgId derivation via try_get_package_id +19/-0

Centralize external pkgId derivation via try_get_package_id

• Adds 'PkgNameVerPeer::pkg_id()' to compute the package id used outside the lockfile (store-index keys, progress events, and fetcher resolution ids). For non-registry resolutions, it strips the 'name@' prefix to match pnpm 11’s bare-id contract.

pnpm/crates/lockfile/src/pkg_name_ver_peer.rs

Bug fix (12) +60 / -62
cat_index.rsCompute store-index keys from normalized pkgId (not raw lockfile key) +5/-5

Compute store-index keys from normalized pkgId (not raw lockfile key)

• Stops treating the peer-stripped lockfile key string as the store 'pkgId'. Uses 'PkgNameVerPeer::pkg_id()' when generating store-index keys while preserving request matching against the lockfile-shaped key.

pnpm/crates/cli/src/cli_args/cat_index.rs

fetcher.rsTreat fetcher package_id as the resolution id and pass it to prepare_package +5/-3

Treat fetcher package_id as the resolution id and pass it to prepare_package

• Clarifies 'package_id' semantics for git fetching to be the bare resolution id used to synthesize gated dep paths. Renames the prepare option usage to pass 'pkg_resolution_id' instead of the old dep-path field.

pnpm/crates/git-fetcher/src/fetcher.rs

prepare_package.rsSynthesize allowBuild dep-path from manifest name + resolution id +11/-4

Synthesize allowBuild dep-path from manifest name + resolution id

• Renames 'dep_path' to 'pkg_resolution_id' and changes gating to call 'allow_build' with '<manifest name>@<resolution id>'. Documents why URL/git resolution ids must be treated as untrusted identities and why name-only rules shouldn’t accidentally approve them.

pnpm/crates/git-fetcher/src/prepare_package.rs

tarball_fetcher.rsPass tarball fetcher resolution id into prepare_package gating +3/-2

Pass tarball fetcher resolution id into prepare_package gating

• Aligns git-hosted tarball fetcher with the updated 'PreparePackageOptions' by passing 'pkg_resolution_id'. Preserves the shared meaning of 'package_id' across fetchers.

pnpm/crates/git-fetcher/src/tarball_fetcher.rs

build_modules.rsUpload side-effects under store-index keys built from normalized pkgId +1/-1

Upload side-effects under store-index keys built from normalized pkgId

• Switches side-effects upload keying from the raw lockfile key string to 'metadata_key.pkg_id()', ensuring non-registry entries land under the same store-index row other stacks read.

pnpm/crates/package-manager/src/build_modules.rs

create_virtual_store.rsUse normalized pkgId for warm-snapshot progress and linking +3/-3

Use normalized pkgId for warm-snapshot progress and linking

• Changes warm-store progress emission and parallel link slot handling to use 'snapshot_key.pkg_id()' rather than 'without_peer().to_string()'. Keeps progress/store behavior consistent for non-registry deps.

pnpm/crates/package-manager/src/create_virtual_store.rs

install_package_by_snapshot.rsEmit progress and fetch binaries using normalized pkgId +2/-2

Emit progress and fetch binaries using normalized pkgId

• Updates resolved-progress emission and binary-resolution fetch path to use 'package_key.pkg_id()'. Prevents non-registry installs from diverging in store-index identity vs pnpm 11.

pnpm/crates/package-manager/src/install_package_by_snapshot.rs

install_with_fresh_lockfile.rsPrefetch cache keys and graph prefetch derive pkgId from dep_path stripping +10/-18

Prefetch cache keys and graph prefetch derive pkgId from dep_path stripping

• Ensures prefetch cache keys for tarballs use 'key.pkg_id()' and derives graph prefetch 'pkg_id' by stripping 'node.dep_path' via 'try_get_package_id'. Removes prior resolve-time 'name@version' derivation that caused remote-tarball double-row indexing.

pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs

patch.rsKey patch operations by normalized pkgId +1/-1

Key patch operations by normalized pkgId

• Replaces 'alias@version' formatting with 'target.package_key.pkg_id()' so patch-related store-index interactions use the same external id rules as install.

pnpm/crates/package-manager/src/patch.rs

tarball_prefetch.rsPrefetch tarballs using normalized pkgId +1/-1

Prefetch tarballs using normalized pkgId

• Updates tarball prefetch to use 'package_key.pkg_id()' when emitting progress and constructing store-index-related identifiers.

pnpm/crates/package-manager/src/tarball_prefetch.rs

tarball_resolver.rsPass normalized bare specifier as tarball package_id (not redirected URL) +6/-3

Pass normalized bare specifier as tarball package_id (not redirected URL)

• Changes tarball resolver to pass the normalized bare specifier as 'package_id' so store-index rows are keyed by the lockfile-recorded id. Avoids divergence when 'resolved_url' differs due to redirects.

pnpm/crates/resolving-tarball-resolver/src/tarball_resolver.rs

lib.rsFetchTarballForResolution writes store-index row keyed by caller pkgId +12/-19

FetchTarballForResolution writes store-index row keyed by caller pkgId

• Adjusts resolve-time tarball fetch to key the store-index row using the caller-provided 'package_id' (the same 'pkg_id' the install pass uses), rather than deriving 'name@version' from the bundled manifest. Removes now-unused manifest-to-package-id helper to prevent remote tarballs from occupying two rows.

pnpm/crates/tarball/src/lib.rs

Tests (5) +138 / -16
git_hosted_install.rsAdd regression test for git dep store-index key shape +32/-0

Add regression test for git dep store-index key shape

• Introduces a test asserting git dependencies are indexed under the bare 'git+…#<commit>' resolution id and not under a 'name@…'-prefixed key. Protects the shared-store contract with pnpm 11.

pnpm/crates/cli/tests/git_hosted_install.rs

tarball_url_dependency.rsAdd regression test for remote-tarball single-row indexing by bare URL +49/-0

Add regression test for remote-tarball single-row indexing by bare URL

• Adds a test verifying a remote tarball produces exactly one store-index row and that the row key uses the bare tarball URL. Covers the prior duplication between resolve-time and install-time keying.

pnpm/crates/cli/tests/tarball_url_dependency.rs

tests.rsUpdate git-fetcher tests for bare-resolution-id package_id semantics +10/-8

Update git-fetcher tests for bare-resolution-id package_id semantics

• Adjusts test fixtures so the fetcher’s 'package_id' and store-index key use the bare git resolution id. Keeps allow-build policy tests aligned with the synthesized '<name>@<id>' dep path behavior.

pnpm/crates/git-fetcher/src/fetcher/tests.rs

tests.rsUpdate prepare_package tests for new pkg_resolution_id option +17/-8

Update prepare_package tests for new pkg_resolution_id option

• Refactors option helpers and updates tests to assert the policy sees 'name@<resolution id>' (lockfile-shaped dep path), not the bare id. Keeps coverage for dep-path-specific allow behavior.

pnpm/crates/git-fetcher/src/prepare_package/tests.rs

tests.rsTest pkg_id behavior for registry, peer, tarball, git, and runtime shapes +30/-0

Test pkg_id behavior for registry, peer, tarball, git, and runtime shapes

• Introduces unit tests asserting 'pkg_id()' preserves 'name@version' for registry entries and returns bare URL/git ids for non-registry entries, while keeping runtime entries intact.

pnpm/crates/lockfile/src/pkg_name_ver_peer/tests.rs

Documentation (1) +5 / -0
store-index-keys-non-registry-deps-by-resolution-id.mdDocument store-index key normalization for non-registry deps +5/-0

Document store-index key normalization for non-registry deps

• Adds a changeset describing the new store-index keying behavior for URL/git dependencies and the resulting cross-major store reuse improvements. Notes the remote-tarball duplicate-row fix.

.changeset/store-index-keys-non-registry-deps-by-resolution-id.md

Other (2) +2 / -0
Cargo.lockLock pacquet-deps-path into the workspace dependency graph +1/-0

Lock pacquet-deps-path into the workspace dependency graph

• Updates the lockfile to include the new 'pacquet-deps-path' dependency pulled in by lockfile-related crates.

Cargo.lock

Cargo.tomlAdd pacquet-deps-path dependency to lockfile crate +1/-0

Add pacquet-deps-path dependency to lockfile crate

• Adds 'pacquet-deps-path' so 'PkgNameVerPeer' can derive the external-facing 'pkgId' with shared logic matching pnpm’s 'tryGetPackageId'.

pnpm/crates/lockfile/Cargo.toml

@greptile-apps

greptile-apps Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported aliased-git identity concern is contradicted by the lockfile identity contract and the added end-to-end regression coverage.

Reviews (3): Last reviewed commit: "docs(git-fetcher): disambiguate the prep..." | Re-trigger Greptile

@qodo-code-review

qodo-code-review Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Remediation recommended

1. Historical test doc comment ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
A newly added doc comment in a Rust test describes prior behavior ("before") instead of documenting
the current behavior/contract. This can quickly become stale and should be moved to PR
description/changelog or rephrased as current rationale.
Code

pnpm/crates/cli/tests/tarball_url_dependency.rs[R327-330]

+/// Two rows appeared here before: the resolve-time fetch keyed its row by
+/// the manifest's `name@version` while the install pass keyed one by the
+/// lockfile's `name@<url>`, so one tarball cost two index entries and two
+/// extractions.
Relevance

⭐⭐⭐ High

Team often accepts rewording comments to avoid historical phrasing like “before/previously”.

PR-#13409
PR-#13246
PR-#13138

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids historical/temporal phrasing in code comments (e.g., "before",
"previously"). The added doc comment explicitly says "Two rows appeared here before", describing
historical behavior rather than the current contract.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/tests/tarball_url_dependency.rs[322-330]

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

## Issue description
A newly added doc comment uses historical phrasing (e.g., "before") to describe prior behavior instead of documenting the current behavior.

## Issue Context
Inline source comments should describe the current contract and rationale, not the previous implementation.

## Fix Focus Areas
- pnpm/crates/cli/tests/tarball_url_dependency.rs[322-330]

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


2. pkg_id extra allocation ✓ Resolved 🐞 Bug ➹ Performance
Description
PkgNameVerPeer::pkg_id() allocates via self.to_string() and then typically allocates again when
try_get_package_id(..) returns Cow::Borrowed and .into_owned() clones the slice. This adds
avoidable allocation/CPU overhead in hot paths that call pkg_id() once per snapshot during
installs and warm-store linking.
Code

pnpm/crates/lockfile/src/pkg_name_ver_peer.rs[R64-66]

+    pub fn pkg_id(&self) -> String {
+        pacquet_deps_path::try_get_package_id(&self.to_string()).into_owned()
+    }
Relevance

⭐⭐ Medium

Micro-allocation/perf tweaks in lockfile code have been rejected before; unclear if this one’s
prioritized.

PR-#13117

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The implementation of pkg_id() forces .into_owned() on the result of
try_get_package_id(&self.to_string()), which necessarily creates a second allocation when
try_get_package_id returns a borrowed slice. try_get_package_id explicitly returns
Cow::Borrowed for inputs without : (typical registry keys) and for suffix trimming, and
pkg_id() is now invoked from install/warm-store code paths per snapshot.

pnpm/crates/lockfile/src/pkg_name_ver_peer.rs[49-66]
pnpm/crates/deps-path/src/try_get_package_id.rs[21-42]
pnpm/crates/package-manager/src/install_package_by_snapshot.rs[300-315]
pnpm/crates/package-manager/src/create_virtual_store.rs[766-779]
pnpm/crates/package-manager/src/create_virtual_store.rs[1236-1244]

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

### Issue description
`PkgNameVerPeer::pkg_id()` currently does:
- allocate a `String` via `self.to_string()`
- call `pacquet_deps_path::try_get_package_id(&string)`
- call `.into_owned()`

When `try_get_package_id` returns `Cow::Borrowed` (common for registry keys and/or when only the peer/patch suffix is stripped), `.into_owned()` allocates *another* `String`, discarding the first allocation.

### Issue Context
`pkg_id()` is now used to derive identifiers during install/warm-store flows (progress emission, warm snapshot keying, cache key derivation). Even if each call is small, this is on the “called per snapshot” path and shows up on large installs.

### Fix Focus Areas
- pnpm/crates/lockfile/src/pkg_name_ver_peer.rs[49-66]

### Suggested fix
Rewrite `pkg_id()` to reuse the initially-rendered string for the `Cow::Borrowed` case. For example:

```rust
pub fn pkg_id(&self) -> String {
   let mut rendered = self.to_string();
   match pacquet_deps_path::try_get_package_id(&rendered) {
       std::borrow::Cow::Borrowed(slice) => {
           // `try_get_package_id` only borrows `rendered` as a prefix slice
           // (full string or peer/patch trimmed prefix).
           rendered.truncate(slice.len());
           rendered
       }
       std::borrow::Cow::Owned(owned) => owned,
   }
}
```

This avoids the second allocation in the borrowed case while preserving behavior for the “strip `<name>@` to bare resolution id” case (`Cow::Owned`).

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



Informational

3. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only bumps pacquet and does not include a pnpm entry, which violates the
requirement that changesets explicitly declare a pnpm bump type. This can lead to incomplete or
incorrect release notes/versioning for pnpm-related changes.
Code

.changeset/store-index-keys-non-registry-deps-by-resolution-id.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Prior identical “add pnpm entry to pacquet-only changeset” suggestions were repeatedly rejected.

PR-#13404
PR-#13395
PR-#12991

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changeset front-matter to contain an entry for the pnpm package
with a valid bump type. The added changeset file includes only "pacquet": patch and omits pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/store-index-keys-non-registry-deps-by-resolution-id.md[1-3]

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 changeset front-matter does not include a `pnpm` entry, but the compliance checklist requires that changesets explicitly declare a bump type for `pnpm`.

## Issue Context
A new changeset was added for this PR under `.changeset/`, but it only lists `"pacquet": patch`.

## Fix Focus Areas
- .changeset/store-index-keys-non-registry-deps-by-resolution-id.md[1-3]

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


Grey Divider

Qodo Logo

@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: 3

🧹 Nitpick comments (1)
pnpm/crates/cli/tests/tarball_url_dependency.rs (1)

327-330: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove obsolete implementation history.

These lines describe the former implementation rather than the current invariant. Lines 322-325 already explain why this regression matters; keep the test focused on that contract. As per coding guidelines, comments must not “describe removed implementation history.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/tarball_url_dependency.rs` around lines 327 - 330,
Remove the obsolete implementation-history comment describing the former
resolve-time and install-pass row keys and duplicate extractions. Keep the
surrounding test and the existing explanation of the regression’s contract
unchanged.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/package-manager/src/build_modules.rs`:
- Line 1280: Update the side-effects upload key at the `store_index_key` call
near `snapshot_cache_key()` to use the git-hosted store index key for git-hosted
tarballs, matching `git_hosted_store_index_key(pkg_id, !ignore_scripts)`.
Preserve the existing integrity-based key for non-git packages so uploads use
the same key shape that snapshot lookup reads.

In `@pnpm/crates/package-manager/src/install_package_by_snapshot.rs`:
- Line 301: Update the nearby comment explaining remote-tarball cache
store-index IDs to describe the current bare-URL key contract, removing the
stale claim that install addresses use name@<url>. Preserve the explanation of
the non-obvious rationale without documenting the previous implementation.

In `@pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs`:
- Line 884: Update the prior tarball entry construction near
reuse_from_warm_store() to bind key.pkg_id() once and use that value
consistently for both the map key and store_index_key component, instead of the
resolved tarball URL. Add a regression test covering warm/offline reuse through
an immutable redirect.

---

Nitpick comments:
In `@pnpm/crates/cli/tests/tarball_url_dependency.rs`:
- Around line 327-330: Remove the obsolete implementation-history comment
describing the former resolve-time and install-pass row keys and duplicate
extractions. Keep the surrounding test and the existing explanation of the
regression’s contract unchanged.
🪄 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: 2e41f05e-0e6a-46f7-aa02-174103762297

📥 Commits

Reviewing files that changed from the base of the PR and between ffdcbaf and 21518b1.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (20)
  • .changeset/store-index-keys-non-registry-deps-by-resolution-id.md
  • pnpm/crates/cli/src/cli_args/cat_index.rs
  • pnpm/crates/cli/tests/git_hosted_install.rs
  • pnpm/crates/cli/tests/tarball_url_dependency.rs
  • pnpm/crates/git-fetcher/src/fetcher.rs
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm/crates/git-fetcher/src/prepare_package.rs
  • pnpm/crates/git-fetcher/src/prepare_package/tests.rs
  • pnpm/crates/git-fetcher/src/tarball_fetcher.rs
  • pnpm/crates/lockfile/Cargo.toml
  • pnpm/crates/lockfile/src/pkg_name_ver_peer.rs
  • pnpm/crates/lockfile/src/pkg_name_ver_peer/tests.rs
  • pnpm/crates/package-manager/src/build_modules.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/patch.rs
  • pnpm/crates/package-manager/src/tarball_prefetch.rs
  • pnpm/crates/resolving-tarball-resolver/src/tarball_resolver.rs
  • pnpm/crates/tarball/src/lib.rs

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

zkochan and others added 4 commits July 27, 2026 11:38
…ion id

The v11 store index is an on-disk contract shared between the TypeScript
CLI and pacquet, but the two stacks disagreed on `pkgId` for every
non-registry dependency: pnpm writes the bare resolution id (the tarball
URL, the git-host archive URL, the `git+…#<commit>` spec) while pacquet
wrote the lockfile-shaped `<name>@<id>`. Registry entries — the
overwhelming majority — already agreed. The cost was reuse: a store
warmed by one stack was cold for the other for every URL / git
dependency, so switching between pnpm 11 and pnpm 12 re-downloaded,
re-extracted, and re-imported all of them, and `cat-index` in one stack
could not see the other's rows.

`PkgNameVerPeer::pkg_id` now derives that id from a lockfile key, reusing
`pacquet_deps_path::try_get_package_id` (pnpm's `tryGetPackageId`), and
every store-index keying site goes through it.

A remote tarball also occupied two rows rather than one: the resolve-time
fetch keyed its row by the bundled manifest's `name@version` while the
install pass keyed one by `name@<url>`. `FetchTarballForResolution` now
keys by the caller's `package_id`, and the tarball resolver passes the
normalized bare specifier (the id the lockfile records) rather than the
post-redirect URL, so both passes address one row.

The git fetchers hand `prepare_package` a resolution id now, so it
synthesizes the `<name>@<id>` dep path it gates on from the fetched
manifest's name — exactly what pnpm's `preparePackage` does, keeping the
`allowBuilds` identity unchanged while the store key moves.

Closes #13365

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Intra-doc links can't resolve across a crate boundary pacquet-lockfile
deliberately doesn't depend on, so rustdoc rejected them.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The prior-lockfile reuse map was keyed by `resolution.tarball` while
`reuse_from_warm_store` queries it with the dependency's normalized bare
specifier. An immutable response that redirects moves the two apart —
the lockfile records the post-redirect URL, the id stays the specifier
the manifest asked for — so every re-resolve of such a tarball missed
the warm store and re-downloaded.

Keying by `pkg_id` puts both sides on the specifier. The recorded URL
now travels in `PriorTarballEntry` so a warm reuse replays the
resolution verbatim instead of re-deriving a `resolution.tarball` from
the lookup key and churning the lockfile.

Also addresses review feedback on the store-index keying commit: the
mem-cache rationale in `install_package_by_snapshot` documented the
pre-change `name@<url>` contract, and `pkg_id` allocated a second string
whenever `try_get_package_id` borrowed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The rustdoc and dylint gates rejected the two shortcuts the previous
commit took: an intra-doc link into a private method, and an impure
expression inside `debug_assert!`. Stating the prefix guarantee on
`try_get_package_id` itself is what `pkg_id`'s in-place truncation
needs, so neither shortcut is required.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 27, 2026 10:10

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 27, 2026

Copy link
Copy Markdown
Member Author

Rebased onto ffdcbaff2a and pushed review fixes.

Qodo findings

pkg_id extra allocation — valid, fixed in ce06375 / 05a7aaa. pkg_id() now truncates the rendered key in place when try_get_package_id borrows, so the common case allocates once instead of twice. The prefix guarantee that makes the truncation sound is now stated on try_get_package_id itself rather than asserted at the call site.

Historical test doc comment — valid, reworded to state the current contract ("One row, not two: the resolve-time fetch and the install pass address the same key…").

Changeset missing a pnpm entry — declining this one. AGENTS.md is explicit that in changesets pnpm always means the TypeScript CLI package, and that a Rust-only change must target pacquet alone:

Do not add "pnpm" to a Rust-only changeset: in changesets, pnpm always means the TypeScript CLI package. A changeset whose implementation is Rust-only and targets pacquet must omit "pnpm".

This PR is pacquet-only — the TypeScript side already writes the correct key — so the changeset is correct as-is.

Verification

Full suite green (7346 tests), plus cargo fmt, clippy, cargo doc -D warnings, dylint, and typos.

Both new regression tests were checked against the unfixed code: a_remote_tarball_is_indexed_once_under_the_bare_url reports the two rows from the issue verbatim, and remote_tarball_behind_an_immutable_redirect_reuses_the_warm_store fails with server returned HTTP 501 — the re-download a missed warm entry forces.

The end-to-end claim was also checked against a real [email protected]: installing the same git+file:// dependency with each binary into separate stores now produces the byte-identical index.db key, and a pacquet install pointed at the TS-warmed store reuses the row instead of adding a second.


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

`prepare_package` names both the module and the function, so rustdoc
rejects the bare link. Parentheses point it at the function.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 27, 2026 10:14

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-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     11.8±0.39ms    31.8 MB/sec    1.03     12.1±0.21ms    30.9 MB/sec
packument/parse                1.01     42.2±0.74µs  1570.1 MB/sec    1.00     41.8±1.77µs  1585.4 MB/sec
tarball/download_dependency    1.00      3.2±0.39ms  1344.5 KB/sec    1.08      3.5±0.29ms  1240.7 KB/sec

@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.

🧹 Nitpick comments (1)
pnpm/crates/cli/tests/tarball_url_dependency.rs (1)

428-430: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Log the lockfile contents before assert_eq! on the multi-line diff.

after and lockfile are full pnpm-lock.yaml contents; a bare assert_eq! failure here won't show a readable diff. Based on learnings, when comparing potentially multi-line strings, log the rendered value with eprintln! before the assertion.

🪵 Proposed fix
     let after = fs::read_to_string(workspace.join("pnpm-lock.yaml")).expect("read the lockfile");
+    eprintln!("LOCKFILE AFTER UPDATE:\n{after}\n");
     assert_eq!(after, lockfile, "a warm re-resolve must not rewrite the entry");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/tarball_url_dependency.rs` around lines 428 - 430,
Update the assertion in the warm re-resolve test after reading `after` to print
the rendered lockfile contents with `eprintln!` immediately before
`assert_eq!(after, lockfile, ...)`, so multi-line differences are readable while
preserving the existing comparison.

Source: Learnings

🤖 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 `@pnpm/crates/cli/tests/tarball_url_dependency.rs`:
- Around line 428-430: Update the assertion in the warm re-resolve test after
reading `after` to print the rendered lockfile contents with `eprintln!`
immediately before `assert_eq!(after, lockfile, ...)`, so multi-line differences
are readable while preserving the existing comparison.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a71a91ff-d112-45f1-832f-860a4ed2778d

📥 Commits

Reviewing files that changed from the base of the PR and between 21518b1 and 05a7aaa.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (22)
  • .changeset/store-index-keys-non-registry-deps-by-resolution-id.md
  • pnpm/crates/cli/src/cli_args/cat_index.rs
  • pnpm/crates/cli/tests/git_hosted_install.rs
  • pnpm/crates/cli/tests/tarball_url_dependency.rs
  • pnpm/crates/deps-path/src/try_get_package_id.rs
  • pnpm/crates/git-fetcher/src/fetcher.rs
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm/crates/git-fetcher/src/prepare_package.rs
  • pnpm/crates/git-fetcher/src/prepare_package/tests.rs
  • pnpm/crates/git-fetcher/src/tarball_fetcher.rs
  • pnpm/crates/lockfile/Cargo.toml
  • pnpm/crates/lockfile/src/pkg_name_ver_peer.rs
  • pnpm/crates/lockfile/src/pkg_name_ver_peer/tests.rs
  • pnpm/crates/package-manager/src/build_modules.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/patch.rs
  • pnpm/crates/package-manager/src/tarball_prefetch.rs
  • pnpm/crates/resolving-tarball-resolver/src/lib.rs
  • pnpm/crates/resolving-tarball-resolver/src/tarball_resolver.rs
  • pnpm/crates/tarball/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (15)
  • pnpm/crates/package-manager/src/tarball_prefetch.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/git-fetcher/src/fetcher.rs
  • pnpm/crates/git-fetcher/src/tarball_fetcher.rs
  • .changeset/store-index-keys-non-registry-deps-by-resolution-id.md
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/patch.rs
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/cli/src/cli_args/cat_index.rs
  • pnpm/crates/package-manager/src/build_modules.rs
  • pnpm/crates/lockfile/src/pkg_name_ver_peer/tests.rs
  • pnpm/crates/git-fetcher/src/prepare_package.rs
  • pnpm/crates/git-fetcher/src/prepare_package/tests.rs
  • pnpm/crates/tarball/src/lib.rs

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 4ef8ddd

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.58%. Comparing base (ffdcbaf) to head (4ef8ddd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13417   +/-   ##
=======================================
  Coverage   87.57%   87.58%           
=======================================
  Files         544      545    +1     
  Lines       93579    93572    -7     
=======================================
- Hits        81953    81951    -2     
+ Misses      11626    11621    -5     

☔ 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.

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 4ef8dddd4627

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.472 ± 0.101 2.376 2.685 1.59 ± 0.12
pacquet@main 2.663 ± 0.171 2.392 2.872 1.71 ± 0.16
pnpr@HEAD 1.629 ± 0.151 1.419 1.829 1.05 ± 0.12
pnpr@main 1.558 ± 0.102 1.388 1.699 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4723031401,
      "stddev": 0.10092038211422037,
      "median": 2.4455135842,
      "user": 1.9487739999999998,
      "system": 1.4976624200000002,
      "min": 2.3761658252,
      "max": 2.6845390732,
      "times": [
        2.3813625562,
        2.5081487582,
        2.6845390732,
        2.4209300062,
        2.5865016472,
        2.4700971622,
        2.3969861232,
        2.3972242282000003,
        2.3761658252,
        2.5010760212000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6625446914000004,
      "stddev": 0.17126031569791333,
      "median": 2.6752121122,
      "user": 2.0986364,
      "system": 1.60721902,
      "min": 2.3917814972,
      "max": 2.8721429002,
      "times": [
        2.7152862832,
        2.6351379412,
        2.3917814972,
        2.8721429002,
        2.7639032752,
        2.5435393512,
        2.8717734772,
        2.5499760542,
        2.4657712662,
        2.8161348682000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6291538602,
      "stddev": 0.1509747788811448,
      "median": 1.6506246037,
      "user": 1.5355144,
      "system": 1.42868122,
      "min": 1.4187488312,
      "max": 1.8287987052,
      "times": [
        1.8287987052,
        1.5457628842000002,
        1.4298173422000002,
        1.6342836842000001,
        1.8166773292,
        1.7561913872000001,
        1.6959251062000003,
        1.6669655232,
        1.4187488312,
        1.4983678092000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5576912277000001,
      "stddev": 0.10190060566365716,
      "median": 1.5702577327,
      "user": 1.5395876999999998,
      "system": 1.4580831200000002,
      "min": 1.3883313632,
      "max": 1.6986976752,
      "times": [
        1.6986976752,
        1.5149230422,
        1.5493170592,
        1.4014023412,
        1.6018770842,
        1.3883313632,
        1.6341118152000003,
        1.5423473342,
        1.5911984062000002,
        1.6547061562
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 303.0 ± 18.4 279.6 344.1 1.04 ± 0.07
pacquet@main 305.4 ± 12.5 282.8 320.1 1.05 ± 0.05
pnpr@HEAD 304.5 ± 25.3 279.7 339.6 1.05 ± 0.09
pnpr@main 291.4 ± 8.7 276.8 304.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3029955663,
      "stddev": 0.018353238539513123,
      "median": 0.2985500067,
      "user": 0.24127485999999995,
      "system": 0.62753886,
      "min": 0.2796160712,
      "max": 0.34410275619999997,
      "times": [
        0.2995505742,
        0.2871701962,
        0.2920339252,
        0.2948684232,
        0.2796160712,
        0.2975494392,
        0.3193516252,
        0.3068034362,
        0.34410275619999997,
        0.3089092162
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.3054114105,
      "stddev": 0.012541104321702842,
      "median": 0.3093902692,
      "user": 0.26152596000000006,
      "system": 0.5965960599999999,
      "min": 0.2827730592,
      "max": 0.3201406022,
      "times": [
        0.3127539142,
        0.3201406022,
        0.3136832152,
        0.2827730592,
        0.2978669272,
        0.2888189602,
        0.3010033282,
        0.3136292832,
        0.3060266242,
        0.3174181912
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30451179539999995,
      "stddev": 0.025303461687323916,
      "median": 0.29377715019999995,
      "user": 0.25567506000000007,
      "system": 0.5805829599999999,
      "min": 0.2796789692,
      "max": 0.3395847292,
      "times": [
        0.3373034002,
        0.3362227972,
        0.3395847292,
        0.2873883482,
        0.2796789692,
        0.2810738182,
        0.3001659522,
        0.2814303402,
        0.2866826322,
        0.3155869672
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.2913673716,
      "stddev": 0.008706783368239924,
      "median": 0.2901184862,
      "user": 0.23074785999999997,
      "system": 0.55790266,
      "min": 0.27684330819999997,
      "max": 0.3046805872,
      "times": [
        0.2989901532,
        0.2868008012,
        0.28220949419999997,
        0.2915372902,
        0.2886996822,
        0.2949283272,
        0.3046805872,
        0.28771329819999997,
        0.3012707742,
        0.27684330819999997
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.801 ± 0.022 2.765 2.843 1.77 ± 0.17
pacquet@main 2.769 ± 0.021 2.738 2.799 1.75 ± 0.16
pnpr@HEAD 1.604 ± 0.160 1.450 1.883 1.01 ± 0.14
pnpr@main 1.582 ± 0.147 1.441 1.841 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.80079212556,
      "stddev": 0.022075539174255157,
      "median": 2.80477194916,
      "user": 2.02947208,
      "system": 1.443401,
      "min": 2.76503111266,
      "max": 2.84320626866,
      "times": [
        2.81109115766,
        2.80862602066,
        2.8050739126599997,
        2.80446998566,
        2.77654791466,
        2.84320626866,
        2.79000195066,
        2.76503111266,
        2.78775855566,
        2.81611437666
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.76914723146,
      "stddev": 0.020805209136400816,
      "median": 2.76932347366,
      "user": 1.9950084799999999,
      "system": 1.3921438999999998,
      "min": 2.73784480566,
      "max": 2.79934446066,
      "times": [
        2.79633289566,
        2.74006008266,
        2.7607651136599998,
        2.79934446066,
        2.78176079966,
        2.7589548856599997,
        2.76694170766,
        2.7717052396599997,
        2.73784480566,
        2.7777623236599998
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6039194678600002,
      "stddev": 0.15953804991116177,
      "median": 1.60338871066,
      "user": 1.28179678,
      "system": 1.2399301,
      "min": 1.4500426206600001,
      "max": 1.8830976776600001,
      "times": [
        1.47507422566,
        1.45439035166,
        1.59971181266,
        1.60706560866,
        1.4545726676600002,
        1.6250926596600002,
        1.63135548966,
        1.85879156466,
        1.8830976776600001,
        1.4500426206600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.58155269426,
      "stddev": 0.14744278112631873,
      "median": 1.54144210216,
      "user": 1.28599508,
      "system": 1.2097920999999996,
      "min": 1.44148392266,
      "max": 1.84108433666,
      "times": [
        1.44395041466,
        1.4502315406600002,
        1.84108433666,
        1.44148392266,
        1.68342723466,
        1.45909412766,
        1.49268717766,
        1.76927947366,
        1.59019702666,
        1.64409168766
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 638.1 ± 23.2 604.0 684.1 2.07 ± 0.10
pacquet@main 601.9 ± 22.3 572.0 630.8 1.95 ± 0.09
pnpr@HEAD 308.6 ± 8.9 292.8 325.7 1.00
pnpr@main 311.4 ± 12.0 286.9 328.8 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6380725893999999,
      "stddev": 0.0231875521310981,
      "median": 0.6364672536,
      "user": 0.8108266000000001,
      "system": 0.7272646599999998,
      "min": 0.6039527226,
      "max": 0.6840961986,
      "times": [
        0.6194187476,
        0.6039527226,
        0.6316370456,
        0.6450803246,
        0.6840961986,
        0.6273292686,
        0.6629942336,
        0.6412974616,
        0.6448741356,
        0.6200457556
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.601888446,
      "stddev": 0.02232273093448748,
      "median": 0.6046028216,
      "user": 0.7632751,
      "system": 0.6807886599999999,
      "min": 0.5719617066,
      "max": 0.6308258966,
      "times": [
        0.6169643876,
        0.5719617066,
        0.5731392126,
        0.6183616596,
        0.6072350746,
        0.5827353406,
        0.6308258966,
        0.5859343406,
        0.6019705686,
        0.6297562726
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.308644638,
      "stddev": 0.008857895556272862,
      "median": 0.30882323410000007,
      "user": 0.1894208,
      "system": 0.54792456,
      "min": 0.29276580960000004,
      "max": 0.32567218560000005,
      "times": [
        0.31209003960000004,
        0.30829589460000006,
        0.3152415646,
        0.31232465060000003,
        0.29276580960000004,
        0.30078181260000003,
        0.30329087960000006,
        0.3066329696,
        0.30935057360000007,
        0.32567218560000005
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31140480200000004,
      "stddev": 0.012010874914137052,
      "median": 0.31164790510000007,
      "user": 0.2074584,
      "system": 0.53330846,
      "min": 0.28688101060000004,
      "max": 0.3288075066,
      "times": [
        0.3046570116,
        0.31686828060000005,
        0.3288075066,
        0.3195894046,
        0.28688101060000004,
        0.30813563960000007,
        0.3070730166,
        0.32343517160000007,
        0.30344080760000003,
        0.31516017060000007
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.936 ± 0.020 1.909 1.975 6.35 ± 0.38
pacquet@main 1.927 ± 0.012 1.903 1.944 6.32 ± 0.38
pnpr@HEAD 0.319 ± 0.013 0.306 0.349 1.05 ± 0.07
pnpr@main 0.305 ± 0.018 0.284 0.334 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.93641856714,
      "stddev": 0.019631967522186166,
      "median": 1.93758125354,
      "user": 1.0348848199999998,
      "system": 0.8042457199999999,
      "min": 1.90869061004,
      "max": 1.97483639704,
      "times": [
        1.95553218804,
        1.93981012404,
        1.94024825804,
        1.92380679604,
        1.90869061004,
        1.93551565404,
        1.9105831370400002,
        1.97483639704,
        1.9386797150400001,
        1.93648279204
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.9266899377399997,
      "stddev": 0.012331065397150015,
      "median": 1.9275745360399998,
      "user": 1.00805192,
      "system": 0.81600462,
      "min": 1.90334679204,
      "max": 1.94352918004,
      "times": [
        1.92801622504,
        1.93149939704,
        1.92326854504,
        1.9419650370400001,
        1.92713284704,
        1.91360318604,
        1.92026981804,
        1.90334679204,
        1.93426835004,
        1.94352918004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31936162724,
      "stddev": 0.012660320243832403,
      "median": 0.31970577504000003,
      "user": 0.20671471999999996,
      "system": 0.53838612,
      "min": 0.30574471004000003,
      "max": 0.34927667204,
      "times": [
        0.32354610804000006,
        0.31741003304000004,
        0.34927667204,
        0.32351893704000007,
        0.30574471004000003,
        0.30646813404000006,
        0.32200151704,
        0.32298824504000007,
        0.31336496604,
        0.30929695004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30475914024,
      "stddev": 0.01808395746614816,
      "median": 0.2995604525400001,
      "user": 0.19304682,
      "system": 0.5188390199999999,
      "min": 0.28378378504,
      "max": 0.33447149204000004,
      "times": [
        0.32667753004000005,
        0.32735716404000004,
        0.28813477604000004,
        0.29493818804000005,
        0.29080022404000005,
        0.28378378504,
        0.29865110604000006,
        0.30230733804000004,
        0.30046979904000004,
        0.33447149204000004
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 371.1 ± 11.3 358.4 393.5 4.15 ± 0.18
pacquet@main 367.8 ± 8.0 360.8 385.5 4.11 ± 0.15
pnpr@HEAD 89.4 ± 2.7 85.0 95.7 1.00
pnpr@main 90.0 ± 3.5 84.3 100.6 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.37107809366000005,
      "stddev": 0.011330286993401136,
      "median": 0.36952452026,
      "user": 0.36147482000000003,
      "system": 0.07505643999999997,
      "min": 0.35837804376,
      "max": 0.39352931276,
      "times": [
        0.39352931276,
        0.36677144776,
        0.38049075076,
        0.38040321776,
        0.36650260876,
        0.37342447376,
        0.37227759276,
        0.35961078776,
        0.35939270076,
        0.35837804376
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.36780078146000006,
      "stddev": 0.008009720868584572,
      "median": 0.36574522776,
      "user": 0.36507571999999994,
      "system": 0.06334293999999999,
      "min": 0.36079749276,
      "max": 0.38553051076,
      "times": [
        0.37183701376,
        0.36192343376,
        0.36983613076,
        0.36093683176,
        0.36079749276,
        0.36106258076000003,
        0.36330316676,
        0.38553051076,
        0.36818728876,
        0.37459336476
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08938135450193548,
      "stddev": 0.0026954373980430323,
      "median": 0.09044090476,
      "user": 0.019508184516129033,
      "system": 0.01293478064516129,
      "min": 0.08500540476,
      "max": 0.09568702876,
      "times": [
        0.09056556376,
        0.09050503676,
        0.09069635076,
        0.09106691876,
        0.09051451676,
        0.08506920476,
        0.09187818276,
        0.08602380476,
        0.08802532376,
        0.09132557076,
        0.08801963976,
        0.09059839475999999,
        0.08965984776,
        0.09217489076,
        0.09044090476,
        0.09193276576,
        0.09080517476,
        0.08500540476,
        0.08763153676,
        0.09568702876,
        0.08651998176,
        0.08641245976,
        0.08603867076,
        0.08520988776,
        0.09429110076,
        0.08859275076,
        0.08855184376,
        0.08826137776,
        0.09090584676,
        0.08694319776,
        0.09146880976
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08996175285375,
      "stddev": 0.003471979827762943,
      "median": 0.09036863426,
      "user": 0.02112377625,
      "system": 0.012022116874999997,
      "min": 0.08425978976,
      "max": 0.10061675276,
      "times": [
        0.08784579076,
        0.08642560176,
        0.09122374076,
        0.08637133676,
        0.09053613976,
        0.09517388276,
        0.09054129176,
        0.09271566776,
        0.08684195676,
        0.08870595776,
        0.09020112876,
        0.09127721076,
        0.09347622076,
        0.08578382976,
        0.09225613676,
        0.08539983576,
        0.08606683376,
        0.08888270476,
        0.08425978976,
        0.08791847376,
        0.09099475876,
        0.08730584076,
        0.09262815276,
        0.08663889876,
        0.09080922176,
        0.09562295576,
        0.08877180876,
        0.09075556776,
        0.09067208876,
        0.09295395876,
        0.08910255476,
        0.10061675276
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.557 ± 0.139 4.428 4.863 1.30 ± 0.04
pacquet@main 4.626 ± 0.188 4.433 4.990 1.32 ± 0.06
pnpr@HEAD 3.500 ± 0.040 3.456 3.570 1.00
pnpr@main 3.537 ± 0.072 3.447 3.636 1.01 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.55714690368,
      "stddev": 0.13916031270039841,
      "median": 4.53205917108,
      "user": 1.8914291199999997,
      "system": 1.5005549999999999,
      "min": 4.42826198458,
      "max": 4.86326212858,
      "times": [
        4.43164306458,
        4.56012530558,
        4.67983148358,
        4.42826198458,
        4.50399303658,
        4.45473926958,
        4.43615612858,
        4.61882856058,
        4.86326212858,
        4.59462807458
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.62561317988,
      "stddev": 0.18769281488795944,
      "median": 4.57586326758,
      "user": 2.07189962,
      "system": 1.5388283,
      "min": 4.43273003458,
      "max": 4.99045272058,
      "times": [
        4.68280087558,
        4.53345493158,
        4.53528444958,
        4.99045272058,
        4.61644208558,
        4.73454231458,
        4.43511016558,
        4.45066758258,
        4.8446466385799996,
        4.43273003458
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.49950878098,
      "stddev": 0.040036526849046454,
      "median": 3.49546006008,
      "user": 1.29771612,
      "system": 1.2555821999999999,
      "min": 3.45642824058,
      "max": 3.57030779958,
      "times": [
        3.45642824058,
        3.5078387165800002,
        3.53679181558,
        3.46318582358,
        3.49564741858,
        3.57030779958,
        3.46593641458,
        3.45936423858,
        3.4952727015800003,
        3.54431464058
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5365627168800002,
      "stddev": 0.07230365817601779,
      "median": 3.55106626258,
      "user": 1.2897765199999998,
      "system": 1.2799755000000002,
      "min": 3.44693565658,
      "max": 3.63601038458,
      "times": [
        3.44693565658,
        3.6049187055800003,
        3.58571274758,
        3.45004273758,
        3.51641977758,
        3.48556109958,
        3.58745065558,
        3.46015937358,
        3.63601038458,
        3.59241603058
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13417
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,765.03 ms
(+0.84%)Baseline: 2,741.91 ms
3,290.30 ms
(84.04%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,908.69 ms
(+0.49%)Baseline: 1,899.33 ms
2,279.20 ms
(83.74%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
603.95 ms
(+3.64%)Baseline: 582.77 ms
699.32 ms
(86.36%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
358.38 ms
(+0.09%)Baseline: 358.05 ms
429.66 ms
(83.41%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,376.17 ms
(+0.53%)Baseline: 2,363.52 ms
2,836.23 ms
(83.78%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,428.26 ms
(+0.03%)Baseline: 4,427.12 ms
5,312.54 ms
(83.35%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
279.62 ms
(+12.23%)Baseline: 249.14 ms
298.97 ms
(93.53%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13417
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,450.04 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
305.74 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
292.77 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.01 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,418.75 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,456.43 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
279.68 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan deleted the fix-13365 branch July 27, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store-index pkgId differs between pnpm and pacquet for URL and git dependencies, so neither reuses the other's rows

3 participants