Skip to content

fix(napi): keep registry-custom fields in a fullMetadata resolve - #13664

Merged
zkochan merged 1 commit into
mainfrom
fix-bi
Aug 5, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-bi

Conversation

@zkochan

@zkochan zkochan commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

@pnpm/napi's resolveDependency derived filter_metadata from full_metadata, so a caller asking for full metadata got a manifest that had been run through clear_meta — reduced to npm's abbreviated version fields. Any registry-custom field on the version object was dropped.

Bit is the consumer that hit this: it reads componentId off the resolved manifest, and every resolve through the engine failed with

unable to resolve a component-id from the package-name @bitdev/node.node-server,
the package.json of version "3.0.17" has no componentId field, it's probably not a component

The API this replaces — createClient({ fullMetadata: true }) from @pnpm/installing.client — leaves filterMetadata unset, and retainsFullMeta() keeps the document whole in exactly that combination. Only the install path (createNewStoreController) pairs the two flags, where nothing outside the abbreviated set is ever read. This PR untangles them on the napi resolve path.

No cache invalidation is needed after upgrading: filtered documents were mirrored under FULL_FILTERED_META_DIR, a different slot from the unfiltered FULL_META_DIR the fixed code reads, so a poisoned mirror can't be served.

No TypeScript-side change is needed — the TS resolver path was already correct; only the napi binding mis-paired the flags.

Related to teambit/bit#10558, which added a fallback on the Bit side.

Squash Commit Body

`resolveDependency` derived `filter_metadata` from `full_metadata`, so a
caller asking for full metadata got a manifest run through `clear_meta` —
reduced to npm's abbreviated version fields. Registry-custom fields were
dropped, which broke Bit's `componentId` lookups ("the package.json of
version X has no componentId field").

The API this replaces, `createClient({ fullMetadata: true })`, leaves
`filterMetadata` unset and keeps the document whole; only the install
path pairs the two flags, where nothing outside the abbreviated set is
read. Untangle them here.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • 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[1m]).


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

    • Full-metadata dependency resolution now preserves registry-specific fields, such as Bit’s componentId, on version manifests.
    • Custom metadata is retained consistently for dependencies resolved from npm and named registries.
  • Tests

    • Added coverage validating preservation of custom registry metadata during full-metadata resolution.

`resolveDependency` derived `filter_metadata` from `full_metadata`, so a
caller asking for full metadata got a manifest run through `clear_meta` —
reduced to npm's abbreviated version fields. Registry-custom fields were
dropped, which broke Bit's `componentId` lookups ("the package.json of
version X has no componentId field").

The API this replaces, `createClient({ fullMetadata: true })`, leaves
`filterMetadata` unset and keeps the document whole; only the install
path pairs the two flags, where nothing outside the abbreviated set is
read. Untangle them here.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

resolveDependency({ fullMetadata: true }) now preserves custom registry fields on version manifests. The change disables metadata filtering for npm and named-registry resolution and adds mock-registry coverage for Bit’s componentId field.

Changes

Full metadata preservation

Layer / File(s) Summary
Resolver metadata filtering
pnpm/crates/napi/src/resolve.rs
Npm and named-registry resolution now disable metadata filtering, including when full_metadata is requested.
Registry regression coverage
pnpm/crates/napi/Cargo.toml, pnpm/crates/napi/src/resolve/tests.rs, .changeset/napi-resolve-full-metadata.md
Added the mockito test dependency, a packument with componentId, a full-metadata resolution test, and a patch changeset.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Test
  participant MockRegistry
  participant resolveDependency
  participant Resolver
  Test->>MockRegistry: Serve packument with componentId
  Test->>resolveDependency: Request full metadata
  resolveDependency->>Resolver: Resolve dependency
  Resolver->>MockRegistry: Fetch packument
  MockRegistry-->>Resolver: Return version manifest
  Resolver-->>resolveDependency: Preserve custom fields
  resolveDependency-->>Test: Return componentId.name
Loading

Possibly related PRs

  • pnpm/pnpm#13512: Related metadata filtering changes preserve custom version-manifest fields.

Suggested labels: product: pacquet

Suggested reviewers: qodo-code-review

✨ 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-bi

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.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.02     14.2±1.22ms    26.3 MB/sec    1.00     14.0±0.66ms    26.8 MB/sec
packument/parse                                  1.01     45.9±2.67µs  1444.9 MB/sec    1.00     45.5±0.55µs  1457.6 MB/sec
tarball/download_dependency                      1.28      5.0±0.72ms   863.7 KB/sec    1.00      3.9±0.47ms  1108.9 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.20   270.0±25.97ms 59.3 KElem/sec    1.00    224.4±9.57ms 71.3 KElem/sec
workspace_resolution/hoist_heavy                 1.02   304.5±24.61ms        ? ?/sec    1.00    299.1±4.41ms        ? ?/sec

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.08%. Comparing base (bdb25ee) to head (078a7a7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13664   +/-   ##
=======================================
  Coverage   88.08%   88.08%           
=======================================
  Files         608      608           
  Lines       99032    99033    +1     
=======================================
+ Hits        87231    87232    +1     
  Misses      11801    11801           

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

@zkochan
zkochan marked this pull request as ready for review August 5, 2026 14:47
Copilot AI lite review requested due to automatic review settings August 5, 2026 14:47

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 Summary by Qodo

Fix napi resolveDependency(fullMetadata) to preserve registry-custom fields

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Stop deriving filter_metadata from full_metadata in the N-API resolver path.
• Preserve non-abbreviated registry version fields (e.g. Bit componentId) in manifests.
• Add a mock-registry test ensuring custom fields survive fullMetadata: true resolves.
Diagram

graph TD
  A["JS caller"] --> B["@pnpm/napi resolveDependency"] --> C["run_resolve_blocking"] --> D["NpmResolver (filter off)"] --> E[("Registry packument")]
  E --> F["Resolved manifest (custom fields kept)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Expose `filterMetadata` as an explicit N-API option
  • ➕ Allows callers to opt into abbreviated metadata when desired (parity with install path behavior).
  • ➕ Avoids hardcoding behavior; easier to extend without another breaking change.
  • ➖ Expands public API surface area and needs JS/TS typing updates.
  • ➖ Requires deciding defaults and documenting the interaction with fullMetadata clearly.
2. Infer `filter_metadata` from a separate config source (not `full_metadata`)
  • ➕ Keeps API surface stable while allowing environment/config-driven behavior changes.
  • ➖ Less discoverable for callers; harder to reason about than an explicit option.
  • ➖ Risk of surprising behavior differences across environments/projects.

Recommendation: Keep the PR’s approach (always disable filtering for resolveDependency, even with fullMetadata) because it matches the semantics of the API it replaces (createClient({ fullMetadata: true }) with no filterMetadata) and avoids silently dropping registry-custom fields. Consider a follow-up to expose filterMetadata explicitly if a real consumer needs abbreviated manifests for performance or consistency.

Files changed (5) +77 / -7

Bug fix (1) +9 / -2
resolve.rsDecouple filter_metadata from full_metadata in resolveDependency +9/-2

Decouple filter_metadata from full_metadata in resolveDependency

• Stops deriving 'filter_metadata' from 'full_metadata' for the N-API resolver path. Configures both 'NpmResolver' and 'NamedRegistryResolver' with 'filter_metadata = false' so full metadata retains registry-custom fields.

pnpm/crates/napi/src/resolve.rs

Tests (1) +61 / -5
tests.rsAdd regression test for registry custom fields under full metadata +61/-5

Add regression test for registry custom fields under full metadata

• Extends resolver-chain tests to include a mock registry packument whose version contains a custom field ('componentId'). Verifies that a 'full_metadata: true' resolve returns a manifest that still includes the custom field.

pnpm/crates/napi/src/resolve/tests.rs

Documentation (1) +5 / -0
napi-resolve-full-metadata.mdAdd patch changeset documenting full-metadata manifest preservation +5/-0

Add patch changeset documenting full-metadata manifest preservation

• Adds a patch changeset for '@pnpm/napi' describing that 'resolveDependency({ fullMetadata: true })' no longer returns an abbreviated manifest. Notes that registry-custom fields on version objects are preserved.

.changeset/napi-resolve-full-metadata.md

Other (2) +2 / -0
Cargo.lockUpdate lockfile for new dev dependency +1/-0

Update lockfile for new dev dependency

• Updates the Rust lockfile to include 'mockito' as a dependency used by the N-API crate’s tests.

Cargo.lock

Cargo.tomlAdd mockito as a dev-dependency for resolver tests +1/-0

Add mockito as a dev-dependency for resolver tests

• Adds 'mockito' under '[dev-dependencies]' to enable local HTTP registry mocking in the N-API resolver test suite.

pnpm/crates/napi/Cargo.toml

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge, with the resolver flags, cache namespaces, and regression coverage aligned with the intended full-metadata contract.

The changed NAPI paths consistently request unfiltered full metadata, filtered and unfiltered documents remain isolated in distinct cache slots, and the test exercises the affected registry resolution behavior without introducing a production dependency.

Reviews (1): Last reviewed commit: "fix(napi): keep registry-custom fields i..." | Re-trigger Greptile

@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/napi/src/resolve/tests.rs (1)

120-152: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add coverage for the named-registry resolver.

This test configures only the default registry, so it exercises NpmResolver but not NamedRegistryResolver at Line 224. Add a named-registry case that asserts manifest["componentId"]["name"] remains "button".

🤖 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/napi/src/resolve/tests.rs` around lines 120 - 152, Add a separate
test case for the named-registry resolution path using the visible
`full_metadata_keeps_registry_custom_version_fields` setup as a model, but
configure and resolve through a named registry so `NamedRegistryResolver` is
exercised. Assert that the returned manifest’s `componentId.name` remains
`"button"`, and retain the existing default-registry coverage unchanged.
🤖 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/napi/src/resolve/tests.rs`:
- Around line 120-152: Add a separate test case for the named-registry
resolution path using the visible
`full_metadata_keeps_registry_custom_version_fields` setup as a model, but
configure and resolve through a named registry so `NamedRegistryResolver` is
exercised. Assert that the returned manifest’s `componentId.name` remains
`"button"`, and retain the existing default-registry coverage unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 407d5faa-3516-4b77-a690-76e7fb31549f

📥 Commits

Reviewing files that changed from the base of the PR and between bdb25ee and 078a7a7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (4)
  • .changeset/napi-resolve-full-metadata.md
  • pnpm/crates/napi/Cargo.toml
  • pnpm/crates/napi/src/resolve.rs
  • pnpm/crates/napi/src/resolve/tests.rs

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 5, 2026
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Historical createClient reference comment 📘 Rule violation ⚙ Maintainability
Description
A newly added inline comment explains the current behavior by referencing a replaced/previous API
(createClient) and contrasting with the install path. This violates the requirement that comments
describe current behavior rather than historical implementations.
Code

pnpm/crates/napi/src/resolve.rs[R140-142]

+    // and `clear_meta` would drop exactly those. Matches pnpm's
+    // `createClient({ fullMetadata: true })` with no `filterMetadata`,
+    // which is what this API replaces.
Relevance

●●● Strong

Team often accepts rewriting comments to remove historical/replaced-API phrasing, especially in NAPI
Rust code.

PR-#13532
PR-#13652

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist forbids comments that reference previous or replaced implementations. The added
comment explicitly states that the current API "replaces" another (`createClient({ fullMetadata:
true })`), which is historical context rather than a description of current behavior and contract.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/napi/src/resolve.rs[140-142]

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 comment describing `filter_metadata` uses historical framing (e.g., referencing what this API "replaces") rather than documenting the current contract/invariants of the code.

## Issue Context
The code change is correct, but the comment should be rewritten to describe the present behavior/contract (what callers can rely on and why `filter_metadata` must stay `false`) without referencing prior implementations.

## Fix Focus Areas
- pnpm/crates/napi/src/resolve.rs[137-143]

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



Informational

2. mockito used in registry test 📘 Rule violation ▣ Testability
Description
Registry-interacting test code starts a mockito server directly instead of using
pacquet-testing-utils, which violates the required standard test harness for mocked registries.
This can lead to inconsistent registry behavior across tests and duplication of lifecycle/setup
logic.
Code

pnpm/crates/napi/src/resolve/tests.rs[R122-124]

+    let mut server = mockito::Server::new();
+    let mock = server
+        .mock("GET", "/custom-field-pkg")
Relevance

● Weak

Close precedent: reviewers rejected switching mockito-based registry tests to pacquet-testing-utils
harness.

PR-#13549

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The compliance rule requires tests that interact with a mocked registry to use
pacquet-testing-utils to start/manage the registry. The added test instead instantiates
mockito::Server directly, which is a non-compliant manual registry startup approach.

Rule 2254915: Use pacquet-testing-utils to start mocked registry in tests
pnpm/crates/napi/src/resolve/tests.rs[120-127]

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 test `full_metadata_keeps_registry_custom_version_fields` manually starts a mock registry with `mockito`, but compliance requires using `pacquet-testing-utils` helpers to manage the mocked registry lifecycle for registry-interacting tests.

## Issue Context
This PR added a registry-backed test to validate that `full_metadata` preserves registry-custom fields. The mock registry should be started via `pacquet-testing-utils` so the test suite uses a consistent mock-registry setup.

## Fix Focus Areas
- pnpm/crates/napi/src/resolve/tests.rs[120-152]

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


3. Debug print in test 🐞 Bug ⚙ Maintainability
Description
The new registry regression test includes dbg!(&manifest), which will emit noisy stderr output in
CI and local test runs despite the test already asserting the needed field.
Code

pnpm/crates/napi/src/resolve/tests.rs[R148-150]

+    let manifest = result.manifest.expect("registry resolution carries a manifest");
+    dbg!(&manifest);
+    assert_eq!(manifest["componentId"]["name"], "button");
Relevance

● Weak

Close precedent rejected removing unconditional dbg! from tests; recent examples show team may keep
dbg output.

PR-#13571

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test prints the manifest via dbg!, and the resolver returns a manifest value as part of the
NAPI result, so this line will always emit output when the test runs.

pnpm/crates/napi/src/resolve/tests.rs[146-151]
pnpm/crates/napi/src/resolve.rs[287-290]

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 `dbg!(&manifest)` call was added to the new registry test. This produces unnecessary stderr output in CI and local runs.

### Issue Context
The test already asserts on `manifest["componentId"]["name"]`, so the debug print is redundant.

### Fix Focus Areas
- pnpm/crates/napi/src/resolve/tests.rs[146-151]

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


Grey Divider

Context used
✅ Compliance rules (platform): 24 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

@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

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 078a7a75ef2a

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD.

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

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.641 ± 0.174 2.410 2.895 1.73 ± 0.22
pacquet@main 2.655 ± 0.156 2.421 2.846 1.74 ± 0.22
pnpr@HEAD 1.524 ± 0.169 1.372 1.858 1.00
pnpr@main 1.575 ± 0.158 1.383 1.813 1.03 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6408072041600006,
      "stddev": 0.17350133394401646,
      "median": 2.64695133826,
      "user": 1.7779978799999996,
      "system": 1.4484860999999998,
      "min": 2.40967194226,
      "max": 2.8951946792600003,
      "times": [
        2.8951946792600003,
        2.4297826812600003,
        2.40967194226,
        2.80104917926,
        2.68336854226,
        2.65596175326,
        2.60480965126,
        2.63794092326,
        2.84413912826,
        2.44615356126
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6547418367600004,
      "stddev": 0.15560162033116073,
      "median": 2.69703129176,
      "user": 1.80585958,
      "system": 1.4059899,
      "min": 2.42097119726,
      "max": 2.8461508012600003,
      "times": [
        2.80334275326,
        2.69374672126,
        2.81120032026,
        2.70031586226,
        2.8461508012600003,
        2.42777022726,
        2.72899353726,
        2.57335727826,
        2.42097119726,
        2.5415696692600003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.52397833306,
      "stddev": 0.1693534455486789,
      "median": 1.4404467357600002,
      "user": 1.2710717800000002,
      "system": 1.266452,
      "min": 1.37209889826,
      "max": 1.8575865012600001,
      "times": [
        1.37209889826,
        1.45717128226,
        1.63490324526,
        1.42027868626,
        1.42372218926,
        1.74889650226,
        1.3954417432600001,
        1.5425823742600002,
        1.38710190826,
        1.8575865012600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5753809364600002,
      "stddev": 0.15752596440539818,
      "median": 1.59667171576,
      "user": 1.2626523800000002,
      "system": 1.3084241,
      "min": 1.3828934722600001,
      "max": 1.8129200562600003,
      "times": [
        1.4514022822600001,
        1.70422028126,
        1.3975363232600002,
        1.8129200562600003,
        1.5387461202600001,
        1.4139583082600002,
        1.7314131972600002,
        1.65459731126,
        1.3828934722600001,
        1.6661220122600002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 286.1 ± 13.0 267.5 312.2 1.00
pacquet@main 289.2 ± 7.0 284.5 306.4 1.01 ± 0.05
pnpr@HEAD 297.5 ± 16.7 279.5 328.1 1.04 ± 0.08
pnpr@main 286.8 ± 13.3 267.6 300.8 1.00 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.28613697386000003,
      "stddev": 0.013040725045268391,
      "median": 0.28475887716000003,
      "user": 0.23943995999999998,
      "system": 0.5587359199999999,
      "min": 0.26748015066,
      "max": 0.31216528066000004,
      "times": [
        0.31216528066000004,
        0.29534365066,
        0.28886633766,
        0.28240501466000006,
        0.29527147466000003,
        0.26748015066,
        0.28336501366000005,
        0.28615274066,
        0.28093695566000004,
        0.26938311966000006
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.28915579216000004,
      "stddev": 0.0069884032956233424,
      "median": 0.28592666966,
      "user": 0.22667436,
      "system": 0.5819749200000001,
      "min": 0.28448913366000006,
      "max": 0.30641737166000005,
      "times": [
        0.28971885566000005,
        0.28492817166000006,
        0.28912343166000004,
        0.29558290166000006,
        0.28616750866,
        0.28448913366000006,
        0.28568583066000003,
        0.28462123266000006,
        0.28482348366000004,
        0.30641737166000005
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29754690376,
      "stddev": 0.016721060184335782,
      "median": 0.29185035916,
      "user": 0.25133486,
      "system": 0.5491571199999999,
      "min": 0.27947079166000005,
      "max": 0.32809398566000003,
      "times": [
        0.32809398566000003,
        0.30617065666000004,
        0.28960157466,
        0.31339036966000006,
        0.28151902366000003,
        0.29409914366000006,
        0.27947079166000005,
        0.28155046266000006,
        0.28809191766000003,
        0.31348111166000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28682232986,
      "stddev": 0.013304341585215549,
      "median": 0.28883579916,
      "user": 0.22089346,
      "system": 0.55397232,
      "min": 0.26760352466000004,
      "max": 0.30079893866,
      "times": [
        0.30021256166000004,
        0.29197205266000004,
        0.28569954566000005,
        0.29907901366000006,
        0.27525706466000005,
        0.26760352466000004,
        0.27769418066,
        0.29990263766,
        0.27000377866,
        0.30079893866
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.614 ± 0.018 2.583 2.638 1.66 ± 0.18
pacquet@main 2.591 ± 0.013 2.573 2.606 1.64 ± 0.18
pnpr@HEAD 1.576 ± 0.172 1.428 1.857 1.00
pnpr@main 1.591 ± 0.139 1.435 1.805 1.01 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6141057291999994,
      "stddev": 0.018426747391926714,
      "median": 2.6141308181999996,
      "user": 1.5427199999999996,
      "system": 1.2676930599999998,
      "min": 2.5834802986999996,
      "max": 2.6377822307,
      "times": [
        2.6119125506999996,
        2.6377822307,
        2.6117622676999996,
        2.6163490856999996,
        2.6350716817,
        2.6310098466999996,
        2.5999967877,
        2.5908416637,
        2.5834802986999996,
        2.6228508786999996
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.5905349838999996,
      "stddev": 0.013262926346156887,
      "median": 2.5890154261999996,
      "user": 1.4458655,
      "system": 1.3021355600000002,
      "min": 2.5726507787,
      "max": 2.6062830047,
      "times": [
        2.5748284336999996,
        2.6032210336999997,
        2.6062830047,
        2.5908737836999998,
        2.5763078817,
        2.6036176416999997,
        2.6046644626999997,
        2.5726507787,
        2.5857457497,
        2.5871570687
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5760249220000002,
      "stddev": 0.17217568387355883,
      "median": 1.4844894592000002,
      "user": 1.0258828,
      "system": 1.10083646,
      "min": 1.4282515837,
      "max": 1.8566389827,
      "times": [
        1.5178036507000001,
        1.6540647677000002,
        1.8497256037,
        1.4383926867,
        1.8566389827,
        1.4282515837,
        1.4434386857000001,
        1.4511752677,
        1.6812678267,
        1.4394901647
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5906926728000002,
      "stddev": 0.13890737575228423,
      "median": 1.5220041267,
      "user": 1.0792433999999997,
      "system": 1.19737896,
      "min": 1.4348073997000002,
      "max": 1.8050677377000002,
      "times": [
        1.5104383387,
        1.7353704617,
        1.7837436397000002,
        1.4904480037,
        1.5117253046999999,
        1.6409475146999999,
        1.8050677377000002,
        1.4348073997000002,
        1.5322829487,
        1.4620953787000002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 433.0 ± 16.0 396.1 454.7 1.25 ± 0.08
pacquet@main 424.5 ± 26.1 386.6 470.6 1.23 ± 0.10
pnpr@HEAD 346.0 ± 18.7 321.9 379.0 1.00
pnpr@main 360.5 ± 25.4 328.7 416.6 1.04 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4329735385200001,
      "stddev": 0.015999730507888905,
      "median": 0.43539666062000004,
      "user": 0.5675930200000001,
      "system": 0.7393157,
      "min": 0.39613859712000005,
      "max": 0.45471057512,
      "times": [
        0.43437994012000003,
        0.42738096812000004,
        0.44162069612000004,
        0.42927893512000004,
        0.45471057512,
        0.44852706212000004,
        0.43641338112,
        0.43728796912,
        0.39613859712000005,
        0.42399726112
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.4245019394200001,
      "stddev": 0.026145428075361042,
      "median": 0.42591939862000006,
      "user": 0.5793767200000001,
      "system": 0.7235547,
      "min": 0.38655858212000005,
      "max": 0.47062664212000005,
      "times": [
        0.43748072312,
        0.47062664212000005,
        0.44619196112000004,
        0.42436292012000004,
        0.41570997212000005,
        0.44265198912000003,
        0.42747587712,
        0.39417881412,
        0.38655858212000005,
        0.39978191312
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.34595071152,
      "stddev": 0.018681675342860294,
      "median": 0.34450286012,
      "user": 0.23368751999999998,
      "system": 0.5976269999999999,
      "min": 0.32193303012,
      "max": 0.37903895712,
      "times": [
        0.35503277212,
        0.32374198712,
        0.32193303012,
        0.34367997412,
        0.34614178212,
        0.37195700912,
        0.33268472212,
        0.33997113512000005,
        0.34532574612,
        0.37903895712
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.36045023882000005,
      "stddev": 0.025436359460623986,
      "median": 0.35136938262,
      "user": 0.24677121999999999,
      "system": 0.5998528000000001,
      "min": 0.32869620612,
      "max": 0.41664057512,
      "times": [
        0.37585959512,
        0.34337838612000005,
        0.35495664812,
        0.41664057512,
        0.34778211712,
        0.34769481312,
        0.34637616712,
        0.35870867112000004,
        0.38440920912000004,
        0.32869620612
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.854 ± 0.037 1.790 1.894 5.44 ± 0.19
pacquet@main 1.790 ± 0.039 1.747 1.861 5.25 ± 0.19
pnpr@HEAD 0.362 ± 0.042 0.323 0.438 1.06 ± 0.13
pnpr@main 0.341 ± 0.010 0.329 0.362 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.8538004474599998,
      "stddev": 0.03680341426950998,
      "median": 1.86531339616,
      "user": 0.9537063800000001,
      "system": 0.8796217399999999,
      "min": 1.79043553716,
      "max": 1.8936674201600001,
      "times": [
        1.8916880301599999,
        1.79043553716,
        1.86385318916,
        1.82682022216,
        1.8936674201600001,
        1.86847036116,
        1.8461709631599998,
        1.88823117516,
        1.86677360316,
        1.80189397316
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.7898137887599996,
      "stddev": 0.0386249708252859,
      "median": 1.76913534766,
      "user": 0.8537689800000001,
      "system": 0.8062660399999999,
      "min": 1.7466011021599999,
      "max": 1.86062644716,
      "times": [
        1.76188725216,
        1.77163650716,
        1.76531306916,
        1.7466011021599999,
        1.76663418816,
        1.76363341316,
        1.8430746171599999,
        1.86062644716,
        1.81167477816,
        1.80705651316
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36218457946000004,
      "stddev": 0.04207453754384006,
      "median": 0.34651012616,
      "user": 0.25776918000000004,
      "system": 0.5747542400000001,
      "min": 0.32323134316,
      "max": 0.43779226716,
      "times": [
        0.34886155816000003,
        0.43779226716,
        0.42668189716000005,
        0.32437315516000004,
        0.37847789716,
        0.34415869416,
        0.37832413716,
        0.33159668816000004,
        0.32834815716000004,
        0.32323134316
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.34090006116000005,
      "stddev": 0.010026939228128234,
      "median": 0.33920140116,
      "user": 0.23561717999999998,
      "system": 0.5557350400000001,
      "min": 0.32869494016,
      "max": 0.36168843316000004,
      "times": [
        0.35431818316,
        0.33347464816,
        0.34031963916,
        0.33913303216,
        0.32869494016,
        0.33503989816,
        0.34282453016000003,
        0.33926977016000004,
        0.33423753716000004,
        0.36168843316000004
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 215.6 ± 15.3 191.7 240.9 2.35 ± 0.18
pacquet@main 241.4 ± 32.0 210.6 297.0 2.64 ± 0.36
pnpr@HEAD 91.6 ± 2.3 86.5 97.9 1.00
pnpr@main 92.6 ± 2.4 88.0 99.8 1.01 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21563349915846158,
      "stddev": 0.015315521064582277,
      "median": 0.21839709962,
      "user": 0.19523102769230766,
      "system": 0.08323231076923075,
      "min": 0.19165560862,
      "max": 0.24091638162,
      "times": [
        0.22567645962000002,
        0.24091638162,
        0.22976456362000003,
        0.22191045062,
        0.22627156062,
        0.20680467062000002,
        0.20575147562,
        0.19165560862,
        0.19569423062000002,
        0.20103406462,
        0.20701445662,
        0.21839709962,
        0.23234446662000002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.24137367862000003,
      "stddev": 0.03204734819170716,
      "median": 0.22207697512000002,
      "user": 0.22405182000000004,
      "system": 0.08540087999999998,
      "min": 0.21055858562000002,
      "max": 0.29702934762,
      "times": [
        0.29702934762,
        0.22285217562,
        0.25696237361999996,
        0.26228565662,
        0.21979483362000002,
        0.28782403062,
        0.21055858562000002,
        0.21503016362000002,
        0.22009784462,
        0.22130177462
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09158688062,
      "stddev": 0.0023070262351121058,
      "median": 0.09164257262,
      "user": 0.022830945806451623,
      "system": 0.01105755870967742,
      "min": 0.08649009162,
      "max": 0.09792265862,
      "times": [
        0.09151876862000001,
        0.09174900262,
        0.09145272562000001,
        0.09032027062,
        0.09341028462,
        0.09202172762000001,
        0.09041329562,
        0.09792265862,
        0.09660772962000001,
        0.09182394462,
        0.08999104062,
        0.09365403462,
        0.09244815062,
        0.08976791962000001,
        0.09073741662000001,
        0.08808624962,
        0.09354904562000001,
        0.09183041662000001,
        0.09061955462,
        0.09496029562000001,
        0.08922120962,
        0.08849580162000001,
        0.09202222762000001,
        0.09245711862,
        0.09128761362000001,
        0.09096411462000001,
        0.08649009162,
        0.08948531662,
        0.09189273362,
        0.09164257262,
        0.09234996662
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.0926465842651613,
      "stddev": 0.0024236503830666867,
      "median": 0.09196832662000001,
      "user": 0.023195300645161288,
      "system": 0.01097104516129032,
      "min": 0.08801327262000001,
      "max": 0.09984166562,
      "times": [
        0.09141061562000001,
        0.09446960162000001,
        0.09147099862000001,
        0.09118633162,
        0.09196832662000001,
        0.09097389162000001,
        0.09066569162,
        0.09468323362,
        0.09123850062000001,
        0.09092806562000001,
        0.09076640162,
        0.09084381662,
        0.09248304662000001,
        0.09222391862000001,
        0.09301527962,
        0.09157530562,
        0.09343377862,
        0.09048688462000001,
        0.09168478262,
        0.09075180462,
        0.09343757562,
        0.08916451262000001,
        0.08801327262000001,
        0.09358557462,
        0.09446776762,
        0.09484883562,
        0.09984166562,
        0.09462373062000001,
        0.09514488362000001,
        0.09554504862,
        0.09711096862
      ]
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.170 ± 0.212 0.940 1.520 1.00
pacquet@main 1.258 ± 0.253 1.049 1.844 1.08 ± 0.29
pnpm@HEAD 5.560 ± 0.321 4.907 6.011 4.75 ± 0.90
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.1699223548022222,
      "stddev": 0.21169186406440307,
      "median": 1.09280835858,
      "user": 1.082529582222222,
      "system": 0.15724466222222222,
      "min": 0.9398772745800001,
      "max": 1.52013627358,
      "times": [
        1.48911736458,
        1.09280835858,
        1.0034041135799998,
        0.9398772745800001,
        1.0009284725799998,
        1.06149771158,
        1.52013627358,
        1.25392525958,
        1.16760636458
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.2579050532466665,
      "stddev": 0.25322174380903834,
      "median": 1.1968738935799998,
      "user": 1.1752139155555554,
      "system": 0.1853392177777778,
      "min": 1.04927067458,
      "max": 1.84352555958,
      "times": [
        1.05365343958,
        1.1968738935799998,
        1.0860402625799999,
        1.33023869958,
        1.04927067458,
        1.10694353858,
        1.2440635065799999,
        1.4105359045799999,
        1.84352555958
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 5.560396268691111,
      "stddev": 0.32121020647474263,
      "median": 5.63716593258,
      "user": 8.541637693333334,
      "system": 0.4773573288888888,
      "min": 4.90659418958,
      "max": 6.01135753458,
      "times": [
        5.7982871005800005,
        5.63716593258,
        5.72364841358,
        5.55328415858,
        5.45142490658,
        6.01135753458,
        4.90659418958,
        5.68200389558,
        5.2798002865800004
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.960 ± 0.137 4.826 5.223 1.24 ± 0.07
pacquet@main 5.011 ± 0.069 4.905 5.105 1.25 ± 0.06
pnpr@HEAD 4.042 ± 0.145 3.832 4.294 1.01 ± 0.06
pnpr@main 4.001 ± 0.179 3.779 4.317 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.96020248466,
      "stddev": 0.1366499172858255,
      "median": 4.91930223186,
      "user": 3.1946820999999996,
      "system": 2.2656820199999994,
      "min": 4.82582681386,
      "max": 5.22330471886,
      "times": [
        4.83362955386,
        5.22330471886,
        4.93123615886,
        4.907368304859999,
        5.1855993288599995,
        4.9748790418599995,
        4.93612653786,
        4.82582681386,
        4.902831281859999,
        4.881223105859999
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 5.0108673131599994,
      "stddev": 0.06882856355841734,
      "median": 5.02258084936,
      "user": 3.2638754,
      "system": 2.26958902,
      "min": 4.9047417928599994,
      "max": 5.10477907786,
      "times": [
        5.10477907786,
        5.09299239786,
        4.9047417928599994,
        5.03308233686,
        5.04671301186,
        4.937728326859999,
        5.01207936186,
        5.04904812586,
        4.926448006859999,
        5.001060692859999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.04163366876,
      "stddev": 0.14454169548011972,
      "median": 4.00734450186,
      "user": 2.3213798999999997,
      "system": 2.3453603199999997,
      "min": 3.83198777686,
      "max": 4.29391265586,
      "times": [
        4.06896871686,
        4.0707821938599995,
        4.04110812986,
        4.29391265586,
        4.26894052486,
        3.96965430286,
        3.94222621186,
        3.97358087386,
        3.83198777686,
        3.95517530086
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 4.00145976266,
      "stddev": 0.17928240105760207,
      "median": 3.98920204886,
      "user": 2.3068267,
      "system": 2.285738919999999,
      "min": 3.77949635186,
      "max": 4.31708505586,
      "times": [
        3.86141892386,
        4.06292478386,
        3.82632915086,
        3.77949635186,
        3.87031253686,
        4.071619924859999,
        4.0853614358599994,
        3.91547931386,
        4.22457014886,
        4.31708505586
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13664
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.peer-heavy-resolve.hot-cache.offlineLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
939.88 ms
(+31.77%)Baseline: 713.26 ms
855.91 ms
(109.81%)

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,583.48 ms
(-4.30%)Baseline: 2,699.52 ms
3,239.43 ms
(79.75%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,790.44 ms
(-1.39%)Baseline: 1,815.70 ms
2,178.85 ms
(82.17%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
396.14 ms
(-13.26%)Baseline: 456.67 ms
548.01 ms
(72.29%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
191.66 ms
(-9.34%)Baseline: 211.40 ms
253.67 ms
(75.55%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,409.67 ms
(-1.07%)Baseline: 2,435.85 ms
2,923.02 ms
(82.44%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,825.83 ms
(+7.23%)Baseline: 4,500.49 ms
5,400.59 ms
(89.36%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
267.48 ms
(-8.12%)Baseline: 291.13 ms
349.35 ms
(76.56%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
🚨 view alert (🔔)
939.88 ms
(+31.77%)Baseline: 713.26 ms
855.91 ms
(109.81%)

🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit 34347bc into main Aug 5, 2026
34 of 35 checks passed
@zkochan
zkochan deleted the fix-bi branch August 5, 2026 15:13
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.

3 participants