Skip to content

feat(resolving-git-resolver)!: treat hosted git specs as identities, not transport choices - #13684

Merged
zkochan merged 5 commits into
mainfrom
refactor/git-identity-resolution
Aug 6, 2026
Merged

zkochan merged 5 commits into
mainfrom
refactor/git-identity-resolution

Conversation

@zkochan

@zkochan zkochan commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Breaking change, Rust CLI (v12 lane) only. Git dependency specs of known hosts (GitHub, GitLab, Bitbucket) are now treated as identities, not transport choices. Every representation of the same repository — github:owner/repo, owner/repo, git+https://…, git+ssh://git@… — resolves through the host's canonical HTTPS URL, and nothing transport-shaped is ever probed for or recorded in the lockfile.

The resolution shape is decided by a single fail-safe check: after ls-remote pins the commit, the resolver issues one anonymous HTTP HEAD of the exact archive URL it would record (with transient-failure retries). Success records the host-archive tarball — fetchable by construction. Anything else records type: git over the canonical HTTPS URL, which is always valid for any machine that can access the repo. A false negative (throttling past retries) therefore costs archive speed on one dependency, never correctness.

Reaching a private hosted repo over SSH becomes per-machine configuration, which git already provides: git config --global url."[email protected]:".insteadOf https://github.com/. pnpm shells out to git for ls-remote and clones, so the rewrite applies everywhere automatically. Unknown-host URLs keep their exact URL (SSH included); credential-embedded URLs are kept verbatim and never resolve to a host archive.

This deletes the resolve-time transport-probing ladder (publicness HEAD heuristic, HTTPS/SSH ls-remote --exit-code reachability probes, SSH fallback) that could freeze one machine's working transport into the lockfile and break every environment configured differently. Ecosystem precedent: Go modules and Cargo record identity only and delegate transport to gitconfig; no other package manager probes the network to choose a transport at resolve time.

Related to #13276 (the v12 resolution of that bug class; #13290 fixes the acute v11 regression within the probing design, which the TypeScript CLI keeps).

Squash Commit Body

Hosted specs (github:/gitlab:/bitbucket: shortcuts and HTTPS/SSH URLs
of those hosts) now all resolve through the host's canonical HTTPS
URL. The lockfile records either the host archive tarball - only when
an anonymous HEAD of the exact archive URL succeeds, so a recorded
archive URL is fetchable by construction - or a git resolution over
the canonical HTTPS URL, which any machine with access to the repo can
fetch. SSH is never inferred: reaching a host over SSH is per-machine
git configuration (url.insteadOf), which pnpm honors by shelling out
to git.

This deletes the resolve-time transport probing (HTTP HEAD publicness
check plus https/ssh ls-remote reachability ladder) that could freeze
one machine's working transport into the lockfile and break every
environment configured differently - the pnpm/pnpm#13276 bug class.
URLs of unknown hosts and URLs with embedded credentials keep their
exact URL and never resolve to a host archive.

parse_bare_specifier becomes fully synchronous and network-free; the
GitProbe seam shrinks to one method (anonymous_head_ok, with
transient-status retries) consumed by pick_resolution. Existing
lockfile entries are untouched - the new rules apply to fresh and
re-resolutions only, and both recorded shapes already exist in the
lockfile format.

Rust-only breaking change for the v12 lane; the TypeScript CLI stays
on the v11 probing behavior (fixed separately in pnpm/pnpm#13290).

Related to pnpm/pnpm#13276.

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. (Deliberately Rust-only: this is a v12 breaking change and the Rust CLI is the v12 version; the TypeScript CLI will not have a v12.)
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed. (pnpm.io docs for v12 git specs / the insteadOf recipe should follow before v12 stable.)

Written by an agent (Claude Code, claude-fable-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

  • New Features

    • Git dependencies from supported hosts now use canonical HTTPS repository identities.
    • Public repositories may resolve through downloadable archives for faster installation.
    • Private repositories continue using Git access configured on the machine.
  • Bug Fixes

    • Improved handling of hosted SSH, SCP-style, unknown-host, and authenticated Git URLs.
    • Failed or unavailable archive checks now fall back to Git access.
    • Added retries for temporary archive-server responses.
    • Authenticated repository URLs are preserved and not treated as public archives.

…not transport choices

Hosted specs (github:/gitlab:/bitbucket: shortcuts and HTTPS/SSH URLs
of those hosts) now all resolve through the host's canonical HTTPS
URL. The lockfile records either the host archive tarball — only when
an anonymous HEAD of the exact archive URL succeeds, so a recorded
archive URL is fetchable by construction — or a git resolution over
the canonical HTTPS URL, which any machine with access to the repo can
fetch. SSH is never inferred: reaching a host over SSH is per-machine
git configuration (url.insteadOf), which pnpm honors by shelling out
to git.

This deletes the resolve-time transport probing (HTTP HEAD publicness
check plus https/ssh ls-remote reachability ladder) that could freeze
one machine's working transport into the lockfile and break every
environment configured differently — the #13276 bug class.
URLs of unknown hosts and URLs with embedded credentials keep their
exact URL and never resolve to a host archive.

Rust-only breaking change for the v12 lane; the TypeScript CLI keeps
the v11 probing behavior.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 6, 2026 14:32

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 Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

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

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: db35cecb-f7c9-44de-8b87-72bcec9006af

📥 Commits

Reviewing files that changed from the base of the PR and between 34c743b and 6103ab5.

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

📝 Walkthrough

Walkthrough

Git dependency parsing now creates canonical HTTPS identities without network probes. GitResolver probes archive URLs during resolution and falls back to Git when needed. RealGitProbe retries transient HTTP failures, and tests cover hosted, SSH, unknown-host, and credentialed URLs.

Changes

Git identity contract

Layer / File(s) Summary
Canonical Git identity contract
.changeset/git-specs-are-identities.md, pnpm/crates/resolving-git-resolver/src/lib.rs, pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs, pnpm/crates/resolving-git-resolver/src/parse_bare_specifier/tests.rs
Hosted specs finalize synchronously to canonical HTTPS URLs. Unknown-host and credentialed URLs retain their required forms. Parser tests validate deterministic normalization.
Archive probe infrastructure
pnpm/crates/resolving-git-resolver/Cargo.toml, pnpm/crates/resolving-git-resolver/src/git_resolver.rs, pnpm/crates/resolving-git-resolver/src/runners.rs, pnpm/crates/resolving-git-resolver/src/runners/tests.rs
GitProbe checks archive URLs asynchronously. RealGitProbe retries transient HTTP responses, and ls_remote_command no longer has probe modes.
Archive-or-Git resolution selection
pnpm/crates/resolving-git-resolver/src/git_resolver.rs, pnpm/crates/resolving-git-resolver/src/git_resolver/tests.rs
GitResolver probes generated archive URLs and selects tarball resolutions on success or Git resolutions on failure. Tests cover archive URLs, SSH normalization, unknown hosts, and authenticated URLs.

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

Sequence Diagram(s)

sequenceDiagram
  participant GitResolver
  participant GitProbe
  participant RealGitProbe
  GitResolver->>GitResolver: Finalize the Git spec
  GitResolver->>GitProbe: Check the generated archive URL
  GitProbe->>RealGitProbe: Send throttled HTTP HEAD requests
  RealGitProbe-->>GitProbe: Return archive availability
  GitProbe-->>GitResolver: Return the probe result
  GitResolver->>GitResolver: Select tarball or Git resolution
Loading

Possibly related PRs

  • pnpm/pnpm#13160: Both changes update Git resolver handling for authenticated HTTPS URLs.
  • pnpm/pnpm#13169: Both changes update Git probing and ls_remote_command.
  • pnpm/pnpm#13290: This change refines related Git probing and HTTPS fallback behavior.

Suggested labels: product: pacquet

Suggested reviewers: copilot, kairosci

✨ 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 refactor/git-identity-resolution

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

Resolve hosted git deps by identity (canonical HTTPS) with archive HEAD gating

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Normalize GitHub/GitLab/Bitbucket specs to a canonical HTTPS identity; never record SSH for them.
• Replace resolve-time transport probing with a single anonymous archive HEAD check to choose
 tarball vs git.
• Add regression tests and docs for private/credentialed/unknown-host behavior and retry semantics.
Diagram

graph TD
  A["User git spec"] --> B["parse_bare_specifier (pure)"] --> C{"Known host?"}
  C -->|"yes"| D["Canonical HTTPS fetchSpec"] --> E["git ls-remote (pin commit)"] --> F{"Archive HEAD 2xx?"}
  F -->|"yes"| G[("Lockfile: Tarball URL")]
  F -->|"no"| H[("Lockfile: Git over HTTPS")]
  C -->|"no"| I["Keep exact URL"] --> E
  subgraph Legend
    direction LR
    _p["Process"] ~~~ _d{"Decision"} ~~~ _s[("Lockfile")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Resolve as canonical identity, decide tarball vs git at fetch time
  • ➕ Lockfile always records a single identity (git+https), avoiding any network checks during resolution
  • ➕ Can opportunistically use archives when available without affecting lockfile reproducibility
  • ➖ Shifts behavior and performance decisions into install/fetch layer, potentially duplicating logic across codepaths
  • ➖ Harder to guarantee 'recorded URL is fetchable by construction' for tarball-shaped entries because you would not record them
2. Record both tarball and git candidates in lockfile
  • ➕ Installers can choose best transport per environment without re-resolving
  • ➕ Avoids false negatives downgrading performance (archive) due to transient throttling
  • ➖ Lockfile format complexity and compatibility concerns
  • ➖ Requires defining precedence and security semantics (e.g., which URL is authoritative)
3. Keep probing ladder but never write chosen transport to lockfile
  • ➕ Preserves prior behavior of selecting a working transport for the current machine
  • ➕ Still avoids 'SSH locked into lockfile' failure mode
  • ➖ Still performs extra network/git probes at resolve time (slower, flakier)
  • ➖ Selection heuristics remain complex and can still be surprising (though less persistent)

Recommendation: The PR’s approach is the best tradeoff for v12: treat hosted specs as identity (canonical HTTPS) and use exactly one fail-safe network check (anonymous HEAD of the exact archive URL) to decide whether a tarball URL is safe to record. This keeps lockfiles transport-agnostic (gitconfig decides SSH vs HTTPS) while preserving fast-path tarballs only when fetchability is proven, minimizing correctness risk to a performance-only downgrade on probe false negatives.

Files changed (10) +360 / -415

Enhancement (3) +128 / -205
git_resolver.rsMove hosted archive decision to resolver via single anonymous HEAD probe +51/-22

Move hosted archive decision to resolver via single anonymous HEAD probe

• Introduces a new 'GitProbe' trait focused solely on anonymous HTTP HEAD checks (with boxed future type moved here). Updates resolution to always pin via canonical fetch spec and then choose Tarball vs Git based on probing the exact archive URL; removes SSH detection and transport-based branching.

pnpm/crates/resolving-git-resolver/src/git_resolver.rs

parse_bare_specifier.rsMake parsing pure and normalize known-host URLs to canonical HTTPS +45/-119

Make parsing pure and normalize known-host URLs to canonical HTTPS

• Removes async probing and transport selection from parsing. Hosted inputs (including SSH forms) now finalize to canonical HTTPS fetch specs; URLs with embedded credentials are kept verbatim and marked ineligible for hosted-archive resolution; unknown hosts pass through unchanged.

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs

runners.rsImplement production archive HEAD probe with retries; simplify ls-remote command builder +32/-64

Implement production archive HEAD probe with retries; simplify ls-remote command builder

• Updates 'RealGitProbe' to only perform an anonymous HEAD with transient-failure retries and backoff. Removes the 'ls-remote --exit-code' probing mode and simplifies 'ls_remote_command' to a single resolve-oriented shape while retaining safe argument separation and 'GIT_TERMINAL_PROMPT=0'.

pnpm/crates/resolving-git-resolver/src/runners.rs

Tests (3) +196 / -196
tests.rsRewrite git resolver tests around archive-probe rule and HTTPS identity +109/-126

Rewrite git resolver tests around archive-probe rule and HTTPS identity

• Replaces prior transport reachability probing tests with assertions that (1) hosted SSH inputs normalize to the same HTTPS identity, (2) archive probe failure yields git+https (never SSH), (3) unknown hosts remain verbatim and skip archive probing, and (4) credentialed URLs stay git-only and are never probed for archives.

pnpm/crates/resolving-git-resolver/src/git_resolver/tests.rs

tests.rsUpdate parser tests for pure finalize() and canonical HTTPS normalization +46/-57

Update parser tests for pure finalize() and canonical HTTPS normalization

• Converts async tests to sync tests, removes probe fakes, and adds coverage for SSH/scp-style hosted inputs normalizing to HTTPS identity plus credentialed hosted URLs being preserved and excluded from archive eligibility.

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier/tests.rs

tests.rsAdd mockito tests for HEAD retry behavior and adjust ls-remote arg tests +41/-13

Add mockito tests for HEAD retry behavior and adjust ls-remote arg tests

• Drops the old probe-mode argument test and updates existing command-line safety assertions to match the new 'ls_remote_command' signature. Adds async tests using 'mockito' to validate retry counts for success, definitive failures, and transient throttling responses.

pnpm/crates/resolving-git-resolver/src/runners/tests.rs

Documentation (2) +34 / -14
git-specs-are-identities.mdDocument breaking change: hosted git specs become transport-agnostic identities +15/-0

Document breaking change: hosted git specs become transport-agnostic identities

• Adds a changeset describing the new resolution semantics for GitHub/GitLab/Bitbucket specs. Documents canonical-HTTPS normalization, archive-vs-git fallback, and the recommended 'url.<base>.insteadOf' gitconfig approach for SSH access.

.changeset/git-specs-are-identities.md

lib.rsUpdate crate docs/exports to reflect identity-based hosted parsing and new GitProbe +19/-14

Update crate docs/exports to reflect identity-based hosted parsing and new GitProbe

• Updates module documentation to state that hosted specs are identities and parsing is pure. Re-exports 'GitProbe'/'ProbeFuture' from 'git_resolver' instead of 'parse_bare_specifier' to match the new responsibility split.

pnpm/crates/resolving-git-resolver/src/lib.rs

Other (2) +2 / -0
Cargo.lockAdd mockito to lockfile for resolver tests +1/-0

Add mockito to lockfile for resolver tests

• Updates the workspace lockfile to include the 'mockito' crate used by new HTTP HEAD probe tests.

Cargo.lock

Cargo.tomlAdd mockito dev-dependency for HTTP probe testing +1/-0

Add mockito dev-dependency for HTTP probe testing

• Introduces 'mockito' under dev-dependencies to enable deterministic tests for the anonymous HEAD retry behavior.

pnpm/crates/resolving-git-resolver/Cargo.toml

@greptile-apps

greptile-apps Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (5): Last reviewed commit: "fix(resolving-git-resolver): bound each ..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.2±0.05ms    30.7 MB/sec    1.00     12.1±0.04ms    30.8 MB/sec
packument/parse                                  1.00     37.8±0.19µs  1755.6 MB/sec    1.00     37.8±0.34µs  1753.1 MB/sec
tarball/download_dependency                      1.07      2.3±0.08ms  1857.7 KB/sec    1.00      2.2±0.07ms  1982.3 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    178.1±1.52ms 89.8 KElem/sec    1.00    178.8±0.87ms 89.5 KElem/sec
workspace_resolution/hoist_heavy                 1.00    242.6±1.10ms        ? ?/sec    1.05    255.3±0.66ms        ? ?/sec

@qodo-code-review

qodo-code-review Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. HEAD probe can block minutes ✓ Resolved 🐞 Bug ➹ Performance
Description
RealGitProbe::anonymous_head_ok performs up to 3 sequential HTTP HEAD attempts using the
install-wide reqwest timeout, so an unreachable/blackholed host archive endpoint can stall
resolution for ~3×fetchTimeout (default 60s) per hosted git dependency before falling back to git.
Code

pnpm/crates/resolving-git-resolver/src/runners.rs[R36-41]

+                // Scoped so the throttle permit is released before any
+                // backoff sleep.
+                let status = {
+                    let guard = self.http_client.acquire_for_url(url).await;
+                    guard.head(url).send().await.map(|response| response.status()).ok()
+                };
Relevance

●● Moderate

Perf concern is plausible but fix needs timeout policy change; no close precedent for network-probe
timeout caps.

PR-#13594
PR-#13600

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new HEAD probe explicitly loops 3 times and awaits head(url).send() each time, so request
latency accumulates. The HTTP client used by the probe is the shared ThrottledClient, whose
default network setting is a 60s fetch_timeout, and that timeout is applied to all requests via
reqwest’s .timeout(...) and .connect_timeout(...), meaning each HEAD attempt can consume up to a
full timeout period under blackhole/slow-network conditions.

pnpm/crates/resolving-git-resolver/src/runners.rs[31-55]
pnpm/crates/network/src/lib.rs[72-103]
pnpm/crates/network/src/lib.rs[658-675]

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

### Issue description
`RealGitProbe::anonymous_head_ok` retries a HEAD request up to 3 times, but it does not apply a probe-specific timeout/deadline. Because the underlying `ThrottledClient` uses the global `fetchTimeout` as the request timeout, a slow/blackholed endpoint can delay resolution for multiple full timeout periods.

### Issue Context
This HEAD probe runs on the resolution hot path for hosted git dependencies, before deciding whether to record a tarball URL or fall back to `type: git`.

### Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/runners.rs[32-55]

### Suggested fix
- Apply a dedicated, shorter deadline to the HEAD probe request (e.g. `guard.head(url).timeout(PROBE_TIMEOUT)` or wrapping the `.send()` in `tokio::time::timeout`).
- Keep current retry semantics, but ensure the *total* wall-clock time is bounded (either per-attempt or overall).
- Add a small unit test (or extend existing mockito tests) to assert the timeout path does not exceed the expected bound (can use tokio time pausing if available).

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


2. HEAD probe skips URL routing ✓ Resolved 🐞 Bug ➹ Performance
Description
RealGitProbe::anonymous_head_ok uses ThrottledClient::acquire() (not acquire_for_url*), so the
new archive HEAD probe bypasses per-origin maxSockets and per-URL client routing (incl. TLS
overrides), potentially over-connecting to a single host and behaving inconsistently with other
network requests.
Code

pnpm/crates/resolving-git-resolver/src/runners.rs[R36-38]

+                let guard = self.http_client.acquire().await;
+                let response = guard.head(url).send().await;
+                drop(guard);
Relevance

●● Moderate

Bypassing acquire_for_url could matter, but no close precedent that reviewers require URL-routed
acquire for HEAD probes.

PR-#12934
PR-#13597

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new probe uses ThrottledClient::acquire() for the HEAD request, but ThrottledClient only
applies per-origin socket limits and per-URL routing when callers use acquire_for_url*; bypassing
that can defeat maxSockets and URL-specific client configuration for these new requests.

pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
pnpm/crates/network/src/lib.rs[507-538]

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

## Issue description
`RealGitProbe::anonymous_head_ok` currently calls `self.http_client.acquire()` which does not apply per-origin socket caps (`maxSockets`) or URL-aware client routing (per-registry/per-host TLS overrides). This can increase connection fan-out to a git host during resolution and make the probe fail in environments relying on URL-specific TLS settings.

## Issue Context
The new behavior introduces a per-hosted-dependency archive HEAD probe; making those requests respect the same throttling/routing rules as other outbound HTTP requests is important for performance and reliability.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
- pnpm/crates/network/src/lib.rs[507-538]

## Suggested changes
- Replace `self.http_client.acquire().await` with `self.http_client.acquire_for_url(url).await` (or `acquire_for_url_with_priority(url, UNPRIORITIZED)` if you want to be explicit about priority).
- Keep the guard alive at least until the `Response` is dropped (avoid an explicit `drop(guard)` right after `send()` unless you wrap request+status handling in a scope that ensures the response is fully released first).

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



Remediation recommended

3. Credential persistence under-documented 🐞 Bug ⛨ Security
Description
The new comment frames URL-embedded credentials as ordinary "user content" without warning that the
credentialed URL is propagated into normalized_bare_specifier, which is later written back into
manifests during add/update. This can cause accidental secret leakage into package.json (and
potentially logs/metadata) when users embed tokens in git URLs.
Code

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[R205-207]

+    // URL-embedded credentials are explicit user content, not
+    // transport — and the host's archive endpoint would not carry
+    // them, so the spec stays archive-ineligible.
Relevance

●●● Strong

Team has recent accepted security fixes preventing credential leakage in outputs;
warning/clarification likely welcomed.

PR-#13230
PR-#13371
PR-#13439

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed comment sits immediately above logic that preserves credentialed URLs and injects them
into normalized_bare_specifier. Downstream, normalized_bare_specifier is documented and used as
the value written back into manifests by add/update, so an embedded token can be persisted to
package.json unless users know to avoid credential-in-URL patterns.

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-218]
pnpm/crates/resolving-git-resolver/src/lib.rs[1-16]
pnpm/crates/resolving-resolver-base/src/resolve.rs[441-444]
pnpm/crates/package-manager/src/update_project_manifest.rs[118-134]
REVIEW_GUIDE.md[30-58]

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 new comment/documentation update describes URL-embedded credentials as “explicit user content” but does not warn that these credentialed URLs are propagated into `normalized_bare_specifier`, which downstream code uses to update/write dependency specifiers into `package.json`. This creates a realistic risk of users accidentally committing tokens.

## Issue Context
- `from_hosted_git()` preserves a credentialed HTTPS URL and formats it into `normalized_bare_specifier`.
- `ResolveResult.normalized_bare_specifier` is explicitly used to update the manifest specifier when `add`/`update` runs.
- The repo’s review guide flags token leakage as a priority concern.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[205-207]
- pnpm/crates/resolving-git-resolver/src/lib.rs[8-9]

## Proposed fix
- Update the comment (and the adjacent rustdoc in `lib.rs`) to explicitly state that credential-bearing URLs are preserved verbatim *and may be persisted back into manifests via `normalized_bare_specifier`*, so users should prefer git credential helpers / `url.<base>.insteadOf` rewrites instead of embedding secrets.
- Keep the current behavior (do not strip credentials here), but make the sensitivity clear in docs/comments so future maintainers don’t add logging/serialization assuming it’s safe to print.

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


4. pnpm missing; bump wrong ✓ Resolved 📘 Rule violation § Compliance
Description
The new changeset declares only "pacquet": minor even though it describes a breaking change, and
it omits the required pnpm entry. This can produce incorrect release versioning and incomplete
release notes.
Code

.changeset/git-specs-are-identities.md[R1-5]

+---
+"pacquet": minor
+---
+
+**Breaking change.** Git dependencies on known hosts (GitHub, GitLab, Bitbucket) are now treated as identities rather than transport choices. Every representation of the same repository — `github:owner/repo`, `owner/repo`, `git+https://…`, `git+ssh://git@…` — resolves through the host's canonical HTTPS URL, and the lockfile never records an SSH URL for them. Repositories whose archive endpoint is anonymously reachable resolve to the host's archive (fast tarball download); all others resolve to a `git` clone of the canonical HTTPS URL, which every machine with access to the repository can fetch.
Relevance

●● Moderate

Mixed precedent: pnpm entry sometimes required, often rejected for Rust-only pacquet changes; bump
type likely adjusted.

PR-#13403
PR-#13545
PR-#13117

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changesets to include pnpm and to use the correct bump type. The
added changeset lists only pacquet: minor while the body states **Breaking change.**,
demonstrating both the missing pnpm entry and the incorrect bump type.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/git-specs-are-identities.md[1-5]

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

## Issue description
The changeset is missing a `pnpm` entry and uses `minor` despite documenting a breaking change.

## Issue Context
Compliance requires explicitly listing `pnpm` in changesets and using the correct bump type (`major` for breaking changes).

## Fix Focus Areas
- .changeset/git-specs-are-identities.md[1-5]

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


5. Custom HEAD retry loop 📘 Rule violation ⚙ Maintainability
Description
RealGitProbe::anonymous_head_ok implements bespoke HTTP retry/backoff logic even though the repo
already has a shared retry policy module. This duplication risks diverging retry semantics and makes
future fixes harder to apply consistently.
Code

pnpm/crates/resolving-git-resolver/src/runners.rs[R34-37]

+            let mut delay = Duration::from_millis(500);
+            for attempt in 0..3 {
+                let guard = self.http_client.acquire().await;
+                let response = guard.head(url).send().await;
Relevance

●● Moderate

Reuse of shared retry module is reasonable, but team sometimes rejects refactor/duplication
complaints without strong need.

PR-#13593
PR-#12833

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713439 requires avoiding duplicate implementations when a shared module already
provides the same functionality. The PR adds a hand-rolled retry loop in anonymous_head_ok, while
pacquet_network::retry already documents and implements a shared retry algorithm (RetryOpts,
send_with_retry) intended for reuse.

Rule 713439: Avoid reimplementing existing functionality; extract and reuse shared modules
pnpm/crates/resolving-git-resolver/src/runners.rs[32-55]
pnpm/crates/network/src/retry.rs[1-15]
pnpm/crates/network/src/retry.rs[95-174]

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 custom retry loop was added for the archive HEAD probe, duplicating existing shared retry/backoff functionality.

## Issue Context
The repo already centralizes retry policy in `pnpm/crates/network/src/retry.rs` for consistent behavior across network clients.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/runners.rs[32-55]
- pnpm/crates/network/src/retry.rs[1-15]
- pnpm/crates/network/src/retry.rs[95-174]

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


View more (2)
6. Pacquet git identity diverges 📘 Rule violation ≡ Correctness
Description
Pacquet now canonicalizes known-host git inputs to HTTPS identity and never records SSH for those
hosts, which differs from pnpm TypeScript behavior that probes and may select SSH. This violates the
requirement that Pacquet not introduce new user-visible behavior beyond pnpm for the same inputs.
Code

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[R199-205]

+/// Finalise a hosted spec to its canonical HTTPS URL. See the module
+/// doc for why no other representation (notably SSH) is ever derived
+/// here.
+fn from_hosted_git(hosted: HostedGit) -> HostedPackageSpec {
+    let params = parse_git_params(hosted.committish.as_deref());
+    let https_url = hosted.https(HostedGit::no_committish_no_git_plus());
+    // URL-embedded credentials are explicit user content, not
Relevance

●● Moderate

Parity is valued, but PR explicitly introduces Rust-only breaking behavior; unclear if team will
treat as violation.

PR-#13117
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713429 prohibits Pacquet from adding user-visible behavior that pnpm does not have.
The Rust implementation finalizes hosted specs to canonical HTTPS (and removes SSH selection), while
pnpm TypeScript’s fromHostedGit explicitly probes HTTPS then falls back to SSH, so the same user
input can resolve to different lockfile URLs and semantics across implementations.

Rule 713429: Pacquet must not introduce new user-visible behavior beyond pnpm
pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-226]
pnpm11/resolving/git-resolver/src/parseBareSpecifier.ts[71-121]

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

## Issue description
Pacquet’s hosted-git resolution semantics now differ from pnpm TypeScript: pacquet forces canonical HTTPS identity for known hosts, while pnpm TS may choose SSH based on probing.

## Issue Context
Compliance requires pacquet to avoid introducing user-visible behavior that is not present in pnpm for the corresponding version/inputs.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-226]
- pnpm11/resolving/git-resolver/src/parseBareSpecifier.ts[71-121]

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


7. Archive probe adds latency 🐞 Bug ➹ Performance
Description
pick_resolution now awaits an HTTP HEAD for every archive-eligible hosted spec before choosing
tarball vs git, adding an extra network round-trip on the resolution hot path; transient failures
(429/5xx/network errors) can add ~1.5s of backoff delay per affected probe due to retries.
Code

pnpm/crates/resolving-git-resolver/src/git_resolver.rs[R296-298]

+        if let Some(tarball) = hosted.tarball(HostedOpts::default())
+            && probe.anonymous_head_ok(&tarball).await
+        {
Relevance

●● Moderate

Latency concern plausible but seems intentional/within PR design; no close acceptance/rejection
precedent found.

PR-#13545
PR-#13439

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR changes resolution selection to call anonymous_head_ok for hosted specs with a tarball URL.
The production probe retries transient failures with two sleeps (500ms then 1s), which can
materially increase resolution latency under throttling. Credentialed hosted URLs explicitly set
hosted: None, so the probe applies only to archive-eligible hosted specs.

pnpm/crates/resolving-git-resolver/src/git_resolver.rs[286-305]
pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-229]

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

## Issue description
Resolution now performs an archive HEAD probe for each hosted dependency eligible for a host archive. This adds a per-dependency network RTT on the resolution hot path; when the host returns transient statuses (e.g. 429) the built-in backoff adds additional latency.

## Issue Context
The behavior is correct-by-construction (probe gates recording the tarball URL), but can regress performance in repos with many hosted git deps or under host throttling.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/git_resolver.rs[286-305]
- pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
- pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-229]

## Suggested changes
- Add a lightweight in-memory cache in `RealGitProbe` keyed by the archive URL (or `(host, repo, commit)`), so repeated resolutions in the same run don’t re-HEAD the same URL.
- Consider coalescing concurrent probes for the same URL (single-flight) to avoid thundering-herd retries when many deps point at the same repo/commit.
- Keep existing fail-safe semantics (probe failure => git HTTPS resolution).

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



Informational

8. Probe failures lack diagnostics 🐞 Bug ◔ Observability ⭐ New
Description
anonymous_head_ok converts any request error into None and ultimately returns false without
emitting any trace/debug information. This makes it difficult to distinguish “repo has no anonymous
archive” from systemic network/proxy/TLS failures that force slow git fallbacks.
Code

pnpm/crates/resolving-git-resolver/src/runners.rs[R50-53]

+                        .send()
+                        .await
+                        .map(|response| response.status())
+                        .ok()
Relevance

●●● Strong

Repo tends to avoid .ok() swallowing request errors; prefers surfacing diagnostics for
troubleshooting.

PR-#13404
PR-#13202

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The probe explicitly drops all request errors by mapping the result to Option<StatusCode> and
never records the error/status anywhere, so operators can’t tell why the archive optimization was
skipped.

pnpm/crates/resolving-git-resolver/src/runners.rs[45-70]

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

## Issue description
The archive probe swallows network errors (`.ok()`) and returns a fail-safe `false` without logging why the probe failed. This reduces debuggability when users unexpectedly get `type: git` resolutions because the archive probe consistently fails due to corporate proxy/TLS/firewall issues.

## Issue Context
The probe is intentionally fail-safe for correctness, so logs should be low-noise (e.g., `trace!` per-attempt and/or a single `debug!` when retries are exhausted due to request errors).

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/runners.rs[47-53]

## Suggested fix
- Capture the error (instead of discarding it via `.ok()`) and log:
 - URL host (or full URL if safe),
 - attempt number,
 - final status code or error kind,
 - whether it was treated as transient.
- Consider logging only on “retries exhausted” for error cases to avoid noise for expected 404/private cases.

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

Previous review results

Review updated until commit 6103ab5

Results up to commit 7401882 ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. HEAD probe skips URL routing ✓ Resolved 🐞 Bug ➹ Performance
Description
RealGitProbe::anonymous_head_ok uses ThrottledClient::acquire() (not acquire_for_url*), so the
new archive HEAD probe bypasses per-origin maxSockets and per-URL client routing (incl. TLS
overrides), potentially over-connecting to a single host and behaving inconsistently with other
network requests.
Code

pnpm/crates/resolving-git-resolver/src/runners.rs[R36-38]

+                let guard = self.http_client.acquire().await;
+                let response = guard.head(url).send().await;
+                drop(guard);
Relevance

●● Moderate

Bypassing acquire_for_url could matter, but no close precedent that reviewers require URL-routed
acquire for HEAD probes.

PR-#12934
PR-#13597

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new probe uses ThrottledClient::acquire() for the HEAD request, but ThrottledClient only
applies per-origin socket limits and per-URL routing when callers use acquire_for_url*; bypassing
that can defeat maxSockets and URL-specific client configuration for these new requests.

pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
pnpm/crates/network/src/lib.rs[507-538]

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

## Issue description
`RealGitProbe::anonymous_head_ok` currently calls `self.http_client.acquire()` which does not apply per-origin socket caps (`maxSockets`) or URL-aware client routing (per-registry/per-host TLS overrides). This can increase connection fan-out to a git host during resolution and make the probe fail in environments relying on URL-specific TLS settings.

## Issue Context
The new behavior introduces a per-hosted-dependency archive HEAD probe; making those requests respect the same throttling/routing rules as other outbound HTTP requests is important for performance and reliability.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
- pnpm/crates/network/src/lib.rs[507-538]

## Suggested changes
- Replace `self.http_client.acquire().await` with `self.http_client.acquire_for_url(url).await` (or `acquire_for_url_with_priority(url, UNPRIORITIZED)` if you want to be explicit about priority).
- Keep the guard alive at least until the `Response` is dropped (avoid an explicit `drop(guard)` right after `send()` unless you wrap request+status handling in a scope that ensures the response is fully released first).

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



Remediation recommended
2. pnpm missing; bump wrong ✓ Resolved 📘 Rule violation § Compliance
Description
The new changeset declares only "pacquet": minor even though it describes a breaking change, and
it omits the required pnpm entry. This can produce incorrect release versioning and incomplete
release notes.
Code

.changeset/git-specs-are-identities.md[R1-5]

+---
+"pacquet": minor
+---
+
+**Breaking change.** Git dependencies on known hosts (GitHub, GitLab, Bitbucket) are now treated as identities rather than transport choices. Every representation of the same repository — `github:owner/repo`, `owner/repo`, `git+https://…`, `git+ssh://git@…` — resolves through the host's canonical HTTPS URL, and the lockfile never records an SSH URL for them. Repositories whose archive endpoint is anonymously reachable resolve to the host's archive (fast tarball download); all others resolve to a `git` clone of the canonical HTTPS URL, which every machine with access to the repository can fetch.
Relevance

●● Moderate

Mixed precedent: pnpm entry sometimes required, often rejected for Rust-only pacquet changes; bump
type likely adjusted.

PR-#13403
PR-#13545
PR-#13117

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changesets to include pnpm and to use the correct bump type. The
added changeset lists only pacquet: minor while the body states **Breaking change.**,
demonstrating both the missing pnpm entry and the incorrect bump type.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/git-specs-are-identities.md[1-5]

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

## Issue description
The changeset is missing a `pnpm` entry and uses `minor` despite documenting a breaking change.

## Issue Context
Compliance requires explicitly listing `pnpm` in changesets and using the correct bump type (`major` for breaking changes).

## Fix Focus Areas
- .changeset/git-specs-are-identities.md[1-5]

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


3. Custom HEAD retry loop 📘 Rule violation ⚙ Maintainability
Description
RealGitProbe::anonymous_head_ok implements bespoke HTTP retry/backoff logic even though the repo
already has a shared retry policy module. This duplication risks diverging retry semantics and makes
future fixes harder to apply consistently.
Code

pnpm/crates/resolving-git-resolver/src/runners.rs[R34-37]

+            let mut delay = Duration::from_millis(500);
+            for attempt in 0..3 {
+                let guard = self.http_client.acquire().await;
+                let response = guard.head(url).send().await;
Relevance

●● Moderate

Reuse of shared retry module is reasonable, but team sometimes rejects refactor/duplication
complaints without strong need.

PR-#13593
PR-#12833

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713439 requires avoiding duplicate implementations when a shared module already
provides the same functionality. The PR adds a hand-rolled retry loop in anonymous_head_ok, while
pacquet_network::retry already documents and implements a shared retry algorithm (RetryOpts,
send_with_retry) intended for reuse.

Rule 713439: Avoid reimplementing existing functionality; extract and reuse shared modules
pnpm/crates/resolving-git-resolver/src/runners.rs[32-55]
pnpm/crates/network/src/retry.rs[1-15]
pnpm/crates/network/src/retry.rs[95-174]

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 custom retry loop was added for the archive HEAD probe, duplicating existing shared retry/backoff functionality.

## Issue Context
The repo already centralizes retry policy in `pnpm/crates/network/src/retry.rs` for consistent behavior across network clients.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/runners.rs[32-55]
- pnpm/crates/network/src/retry.rs[1-15]
- pnpm/crates/network/src/retry.rs[95-174]

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


4. Pacquet git identity diverges 📘 Rule violation ≡ Correctness
Description
Pacquet now canonicalizes known-host git inputs to HTTPS identity and never records SSH for those
hosts, which differs from pnpm TypeScript behavior that probes and may select SSH. This violates the
requirement that Pacquet not introduce new user-visible behavior beyond pnpm for the same inputs.
Code

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[R199-205]

+/// Finalise a hosted spec to its canonical HTTPS URL. See the module
+/// doc for why no other representation (notably SSH) is ever derived
+/// here.
+fn from_hosted_git(hosted: HostedGit) -> HostedPackageSpec {
+    let params = parse_git_params(hosted.committish.as_deref());
+    let https_url = hosted.https(HostedGit::no_committish_no_git_plus());
+    // URL-embedded credentials are explicit user content, not
Relevance

●● Moderate

Parity is valued, but PR explicitly introduces Rust-only breaking behavior; unclear if team will
treat as violation.

PR-#13117
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713429 prohibits Pacquet from adding user-visible behavior that pnpm does not have.
The Rust implementation finalizes hosted specs to canonical HTTPS (and removes SSH selection), while
pnpm TypeScript’s fromHostedGit explicitly probes HTTPS then falls back to SSH, so the same user
input can resolve to different lockfile URLs and semantics across implementations.

Rule 713429: Pacquet must not introduce new user-visible behavior beyond pnpm
pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-226]
pnpm11/resolving/git-resolver/src/parseBareSpecifier.ts[71-121]

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

## Issue description
Pacquet’s hosted-git resolution semantics now differ from pnpm TypeScript: pacquet forces canonical HTTPS identity for known hosts, while pnpm TS may choose SSH based on probing.

## Issue Context
Compliance requires pacquet to avoid introducing user-visible behavior that is not present in pnpm for the corresponding version/inputs.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-226]
- pnpm11/resolving/git-resolver/src/parseBareSpecifier.ts[71-121]

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


View more (1)
5. Archive probe adds latency 🐞 Bug ➹ Performance
Description
pick_resolution now awaits an HTTP HEAD for every archive-eligible hosted spec before choosing
tarball vs git, adding an extra network round-trip on the resolution hot path; transient failures
(429/5xx/network errors) can add ~1.5s of backoff delay per affected probe due to retries.
Code

pnpm/crates/resolving-git-resolver/src/git_resolver.rs[R296-298]

+        if let Some(tarball) = hosted.tarball(HostedOpts::default())
+            && probe.anonymous_head_ok(&tarball).await
+        {
Relevance

●● Moderate

Latency concern plausible but seems intentional/within PR design; no close acceptance/rejection
precedent found.

PR-#13545
PR-#13439

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR changes resolution selection to call anonymous_head_ok for hosted specs with a tarball URL.
The production probe retries transient failures with two sleeps (500ms then 1s), which can
materially increase resolution latency under throttling. Credentialed hosted URLs explicitly set
hosted: None, so the probe applies only to archive-eligible hosted specs.

pnpm/crates/resolving-git-resolver/src/git_resolver.rs[286-305]
pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-229]

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

## Issue description
Resolution now performs an archive HEAD probe for each hosted dependency eligible for a host archive. This adds a per-dependency network RTT on the resolution hot path; when the host returns transient statuses (e.g. 429) the built-in backoff adds additional latency.

## Issue Context
The behavior is correct-by-construction (probe gates recording the tarball URL), but can regress performance in repos with many hosted git deps or under host throttling.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/git_resolver.rs[286-305]
- pnpm/crates/resolving-git-resolver/src/runners.rs[31-56]
- pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-229]

## Suggested changes
- Add a lightweight in-memory cache in `RealGitProbe` keyed by the archive URL (or `(host, repo, commit)`), so repeated resolutions in the same run don’t re-HEAD the same URL.
- Consider coalescing concurrent probes for the same URL (single-flight) to avoid thundering-herd retries when many deps point at the same repo/commit.
- Keep existing fail-safe semantics (probe failure => git HTTPS resolution).

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


Results up to commit 6bb25fe ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. HEAD probe can block minutes ✓ Resolved 🐞 Bug ➹ Performance
Description
RealGitProbe::anonymous_head_ok performs up to 3 sequential HTTP HEAD attempts using the
install-wide reqwest timeout, so an unreachable/blackholed host archive endpoint can stall
resolution for ~3×fetchTimeout (default 60s) per hosted git dependency before falling back to git.
Code

pnpm/crates/resolving-git-resolver/src/runners.rs[R36-41]

+                // Scoped so the throttle permit is released before any
+                // backoff sleep.
+                let status = {
+                    let guard = self.http_client.acquire_for_url(url).await;
+                    guard.head(url).send().await.map(|response| response.status()).ok()
+                };
Relevance

●● Moderate

Perf concern is plausible but fix needs timeout policy change; no close precedent for network-probe
timeout caps.

PR-#13594
PR-#13600

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new HEAD probe explicitly loops 3 times and awaits head(url).send() each time, so request
latency accumulates. The HTTP client used by the probe is the shared ThrottledClient, whose
default network setting is a 60s fetch_timeout, and that timeout is applied to all requests via
reqwest’s .timeout(...) and .connect_timeout(...), meaning each HEAD attempt can consume up to a
full timeout period under blackhole/slow-network conditions.

pnpm/crates/resolving-git-resolver/src/runners.rs[31-55]
pnpm/crates/network/src/lib.rs[72-103]
pnpm/crates/network/src/lib.rs[658-675]

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

### Issue description
`RealGitProbe::anonymous_head_ok` retries a HEAD request up to 3 times, but it does not apply a probe-specific timeout/deadline. Because the underlying `ThrottledClient` uses the global `fetchTimeout` as the request timeout, a slow/blackholed endpoint can delay resolution for multiple full timeout periods.

### Issue Context
This HEAD probe runs on the resolution hot path for hosted git dependencies, before deciding whether to record a tarball URL or fall back to `type: git`.

### Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/runners.rs[32-55]

### Suggested fix
- Apply a dedicated, shorter deadline to the HEAD probe request (e.g. `guard.head(url).timeout(PROBE_TIMEOUT)` or wrapping the `.send()` in `tokio::time::timeout`).
- Keep current retry semantics, but ensure the *total* wall-clock time is bounded (either per-attempt or overall).
- Add a small unit test (or extend existing mockito tests) to assert the timeout path does not exceed the expected bound (can use tokio time pausing if available).

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


Results up to commit 34c743b ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Credential persistence under-documented 🐞 Bug ⛨ Security
Description
The new comment frames URL-embedded credentials as ordinary "user content" without warning that the
credentialed URL is propagated into normalized_bare_specifier, which is later written back into
manifests during add/update. This can cause accidental secret leakage into package.json (and
potentially logs/metadata) when users embed tokens in git URLs.
Code

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[R205-207]

+    // URL-embedded credentials are explicit user content, not
+    // transport — and the host's archive endpoint would not carry
+    // them, so the spec stays archive-ineligible.
Relevance

●●● Strong

Team has recent accepted security fixes preventing credential leakage in outputs;
warning/clarification likely welcomed.

PR-#13230
PR-#13371
PR-#13439

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed comment sits immediately above logic that preserves credentialed URLs and injects them
into normalized_bare_specifier. Downstream, normalized_bare_specifier is documented and used as
the value written back into manifests by add/update, so an embedded token can be persisted to
package.json unless users know to avoid credential-in-URL patterns.

pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[199-218]
pnpm/crates/resolving-git-resolver/src/lib.rs[1-16]
pnpm/crates/resolving-resolver-base/src/resolve.rs[441-444]
pnpm/crates/package-manager/src/update_project_manifest.rs[118-134]
REVIEW_GUIDE.md[30-58]

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 new comment/documentation update describes URL-embedded credentials as “explicit user content” but does not warn that these credentialed URLs are propagated into `normalized_bare_specifier`, which downstream code uses to update/write dependency specifiers into `package.json`. This creates a realistic risk of users accidentally committing tokens.

## Issue Context
- `from_hosted_git()` preserves a credentialed HTTPS URL and formats it into `normalized_bare_specifier`.
- `ResolveResult.normalized_bare_specifier` is explicitly used to update the manifest specifier when `add`/`update` runs.
- The repo’s review guide flags token leakage as a priority concern.

## Fix Focus Areas
- pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs[205-207]
- pnpm/crates/resolving-git-resolver/src/lib.rs[8-9]

## Proposed fix
- Update the comment (and the adjacent rustdoc in `lib.rs`) to explicitly state that credential-bearing URLs are preserved verbatim *and may be persisted back into manifests via `normalized_bare_specifier`*, so users should prefer git credential helpers / `url.<base>.insteadOf` rewrites instead of embedding secrets.
- Keep the current behavior (do not strip credentials here), but make the sensitivity clear in docs/comments so future maintainers don’t add logging/serialization assuming it’s safe to print.

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


Qodo Logo

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pnpm/crates/resolving-git-resolver/src/runners.rs (1)

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

Wire the probe retry budget through GitFetchContext.

RealGitProbe still uses a 500 ms / 1 / 2 exponential loop with hardcoded 408, 409, 420, and 429 status retries, while install callers pass retry_opts via GitFetchContext. Move that policy into the probe trait or context and reuse it in RealGitProbe::anonymous_head_ok() so network retries and the type: git fallback path share the same policy. Also log rejected send() errors at debug level so transport failures do not look like private repos.

🤖 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-git-resolver/src/runners.rs` around lines 34 - 55,
Update `RealGitProbe::anonymous_head_ok()` to stop hardcoding the 500 ms / 1 / 2
retry loop and the 408/409/420/429 transient set; instead, read and reuse the
retry budget from `GitFetchContext` or the probe trait so the same policy drives
both network retries and the `type: git` fallback path. Keep the existing
success/non-transient short-circuit behavior, but route the retry timing/status
checks through the shared retry settings. Also add a debug-level log for
`send()` failures in `anonymous_head_ok()` so transport errors are surfaced
without being treated like private-repo responses.

Source: Path instructions

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

Inline comments:
In @.changeset/git-specs-are-identities.md:
- Around line 9-11: Update the fenced code block containing the git config
command to specify the sh language identifier, preserving the command and
surrounding documentation unchanged.

---

Nitpick comments:
In `@pnpm/crates/resolving-git-resolver/src/runners.rs`:
- Around line 34-55: Update `RealGitProbe::anonymous_head_ok()` to stop
hardcoding the 500 ms / 1 / 2 retry loop and the 408/409/420/429 transient set;
instead, read and reuse the retry budget from `GitFetchContext` or the probe
trait so the same policy drives both network retries and the `type: git`
fallback path. Keep the existing success/non-transient short-circuit behavior,
but route the retry timing/status checks through the shared retry settings. Also
add a debug-level log for `send()` failures in `anonymous_head_ok()` so
transport errors are surfaced without being treated like private-repo responses.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 668fd13e-246c-4c62-aa52-1a7d4ff3788c

📥 Commits

Reviewing files that changed from the base of the PR and between dd0e058 and 7401882.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (9)
  • .changeset/git-specs-are-identities.md
  • pnpm/crates/resolving-git-resolver/Cargo.toml
  • pnpm/crates/resolving-git-resolver/src/git_resolver.rs
  • pnpm/crates/resolving-git-resolver/src/git_resolver/tests.rs
  • pnpm/crates/resolving-git-resolver/src/lib.rs
  • pnpm/crates/resolving-git-resolver/src/parse_bare_specifier.rs
  • pnpm/crates/resolving-git-resolver/src/parse_bare_specifier/tests.rs
  • pnpm/crates/resolving-git-resolver/src/runners.rs
  • pnpm/crates/resolving-git-resolver/src/runners/tests.rs

Comment thread .changeset/git-specs-are-identities.md Resolved
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@codecov-commenter

codecov-commenter commented Aug 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.18%. Comparing base (dd0e058) to head (6103ab5).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13684      +/-   ##
==========================================
+ Coverage   88.16%   88.18%   +0.02%     
==========================================
  Files         612      612              
  Lines       99579    99539      -40     
==========================================
- Hits        87791    87776      -15     
+ Misses      11788    11763      -25     

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

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

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 7401882fc696

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.882 ± 0.215 2.557 3.169 1.94 ± 0.22
pacquet@main 2.761 ± 0.186 2.432 3.046 1.86 ± 0.20
pnpr@HEAD 1.506 ± 0.111 1.388 1.724 1.01 ± 0.11
pnpr@main 1.487 ± 0.123 1.392 1.767 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8817508333600004,
      "stddev": 0.21528193509241306,
      "median": 2.9432141868599997,
      "user": 2.5056027999999997,
      "system": 1.9398625200000001,
      "min": 2.55713105786,
      "max": 3.1690657768599997,
      "times": [
        3.1690657768599997,
        3.13211932886,
        2.60315448686,
        2.7188175818599998,
        2.73264786186,
        3.01594596586,
        2.93883449786,
        2.94759387586,
        3.0021978998599996,
        2.55713105786
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7607484101599993,
      "stddev": 0.18551397845250894,
      "median": 2.7911788823599997,
      "user": 2.1459532999999995,
      "system": 1.6210607199999998,
      "min": 2.4319879048599997,
      "max": 3.0455939648599997,
      "times": [
        3.0455939648599997,
        2.7857307848599997,
        2.7966269798599996,
        2.82038062486,
        2.7411449748599996,
        2.92424990486,
        2.82980470186,
        2.75959744586,
        2.47236681486,
        2.4319879048599997
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.50595829866,
      "stddev": 0.11106088415434356,
      "median": 1.4995890583600002,
      "user": 1.1776723999999998,
      "system": 1.27687662,
      "min": 1.38826463186,
      "max": 1.72378230186,
      "times": [
        1.48706052386,
        1.39184894086,
        1.4960907008600002,
        1.38826463186,
        1.6577708018600001,
        1.72378230186,
        1.50495347286,
        1.3915270958600001,
        1.50308741586,
        1.51519710086
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4871206694599999,
      "stddev": 0.12330817879115119,
      "median": 1.44566291086,
      "user": 1.2825646,
      "system": 1.31170002,
      "min": 1.39179410786,
      "max": 1.7673322718600002,
      "times": [
        1.39576941786,
        1.48376918386,
        1.39348704886,
        1.4533956268600001,
        1.46575233686,
        1.7673322718600002,
        1.39179410786,
        1.43793019486,
        1.4353998808600001,
        1.64657662486
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 325.9 ± 25.0 292.8 355.9 1.00
pacquet@main 343.2 ± 26.3 308.4 390.7 1.05 ± 0.11
pnpr@HEAD 392.8 ± 72.0 324.6 549.6 1.21 ± 0.24
pnpr@main 392.2 ± 69.3 332.9 574.4 1.20 ± 0.23
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.32592376924,
      "stddev": 0.024960970527392632,
      "median": 0.32607285254,
      "user": 0.27721878,
      "system": 0.5999438,
      "min": 0.29281087804,
      "max": 0.35593688204,
      "times": [
        0.32301780204,
        0.29281087804,
        0.29579114804,
        0.31118089704,
        0.30038944904,
        0.35458904804,
        0.34782109104000003,
        0.35593688204,
        0.34857259404,
        0.32912790304
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.34318441944,
      "stddev": 0.026343511421145372,
      "median": 0.34777294004000003,
      "user": 0.29439008,
      "system": 0.6512722000000001,
      "min": 0.30835269404,
      "max": 0.39065801804,
      "times": [
        0.39065801804,
        0.34872716304,
        0.35195749304,
        0.37011927204,
        0.34681871704,
        0.32534812004,
        0.32185386404,
        0.30835269404,
        0.35626178204000003,
        0.31174707104
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.39275520514,
      "stddev": 0.07195530006303485,
      "median": 0.36323102404,
      "user": 0.33180058,
      "system": 0.7026977000000001,
      "min": 0.32462979004,
      "max": 0.54958156004,
      "times": [
        0.32462979004,
        0.33328133804,
        0.38749267104,
        0.35731212604,
        0.36280144204000003,
        0.36366060604,
        0.44836837504,
        0.33859347004,
        0.46183067304000003,
        0.54958156004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.39223925594,
      "stddev": 0.06927880637720829,
      "median": 0.36570621804000003,
      "user": 0.33161878,
      "system": 0.6851315,
      "min": 0.33286885804,
      "max": 0.5743601260400001,
      "times": [
        0.5743601260400001,
        0.41915039904,
        0.39490143304,
        0.36024475204,
        0.36096020604,
        0.35034668404,
        0.37045223004,
        0.33286885804,
        0.35487296304,
        0.40423490804
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.830 ± 0.126 2.709 3.145 1.65 ± 0.17
pacquet@main 2.774 ± 0.074 2.676 2.906 1.62 ± 0.16
pnpr@HEAD 1.714 ± 0.158 1.504 1.994 1.00
pnpr@main 1.887 ± 0.413 1.594 3.017 1.10 ± 0.26
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8298235541200003,
      "stddev": 0.12641369733983704,
      "median": 2.80101044102,
      "user": 2.19160968,
      "system": 1.77309494,
      "min": 2.70930559502,
      "max": 3.14517429102,
      "times": [
        3.14517429102,
        2.89407318902,
        2.81267877602,
        2.8763012890199997,
        2.83121204602,
        2.78934210602,
        2.70930559502,
        2.73084638002,
        2.7709604300199997,
        2.73834143902
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7736750076199996,
      "stddev": 0.07372608067709843,
      "median": 2.76200226852,
      "user": 2.0024189800000003,
      "system": 1.6556468399999997,
      "min": 2.67629565002,
      "max": 2.9063860350199997,
      "times": [
        2.72811224902,
        2.88925262702,
        2.78467342802,
        2.7441669110199998,
        2.67629565002,
        2.77516702702,
        2.74883751002,
        2.77910666302,
        2.70475197602,
        2.9063860350199997
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.71431244792,
      "stddev": 0.15791900147192056,
      "median": 1.6862885730200001,
      "user": 1.4821115800000002,
      "system": 1.66603174,
      "min": 1.5038233480200003,
      "max": 1.99379890002,
      "times": [
        1.5505432460200002,
        1.7476913840200001,
        1.59975548102,
        1.5038233480200003,
        1.6462847500200002,
        1.7970955780200002,
        1.6672636480200003,
        1.9315546460200002,
        1.99379890002,
        1.70531349802
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.88736945552,
      "stddev": 0.4127864878546561,
      "median": 1.7781102530200001,
      "user": 1.8229203799999998,
      "system": 1.9142247399999999,
      "min": 1.5937033120200002,
      "max": 3.01736574602,
      "times": [
        1.74388260302,
        1.7279452410200002,
        1.8781246100200002,
        1.6207426300200003,
        1.8350245790200002,
        3.01736574602,
        1.8123379030200002,
        1.68741200702,
        1.95715592402,
        1.5937033120200002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 662.7 ± 91.1 493.9 815.8 1.72 ± 0.24
pacquet@main 556.3 ± 40.1 496.6 634.7 1.45 ± 0.12
pnpr@HEAD 417.4 ± 26.6 367.0 447.6 1.08 ± 0.08
pnpr@main 385.0 ± 13.6 363.2 399.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6626949457200001,
      "stddev": 0.09108856870614197,
      "median": 0.6649398455200002,
      "user": 0.9038033199999997,
      "system": 1.0216894,
      "min": 0.49385416702,
      "max": 0.8157666710200001,
      "times": [
        0.5870252610200001,
        0.6412962300200001,
        0.8157666710200001,
        0.7012978030200001,
        0.6217395970200001,
        0.49385416702,
        0.73819172602,
        0.7284164590200001,
        0.6885834610200001,
        0.6107780820200001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5562894657200002,
      "stddev": 0.040069347104468245,
      "median": 0.55926835352,
      "user": 0.7441427199999999,
      "system": 0.9304924,
      "min": 0.49658175502,
      "max": 0.6346693830200001,
      "times": [
        0.5205129000200001,
        0.6346693830200001,
        0.5801208320200001,
        0.58696526802,
        0.5680224690200001,
        0.5660009500200001,
        0.5190233310200001,
        0.5525357570200001,
        0.49658175502,
        0.5384620120200001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.41741945922,
      "stddev": 0.026565136793861074,
      "median": 0.42724345702,
      "user": 0.30046621999999995,
      "system": 0.7095020999999999,
      "min": 0.36704400802000003,
      "max": 0.44757282602000004,
      "times": [
        0.44757282602000004,
        0.36704400802000003,
        0.43512282302000005,
        0.42094492202,
        0.40069189002,
        0.37893438902000004,
        0.43123792002,
        0.42590172002000004,
        0.42858519402,
        0.43815890002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.38497535252000004,
      "stddev": 0.013629110521278794,
      "median": 0.38549201652,
      "user": 0.27683972,
      "system": 0.6542408,
      "min": 0.36318418202,
      "max": 0.39951353502000003,
      "times": [
        0.36318418202,
        0.39938296902000003,
        0.39932567202,
        0.39951353502000003,
        0.37802456002,
        0.37978235302,
        0.39120168002,
        0.37748808102000003,
        0.39451081002000005,
        0.36733968302000003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.851 ± 0.042 1.792 1.901 4.50 ± 0.26
pacquet@main 2.000 ± 0.168 1.861 2.327 4.86 ± 0.48
pnpr@HEAD 0.474 ± 0.062 0.409 0.573 1.15 ± 0.16
pnpr@main 0.411 ± 0.022 0.381 0.444 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.85102886096,
      "stddev": 0.042442686859032554,
      "median": 1.8582151263600002,
      "user": 0.9255281399999999,
      "system": 0.91146354,
      "min": 1.7924178913600002,
      "max": 1.90141446436,
      "times": [
        1.8883547333600001,
        1.8922596533600002,
        1.90141446436,
        1.8179307603600001,
        1.8641508643600002,
        1.8901116263600002,
        1.8522793883600002,
        1.81655618536,
        1.7924178913600002,
        1.7948130423600002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.00021628216,
      "stddev": 0.1675266726552328,
      "median": 1.91019867036,
      "user": 1.21115124,
      "system": 1.04106664,
      "min": 1.86111548836,
      "max": 2.3272486193599997,
      "times": [
        1.88236577536,
        1.88835534336,
        1.88274139136,
        1.86111548836,
        1.86196161036,
        1.93204199736,
        2.09034788036,
        2.04789450536,
        2.22809021036,
        2.3272486193599997
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.47427006346,
      "stddev": 0.062411953770259654,
      "median": 0.45818531036,
      "user": 0.34020404000000004,
      "system": 0.79817874,
      "min": 0.40910522836,
      "max": 0.5730910223600001,
      "times": [
        0.41551433636,
        0.42876027636,
        0.51643516836,
        0.40910522836,
        0.42493811136000004,
        0.43091018836,
        0.48886360936,
        0.5730910223600001,
        0.56962226136,
        0.48546043236
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.41146511146,
      "stddev": 0.021994668549312615,
      "median": 0.41004660786,
      "user": 0.32073734,
      "system": 0.6772032399999999,
      "min": 0.38147902636000003,
      "max": 0.44412162336,
      "times": [
        0.41302670036,
        0.40706651536,
        0.38147902636000003,
        0.39072268136,
        0.39788517636000004,
        0.42281666336,
        0.43775717936,
        0.38836197436000003,
        0.44412162336,
        0.43141357436
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 252.0 ± 15.1 235.0 277.5 2.49 ± 0.18
pacquet@main 265.9 ± 16.2 241.9 299.1 2.63 ± 0.19
pnpr@HEAD 101.1 ± 4.0 93.8 112.1 1.00
pnpr@main 108.7 ± 4.8 99.5 117.8 1.07 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2520244470781819,
      "stddev": 0.015077048857596101,
      "median": 0.24612233226,
      "user": 0.22773062363636365,
      "system": 0.10173261272727271,
      "min": 0.23496879326,
      "max": 0.27748253226,
      "times": [
        0.24603038826,
        0.25588051526000005,
        0.25002306326,
        0.27040823426000005,
        0.27748253226,
        0.27242694926000005,
        0.24396029726000001,
        0.24612233226,
        0.23496879326,
        0.23639731026,
        0.23856850226
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.2658634234418182,
      "stddev": 0.016224541788693914,
      "median": 0.25973412826000003,
      "user": 0.2412565327272727,
      "system": 0.10562070363636365,
      "min": 0.24190589426,
      "max": 0.29908174526000003,
      "times": [
        0.25407764626,
        0.24190589426,
        0.25696638526000004,
        0.28254986826000006,
        0.27559582526000004,
        0.25620261026,
        0.25636070826,
        0.27770147426,
        0.29908174526000003,
        0.26432137226,
        0.25973412826000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10114587796370372,
      "stddev": 0.0039998715975774575,
      "median": 0.10110076726,
      "user": 0.027795630370370368,
      "system": 0.014924043703703706,
      "min": 0.09383339626000001,
      "max": 0.11212161426000002,
      "times": [
        0.10311633726000001,
        0.10053054526,
        0.10357783326,
        0.09743228026,
        0.10247957926000001,
        0.10110365226000001,
        0.10107291526,
        0.10110076726,
        0.09938953026000001,
        0.10327675726,
        0.11212161426000002,
        0.10242546726000001,
        0.09947598326000001,
        0.10638153426000001,
        0.11063536126000001,
        0.09807915726000001,
        0.10224818426000001,
        0.10205599326,
        0.09752594726000001,
        0.09703660826,
        0.09383339626000001,
        0.09647127426,
        0.09889983926000001,
        0.10247597126,
        0.09966613026000001,
        0.09734181126000001,
        0.10118423426
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10866215390285718,
      "stddev": 0.004788430147030137,
      "median": 0.10889790926000001,
      "user": 0.03172086714285714,
      "system": 0.01770684,
      "min": 0.09951672026000001,
      "max": 0.11776423126,
      "times": [
        0.09999291526000001,
        0.11280139226000001,
        0.10430785526000001,
        0.09951672026000001,
        0.11233570826000001,
        0.10647408826,
        0.10865886526000001,
        0.10240699326000001,
        0.10319909226000001,
        0.11776423126,
        0.11399778126000001,
        0.10265990826,
        0.10599265326000001,
        0.10702418226,
        0.10651278026000001,
        0.10996681326,
        0.10366815326,
        0.11093551526,
        0.11620315726000001,
        0.11137029126,
        0.11160318026,
        0.10909283026000001,
        0.10928904026000001,
        0.10794649626000001,
        0.11199533726000001,
        0.11415648026000001,
        0.11396485926000001,
        0.10870298826000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.359 ± 0.306 0.901 1.718 1.30 ± 0.56
pacquet@main 1.049 ± 0.386 0.652 1.729 1.00
pnpm@HEAD 3.883 ± 0.157 3.655 4.098 3.70 ± 1.37
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.3589155709844445,
      "stddev": 0.3060501296991132,
      "median": 1.47469090854,
      "user": 1.280690188888889,
      "system": 0.2739608,
      "min": 0.9014393205400001,
      "max": 1.7177677185400002,
      "times": [
        1.13242708554,
        1.7177677185400002,
        1.67525428154,
        1.47469090854,
        1.49653843754,
        1.53884121854,
        0.9014393205400001,
        1.3758438745400001,
        0.91743729354
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.0486552489844445,
      "stddev": 0.3859559552788052,
      "median": 1.14480151654,
      "user": 0.9876981888888889,
      "system": 0.17920513333333335,
      "min": 0.6523024875400001,
      "max": 1.72861438854,
      "times": [
        1.72861438854,
        0.67709509454,
        0.6894671805400001,
        1.40234412954,
        0.6523024875400001,
        1.15669697754,
        1.14480151654,
        0.7166661795400001,
        1.26990928654
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.8829992589844458,
      "stddev": 0.1570909523503433,
      "median": 3.83194442454,
      "user": 5.981157188888889,
      "system": 0.33493091111111106,
      "min": 3.65527924454,
      "max": 4.09759021654,
      "times": [
        4.04513313454,
        4.07462108754,
        4.09759021654,
        3.71632426154,
        3.8278641435400003,
        3.65527924454,
        3.86893859854,
        3.83194442454,
        3.82929821954
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.754 ± 0.117 4.643 4.940 1.30 ± 0.06
pacquet@main 4.789 ± 0.176 4.520 5.048 1.31 ± 0.07
pnpr@HEAD 3.686 ± 0.118 3.534 3.931 1.00 ± 0.05
pnpr@main 3.669 ± 0.137 3.562 4.029 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.754154862679999,
      "stddev": 0.11726995337246929,
      "median": 4.70848484028,
      "user": 2.66793336,
      "system": 2.00699238,
      "min": 4.64296173428,
      "max": 4.93959138428,
      "times": [
        4.72374981628,
        4.90674448628,
        4.65251027428,
        4.69321986428,
        4.83949900128,
        4.84795933628,
        4.93959138428,
        4.64296173428,
        4.64750719928,
        4.647805530279999
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.78883773218,
      "stddev": 0.17578485795359217,
      "median": 4.77643021978,
      "user": 2.52137246,
      "system": 1.8930321799999998,
      "min": 4.52042780428,
      "max": 5.04819238328,
      "times": [
        4.89165981828,
        4.64677897928,
        4.7426816582799995,
        4.94139409528,
        4.52042780428,
        4.993406398279999,
        5.04819238328,
        4.647225833279999,
        4.810178781279999,
        4.64643157028
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.68626560678,
      "stddev": 0.11820115779450781,
      "median": 3.6647363947800002,
      "user": 1.8295038599999998,
      "system": 1.71398918,
      "min": 3.53395574428,
      "max": 3.93124399028,
      "times": [
        3.5554280422800004,
        3.66070750528,
        3.64702144628,
        3.93124399028,
        3.76924674728,
        3.53395574428,
        3.67708982528,
        3.62341888428,
        3.66876528428,
        3.79577859828
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.66869117318,
      "stddev": 0.13679968251414393,
      "median": 3.63523175178,
      "user": 1.7468089599999999,
      "system": 1.6687785800000001,
      "min": 3.56197813628,
      "max": 4.028858233279999,
      "times": [
        3.5666375352800004,
        3.56197813628,
        3.58510045628,
        3.6469309662800002,
        3.6191280372800003,
        3.66327795828,
        4.028858233279999,
        3.73730197328,
        3.62353253728,
        3.65416589828
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13684
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.peer-heavy-resolve.hot-cache.offlineLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
901.44 ms
(+24.58%)Baseline: 723.58 ms
868.30 ms
(103.82%)

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,709.31 ms
(-0.05%)Baseline: 2,710.57 ms
3,252.69 ms
(83.29%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,792.42 ms
(-0.56%)Baseline: 1,802.50 ms
2,163.00 ms
(82.87%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
493.85 ms
(+8.68%)Baseline: 454.40 ms
545.28 ms
(90.57%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
234.97 ms
(+11.14%)Baseline: 211.42 ms
253.70 ms
(92.62%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,557.13 ms
(+3.76%)Baseline: 2,464.49 ms
2,957.39 ms
(86.47%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,642.96 ms
(+2.97%)Baseline: 4,509.23 ms
5,411.08 ms
(85.80%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
292.81 ms
(-3.14%)Baseline: 302.30 ms
362.75 ms
(80.72%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
🚨 view alert (🔔)
901.44 ms
(+24.58%)Baseline: 723.58 ms
868.30 ms
(103.82%)

🐰 View full continuous benchmarking report in Bencher

…client selection

acquire_for_url applies the per-origin maxSockets cap and per-URL TLS
routing that every other outbound request in pacquet gets; the bare
acquire() was inherited from the deleted probe ladder. The permit now
also spans the response's lifetime while never being held across a
backoff sleep.

Also trims a narrating test-helper doc and adds the changeset code
fence language, both from review.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 6, 2026 15:05

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

Code review by qodo was updated up to the latest commit 6bb25fe

@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 added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 6, 2026
The bump type carries the breaking-change semantics, so the prose
prefix saying so is dropped.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 6, 2026 15:22

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

Code review by qodo was updated up to the latest commit 085d9a3

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

The identity rule stays in parse_bare_specifier's module doc with
lib.rs pointing at it, the credentials rationale stays on the
implementation branch, and the test doc comments that re-explained
their own asserts are dropped.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 6, 2026 15:27

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

Code review by qodo was updated up to the latest commit 34c743b

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

…s own deadline

The install-wide fetchTimeout (60s default) is sized for downloads; an
archive endpoint a firewall blackholes while the repo host stays
reachable would stall resolution for attempts x fetchTimeout per git
dependency. The probe only gates the archive optimization, so a
10-second per-attempt deadline loses nothing: on expiry the resolution
falls back to type: git.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 6, 2026 20:07

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

Code review by qodo was updated up to the latest commit 6103ab5

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@zkochan
zkochan merged commit 14a890d into main Aug 6, 2026
19 of 21 checks passed
@zkochan
zkochan deleted the refactor/git-identity-resolution branch August 6, 2026 20:39
zkochan added a commit to Ayush442842q/pnpm that referenced this pull request Aug 6, 2026
…t specs on CI

Two flaws let a transient probe failure record an SSH URL for a spec
that never asked for SSH: the visibility HEAD probe ran once with
retries disabled and treated any failure as private, and the SSH
ls-remote probe ran before the anonymous HTTPS one. On a machine with
SSH keys, a throttled HEAD request resolved a public repo to
git@host:..., breaking later installs on keyless CI runners with
Permission denied (publickey).

The resolver now retries transient HEAD failures, probes anonymous
HTTPS git access before SSH for every representation except explicit
SSH URLs, falls back to HTTPS when every probe fails, and records the
host-archive tarball only for repos proven public - otherwise the
resolution stays type: git so ambient credentials apply.

TypeScript CLI only: pacquet resolves this bug class structurally via
the v12 identity redesign (pnpm#13684), which supersedes the
Rust-side commits this PR previously carried.

Closes pnpm#13276.

Co-Authored-By: Claude Fable 5 <[email protected]>
zkochan added a commit that referenced this pull request Aug 6, 2026
…t specs on CI (#13290)

Two flaws let a transient probe failure record an SSH URL for a spec
that never asked for SSH: the visibility HEAD probe ran once with
retries disabled and treated any failure as private, and the SSH
ls-remote probe ran before the anonymous HTTPS one. On a machine with
SSH keys, a throttled HEAD request resolved a public repo to
git@host:..., breaking later installs on keyless CI runners with
Permission denied (publickey).

The resolver now retries transient HEAD failures, probes anonymous
HTTPS git access before SSH for every representation except explicit
SSH URLs, falls back to HTTPS when every probe fails, and records the
host-archive tarball only for repos proven public - otherwise the
resolution stays type: git so ambient credentials apply.

TypeScript CLI only: pacquet resolves this bug class structurally via
the v12 identity redesign (#13684), which supersedes the
Rust-side commits this PR previously carried.

Closes #13276.

Co-authored-by: Zoltan Kochan <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
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