Skip to content

fix(resolving-deps-resolver): key an aliased dependency by its manifest name - #13407

Merged
zkochan merged 3 commits into
mainfrom
aliased-jsr-importer
Jul 27, 2026
Merged

zkochan merged 3 commits into
mainfrom
aliased-jsr-importer

Conversation

@zkochan

@zkochan zkochan commented Jul 26, 2026 •

Copy link
Copy Markdown
Member

Summary

An aliased jsr: dependency — "bar-from-jsr": "jsr:@pnpm-e2e/[email protected]" — resolved and installed under pacquet, but the lockfile importer came out empty, so nothing that reads direct dependencies out of the lockfile (outdated, update, licenses, dedupe, frozen-install verification) could see it. Closes #13362.

The jsr: and named-registry resolvers stamp the protocol's own package name on the result as its alias (@pnpm-e2e/bar), which is what an edge with no manifest key of its own — pnpm add jsr:@pnpm-e2e/bar — should install under. pacquet's tree builder let that name win over the manifest key, and build_importer only records aliases the manifest declares, so the edge was dropped.

The TypeScript CLI stamps the very same alias in its resolver (alias: spec.jsrPkgName) but reads it the other way around in the tree builder — wantedDependency.alias ?? pkgResponse.body.alias ?? pkg.name. This PR applies that precedence in pacquet, extracted into one node_alias helper shared by the fresh-resolve and lockfile-reuse node paths. The same bug affected aliased namedRegistries entries ("foo-from-work": "work:@pnpm.e2e/[email protected]"), and the same fix covers them.

TypeScript needs no change here — it already records both shapes correctly, so this is a pacquet-only fix.

Tests: the two jsr with alias ports drop their known_failures gate, and the named-registry shape gets its own CLI test. Its expected lockfile entry was taken from an actual TypeScript CLI run against the same manifest (positive-from-work → specifier: work:[email protected], version: [email protected]) rather than assumed. Both new assertions were verified to fail against the pre-fix precedence.

Squash Commit Body

An aliased `jsr:` or named-registry dependency (`"bar-from-jsr":
"jsr:@pnpm-e2e/[email protected]"`) resolved and installed, but never reached
the lockfile importer. Those resolvers stamp the protocol's own package
name on the result as its alias, and the tree builder let that name win
over the manifest key. `build_importer` only records aliases the
manifest declares, so the edge was dropped and the importer came out
empty.

The TypeScript CLI reads the same resolver output the other way around
(`wantedDependency.alias ?? pkgResponse.body.alias ?? pkg.name`), so
this applies that precedence in the tree builder, shared by the fresh
and the lockfile-reuse node paths. The resolver's alias still names the
edges that carry no manifest key of their own, such as
`pnpm add jsr:@pnpm-e2e/bar`.

The two `jsr with alias` ports lose their `known_failures` gate, and the
named-registry shape gets its own CLI test; its expected lockfile entry
was taken from a TypeScript-CLI run against the same manifest.

TypeScript needs no change: it already records both shapes correctly.

Closes pnpm/pnpm#13362

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting. (pacquet-only: the TypeScript CLI already behaves correctly, and its own jsr with alias test covers it.)
  • 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
    • Fixed lockfile importer tracking for aliased jsr: and named-registry dependencies, so they’re visible to lockfile-based tooling.
    • Aliased dependencies are now recorded correctly and prefer the alias from your manifest when present.
    • Ensured node_modules contains the expected alias-named package, including update --latest scenarios.
  • Tests
    • Expanded and un-gated coverage for JSR and named-registry alias install/update behavior.
  • Documentation
    • Clarified how alias installation naming is handled in resolver docs.

…st name

An aliased `jsr:` or named-registry dependency (`"bar-from-jsr":
"jsr:@pnpm-e2e/[email protected]"`) resolved and installed, but never reached
the lockfile importer. Those resolvers stamp the protocol's own package
name on the result as its alias, and the tree builder let that name win
over the manifest key. `build_importer` only records aliases the
manifest declares, so the edge was dropped and the importer came out
empty.

The TypeScript CLI reads the same resolver output the other way around
(`wantedDependency.alias ?? pkgResponse.body.alias ?? pkg.name`), so
this applies that precedence in the tree builder, shared by the fresh
and the lockfile-reuse node paths. The resolver's alias still names the
edges that carry no manifest key of their own, such as
`pnpm add jsr:@pnpm-e2e/bar`.

The two `jsr with alias` ports lose their `known_failures` gate, and the
named-registry shape gets its own CLI test; its expected lockfile entry
was taken from a TypeScript-CLI run against the same manifest.

TypeScript needs no change: it already records both shapes correctly.

Closes #13362
Copilot AI review requested due to automatic review settings July 26, 2026 22: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.

@coderabbitai

coderabbitai Bot commented Jul 26, 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: 906e2169-6a2f-4f22-a2cf-cfc1f7e2e068

📥 Commits

Reviewing files that changed from the base of the PR and between df18605 and 07e93e3.

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

📝 Walkthrough

Walkthrough

The resolver now prioritizes manifest aliases when recording dependency edges for fresh and reused resolutions. Named-registry and aliased JSR installation/update tests verify lockfile importer entries and alias-based package installation.

Changes

Aliased dependency importer

Layer / File(s) Summary
Manifest alias selection
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs, pnpm/crates/resolving-npm-resolver/src/*.rs
Centralizes alias precedence for fresh and reused resolution paths and updates resolver documentation for manifest-keyed dependencies.
Importer regression coverage
pnpm/crates/cli/tests/named_registry_install.rs, pnpm/crates/cli/tests/update_jsr.rs
Adds named-registry coverage and enables aliased JSR install and update assertions.
Test-porting status and release metadata
pnpm/plans/TEST_PORTING.md, .changeset/aliased-jsr-dependency-importer.md
Marks the JSR alias tests as ported and documents the patch release change.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Resolver
  participant Lockfile
  participant NodeModules
  CLI->>Resolver: Install or update aliased dependency
  Resolver->>Lockfile: Record manifest-keyed importer entry
  Resolver->>NodeModules: Install package under alias
  Lockfile-->>CLI: Return dependency metadata
Loading

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13122 — Modifies the dependency-tree reuse path touched by this alias-selection change.
  • pnpm/pnpm#13366 — Covers related JSR importer-recording expectations.
  • pnpm/pnpm#13394 — Updates related aliased JSR update --latest tests.

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 aliased-jsr-importer

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 lockfile importer for aliased jsr:/named-registry dependencies

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Fix dependency tree alias precedence so manifest keys win over resolver-stamped aliases.
• Ensure aliased jsr: and namedRegistries deps are recorded in lockfile importers.
• Add/ungate CLI tests validating lockfile entries and node_modules links for aliases.
Diagram

graph TD
  A["package.json"] --> B["Resolver (jsr/named)"] --> C["Deps tree builder"] --> D["Lockfile importer"] --> E["pnpm-lock.yaml"] --> F["CLI cmds (update/outdated)"]
  G["CLI tests"] --> E
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Fix in lockfile importer (map resolved alias back to manifest key)
  • ➕ Keeps tree-builder alias behavior unchanged for other consumers
  • ➕ Localizes change to lockfile generation
  • ➖ Importer may not have enough context to reliably recover the manifest key
  • ➖ Risk of papering over alias inconsistencies rather than fixing the source
2. Change resolvers to only stamp protocol alias when no manifest key exists
  • ➕ Avoids producing conflicting alias sources in the first place
  • ➕ Keeps manifest-keyed edges naturally keyed by manifest name
  • ➖ Behavior change across resolver consumers; must audit all call sites
  • ➖ Still needs careful handling for bare specifiers (no manifest key)
3. Carry both manifest key and resolved/package alias through the node model
  • ➕ Most explicit; avoids overloading a single 'alias' field
  • ➕ Importer can unambiguously use manifest key while installers use resolved name
  • ➖ Larger refactor across node structures, serialization, and consumers
  • ➖ More review and regression surface than needed for this bug

Recommendation: The chosen approach (manifest key > resolver alias > package name) is the best tradeoff: it matches pnpm’s TypeScript precedence, fixes the lockfile importer at the source (tree construction), and preserves the resolver-stamped alias behavior for edges that truly lack a manifest key (e.g., pnpm add jsr:@scope/name). The added end-to-end tests for both jsr: and named registries appropriately lock in the expected importer behavior.

Files changed (7) +161 / -78

Bug fix (1) +28 / -12
resolve_dependency_tree.rsPrefer manifest key when computing node alias for dependency edges +28/-12

Prefer manifest key when computing node alias for dependency edges

• Extracts 'node_alias()' and applies it to both fresh-resolve and lockfile-reuse paths so 'wantedDependency.alias' (manifest key) takes precedence over 'ResolveResult.alias'. This prevents aliased 'jsr:'/named-registry edges from being dropped from the lockfile importer when the resolver stamps the protocol’s package name as an alias.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs

Tests (2) +119 / -61
named_registry_install.rsAdd CLI tests for namedRegistries plain vs aliased installs +84/-0

Add CLI tests for namedRegistries plain vs aliased installs

• Introduces end-to-end install tests that assert importer entries for both 'work:<range>' and aliased 'work:<pkg>@<range>' forms, and verifies the alias path exists in 'node_modules'.

pnpm/crates/cli/tests/named_registry_install.rs

update_jsr.rsUngate and strengthen aliased jsr update/install assertions +35/-61

Ungate and strengthen aliased jsr update/install assertions

• Removes the prior known-failure gating and directly asserts the lockfile importer records the aliased 'jsr:' dependency for install and 'update --latest', plus verifies the alias is linked in 'node_modules'.

pnpm/crates/cli/tests/update_jsr.rs

Documentation (4) +14 / -5
aliased-jsr-dependency-importer.mdAdd changeset for aliased jsr/named-registry importer fix +5/-0

Add changeset for aliased jsr/named-registry importer fix

• Adds a patch changeset describing the regression where aliased 'jsr:'/named-registry deps were installed but missing from lockfile importers, breaking commands that read direct deps.

.changeset/aliased-jsr-dependency-importer.md

named_registry_resolver.rsClarify named-registry alias semantics in resolver docs +3/-2

Clarify named-registry alias semantics in resolver docs

• Updates module documentation to reflect that resolver-stamped alias is for edges without a manifest key, while manifest-declared keys must be preserved.

pnpm/crates/resolving-npm-resolver/src/named_registry_resolver.rs

npm_resolver.rsClarify jsr resolver alias semantics in docs +5/-2

Clarify jsr resolver alias semantics in docs

• Updates documentation explaining that 'alias = spec.jsr_pkg_name' is intended for unnamed edges (e.g., 'pnpm add jsr:...'), while manifest-keyed deps keep their manifest key.

pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs

TEST_PORTING.mdMark 'jsr with alias' port as no longer a known failure +1/-1

Mark 'jsr with alias' port as no longer a known failure

• Updates the test porting plan to reflect that the aliased JSR tests are now fully enabled because the importer gap is fixed.

pnpm/plans/TEST_PORTING.md

@greptile-apps

greptile-apps Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the prior documentation concern is resolved because the rustdoc now states the helper contract while the implementation rationale is kept in a regular comment.

Reviews (3): Last reviewed commit: "docs(resolving-deps-resolver): move the ..." | Re-trigger Greptile

@qodo-code-review

qodo-code-review Bot commented Jul 26, 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. Fragile YAML append ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
The new named_registry_install test appends a namedRegistries: block by raw string
concatenation, which will produce malformed pnpm-workspace.yaml if the harness file ever stops
ending with \n (joining the last line and namedRegistries:). This creates a brittle test that
can fail for fixture-format reasons instead of the behavior under test.
Code

pnpm/crates/cli/tests/named_registry_install.rs[R20-24]

+    let workspace_yaml = workspace.join("pnpm-workspace.yaml");
+    let yaml = fs::read_to_string(&workspace_yaml).expect("read the harness pnpm-workspace.yaml");
+    let registry = npmrc_info.mock_instance.url();
+    fs::write(&workspace_yaml, format!("{yaml}namedRegistries:\n  work: {registry}\n"))
+        .expect("write pnpm-workspace.yaml");
Relevance

⭐⭐⭐ High

Very close accepted precedent: newline-safe append / use helper when appending to
pnpm-workspace.yaml in tests.

PR-#13386
PR-#13081

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new test overwrites pnpm-workspace.yaml by concatenating the existing file contents with a new
block, but it does not ensure a trailing newline first; the repo’s own test utilities already
implement newline-safe append for this exact file, indicating the invariant is important and
intentionally guarded elsewhere.

pnpm/crates/cli/tests/named_registry_install.rs[17-24]
pnpm/crates/cli/tests/_utils/mod.rs[83-96]
pnpm/crates/cli/tests/_utils/mod.rs[170-178]
PR-#13386

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

### Issue description
`pnpm/crates/cli/tests/named_registry_install.rs` appends to `pnpm-workspace.yaml` using `format!("{yaml}...")` without ensuring the existing YAML ends with a newline. If the harness fixture changes (e.g., stops ending in `\n`), this will concatenate `namedRegistries:` onto the last line and break YAML parsing, making the test brittle.

### Issue Context
The test suite already contains helpers that *explicitly* ensure a trailing newline before appending to `pnpm-workspace.yaml`.

### Fix Focus Areas
- pnpm/crates/cli/tests/named_registry_install.rs[17-26]
- pnpm/crates/cli/tests/_utils/mod.rs[83-96]
- pnpm/crates/cli/tests/_utils/mod.rs[170-178]

### Suggested change
Refactor `setup()` to append the new YAML block using an existing helper (e.g. `_utils::WorkspaceFixture::append_workspace_yaml(...)`) or replicate the same newline guard pattern (`if !yaml.ends_with('\n') { yaml.push('\n'); }`) before appending `namedRegistries:`.

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


2. Historical note in TEST_PORTING ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The updated TEST_PORTING entry uses historical phrasing (previously ... stubs; ... was fixed)
rather than describing the current state. This can quickly become stale and violates the rule
against historical implementation notes in inline documentation.
Code

pnpm/plans/TEST_PORTING.md[1061]

+- [x] `TypeScript repo: installing/commands/test/update/jsr.ts:91` `jsr with alias` — ported as `install_records_an_aliased_jsr_dependency` and `update_latest_bumps_an_aliased_jsr_dependency` in `crates/cli/tests/update_jsr.rs` (previously `known_failures` stubs; the importer gap was fixed in pnpm/pnpm#13362).
Relevance

⭐⭐⭐ High

Accepted precedent to remove historical phrasing from TEST_PORTING plan entries.

PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids historical implementation commentary in comments/docstrings. The
modified line explicitly references prior state (previously) and a past fix (was fixed).

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/plans/TEST_PORTING.md[1061-1061]

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 modified documentation line contains historical phrasing (e.g., `previously`, `was fixed`) rather than describing current behavior/state.

## Issue Context
The rule requires comments/docs to describe current behavior, not prior implementations.

## Fix Focus Areas
- pnpm/plans/TEST_PORTING.md[1061-1061]

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



Informational

3. Changeset missing pnpm bump 📘 Rule violation § Compliance
Description
The new changeset declares a bump for pacquet but does not include a required entry for the pnpm
package. This breaks the repository changeset contract and can prevent the intended release
note/version bump from being applied correctly.
Code

.changeset/aliased-jsr-dependency-importer.md[R1-3]

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

⭐ Low

Close precedent: team rejected adding pnpm bump when changeset only listed pacquet.

PR-#13395
PR-#13347
PR-#13329

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changesets to explicitly include the pnpm package with a valid
bump type. The added changeset front-matter lists only pacquet and omits pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/aliased-jsr-dependency-importer.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 new changeset does not declare a bump for `pnpm`, even though this repo requires explicitly listing `pnpm` with a valid bump type.

## Issue Context
The file `.changeset/aliased-jsr-dependency-importer.md` currently contains only:
- `"pacquet": patch`

## Fix Focus Areas
- .changeset/aliased-jsr-dependency-importer.md[1-3]

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


Grey Divider

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 Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     11.1±0.06ms    33.7 MB/sec    1.05     11.6±0.09ms    32.3 MB/sec
packument/parse                1.00     37.0±0.68µs  1794.0 MB/sec    1.02     37.7±0.07µs  1758.8 MB/sec
tarball/download_dependency    1.00      2.3±0.10ms  1906.4 KB/sec    1.00      2.3±0.07ms  1904.9 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/resolving-deps-resolver/src/resolve_dependency_tree.rs (1)

1905-1916: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use regular comments for private implementation rationale.

Both blocks explain internal alias-precedence behavior on private functions; reserve /// for public API contracts.

  • pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs#L1905-L1916: convert the private node_alias rationale to //.
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs#L301-L305: convert the private resolve_jsr_impl rationale to //.

As per coding guidelines, “Use rustdoc comments for public API contracts and regular comments for implementation rationale.”

🤖 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/resolving-deps-resolver/src/resolve_dependency_tree.rs` around
lines 1905 - 1916, Convert the private implementation-rationale comments above
node_alias in pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
lines 1905-1916 from rustdoc comments to regular comments, preserving their
content. Apply the same change to the private resolve_jsr_impl rationale in
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs lines 301-305; no wording
or behavior changes are needed.

Source: Coding guidelines

🤖 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/resolving-deps-resolver/src/resolve_dependency_tree.rs`:
- Around line 1905-1916: Convert the private implementation-rationale comments
above node_alias in
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs lines
1905-1916 from rustdoc comments to regular comments, preserving their content.
Apply the same change to the private resolve_jsr_impl rationale in
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs lines 301-305; no wording
or behavior changes are needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2dc81708-3a45-4f91-9f56-2ec73c5a11a7

📥 Commits

Reviewing files that changed from the base of the PR and between 5ed47dc and 9b44713.

📒 Files selected for processing (7)
  • .changeset/aliased-jsr-dependency-importer.md
  • pnpm/crates/cli/tests/named_registry_install.rs
  • pnpm/crates/cli/tests/update_jsr.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
  • pnpm/crates/resolving-npm-resolver/src/named_registry_resolver.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs
  • pnpm/plans/TEST_PORTING.md

…lper

Trim `node_alias`'s doc comment to the contract and the invariant behind
it: the scenarios it narrated are what the integration tests are for.

Append the named-registry test's `namedRegistries` key through
`append_workspace_yaml_key`, which guards the trailing newline and
asserts the harness has not started writing the key itself.
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 26, 2026
@codecov-commenter

codecov-commenter commented Jul 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.55%. Comparing base (5ed47dc) to head (07e93e3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13407   +/-   ##
=======================================
  Coverage   87.55%   87.55%           
=======================================
  Files         544      544           
  Lines       93464    93467    +3     
=======================================
+ Hits        81832    81838    +6     
+ Misses      11632    11629    -3     

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

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

Copilot AI review requested due to automatic review settings July 26, 2026 22:54

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

Copy link
Copy Markdown
Member Author

Review feedback, addressed in df18605:

Fixed

  • Historical note in TEST_PORTING.md (Qodo) — the entry now describes the current state, with no previously / was fixed phrasing.
  • Fragile YAML append (Qodo) — the named-registry test now sets namedRegistries through _utils::append_workspace_yaml_key, which guards the trailing newline and asserts the harness has not started writing the key itself.
  • Doc comment narrating regression scenarios (Greptile) — node_alias's rustdoc is now just the contract plus the invariant behind the precedence; the scenarios live in the tests.

Not changing

  • Changeset missing a pnpm bump (Qodo, rule 713436) — this is a Rust-only fix, and CLAUDE.md is explicit that pnpm in a changeset means the TypeScript CLI package: "A changeset whose implementation is Rust-only and targets pacquet must omit "pnpm"." Qodo's own relevance note records the same precedent from fix(cli): report what dedupe --check would change, and accept peers check #13395, fix(pacquet): repair licenses command #13347 and fix(cli): accept -g for approve-builds #13329.
  • Convert /// to // on the private node_alias and resolve_jsr_impl (CodeRabbit nitpick) — pnpm/AGENTS.md scopes doc comments to "the item's contract — preconditions, postconditions, edge cases, why the item exists", not to visibility, and both blocks state contracts. Private items are documented with /// throughout this file (resolve_node, resolved_pkg_name, build_workspace_root_deps), so switching these two would leave them inconsistent with their neighbours.

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

…t of rustdoc

`node_alias`'s rustdoc keeps the contract; why the manifest key has to
come first turns on how the lockfile importer is built, which is
implementation rationale rather than part of this helper's contract.
Copilot AI review requested due to automatic review settings July 26, 2026 22:57

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

Copy link
Copy Markdown
Member Author

Follow-up on the remaining documentation point (Greptile, and CodeRabbit's nitpick in its narrower reading), addressed in 07e93e3.

Splitting the two halves is the right call: node_alias's rustdoc keeps the contract — which name the edge installs under and in what order — while why the manifest key has to come first turns on how build_importer assembles the importer, which is implementation rationale about another module rather than part of this helper's contract. That half is now a regular // comment.

To be clear about what I did not change: the /// markers themselves stay, since pnpm/AGENTS.md scopes doc comments to the item's contract rather than to visibility, and private items are documented with /// throughout this file.


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

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

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 07e93e3

@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

Integrated-Benchmark Report (Linux)

Commit: 07e93e3d40fd

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.504 ± 0.134 2.363 2.705 1.70 ± 0.16
pacquet@main 2.503 ± 0.151 2.346 2.775 1.70 ± 0.17
pnpr@HEAD 1.474 ± 0.116 1.344 1.743 1.00
pnpr@main 1.538 ± 0.147 1.353 1.792 1.04 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5040354462,
      "stddev": 0.13421964932177538,
      "median": 2.4601828078,
      "user": 1.5213259000000001,
      "system": 1.24434176,
      "min": 2.3626445557999998,
      "max": 2.7046308388,
      "times": [
        2.3702609178,
        2.3626445557999998,
        2.6271526508,
        2.3681853078,
        2.6866817158,
        2.4829043407999998,
        2.5780885328,
        2.4374612748,
        2.4223443268,
        2.7046308388
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.5025159137000004,
      "stddev": 0.15132114104788938,
      "median": 2.5003082277999997,
      "user": 1.4914241,
      "system": 1.21729326,
      "min": 2.3456923058,
      "max": 2.7747065368,
      "times": [
        2.3456923058,
        2.5512235158,
        2.5301526528,
        2.3551325147999997,
        2.3922218328,
        2.7180435628,
        2.5331893988,
        2.7747065368,
        2.4704638028,
        2.3543330138
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4743194344000001,
      "stddev": 0.11594623643023727,
      "median": 1.4433662448000002,
      "user": 1.0589825999999998,
      "system": 1.0945901599999999,
      "min": 1.3441333828000002,
      "max": 1.7426960648000003,
      "times": [
        1.4515312818000001,
        1.7426960648000003,
        1.3659797208000002,
        1.3441333828000002,
        1.5938740768000002,
        1.4361382688000002,
        1.4903940268,
        1.4465054328000002,
        1.4317150318,
        1.4402270568000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5382239639,
      "stddev": 0.14689774558564192,
      "median": 1.4937882558000002,
      "user": 1.0442105000000002,
      "system": 1.1091646599999998,
      "min": 1.3534908328000002,
      "max": 1.7917637308000003,
      "times": [
        1.6913577588000002,
        1.5300881918000002,
        1.4292865868000002,
        1.4066456608000002,
        1.6107565288,
        1.3534908328000002,
        1.7917637308000003,
        1.4574883198000002,
        1.6796098638,
        1.4317521648
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 252.9 ± 6.0 244.9 263.6 1.00 ± 0.04
pacquet@main 251.9 ± 7.6 243.2 266.3 1.00
pnpr@HEAD 259.7 ± 5.1 253.0 269.1 1.03 ± 0.04
pnpr@main 265.7 ± 5.4 257.3 274.2 1.06 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25293875118000003,
      "stddev": 0.00604033712900464,
      "median": 0.25159731478,
      "user": 0.20856950000000002,
      "system": 0.52322536,
      "min": 0.24486228178000002,
      "max": 0.26356131678,
      "times": [
        0.24486228178000002,
        0.25238157578000003,
        0.25488974078000004,
        0.25027106678000005,
        0.26118089178000004,
        0.25583167778000004,
        0.24615579778000002,
        0.26356131678,
        0.25081305378,
        0.24944010878000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25185639088,
      "stddev": 0.007622506834944654,
      "median": 0.25021625428,
      "user": 0.21279309999999999,
      "system": 0.50977586,
      "min": 0.24317755078000003,
      "max": 0.26628024778000003,
      "times": [
        0.25118716578,
        0.25363990578,
        0.24519729978000002,
        0.24421686078000002,
        0.26167012978000004,
        0.24317755078000003,
        0.26628024778000003,
        0.24809760078000004,
        0.24924534278000002,
        0.25585180478
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.25974515638000006,
      "stddev": 0.005139125407294066,
      "median": 0.25804989378,
      "user": 0.2091923,
      "system": 0.51550876,
      "min": 0.25304847678000003,
      "max": 0.26910284078,
      "times": [
        0.25618711378000003,
        0.25811944978,
        0.26294414878000005,
        0.26910284078,
        0.25437057678,
        0.25798033778,
        0.26504110278000004,
        0.25304847678000003,
        0.25724503878000005,
        0.26341247778000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.26573481868,
      "stddev": 0.005424246859368308,
      "median": 0.26698632128,
      "user": 0.20506610000000003,
      "system": 0.53400966,
      "min": 0.25726878378,
      "max": 0.27416559878,
      "times": [
        0.26677549578000004,
        0.26719714678,
        0.27416559878,
        0.26063200178,
        0.26996276378,
        0.26503157378000003,
        0.26742401178,
        0.27028670278,
        0.25860410778000004,
        0.25726878378
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.754 ± 0.014 2.737 2.776 1.76 ± 0.15
pacquet@main 2.741 ± 0.020 2.694 2.763 1.75 ± 0.15
pnpr@HEAD 1.593 ± 0.132 1.441 1.803 1.02 ± 0.12
pnpr@main 1.566 ± 0.132 1.411 1.805 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.75385941614,
      "stddev": 0.01359351256736787,
      "median": 2.74877350404,
      "user": 1.6805546800000002,
      "system": 1.29449922,
      "min": 2.73681817354,
      "max": 2.77597619554,
      "times": [
        2.7448225065400003,
        2.76521397754,
        2.7681063145400002,
        2.76512614354,
        2.75253668854,
        2.74501031954,
        2.77597619554,
        2.74099270354,
        2.73681817354,
        2.74399113854
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.74131489984,
      "stddev": 0.02017488110789742,
      "median": 2.74899067654,
      "user": 1.67173828,
      "system": 1.2585791199999998,
      "min": 2.69401787854,
      "max": 2.76289264454,
      "times": [
        2.72946645254,
        2.74825649954,
        2.75125577654,
        2.75006318854,
        2.76289264454,
        2.74972485354,
        2.73095437454,
        2.69401787854,
        2.7609511925400003,
        2.73556613754
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5931358078400002,
      "stddev": 0.13150706603878762,
      "median": 1.5835543950400002,
      "user": 1.02416308,
      "system": 1.1091750200000001,
      "min": 1.44125079054,
      "max": 1.8028438525400001,
      "times": [
        1.6440340395400002,
        1.46878271654,
        1.44859881354,
        1.8028438525400001,
        1.7584966035400003,
        1.5230747505400002,
        1.5120069385400001,
        1.67515835354,
        1.65711121954,
        1.44125079054
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5655726464400002,
      "stddev": 0.1317386618567603,
      "median": 1.5422694410400002,
      "user": 1.0128428799999998,
      "system": 1.08594302,
      "min": 1.41126585454,
      "max": 1.8052586705400002,
      "times": [
        1.64814010054,
        1.41126585454,
        1.4238177895400002,
        1.8052586705400002,
        1.6933225655400002,
        1.42932273554,
        1.50516632554,
        1.52766515054,
        1.55687373154,
        1.6548935405400003
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 584.3 ± 7.9 570.9 596.3 2.00 ± 0.06
pacquet@main 578.9 ± 13.0 558.6 600.1 1.98 ± 0.07
pnpr@HEAD 296.1 ± 8.2 289.2 318.0 1.01 ± 0.04
pnpr@main 292.3 ± 7.7 281.4 305.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.58429255974,
      "stddev": 0.007893673259383609,
      "median": 0.5826222964400001,
      "user": 0.7032714999999999,
      "system": 0.6481945199999999,
      "min": 0.5708729374400001,
      "max": 0.5963330654400001,
      "times": [
        0.5873368504400001,
        0.5708729374400001,
        0.5775425374400001,
        0.5809073504400001,
        0.57975954644,
        0.5941480364400001,
        0.5963330654400001,
        0.5811928544400001,
        0.5840517384400001,
        0.5907806804400001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.57891274484,
      "stddev": 0.012958828144822632,
      "median": 0.5813266664400001,
      "user": 0.7005361000000001,
      "system": 0.63989972,
      "min": 0.5585855174400001,
      "max": 0.6001111624400001,
      "times": [
        0.5876743024400001,
        0.5697897354400001,
        0.5755640964400001,
        0.5823908524400001,
        0.5896668204400001,
        0.6001111624400001,
        0.5609904174400001,
        0.5802624804400001,
        0.5840920634400001,
        0.5585855174400001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29614576844000007,
      "stddev": 0.008242910001972992,
      "median": 0.29346395144000004,
      "user": 0.1956991,
      "system": 0.5187245199999999,
      "min": 0.28922245544,
      "max": 0.31799943644,
      "times": [
        0.29737808544,
        0.29819584844,
        0.29240515544,
        0.31799943644,
        0.29355372944,
        0.28986090244,
        0.28922245544,
        0.29337417344,
        0.29268517044000003,
        0.29678272744
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29225151104,
      "stddev": 0.0077210640501733764,
      "median": 0.29075730944,
      "user": 0.19146840000000004,
      "system": 0.50224652,
      "min": 0.28139651544,
      "max": 0.30532513244000004,
      "times": [
        0.29459341144,
        0.28139651544,
        0.28800443144,
        0.29341392844,
        0.28810069044000003,
        0.28425004844,
        0.28762929844,
        0.29862255944,
        0.30532513244000004,
        0.30117909444
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.902 ± 0.011 1.888 1.922 6.35 ± 0.16
pacquet@main 1.887 ± 0.009 1.874 1.902 6.31 ± 0.16
pnpr@HEAD 0.299 ± 0.005 0.291 0.308 1.00 ± 0.03
pnpr@main 0.299 ± 0.008 0.289 0.317 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.9017295754599999,
      "stddev": 0.010931366209557699,
      "median": 1.90222969546,
      "user": 0.9311427999999999,
      "system": 0.7472842199999998,
      "min": 1.88813682396,
      "max": 1.9218678989600002,
      "times": [
        1.9218678989600002,
        1.9088398099600001,
        1.9126890009600002,
        1.8998935779600001,
        1.89557162096,
        1.90456581296,
        1.88872346596,
        1.8923732619600002,
        1.88813682396,
        1.9046344809600002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8872600612600003,
      "stddev": 0.008998155303912002,
      "median": 1.88495055696,
      "user": 0.9228793999999999,
      "system": 0.73591172,
      "min": 1.87354738396,
      "max": 1.90159037196,
      "times": [
        1.90159037196,
        1.87698516596,
        1.89187834796,
        1.88399219496,
        1.88246867696,
        1.89522932996,
        1.88385041796,
        1.88590891896,
        1.89714980396,
        1.87354738396
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29948925716,
      "stddev": 0.005325157573530194,
      "median": 0.29844696396000003,
      "user": 0.19918150000000004,
      "system": 0.5160181199999999,
      "min": 0.29097182896,
      "max": 0.30840471596,
      "times": [
        0.30840471596,
        0.30544107696,
        0.30281485096000005,
        0.29861147696,
        0.30259338696000004,
        0.29776598196000004,
        0.29828245096,
        0.29590396096000005,
        0.29410284096,
        0.29097182896
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29930462986000006,
      "stddev": 0.007535816561260251,
      "median": 0.29777169296000006,
      "user": 0.19838050000000002,
      "system": 0.5171697199999998,
      "min": 0.28938537296,
      "max": 0.31678508396000005,
      "times": [
        0.28938537296,
        0.29370402396,
        0.30102831096000005,
        0.29450233096,
        0.29763250196,
        0.30200565296000004,
        0.29791088396000004,
        0.31678508396000005,
        0.30432423296,
        0.29576790396
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 528.7 ± 29.9 497.3 580.8 6.13 ± 0.37
pacquet@main 361.3 ± 11.0 342.1 382.0 4.19 ± 0.16
pnpr@HEAD 86.2 ± 1.9 81.9 89.4 1.00
pnpr@main 86.5 ± 1.9 81.4 89.0 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5286959116600001,
      "stddev": 0.029871923222568136,
      "median": 0.5191358994599999,
      "user": 0.50344964,
      "system": 0.09480858,
      "min": 0.49730331046000004,
      "max": 0.58077469746,
      "times": [
        0.5425986754600001,
        0.51654475946,
        0.52172703946,
        0.50514706046,
        0.49804033246,
        0.5076753444600001,
        0.54803314746,
        0.5691147494600001,
        0.58077469746,
        0.49730331046000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.36127036015999997,
      "stddev": 0.011001869655465676,
      "median": 0.36247700646000003,
      "user": 0.35701713999999996,
      "system": 0.052381880000000006,
      "min": 0.34214305346,
      "max": 0.38195907246,
      "times": [
        0.36118995746,
        0.36376405546,
        0.35999411446,
        0.38195907246,
        0.35076718846,
        0.36780720746,
        0.36818036846,
        0.34214305346,
        0.36440444546,
        0.35249413846
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08619466830848486,
      "stddev": 0.0019362324423312272,
      "median": 0.08652562946,
      "user": 0.020890136969696972,
      "system": 0.008112618181818182,
      "min": 0.08194042846,
      "max": 0.08940275446000001,
      "times": [
        0.08472858846,
        0.08457184346,
        0.08925022946000001,
        0.08430187746000001,
        0.08815175946,
        0.08940275446000001,
        0.08405416346000001,
        0.08558768946,
        0.08420260246000001,
        0.08598595646000001,
        0.08731508946000001,
        0.08608030246000001,
        0.08654615846000001,
        0.08685654946000002,
        0.08311497246,
        0.08605038846,
        0.08372604746000001,
        0.08755216446000001,
        0.08607379046000001,
        0.08340935446,
        0.08777710546,
        0.08775015646,
        0.08783647646000001,
        0.08742908346000001,
        0.08698173346,
        0.08652562946,
        0.08348520546,
        0.08194042846,
        0.08903885246000001,
        0.08657792746000001,
        0.08908688246,
        0.08642323646000001,
        0.08660905446000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08651485580375,
      "stddev": 0.0019224138878154487,
      "median": 0.08721412496,
      "user": 0.020359627499999994,
      "system": 0.008800793749999999,
      "min": 0.08144291546000001,
      "max": 0.08901381646,
      "times": [
        0.08901381646,
        0.08843650346000001,
        0.08869769246,
        0.08491181146000001,
        0.08631681746000001,
        0.08733830246,
        0.08498789546,
        0.08582163846,
        0.08712116646000001,
        0.08777834746,
        0.08721331846000001,
        0.08789320346000001,
        0.08778590246000001,
        0.08772616946,
        0.08641416046000001,
        0.08485010546,
        0.08635394746000001,
        0.08830390346000001,
        0.08799008646,
        0.08605054746000002,
        0.08849973146000001,
        0.08580562846,
        0.08721493146,
        0.08733709046,
        0.08764809446,
        0.08739899646,
        0.08309639746000001,
        0.08722572146,
        0.08680277946,
        0.08251017746000001,
        0.08144291546000001,
        0.08248758546000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.505 ± 0.095 4.409 4.645 1.28 ± 0.05
pacquet@main 4.499 ± 0.117 4.411 4.786 1.28 ± 0.05
pnpr@HEAD 3.546 ± 0.074 3.453 3.667 1.01 ± 0.04
pnpr@main 3.525 ± 0.109 3.425 3.782 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.5053174385600006,
      "stddev": 0.09492886869740762,
      "median": 4.48414045206,
      "user": 1.65887112,
      "system": 1.35475648,
      "min": 4.40858997556,
      "max": 4.64518163556,
      "times": [
        4.41121198356,
        4.64518163556,
        4.40858997556,
        4.6449473045600005,
        4.50974634356,
        4.4357565685600004,
        4.59158680256,
        4.53446445456,
        4.41315475656,
        4.45853456056
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.49925315336,
      "stddev": 0.11712755977716928,
      "median": 4.445418351060001,
      "user": 1.68733232,
      "system": 1.3047818799999997,
      "min": 4.41069754756,
      "max": 4.78558822656,
      "times": [
        4.41937966156,
        4.486667450560001,
        4.78558822656,
        4.55360561456,
        4.42694948956,
        4.445411898560001,
        4.58976916456,
        4.44542480356,
        4.41069754756,
        4.42903767656
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5459584737600003,
      "stddev": 0.0739119429049228,
      "median": 3.53536229456,
      "user": 1.13324622,
      "system": 1.2326699799999998,
      "min": 3.4534636555600002,
      "max": 3.6666010995600002,
      "times": [
        3.4728704765600003,
        3.4534636555600002,
        3.5109412645600004,
        3.6481715515600004,
        3.6666010995600002,
        3.4708054735600005,
        3.5941016255600005,
        3.52593486656,
        3.54478972256,
        3.5719050015600002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5245948090600003,
      "stddev": 0.108841762262107,
      "median": 3.4874012495600004,
      "user": 1.13155442,
      "system": 1.20985208,
      "min": 3.4249694815600003,
      "max": 3.78194155056,
      "times": [
        3.4382534655600003,
        3.5466382105600003,
        3.4439717305600004,
        3.6211389085600003,
        3.4666259735600002,
        3.78194155056,
        3.54760627056,
        3.4825025965600003,
        3.4249694815600003,
        3.49229990256
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13407
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.fresh-resolve.hot-cache.offlineLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
497.30 ms
(+41.08%)Baseline: 352.51 ms
423.01 ms
(117.56%)

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,736.82 ms
(-0.03%)Baseline: 2,737.68 ms
3,285.22 ms
(83.31%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,888.14 ms
(-0.17%)Baseline: 1,891.35 ms
2,269.62 ms
(83.19%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
570.87 ms
(-0.86%)Baseline: 575.84 ms
691.01 ms
(82.61%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
🚨 view alert (🔔)
497.30 ms
(+41.08%)Baseline: 352.51 ms
423.01 ms
(117.56%)

isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,362.64 ms
(+0.23%)Baseline: 2,357.14 ms
2,828.57 ms
(83.53%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,408.59 ms
(-0.34%)Baseline: 4,423.48 ms
5,308.18 ms
(83.05%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
244.86 ms
(-0.84%)Baseline: 246.94 ms
296.33 ms
(82.63%)
🐰 View full continuous benchmarking report in Bencher

@zkochan

zkochan commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Bencher alert on isolated-linker.fresh-resolve.hot-cache.offline does not reproduce locally.

CI measured 497.30 ms on HEAD against a 352.51 ms baseline (+41.08%, over the 423.01 ms boundary). I re-ran the same scenario on one machine, same harness, prebuilt binaries, 10 runs each:

revision mean σ min max
pacquet@HEAD 333.2 ms ± 9.5 321.1 354.4
pacquet@main 346.3 ms ± 14.2 331.8 374.0

HEAD comes out 1.04 ± 0.05 times faster than main — no regression in the direction the alert claims.

That matches what the diff can do. node_alias clones exactly one String per resolved node either way; the only change is which Option is consulted first. The resulting alias differs from the old one only for an aliased jsr:/named-registry edge, and the benchmark fixture has none, so the resolved graph — and the work to build it — is byte-for-byte what it was.

The shape of the CI numbers points the same way: HEAD's σ was 29.9 ms against main's 11.0 ms in the same run, and the other six scenarios all landed within ±1% of baseline, including fresh-install.hot-cache.hot-store, which resolves the same tree. A real +145 ms in the resolver would have shown up there too and would not have tripled the variance.

I have re-run the benchmark workflow to get a fresh measurement.


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

@zkochan
zkochan merged commit c98aef7 into main Jul 27, 2026
33 of 34 checks passed
@zkochan
zkochan deleted the aliased-jsr-importer branch July 27, 2026 08:45
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 27, 2026
…st name (pnpm#13407)

An aliased `jsr:` or named-registry dependency (`"bar-from-jsr":
"jsr:@pnpm-e2e/[email protected]"`) resolved and installed, but never reached
the lockfile importer. Those resolvers stamp the protocol's own package
name on the result as its alias, and the tree builder let that name win
over the manifest key. `build_importer` only records aliases the
manifest declares, so the edge was dropped and the importer came out
empty.

The TypeScript CLI reads the same resolver output the other way around
(`wantedDependency.alias ?? pkgResponse.body.alias ?? pkg.name`), so
this applies that precedence in the tree builder, shared by the fresh
and the lockfile-reuse node paths. The resolver's alias still names the
edges that carry no manifest key of their own, such as
`pnpm add jsr:@pnpm-e2e/bar`.

The two `jsr with alias` ports lose their `known_failures` gate, and the
named-registry shape gets its own CLI test; its expected lockfile entry
was taken from a TypeScript-CLI run against the same manifest.

TypeScript needs no change: it already records both shapes correctly.

Closes pnpm#13362
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.

pacquet: an aliased jsr: dependency is resolved but never recorded in the lockfile importer

3 participants