Skip to content

feat(pacquet-cli): implement pnpm docs / pnpm home command - #12671

Merged
zkochan merged 5 commits into
pnpm:mainfrom
kairosci:feat/paquet-docs
Jun 26, 2026
Merged

zkochan merged 5 commits into
pnpm:mainfrom
kairosci:feat/paquet-docs

Conversation

@kairosci

@kairosci kairosci commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the pnpm docs command (and its pnpm home alias) in the Rust pacquet port, fetching package metadata from the registry and opening the homepage URL in the browser. Ports the functionality from @pnpm/deps.inspection.commands (pnpm11/deps/inspection/commands/src/docs/index.ts).

Related to #11633.

Squash Commit Body

This change adds a DocsArgs struct registered as the Docs variant on CliCommand, visible as both docs and home through clap's visible_alias. At runtime the command fetches package metadata from the configured registry, extracts the homepage field (validated as an http/https URL), and opens it via the platform browser launcher: xdg-open on Linux, open on macOS, cmd /c start on Windows. When the homepage is missing or not an http/https URL, it falls back to https://npmx.dev/package/<name>. When the browser cannot be launched (non-interactive CI, unsupported platform), the URL is printed to stdout instead.

The is_http_url helper validates URL strings and is unit-tested for valid https, http, empty, non-url, ftp, and spaced inputs. Integration tests verify that omitting the package name produces the expected clap error, that the home alias routes correctly, and that help output is generated.

The url crate was added as a dependency of pacquet-cli, already available in the workspace dependencies.

Related to #11633.

Checklist

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

Summary by CodeRabbit

  • New Features
    • Added pacquet docs command (alias: home) to open package docs in the browser.
    • Added new CLI commands: config, completion, deploy, dist-tag, ping, and pack-app (plus expanded list to support local dependency trees).
  • Bug Fixes
    • Hardened deploy/pack-app against unsafe and symlinked paths.
    • Improved handling for local file: tarballs and redaction/sanitization for network output.
  • Tests
    • Added unit and integration coverage for docs/home, completion, deploy, dist-tag, ping, and related parsing/error cases.

@kairosci
kairosci requested a review from zkochan as a code owner June 25, 2026 20:36
@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

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

Use the following commands to manage reviews:

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

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds several new CLI subcommands and support modules, expands config and workspace plumbing for deploy-related settings, hardens path containment in install/deploy/pack-app flows, and adds triage automation plus release-note updates.

Changes

CLI command surface

Layer / File(s) Summary
Command wiring
pacquet/crates/cli/Cargo.toml, pacquet/crates/cli/src/cli_args.rs, pacquet/crates/cli/src/lib.rs, pacquet/crates/cli/src/cli_args/install.rs, pacquet/crates/cli/src/cli_args/whoami.rs, pacquet/crates/cli/src/cli_args/registry_client.rs, pacquet/crates/cli/src/config_overrides.rs
Adds new CLI modules and dependencies, registers new subcommands and aliases, adds early completion handling, routes deploy/config/pack-app/dist-tag/ping, and centralizes registry client and install override wiring.
Docs, completion, dist-tag, ping
pacquet/crates/cli/src/cli_args/docs.rs, pacquet/crates/cli/src/cli_args/completion.rs, pacquet/crates/cli/src/cli_args/dist_tag.rs, pacquet/crates/cli/src/cli_args/ping.rs, pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata.rs, pacquet/crates/cli/tests/*
Implements docs URL opening, shell completion generation and completion-server responses, dist-tag registry mutations, and registry ping output/error handling, with command-specific tests.
Config and workspace commands
pacquet/crates/cli/src/cli_args/config.rs, pacquet/crates/cli/src/cli_args/config/ini.rs, pacquet/crates/config/src/*, pacquet/crates/workspace-manifest-writer/src/*, pacquet/crates/package-manager/src/install.rs, pacquet/crates/package-manager/src/install_package_by_snapshot.rs
Implements config set/get/delete/list, INI persistence, property-path parsing, protected setting censoring, workspace setting layering, manifest field updates, workspace-root selection, and local tarball URL rewriting.
Completion and command behavior tests
pacquet/crates/cli/tests/completion.rs, pacquet/crates/cli/tests/docs.rs, pacquet/crates/cli/src/cli_args/completion/tests.rs, pacquet/crates/cli/src/cli_args/docs/tests.rs, pacquet/crates/cli/src/cli_args/ping/tests.rs
Adds unit and integration tests for completion scripts and command-specific error and alias behavior.
Dist-tag and ping integration tests
pacquet/crates/cli/tests/dist_tag.rs, pacquet/crates/cli/tests/ping.rs
Adds CLI tests for dist-tag listing/mutation, OTP and registry error handling, and ping request/response formatting and sanitization.

Deploy and path safety

Layer / File(s) Summary
Workspace and lockfile plumbing
pacquet/crates/config/src/*, pacquet/crates/lockfile/src/save_lockfile.rs
Adds deploy-related workspace settings, config layering fields, env overrides, raw auth/config retention, naming and property-path helpers, and lockfile YAML serialization reuse.
Config file helpers
pacquet/crates/config/src/property_path.rs, pacquet/crates/config/src/protected_settings.rs, pacquet/crates/config/src/naming_cases.rs, pacquet/crates/config/src/*/tests.rs
Implements property-path parsing/evaluation, protected-setting censoring, and naming-case conversions with supporting tests.
Deploy command
pacquet/crates/cli/src/cli_args/deploy.rs, pacquet/crates/cli/src/cli_args/deploy/tests.rs, pacquet/crates/cli/tests/deploy.rs
Implements deploy target selection, validation, file generation, lockfile rewriting, artifact writing, and coverage for force, workspace-child, symlink, and legacy deploy paths.
Directory fetch containment
pacquet/crates/directory-fetcher/Cargo.toml, pacquet/crates/directory-fetcher/src/*, pacquet/crates/directory-fetcher/tests/fetcher.rs
Adds path containment to directory fetching, including allow_path_escape, confined traversal, linked-root rejection, and escape-focused tests.
Install and tarball path safety
pacquet/crates/package-manager/src/install.rs, pacquet/crates/package-manager/src/install_package_by_snapshot.rs, pacquet/crates/package-manager/src/install_package_by_snapshot/tests.rs, pacquet/crates/tarball/Cargo.toml, pacquet/crates/tarball/src/*, pacquet/crates/tarball/src/tests.rs
Normalizes local file: tarball URLs, routes directory fetches through confined traversal, adds local tarball extraction, and covers the file-path and offline cases.
Pack-app hardening
pacquet/crates/cli/src/cli_args/pack_app.rs, pacquet/crates/cli/src/cli_args/pack_app/tests.rs, pnpm11/releasing/commands/src/pack-app/packApp.ts, pnpm11/releasing/commands/test/pack-app/index.test.ts
Implements pack-app containment checks, output validation, trusted signing, and matching tests, plus the corresponding pnpm release-command hardening.
Deploy target hardening in pnpm release commands
pnpm11/releasing/commands/package.json, pnpm11/releasing/commands/src/deploy/deploy.ts, pnpm11/releasing/commands/test/deploy/deploy.test.ts
Adds deploy target validation, symlink-aware directory creation, and forced-deploy test coverage in the pnpm release command set.
Manifest editing
pacquet/crates/workspace-manifest-writer/Cargo.toml, pacquet/crates/workspace-manifest-writer/src/*, pacquet/crates/workspace-manifest-writer/src/tests.rs
Adds top-level manifest field set/delete support and tests for scalar/object updates and removal behavior.

Automation and release metadata

Layer / File(s) Summary
Triage automation
.agents/skills/triage/SKILL.md, .github/workflows/triage-issues.yml
Adds the triage skill instructions and a workflow that runs the agent on opened issues with per-issue concurrency and issue-label/comment permissions.
Release notes
.changeset/pack-app-path-containment.md, .changeset/quiet-socks-deploy-targets.md
Adds changeset notes for pack-app containment and deploy target hardening.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120+ minutes

Possibly related issues

  • Rust Roadmap #11633: The PR implements multiple Stage 3 roadmap commands named in the issue, including docs, completion, config, deploy, dist-tag, ping, and pack-app, plus supporting plumbing.

Possibly related PRs

  • pnpm/pnpm#11678: Both PRs add path-containment behavior in pacquet-directory-fetcher and update install flows to use it.
  • pnpm/pnpm#11806: Both PRs extend ConfigOverrides with new boolean keys and apply them to pacquet_config::Config.
  • pnpm/pnpm#12668: Both PRs implement the deploy CLI path, including dispatch wiring and deploy execution logic.

Suggested labels

product: pacquet, product: pnpm@11

Suggested reviewers

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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

Copy link
Copy Markdown

PR Summary by Qodo

pacquet-cli: add docs/home command to open package homepage
✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

Description

• Add pacquet docs (alias home) to open a package homepage in the browser.
• Fetch package metadata from the configured registry and validate http/https homepage URLs.
• Add unit/integration tests for URL validation, aliases, and missing-arg clap errors.
Diagram

graph TD
  U(["User"]) --> CLI["pacquet CLI"] --> CMD["DocsArgs"] --> REG[("Registry")] --> VAL{"Homepage http(s)?"}
  VAL -- "yes" --> OPEN["Open URL"] --> DONE["Exit (or print URL)"]
  VAL -- "no" --> FB["Fallback npmx.dev"] --> DONE
  subgraph Legend
    direction LR
    _usr(["User"]) ~~~ _proc["Module/Step"] ~~~ _api[("API")] ~~~ _dec{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use a cross-platform opener crate (e.g., `webbrowser`/`open`)
  • ➕ Handles platform quirks (Windows quoting/escaping, desktop environments) without custom cfg blocks
  • ➕ Potentially easier to test via a smaller surface area
  • ➖ Introduces a new direct dependency for behavior that is currently simple
  • ➖ May reduce control over fallback behavior and error reporting format
2. Inject a browser-opener interface for testability
  • ➕ Enables full integration tests (mock registry + mock opener) without launching a real browser
  • ➕ Centralizes platform spawning logic for reuse by future commands
  • ➖ Adds abstraction/boilerplate for a single command today
  • ➖ Requires plumbing through CLI state/config or dependency injection patterns

Recommendation: The current approach (minimal platform-specific spawning + print-on-failure) is reasonable for a first port and keeps dependencies low. Consider a follow-up to encapsulate the opener behind an interface (or adopt a dedicated opener crate) if more commands need browser launching or if Windows/CI edge cases become a maintenance burden.

Files changed (5) +206 / -0

Enhancement (2) +109 / -0
cli_args.rsRegister 'docs' command with 'home' alias and wire dispatch +9/-0

Register 'docs' command with 'home' alias and wire dispatch

• Adds the 'docs' module, introduces 'CliCommand::Docs', exposes 'home' as a visible alias, and hooks command execution into the main CLI dispatch to load config and run the async handler.

pacquet/crates/cli/src/cli_args.rs

docs.rsImplement docs/home logic: fetch registry metadata and open homepage +100/-0

Implement docs/home logic: fetch registry metadata and open homepage

• Implements 'DocsArgs' to resolve the package name, pick the appropriate registry, fetch package metadata, validate the 'homepage' as http/https, and open it via an OS-specific launcher. Falls back to 'https://npmx.dev/package/<name>' and prints the URL if launching fails or is unsupported.

pacquet/crates/cli/src/cli_args/docs.rs

Tests (2) +96 / -0
tests.rsUnit-test homepage URL validation helper +31/-0

Unit-test homepage URL validation helper

• Adds unit tests covering valid http/https URLs and rejecting empty, non-URL, ftp, and spaced inputs for 'is_http_url'.

pacquet/crates/cli/src/cli_args/docs/tests.rs

docs.rsIntegration tests for docs/home CLI structure and errors +65/-0

Integration tests for docs/home CLI structure and errors

• Adds integration tests asserting that 'docs' and 'home' fail when the package argument is missing and that both commands produce help output successfully.

pacquet/crates/cli/tests/docs.rs

Other (1) +1 / -0
Cargo.tomlAdd 'url' crate dependency for homepage URL parsing +1/-0

Add 'url' crate dependency for homepage URL parsing

• Adds the workspace 'url' dependency to support robust parsing and scheme validation of the 'homepage' field returned by the registry.

pacquet/crates/cli/Cargo.toml

@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)
pacquet/crates/cli/src/cli_args/docs/tests.rs (1)

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

Avoid the use super::*; star import.

This module only needs is_http_url; import it explicitly.

-use super::*;
+use super::is_http_url;

As per coding guidelines: "No star imports inside module bodies. Write use super::{Foo, bar} instead of use super::*; for modules you control."

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

In `@pacquet/crates/cli/src/cli_args/docs/tests.rs` at line 1, The tests module is
using a star import via use super::*, but it only needs is_http_url. Update the
import in docs/tests.rs to explicitly bring in is_http_url from the parent
module instead of importing everything, following the no-star-imports guideline
and keeping the scope narrow.

Source: Coding guidelines

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

Inline comments:
In `@pacquet/crates/cli/src/cli_args/docs.rs`:
- Around line 78-81: The Windows browser launch path in the docs-opening logic
is vulnerable because `Command::new("cmd").args(["/c", "start", url])` lets
`cmd.exe` re-parse the URL. Update the Windows branch in `docs.rs` to avoid
shell parsing by using a non-shell launcher, or if `cmd` must remain, invoke
`start` with an empty title and properly escape the URL before passing it to the
`spawn` call in that Windows-specific block.

---

Nitpick comments:
In `@pacquet/crates/cli/src/cli_args/docs/tests.rs`:
- Line 1: The tests module is using a star import via use super::*, but it only
needs is_http_url. Update the import in docs/tests.rs to explicitly bring in
is_http_url from the parent module instead of importing everything, following
the no-star-imports guideline and keeping the scope narrow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: badb65ba-20f0-4aa2-a411-fc5a849f9ffa

📥 Commits

Reviewing files that changed from the base of the PR and between af58273 and cce7078.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (5)
  • pacquet/crates/cli/Cargo.toml
  • pacquet/crates/cli/src/cli_args.rs
  • pacquet/crates/cli/src/cli_args/docs.rs
  • pacquet/crates/cli/src/cli_args/docs/tests.rs
  • pacquet/crates/cli/tests/docs.rs

Comment thread pacquet/crates/cli/src/cli_args/docs.rs Resolved
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Config get leaks secrets 🐞 Bug ⛨ Security
Description
config_get() prints values from Config::raw_auth_config verbatim, so `pacquet config get
//registry/:_authToken` (and similar protected keys) can leak credentials to stdout/CI logs.
Censoring via protected_settings is only applied in config_to_record() (used by list /
whole-record output), not on the direct get  path.
Code

pacquet/crates/cli/src/cli_args/config.rs[R461-526]

+fn config_get(config: &Config, flags: ConfigFlags, key: &str) -> Result<String, ConfigError> {
+    let is_scoped = key.starts_with('@');
+    let value = match lookup_config(config, key, is_scoped) {
+        Some(value) => value,
+        None if is_property_path(key) => lookup_by_property_path(config, key)?,
+        None => Value::Null,
+    };
+    Ok(display_config(&value, flags.json))
+}
+
+/// `configList`: the full config record as pretty JSON. Port of `configList`.
+fn config_list(config: &Config) -> String {
+    serde_json::to_string_pretty(&Value::Object(config_to_record(config)))
+        .expect("serializing the config record to JSON never fails")
+}
+
+/// `lookupConfig`: resolve `key` against scoped registries, `globalconfig`,
+/// the typed settings, the raw auth keys, or the config record. `None` means
+/// "not found, fall through to a property-path lookup".
+fn lookup_config(config: &Config, key: &str, is_scoped: bool) -> Option<Value> {
+    if is_scoped {
+        if let Some(scope) = key.strip_suffix(":registry") {
+            // Prefer the merged `registries` map so this reports the same URL
+            // resolvers/publish use (pnpm/pnpm#11492).
+            if let Some(merged) = config.registries.get(scope) {
+                return Some(Value::String(merged.clone()));
+            }
+        }
+        return Some(auth_value(config, key));
+    }
+    if key == "globalconfig" {
+        let path = config
+            .config_dir
+            .as_ref()
+            .map(|dir| dir.join(GLOBAL_CONFIG_YAML_FILENAME).to_string_lossy().into_owned())
+            .unwrap_or_default();
+        return Some(Value::String(path));
+    }
+    let kebab = if naming_cases::is_camel_case(key) {
+        naming_cases::to_kebab_case(key)
+    } else {
+        key.to_string()
+    };
+    if config_types::is_type_key(&kebab) {
+        let camel = naming_cases::to_camel_case(&kebab);
+        if let Some(value) = config.explicit_settings.get(&camel) {
+            return Some(value.clone());
+        }
+        if let Some(value) = config.raw_auth_config.get(&kebab) {
+            return Some(Value::String(value.clone()));
+        }
+        return Some(Value::Null);
+    }
+    if config_types::is_ini_config_key(key) {
+        return Some(auth_value(config, key));
+    }
+    // Not in `types` (e.g. packageExtensions): look it up in the record, which
+    // excludes internal/sensitive fields.
+    let camel = naming_cases::to_camel_case(key);
+    let record = config_to_record(config);
+    record.get(&camel).cloned()
+}
+
+fn auth_value(config: &Config, key: &str) -> Value {
+    config.raw_auth_config.get(key).map_or(Value::Null, |value| Value::String(value.clone()))
+}
Evidence
config_get() uses lookup_config() and then directly renders the returned Value via
display_config() with no call to protected_settings; lookup_config()/auth_value() return raw
strings from config.raw_auth_config. The protected_settings module explicitly defines that
protected settings must be replaced with (protected) for pnpm config list / pnpm config get,
but that behavior is not applied on the single-key get path.

pacquet/crates/cli/src/cli_args/config.rs[460-526]
pacquet/crates/config/src/protected_settings.rs[1-37]

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 config get <key>` can print credential-bearing config values (e.g. `//registry/:_authToken`, `_password`, `username`) because the `config_get → lookup_config/auth_value` path returns `Config::raw_auth_config` values without applying `protected_settings`.
### Issue Context
The PR adds protected-settings support (`protected_settings`) and uses it for the `config list`/record path (`config_to_record()`), but `config_get()` for a single key bypasses that censoring.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/config.rs[460-526]
### Suggested fix
Apply protected-setting censoring on the single-key lookup path:
- In `auth_value(config, key)`, if `protected_settings::is_setting_protected(key)`, return `Value::String(protected_settings::PROTECTED_PLACEHOLDER.to_string())` instead of the real value.
- In the `config_types::is_type_key(&kebab)` branch, when returning `config.raw_auth_config.get(&kebab)` (and also `explicit_settings.get(&camel)`), check `protected_settings::is_setting_protected(&kebab)` / `...(&camel)` and return the placeholder.
- Add a unit test in `pacquet/crates/cli/src/cli_args/config/tests.rs` asserting `config_get(..., "//registry.example.com/:_authToken") == "(protected)"`.

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


2. Workflow secret exposed 🐞 Bug ⛨ Security
Description
The new triage-issues workflow triggers on any issues.opened event and passes the repository
secret WARP_API_KEY into a third-party agent action, meaning any GitHub user can cause a run where
that secret is available to external code. Because the agent is explicitly instructed to fetch and
process attacker-controlled issue content and can post comments, this creates a realistic
secret-exfiltration/abuse path if the action/service is compromised or the agent is prompt-injected
into emitting sensitive values.
Code

.github/workflows/triage-issues.yml[R14-69]

+on:
+  issues:
+    types: [opened]
+
+# Avoid duplicate triage runs if the same issue fires overlapping events.
+concurrency:
+  group: triage-issue-${{ github.event.issue.number }}
+  cancel-in-progress: true
+
+jobs:
+  triage:
+    name: Triage issue
+    runs-on: ubuntu-latest
+    # Skip automated issues (Renovate, Dependabot, bots) — they are not user
+    # reports and each triage run consumes Warp credits.
+    if: github.event.issue.user.type != 'Bot'
+    permissions:
+      contents: read   # let the agent inspect the checked-out codebase
+      issues: write     # let the agent apply labels and comment
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+        with:
+          persist-credentials: false
+
+      - name: Triage with Oz agent
+        uses: warpdotdev/oz-agent-action@501d24fbf4d1447e8db60eb0973eeadeb5ff54c2 # v1
+        id: triage
+        env:
+          # Authenticates the `gh` CLI the agent uses to read/label/comment.
+          GH_TOKEN: ${{ github.token }}
+        with:
+          # Uses .agents/skills/triage/SKILL.md as the base prompt.
+          skill: triage
+          name: "Triage issue #${{ github.event.issue.number }}"
+          # Only inject GitHub-generated, non-freeform values to avoid prompt
+          # injection; the agent fetches title/body/comments itself via `gh`.
+          prompt: |
+            Triage the GitHub issue that was just opened in this repository.
+
+            - Repository: ${{ github.repository }}
+            - Issue number: #${{ github.event.issue.number }}
+            - Issue URL: ${{ github.event.issue.html_url }}
+
+            Follow the triage skill: use the `gh` CLI to fetch the full issue
+            (title, body, comments, existing labels) and related open issues,
+            inspect this checked-out codebase, then choose exactly one
+            implementation-readiness state and apply the matching pnpm `state:`
+            label as defined in the skill's pnpm label mapping. Post status
+            comments as directed by the triage skill, using only an Oz run or Oz
+            session URL as the follow-along link. Do not use the GitHub Actions
+            workflow URL as the follow-along link. After labeling, post your
+            triage result as a comment on the issue using
+            `gh issue comment #${{ github.event.issue.number }}`.
+          warp_api_key: ${{ secrets.WARP_API_KEY }}
+          profile: ${{ vars.WARP_AGENT_PROFILE || '' }}
Evidence
The workflow is triggered by issues.opened and passes secrets.WARP_API_KEY to a third-party
action; the triage skill instructs the agent to fetch and process untrusted issue content during
that run. The repo review guide explicitly calls out scoping secrets in workflows that can be
influenced by untrusted artifacts.

.github/workflows/triage-issues.yml[14-69]
.agents/skills/triage/SKILL.md[58-72]
REVIEW_GUIDE.md[92-103]

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

## Issue description
The workflow runs on untrusted issue-open events but injects a repository secret (`WARP_API_KEY`) into a third-party action. This pattern can allow external users to trigger secret-bearing runs and potentially exfiltrate/abuse the secret via agent output/comments.
## Issue Context
- The workflow is intended to triage issues automatically using an agent that fetches full issue content.
- Because issues are attacker-controlled input, secret-bearing automation should be gated or require approval.
## Fix Focus Areas
- .github/workflows/triage-issues.yml[14-69]
## Suggested fix
- Restrict execution to trusted authors (e.g., `author_association` in {`MEMBER`,`OWNER`,`COLLABORATOR`} / optionally `CONTRIBUTOR`), or require manual approval via an environment protection rule before exposing `secrets.WARP_API_KEY`.
- Keep the existing minimal permissions, but ensure the secret is only available in the gated job/step.

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


3. Npm alias resolves wrong 🐞 Bug ≡ Correctness
Description
DocsArgs::run() ignores parse_wanted_dependency(...).bare_specifier and calls
PackageManifest::resolve_registry_dependency(name, name), so inputs like foo@npm:bar@^1 will
fetch/open docs for foo instead of the alias target bar. Because pick_registry_for_package’s
npm-alias routing depends on bare_specifier, this also prevents correct registry selection for
alias targets.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R23-26]

+        let parsed = parse_wanted_dependency(raw_spec);
+        let name = parsed.alias.as_deref().unwrap_or(raw_spec);
+        let (resolved_name, _range) = PackageManifest::resolve_registry_dependency(name, name);
+
Evidence
The docs command currently uses name for both the dependency key and the bare specifier, which
prevents resolve_registry_dependency and pick_registry_for_package from applying their npm-alias
logic (which is explicitly driven by bare_specifier).

pacquet/crates/cli/src/cli_args/docs.rs[23-55]
pacquet/crates/resolving-parse-wanted-dependency/src/lib.rs[12-60]
pacquet/crates/package-manifest/src/lib.rs[207-235]
pacquet/crates/lockfile/src/resolution.rs[360-389]

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 docs/home` parses the user’s spec with `parse_wanted_dependency`, but then discards `bare_specifier` and calls `PackageManifest::resolve_registry_dependency(name, name)`. This breaks npm-alias inputs like `foo@npm:bar@^1` by resolving/fetching `foo` instead of `bar`, and prevents `pick_registry_for_package` from applying its documented npm-alias routing.
### Issue Context
- `parse_wanted_dependency` returns `{ alias, bare_specifier }`; the alias is the local name, while `bare_specifier` carries the actual selector/protocol (including `npm:` alias targets).
- `PackageManifest::resolve_registry_dependency(key, bare_specifier)` only resolves alias targets when `bare_specifier` has the `npm:` prefix.
- `pick_registry_for_package(..., bare_specifier)` explicitly uses `bare_specifier` to route npm-alias targets to the correct scoped registry.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[23-55]
### Concrete fix sketch
- Keep `parsed` from `parse_wanted_dependency(raw_spec)`.
- Pass the *real* `bare_specifier` (when present) into `resolve_registry_dependency`:
- `let key = parsed.alias.as_deref().unwrap_or(raw_spec);`
- `let bare = parsed.bare_specifier.as_deref().unwrap_or(key);`
- `let (resolved_name, _range) = PackageManifest::resolve_registry_dependency(key, bare);`
- Also pass `Some(bare)` into `pick_registry_for_package` when `parsed.bare_specifier.is_some()` so npm-alias routing works as designed.

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


View more (5)
4. Unredacted URL leaked 🐞 Bug ⛨ Security
Description
When browser launching fails, open_url() prints the URL verbatim to stdout; if the URL contains
embedded credentials (userinfo) or other sensitive URL content, it can leak into terminal/CI logs.
This contradicts existing code patterns that avoid emitting credential-bearing URLs to stderr/logs.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R125-132]

+    match result {
+        Ok(_) => Ok(()),
+        Err(e) => {
+            // If we can't open the browser, print the URL instead.
+            eprintln!("Could not open browser: {e}");
+            println!("{url}");
+            Ok(())
+        }
Evidence
open_url() currently prints the raw URL on failure. Elsewhere, the codebase explicitly avoids
printing URLs because they may contain inline credentials, and network errors redact URL credentials
before surfacing them.

pacquet/crates/cli/src/cli_args/docs.rs[125-132]
pacquet/crates/cli/src/cli_args/whoami.rs[82-86]
pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata.rs[112-115]

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

## Issue description
On launcher failure, `open_url()` prints the URL as-is. URLs can legally include userinfo (`https://user:pass@host/...`) and other sensitive fragments (e.g. signed URLs), which may end up in CI logs.
## Issue Context
The codebase already treats URLs as potentially credential-bearing (e.g. registry URLs with inline credentials) and avoids printing them.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[125-132]
## Suggested fix approach
- Before printing, parse the URL with `url::Url` and redact userinfo (`set_username("")`, `set_password(None)`), then print the sanitized string.
- If parsing fails, fall back to printing a generic message (or the existing fallback URL), but avoid emitting raw potentially-sensitive strings.
- Keep stderr message, but ensure it does not include the raw URL.

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


5. Panic on 304 outcome 🐞 Bug ⛨ Security
Description
DocsArgs::run() treats FetchFullMetadataOutcome::NotModified as unreachable and will panic if a
registry/proxy responds 304 Not Modified, causing a remote-triggered CLI crash (DoS). This is
untrusted network input and should be handled as an error/fallback instead of panicking.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R60-64]

+        let package = match outcome {
+            FetchFullMetadataOutcome::Modified(pkg) => *pkg,
+            FetchFullMetadataOutcome::NotModified => {
+                unreachable!("unexpected 304 without conditional headers")
+            }
Evidence
The docs command panics if fetch_full_metadata() returns NotModified, and
fetch_full_metadata() does return NotModified whenever the HTTP status is 304, making the panic
reachable from a network response.

pacquet/crates/cli/src/cli_args/docs.rs[60-65]
pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata.rs[90-118]

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

## Issue description
`DocsArgs::run()` panics on `FetchFullMetadataOutcome::NotModified` via `unreachable!()`. Even though the request does not send conditional headers, a misbehaving registry/CDN/proxy (or adversarial registry) can still respond with 304, turning this into a remote-triggered crash.
## Issue Context
`fetch_full_metadata()` explicitly maps an HTTP 304 to `FetchFullMetadataOutcome::NotModified`, so this variant is reachable on real network responses.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[60-65]
## Suggested fix
- Replace the `unreachable!()` arm with a non-panicking behavior, e.g.:
- return a `miette::Err` with context like "registry returned 304 Not Modified unexpectedly"; or
- fall back to printing/opening `https://npmx.dev/package/<resolved_name>` when `NotModified` occurs.
- Keep the behavior deterministic and safe under attacker-controlled registry responses (no panics).

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


6. Windows URL command injection 🐞 Bug ⛨ Security
Description
On Windows, open_url() spawns cmd /c start  with a URL sourced from registry metadata; because
the URL is not quoted/escaped, cmd metacharacters in an otherwise valid http(s) URL can be
interpreted as additional commands. This enables arbitrary command execution when a user runs
pacquet docs  on Windows against a malicious/compromised registry response.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R78-81]

+        #[cfg(target_os = "windows")]
+        {
+            std::process::Command::new("cmd").args(["/c", "start", url]).spawn()
+        }
Evidence
The PR introduces Windows-specific cmd /c start execution with the registry-provided URL, and the
only validation performed is that the URL parses and uses http/https; no quoting/escaping is done.
Elsewhere in-repo, Windows command shims explicitly add quoting for safety, underscoring that
Windows command parsing is sensitive to argument quoting.

pacquet/crates/cli/src/cli_args/docs.rs[60-81]
pacquet/crates/cmd-shim/src/shim.rs[240-261]

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

## Issue description
`open_url()` uses `cmd /c start` on Windows with an untrusted URL argument, which can be interpreted by `cmd.exe` when it contains metacharacters. This is a command-injection vulnerability.
### Issue Context
The URL comes from registry metadata (`package.homepage`) and `is_http_url()` only checks scheme.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[60-96]
### Suggested fix
- Prefer a non-shell API on Windows (already available via `windows-sys` in this crate): call `ShellExecuteW` with the URL.
- If you must keep `cmd start`, ensure the URL is passed in a way that prevents `cmd` parsing:
- use `cmd /c start "" "<url>"` (empty title + quoted URL), and ensure the URL string cannot contain quotes.
- Keep the existing behavior of printing the URL when launching fails.

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


7. Versioned package input breaks 🐞 Bug ≡ Correctness
Description
DocsArgs documents that package may include @version, but it passes the raw CLI string into
PackageManifest::resolve_registry_dependency, which does not parse name@version and will treat
[email protected] as the registry package name. This causes registry fetches to hit a non-existent
packument path and fail for versioned inputs.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R11-44]

+pub struct DocsArgs {
+    /// Package name (optionally with @version).
+    pub package: String,
+}
+
+impl DocsArgs {
+    pub async fn run(self, config: &Config) -> miette::Result<()> {
+        let package_name = &self.package;
+
+        let http_client = ThrottledClient::for_installs(
+            &config.proxy,
+            &config.tls,
+            &config.tls_by_uri,
+            &NetworkSettings {
+                network_concurrency: config.network_concurrency,
+                fetch_timeout: std::time::Duration::from_millis(config.fetch_timeout),
+                user_agent: config.user_agent.clone(),
+            },
+        )
+        .into_diagnostic()
+        .wrap_err("create the network client for docs")?;
+
+        let (resolved_name, _range) =
+            PackageManifest::resolve_registry_dependency(package_name, package_name);
+        let registries: std::collections::HashMap<String, String> =
+            config.resolved_registries().into_iter().collect();
+        let registry = pick_registry_for_package(&registries, resolved_name, None);
+
+        let package = Package::fetch_from_registry(
+            resolved_name,
+            &http_client,
+            &registry,
+            &config.auth_headers,
+        )
Evidence
The docs command feeds the raw CLI arg into resolve_registry_dependency and then into
fetch_from_registry. The referenced implementation of resolve_registry_dependency only strips
npm: aliases and otherwise returns the input unchanged, while the repo already contains a
dedicated parser that splits [email protected] into alias/specifier for CLI-style inputs.

pacquet/crates/cli/src/cli_args/docs.rs[11-44]
pacquet/crates/package-manifest/src/lib.rs[221-235]
pacquet/crates/resolving-parse-wanted-dependency/src/lib.rs[38-60]

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 docs` claims to accept `pkg@version` but currently sends the entire string (including `@version`) as the registry package name.
### Issue Context
`PackageManifest::resolve_registry_dependency` is for manifest dependency entries (not CLI wanted deps) and only handles `npm:` aliases.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[11-44]
### Suggested fix
- Use the existing wanted-dependency parser to split `name@version` safely:
- `pacquet_resolving_parse_wanted_dependency::parse_wanted_dependency(&self.package)`
- Treat `alias` as the registry package name (e.g. `react` in `react@18`).
- Validate that the derived package name is actually an npm package name (reject URL/git/file specs for this command), then proceed with registry selection + metadata fetch.

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


8. Homepage often missing 🐞 Bug ≡ Correctness
Description
DocsArgs uses Package::fetch_from_registry(), which prefers the abbreviated install-v1
packument response; per the existing registry model docs, homepage is only present in full
metadata. As a result, pacquet docs will frequently fall back to npmx.dev even when a package
has a homepage.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R39-55]

+        let package = Package::fetch_from_registry(
+            resolved_name,
+            &http_client,
+            &registry,
+            &config.auth_headers,
+        )
+        .await
+        .into_diagnostic()
+        .wrap_err_with(|| format!("fetch package info for {package_name}"))?;
+
+        let fallback = || format!("https://npmx.dev/package/{}", package.name);
+        let url = package
+            .homepage
+            .as_deref()
+            .filter(|s| is_http_url(s))
+            .map_or_else(fallback, ToString::to_string);
+
Evidence
The Package type explicitly documents that homepage is omitted from the abbreviated install-v1
metadata that pacquet fetches by default, and fetch_from_registry sets an Accept header that
prefers install-v1. The repo contains a dedicated fetch_full_metadata implementation with an
explicit full-metadata Accept header suitable for this command.

pacquet/crates/cli/src/cli_args/docs.rs[39-55]
pacquet/crates/registry/src/package.rs[60-67]
pacquet/crates/registry/src/package.rs[110-125]
pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata.rs[31-40]
pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata.rs[87-96]

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 docs command needs `homepage`, but it currently fetches metadata using an Accept header that typically returns abbreviated `install-v1` packuments which omit `homepage`.
### Issue Context
The repo already has a full-metadata fetcher (`fetch_full_metadata`) that can request `application/json` explicitly.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[39-55]
### Suggested fix
- Replace `Package::fetch_from_registry(...)` with `pacquet_resolving_npm_resolver::fetch_full_metadata(...)` using `FetchFullMetadataOptions { full_metadata: true, ... }`.
- Extract the `Package` from `FetchFullMetadataOutcome::Modified` and use its `homepage` field.
- Keep fallback behavior for missing/invalid homepages, but ensure the fetch is full-metadata so existing homepages are actually observed.

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



Remediation recommended

9. Windows error code lost 🐞 Bug ◔ Observability ⭐ New
Description
In open_url() on Windows, ShellExecuteW failure is detected via its return value but the
returned error is always std::io::Error::last_os_error(), discarding the ShellExecuteW result.
This can produce misleading diagnostics and make pacquet docs/home failures hard to debug on
Windows.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R108-119]

+            let result = unsafe {
+                windows_sys::Win32::UI::Shell::ShellExecuteW(
+                    std::ptr::null_mut(), // hwnd
+                    std::ptr::null(),     // lpOperation (null => "open")
+                    url_wide.as_ptr(),    // lpFile
+                    std::ptr::null(),     // lpParameters
+                    std::ptr::null(),     // lpDirectory
+                    windows_sys::Win32::UI::WindowsAndMessaging::SW_SHOWNORMAL,
+                )
+            };
+            if (result as isize) > 32 { Ok(()) } else { Err(std::io::Error::last_os_error()) }
+        }
Evidence
The Windows branch stores ShellExecuteW’s return value in result and uses it to decide success
vs failure, but the failure path returns last_os_error() and never includes the result code.
Therefore the surfaced error is not derived from the API’s failure signal.

pacquet/crates/cli/src/cli_args/docs.rs[108-119]

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

### Issue description
On Windows, `open_url()` uses `ShellExecuteW` and checks `result > 32` for success, but on failure it returns `std::io::Error::last_os_error()`. This drops the actual `ShellExecuteW` failure code (the `result` value), so the displayed error may be stale/unrelated and users can’t tell why opening failed.

### Issue Context
This is in the newly added `docs/home` command implementation and directly affects Windows users when the default URL handler cannot be launched.

### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[108-119]

### Suggested fix
- When `result <= 32`, construct an error that includes the `result` value (e.g. `miette::miette!("ShellExecuteW failed with code {code}")` or `std::io::Error::new(ErrorKind::Other, format!(...))`).
- Optionally map the known `ShellExecuteW` error codes to more specific messages, but minimally: **don’t discard the returned code**.

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


10. Opener failures ignored 🐞 Bug ☼ Reliability
Description
open_url() uses Command::spawn() for xdg-open/open and returns Ok(()) as soon as the
process starts, so if the opener exits non-zero (common on headless/CI or misconfigured desktops)
the command will silently succeed and won’t print the fallback URL. This makes pacquet docs/home
unreliable exactly in the environments where the fallback output is supposed to kick in.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R89-96]

+        #[cfg(target_os = "linux")]
+        {
+            std::process::Command::new("xdg-open").arg(url).spawn()
+        }
+        #[cfg(target_os = "macos")]
+        {
+            std::process::Command::new("open").arg(url).spawn()
+        }
Evidence
The new implementation returns success immediately after spawning xdg-open/open, so opener exit
failures are not observable and therefore can’t trigger the URL-print fallback. Existing CLI
subprocess launch sites use status() and check success(), demonstrating the expected pattern in
this codebase for reliable command execution.

pacquet/crates/cli/src/cli_args/docs.rs[87-96]
pacquet/crates/cli/src/cli_args/dlx.rs[358-372]
pacquet/crates/cli/src/cli_args/pack_app.rs[948-956]

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

## Issue description
`open_url()` on Linux/macOS uses `Command::spawn()` and treats “spawn succeeded” as “browser opened”. This never observes the child process exit status, so failures from `xdg-open`/`open` (e.g. no $DISPLAY, no default browser, sandbox restrictions) don’t trigger the intended fallback behavior (printing the URL).
## Issue Context
Other pacquet CLI code that launches subprocesses generally uses `status()` and checks `success()` so failures are detected and surfaced.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[87-141]
- pacquet/crates/cli/src/cli_args/dlx.rs[341-372]
- pacquet/crates/cli/src/cli_args/pack_app.rs[948-956]
## Suggested change
- On Linux/macOS, replace `spawn()` with `status()` (or `spawn()` + `wait()`) and treat non-zero exit as an error so the existing error branch prints the redacted URL.
- Convert non-success exit statuses into an `io::Error` (e.g. `ErrorKind::Other`) with a message including the status code.
- Keep Windows/unsupported-platform handling as-is.

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


11. Retry config ignored 🐞 Bug ☼ Reliability
Description
DocsArgs::run() hard-codes RetryOpts::default() for the registry metadata fetch, ignoring the
user-configured fetch-retries* settings on Config. This makes pacquet docs/home retry/backoff
even when a user intentionally set fetch-retries=0 (and diverges from other CLI registry calls
that honor these knobs).
Code

pacquet/crates/cli/src/cli_args/docs.rs[R45-55]

+        let outcome = fetch_full_metadata(
+            resolved_name,
+            &FetchFullMetadataOptions {
+                registry: &registry,
+                http_client: &http_client,
+                auth_headers: &config.auth_headers,
+                full_metadata: true,
+                etag: None,
+                modified: None,
+                retry_opts: RetryOpts::default(),
+            },
Evidence
The new docs command passes RetryOpts::default() into fetch_full_metadata, while Config
clearly exposes fetch-retry knobs and other CLI registry commands build RetryOpts from those
config fields. The default retry policy is non-trivial (2 retries with 10s/60s backoff), so ignoring
config materially changes runtime behavior.

pacquet/crates/cli/src/cli_args/docs.rs[45-55]
pacquet/crates/config/src/lib.rs[978-1014]
pacquet/crates/cli/src/cli_args/whoami.rs[41-48]
pacquet/crates/network/src/retry.rs[71-79]

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 docs/home` fetches package metadata using `RetryOpts::default()` rather than constructing `RetryOpts` from `Config` (`fetch_retries`, `fetch_retry_factor`, `fetch_retry_mintimeout`, `fetch_retry_maxtimeout`). This ignores user intent (notably `fetch-retries=0` for fail-fast) and is inconsistent with other CLI registry commands.
## Issue Context
Other CLI commands (e.g. `whoami`, `dist-tag`, `audit`) build `RetryOpts` from `Config` for registry requests.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[45-55]
- pacquet/crates/cli/src/cli_args/whoami.rs[41-49]
- pacquet/crates/config/src/lib.rs[978-1014]
- pacquet/crates/network/src/retry.rs[71-79]
## Proposed fix
Construct `RetryOpts` from `config` (mirroring `whoami` / `dist-tag`) and pass that into `FetchFullMetadataOptions.retry_opts` instead of `RetryOpts::default()`. Consider extracting a small shared helper for CLI registry calls if one exists/should exist.

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


View more (6)
12. Unsanitized URL printed 🐞 Bug ⛨ Security
Description
When the browser launcher fails, open_url() prints the URL to stdout, and on URL-parse failure it
prints the raw string without stripping control characters. Because the URL ultimately comes from
untrusted registry metadata (homepage / package.name via fallback), this can inject
newlines/ANSI escapes into terminal/CI logs and spoof subsequent output.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R129-139]

+            let redacted = url::Url::parse(url).map_or_else(
+                |_| url.to_string(),
+                |mut u| {
+                    let _ = u.set_username("");
+                    let _ = u.set_password(None);
+                    u.to_string()
+                },
+            );
+            eprintln!("Could not open browser: {e}");
+            println!("{redacted}");
+            Ok(())
Evidence
The new code prints a potentially untrusted URL on launcher failure, and on parse failure it prints
the raw string; other CLI code explicitly strips control characters from untrusted network-derived
output before printing.

pacquet/crates/cli/src/cli_args/docs.rs[68-75]
pacquet/crates/cli/src/cli_args/docs.rs[129-139]
pacquet/crates/cli/src/cli_args/ping.rs[70-78]

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

## Issue description
`open_url()` prints a URL to stdout when it cannot launch a browser. If `url::Url::parse(url)` fails, it falls back to printing `url.to_string()` verbatim, which can include control characters (e.g. `\n`, `\r`, `\x1b[...]`) from untrusted registry metadata.
## Issue Context
Other CLI commands treat network-derived strings as untrusted and sanitize before printing (credential redaction + control-char stripping). `docs/home` should follow the same contract.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[129-139]
- pacquet/crates/cli/src/cli_args/docs.rs[68-75]
### Suggested fix
- Always apply control-character stripping before printing the URL (even if URL parsing fails).
- Prefer reusing the established pattern from `ping` (redact inline credentials + strip control chars), e.g.:
- `let safe = pacquet_network::redact_url_credentials(&redacted_or_raw).chars().filter(|c| !c.is_control()).collect::<String>();`
- `println!("{safe}");`

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


13. Packlist canonicalize overhead 🐞 Bug ➹ Performance
Description
resolve_paths_in_directory() canonicalizes every packaged file path (fs::canonicalize) when
allow_path_escape is false, adding at least one filesystem syscall per file in packlist mode.
deploy uses packlist by default and sets allow_path_escape=false, so large projects can incur
thousands of extra canonicalizations and noticeably slower deploys.
Code

pacquet/crates/directory-fetcher/src/walker.rs[R257-273]

+pub(crate) fn resolve_paths_in_directory(
+    directory: &Path,
+    files_map: &mut FilesMap,
+) -> Result<(), DirectoryFetcherError> {
+    let root = confined_root(directory)?;
+    for path in files_map.values_mut() {
+        let original = path.clone();
+        let resolved = canonicalize_path(&original)?;
+        if !resolved.starts_with(&root) {
+            return Err(DirectoryFetcherError::PathOutsideDirectory {
+                path: original,
+                directory: root,
+            });
+        }
+        *path = resolved;
+    }
+    Ok(())
Evidence
DirectoryFetcher invokes resolve_paths_in_directory() in packlist mode when containment is
enabled, and that helper canonicalizes each file path. Deploy’s default uses packlist mode
(!deploy_all_files) with containment enabled, so the per-file canonicalize loop runs in a
user-facing path that can touch many files.

pacquet/crates/directory-fetcher/src/fetcher.rs[54-67]
pacquet/crates/directory-fetcher/src/walker.rs[257-279]
pacquet/crates/cli/src/cli_args/deploy.rs[219-233]

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

## Issue description
`resolve_paths_in_directory()` calls `fs::canonicalize()` for every file in the packlist output when path escape is disallowed. On large projects this adds thousands of extra syscalls and can slow `deploy` (default path).
## Issue Context
This check is security-motivated (path containment), but it can be made cheaper by avoiding repeated canonicalization work.
## Fix Focus Areas
- pacquet/crates/directory-fetcher/src/fetcher.rs[55-67]
- pacquet/crates/directory-fetcher/src/walker.rs[257-279]
- pacquet/crates/cli/src/cli_args/deploy.rs[219-233]
## Suggested fix
- Add a caching strategy to avoid full canonicalization per file (e.g., memoize canonicalized parent directories, or canonicalize only when necessary and reuse results across files).
- Consider a fast-path that detects when packlist output is already confined (no symlink/junction involvement) and skips canonicalization, while preserving the containment guarantee.

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


14. Docs bypasses metadata cache 🐞 Bug ➹ Performance
Description
DocsArgs::run() always calls the no-cache fetch_full_metadata() with full_metadata: true, so
each pacquet docs/home invocation re-downloads and parses the full packument even when
Config.cache_dir is available and the resolver has a cache-aware fetch_full_metadata_cached()
implementation. This adds avoidable network and CPU cost for repeated usage.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R44-55]

+        let outcome = fetch_full_metadata(
+            resolved_name,
+            &FetchFullMetadataOptions {
+                registry: &registry,
+                http_client: &http_client,
+                auth_headers: &config.auth_headers,
+                full_metadata: true,
+                etag: None,
+                modified: None,
+                retry_opts: RetryOpts::default(),
+            },
+        )
Evidence
The new command calls the uncached full-metadata fetcher directly, despite the codebase containing a
cache-aware fetcher explicitly meant to reuse cache_dir mirrors via conditional GETs; Config
documents cache_dir for this purpose.

pacquet/crates/cli/src/cli_args/docs.rs[44-55]
pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata_cached.rs[1-17]
pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata_cached.rs[68-120]
pacquet/crates/config/src/lib.rs[1307-1320]

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 docs/home` always uses the no-cache metadata fetcher and requests full metadata. This forces a network download + full JSON parse on every run, even though pacquet already has a cache-aware fetcher designed to reuse an on-disk mirror under `Config.cache_dir` via conditional GET.
### Issue Context
- `fetch_full_metadata_cached` is explicitly designed to consult `<cache_dir>/v11/metadata...` and use conditional requests to avoid re-downloading unchanged packuments.
- `Config` already exposes `cache_dir` and documents it as the packument cache directory.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[40-75]
- pacquet/crates/resolving-npm-resolver/src/fetch_full_metadata_cached.rs[39-66]
### Concrete fix sketch
- Prefer `fetch_full_metadata_cached` for this command:
- Build `FetchFullMetadataCachedOptions { cache_dir: Some(&config.cache_dir), full_metadata: true, filter_metadata: false, ... }`.
- If `FetchFullMetadataCachedOptions.retry_opts` visibility prevents this, consider either:
- making that field public (or adding a constructor) similarly to `FetchFullMetadataOptions`, or
- adding a small helper in `pacquet_resolving_npm_resolver` to build cached options from `Config`.
- Keep behavior identical (still requesting full metadata if homepage requires it), but avoid redundant downloads when the cache is present.

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


15. PATH-based opener execution 🐞 Bug ⛨ Security
Description
open_url() invokes "xdg-open" (Linux) / "open" (macOS) by bare name, so the executable is resolved
via PATH. If pacquet is run in an environment with attacker-influenced PATH (e.g. during scripts
with repo/deps-provided bin directories), this can execute an unintended binary when running
pacquet docs/home.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R88-95]

+        #[cfg(target_os = "linux")]
+        {
+            std::process::Command::new("xdg-open").arg(url).spawn()
+        }
+        #[cfg(target_os = "macos")]
+        {
+            std::process::Command::new("open").arg(url).spawn()
+        }
Evidence
The new command spawns xdg-open/open by name, which is PATH-resolved; the repo’s security guide
explicitly calls out executable resolution as a review risk area.

pacquet/crates/cli/src/cli_args/docs.rs[86-95]
REVIEW_GUIDE.md[48-55]

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

## Issue description
On Linux/macOS, `open_url()` executes `xdg-open`/`open` via PATH lookup. In environments where PATH is influenced by repo/dependency content (common in scripted contexts), this can run an unexpected executable.
### Issue Context
This PR introduces a new `docs/home` command that spawns the platform opener.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[86-96]
### Suggested fix
- Prefer platform APIs or a launcher crate (e.g. `open`/`webbrowser`) that doesn’t rely on PATH for the final executable.
- If staying with `Command`, use an absolute path where stable (macOS: `/usr/bin/open`). For Linux, consider trying common absolute locations (`/usr/bin/xdg-open`, `/bin/xdg-open`) and falling back to PATH only if none exist.

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


16. Unredacted URL output 🐞 Bug ⛨ Security
Description
When the browser launch fails, open_url() prints the URL to stdout, and is_http_url() only checks
scheme, allowing URLs with embedded credentials/userinfo. A registry-controlled homepage like
https://user:[email protected] would be echoed into terminal/CI logs when opening fails.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R125-131]

+    match result {
+        Ok(_) => Ok(()),
+        Err(e) => {
+            // If we can't open the browser, print the URL instead.
+            eprintln!("Could not open browser: {e}");
+            println!("{url}");
+            Ok(())
Evidence
The implementation prints the URL verbatim on failure, and the URL validation only checks for
http/https scheme, not userinfo/credentials.

pacquet/crates/cli/src/cli_args/docs.rs[78-84]
pacquet/crates/cli/src/cli_args/docs.rs[125-131]

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

## Issue description
`open_url()` prints the full URL on failure. Because `is_http_url()` only validates the scheme, URLs containing userinfo (`https://user:pass@host/...`) can be accepted and then leaked to stdout/stderr (CI logs, shared terminals) when browser launch fails.
### Issue Context
Homepage is sourced from registry metadata (attacker-controlled per the security guide’s threat model).
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[78-84]
- pacquet/crates/cli/src/cli_args/docs.rs[125-132]
### Suggested fix
- Tighten `is_http_url()` to reject URLs with userinfo:
- after parse, require `parsed.username().is_empty()` and `parsed.password().is_none()`.
- When printing the URL, print a sanitized form:
- parse as `Url`, clear username/password, and render back to string before `println!`.
- (Optional) consider stripping/obfuscating query strings if you want to prevent token leakage in `?token=...` patterns.

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


17. PATH opener hijack 🐞 Bug ⛨ Security
Description
On Linux/macOS, open_url() executes xdg-open/open by name, relying on PATH-based executable
resolution; if PATH is attacker-influenced (e.g. CI job env, wrapper scripts), running `pacquet
docs/home` can execute an attacker-controlled binary. This is a direct environment-variable
trust/executable-resolution risk in newly added code.
Code

pacquet/crates/cli/src/cli_args/docs.rs[R88-95]

+        #[cfg(target_os = "linux")]
+        {
+            std::process::Command::new("xdg-open").arg(url).spawn()
+        }
+        #[cfg(target_os = "macos")]
+        {
+            std::process::Command::new("open").arg(url).spawn()
+        }
Evidence
The review guide explicitly calls out executable resolution and environment-variable trust as
security hotspots, and the new code uses Command::new() with non-absolute program names on Unix,
which necessarily uses PATH lookup.

REVIEW_GUIDE.md[48-57]
pacquet/crates/cli/src/cli_args/docs.rs[86-95]

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

## Issue description
`open_url()` invokes platform openers on Linux/macOS with `Command::new("xdg-open")` / `Command::new("open")`, which resolves via `PATH`. If `PATH...

Comment on lines +78 to +81
#[cfg(target_os = "windows")]
{
std::process::Command::new("cmd").args(["/c", "start", url]).spawn()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Windows url command injection 🐞 Bug ⛨ Security

On Windows, open_url() spawns cmd /c start <url> with a URL sourced from registry metadata;
because the URL is not quoted/escaped, cmd metacharacters in an otherwise valid http(s) URL can be
interpreted as additional commands. This enables arbitrary command execution when a user runs
pacquet docs <pkg> on Windows against a malicious/compromised registry response.
Agent Prompt
### Issue description
`open_url()` uses `cmd /c start` on Windows with an untrusted URL argument, which can be interpreted by `cmd.exe` when it contains metacharacters. This is a command-injection vulnerability.

### Issue Context
The URL comes from registry metadata (`package.homepage`) and `is_http_url()` only checks scheme.

### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[60-96]

### Suggested fix
- Prefer a non-shell API on Windows (already available via `windows-sys` in this crate): call `ShellExecuteW` with the URL.
- If you must keep `cmd start`, ensure the URL is passed in a way that prevents `cmd` parsing:
  - use `cmd /c start "" "<url>"` (empty title + quoted URL), and ensure the URL string cannot contain quotes.
- Keep the existing behavior of printing the URL when launching fails.

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

Comment on lines +11 to +44
pub struct DocsArgs {
/// Package name (optionally with @version).
pub package: String,
}

impl DocsArgs {
pub async fn run(self, config: &Config) -> miette::Result<()> {
let package_name = &self.package;

let http_client = ThrottledClient::for_installs(
&config.proxy,
&config.tls,
&config.tls_by_uri,
&NetworkSettings {
network_concurrency: config.network_concurrency,
fetch_timeout: std::time::Duration::from_millis(config.fetch_timeout),
user_agent: config.user_agent.clone(),
},
)
.into_diagnostic()
.wrap_err("create the network client for docs")?;

let (resolved_name, _range) =
PackageManifest::resolve_registry_dependency(package_name, package_name);
let registries: std::collections::HashMap<String, String> =
config.resolved_registries().into_iter().collect();
let registry = pick_registry_for_package(&registries, resolved_name, None);

let package = Package::fetch_from_registry(
resolved_name,
&http_client,
&registry,
&config.auth_headers,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Versioned package input breaks 🐞 Bug ≡ Correctness

DocsArgs documents that package may include @version, but it passes the raw CLI string into
PackageManifest::resolve_registry_dependency, which does not parse name@version and will treat
[email protected] as the registry package name. This causes registry fetches to hit a non-existent
packument path and fail for versioned inputs.
Agent Prompt
### Issue description
`pacquet docs` claims to accept `pkg@version` but currently sends the entire string (including `@version`) as the registry package name.

### Issue Context
`PackageManifest::resolve_registry_dependency` is for manifest dependency entries (not CLI wanted deps) and only handles `npm:` aliases.

### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[11-44]

### Suggested fix
- Use the existing wanted-dependency parser to split `name@version` safely:
  - `pacquet_resolving_parse_wanted_dependency::parse_wanted_dependency(&self.package)`
  - Treat `alias` as the registry package name (e.g. `react` in `react@18`).
- Validate that the derived package name is actually an npm package name (reject URL/git/file specs for this command), then proceed with registry selection + metadata fetch.

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

Comment thread pacquet/crates/cli/src/cli_args/docs.rs Outdated
Comment on lines +39 to +55
let package = Package::fetch_from_registry(
resolved_name,
&http_client,
&registry,
&config.auth_headers,
)
.await
.into_diagnostic()
.wrap_err_with(|| format!("fetch package info for {package_name}"))?;

let fallback = || format!("https://npmx.dev/package/{}", package.name);
let url = package
.homepage
.as_deref()
.filter(|s| is_http_url(s))
.map_or_else(fallback, ToString::to_string);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. Homepage often missing 🐞 Bug ≡ Correctness

DocsArgs uses Package::fetch_from_registry(), which prefers the abbreviated install-v1
packument response; per the existing registry model docs, homepage is only present in full
metadata. As a result, pacquet docs will frequently fall back to npmx.dev even when a package
has a homepage.
Agent Prompt
### Issue description
The docs command needs `homepage`, but it currently fetches metadata using an Accept header that typically returns abbreviated `install-v1` packuments which omit `homepage`.

### Issue Context
The repo already has a full-metadata fetcher (`fetch_full_metadata`) that can request `application/json` explicitly.

### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/docs.rs[39-55]

### Suggested fix
- Replace `Package::fetch_from_registry(...)` with `pacquet_resolving_npm_resolver::fetch_full_metadata(...)` using `FetchFullMetadataOptions { full_metadata: true, ... }`.
- Extract the `Package` from `FetchFullMetadataOutcome::Modified` and use its `homepage` field.
- Keep fallback behavior for missing/invalid homepages, but ensure the fetch is full-metadata so existing homepages are actually observed.

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

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

Copy link
Copy Markdown

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

@codecov-commenter

codecov-commenter commented Jun 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 9.58904% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.91%. Comparing base (aea6ace) to head (2923928).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pacquet/crates/cli/src/cli_args/docs.rs 10.00% 63 Missing ⚠️
pacquet/crates/cli/src/cli_args.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12671      +/-   ##
==========================================
- Coverage   87.01%   86.91%   -0.10%     
==========================================
  Files         375      376       +1     
  Lines       57856    57929      +73     
==========================================
+ Hits        50344    50350       +6     
- Misses       7512     7579      +67     

☔ 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 Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 292392840962

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

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 5.072 ± 0.246 4.768 5.665 1.73 ± 0.11
pacquet@main 4.962 ± 0.114 4.841 5.176 1.70 ± 0.08
pnpr@HEAD 2.926 ± 0.066 2.826 3.013 1.00 ± 0.05
pnpr@main 2.925 ± 0.124 2.819 3.152 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 5.0715778255799995,
      "stddev": 0.24605086140090057,
      "median": 4.98520102928,
      "user": 4.0843295,
      "system": 3.6073384399999995,
      "min": 4.76753817878,
      "max": 5.6645671447799995,
      "times": [
        4.97440949478,
        5.6645671447799995,
        4.9127659887799995,
        5.1334016587799995,
        5.15959290078,
        5.20774900378,
        4.76753817878,
        4.99599256378,
        4.968386778779999,
        4.9313745427799995
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.96230112328,
      "stddev": 0.11391450980864759,
      "median": 4.92002954128,
      "user": 4.0987463,
      "system": 3.595195639999999,
      "min": 4.840762358779999,
      "max": 5.175864874779999,
      "times": [
        4.91014219578,
        5.07388263978,
        4.85338585378,
        5.09192183578,
        4.90833301478,
        4.96905089078,
        5.175864874779999,
        4.92991688678,
        4.840762358779999,
        4.869750681779999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.9263062099800004,
      "stddev": 0.06551883710600775,
      "median": 2.9070384127800004,
      "user": 2.7708474,
      "system": 3.0623799399999996,
      "min": 2.8263089207800003,
      "max": 3.01346965778,
      "times": [
        2.8263089207800003,
        2.9059352347800003,
        2.88235456978,
        2.93579489178,
        2.87639432378,
        2.8913996977800003,
        2.90814159078,
        3.01123260978,
        3.01346965778,
        3.01203060278
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.9248622690799997,
      "stddev": 0.12361993841041806,
      "median": 2.8749594382800003,
      "user": 2.7674601,
      "system": 3.06320774,
      "min": 2.8187580367800003,
      "max": 3.15200087778,
      "times": [
        3.13840189578,
        2.8348227767800003,
        2.8187580367800003,
        2.95229943978,
        2.84851368278,
        2.82876647578,
        2.88454316278,
        3.15200087778,
        2.92514062878,
        2.86537571378
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 647.6 ± 11.9 629.7 666.4 1.00 ± 0.03
pacquet@main 645.3 ± 16.5 620.4 666.6 1.00
pnpr@HEAD 712.6 ± 24.2 683.3 765.5 1.10 ± 0.05
pnpr@main 692.8 ± 32.7 670.0 777.5 1.07 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6475875475000001,
      "stddev": 0.011919265165903234,
      "median": 0.6478725369,
      "user": 0.3983543399999999,
      "system": 1.3306236999999999,
      "min": 0.6297107249000001,
      "max": 0.6664403149000001,
      "times": [
        0.6392276799000001,
        0.6664403149000001,
        0.6574284229,
        0.6318352899,
        0.6574401109000001,
        0.6543733659000001,
        0.6436744919,
        0.6439896449000001,
        0.6517554289,
        0.6297107249000001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6453116741,
      "stddev": 0.01650815024196389,
      "median": 0.6438193749000001,
      "user": 0.38310784,
      "system": 1.3318396999999997,
      "min": 0.6203843179,
      "max": 0.6665654169,
      "times": [
        0.6384783539000001,
        0.6387163249000001,
        0.6203843179,
        0.6431476479000001,
        0.6583348729,
        0.6603051329,
        0.6206323089000001,
        0.6665654169,
        0.6620612629000001,
        0.6444911019
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.7125664124000001,
      "stddev": 0.02420978289180034,
      "median": 0.7108045644000001,
      "user": 0.39799863999999996,
      "system": 1.3686211999999998,
      "min": 0.6833406929000001,
      "max": 0.7655128189000001,
      "times": [
        0.6833406929000001,
        0.6924780469,
        0.7166877199000001,
        0.7146837469000001,
        0.6863612869000001,
        0.7655128189000001,
        0.7256227429000001,
        0.7055415869000001,
        0.7069253819000001,
        0.7285100999
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6927799348000002,
      "stddev": 0.03271141857546105,
      "median": 0.6805183029000001,
      "user": 0.39338094,
      "system": 1.3668219999999995,
      "min": 0.6699978229000001,
      "max": 0.7774960359,
      "times": [
        0.6909872899000001,
        0.6717106679000001,
        0.7147266879,
        0.6759664879000001,
        0.6932678229000001,
        0.6726099269000001,
        0.6777571709000001,
        0.7774960359,
        0.6699978229000001,
        0.6832794349000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.816 ± 0.043 4.766 4.914 1.49 ± 0.06
pacquet@main 4.830 ± 0.042 4.779 4.909 1.50 ± 0.06
pnpr@HEAD 3.244 ± 0.110 3.129 3.452 1.01 ± 0.05
pnpr@main 3.227 ± 0.116 3.116 3.476 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.8163141742,
      "stddev": 0.04251588745451984,
      "median": 4.8006860689,
      "user": 3.9224593,
      "system": 3.4667709,
      "min": 4.7658284509,
      "max": 4.9140239889,
      "times": [
        4.8010444779000006,
        4.7929951079,
        4.9140239889,
        4.8305204219,
        4.785521627900001,
        4.8003276599,
        4.8428147329,
        4.789691797900001,
        4.7658284509,
        4.8403734759
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.8300233183,
      "stddev": 0.04157057378778476,
      "median": 4.8209485224,
      "user": 3.9497786999999995,
      "system": 3.4619255000000004,
      "min": 4.7790867619,
      "max": 4.9090607189,
      "times": [
        4.812651332900001,
        4.8272276789,
        4.8414889799,
        4.8146693659,
        4.8874841599000005,
        4.7949335259,
        4.8408238639,
        4.9090607189,
        4.7928067949,
        4.7790867619
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.2437902323000003,
      "stddev": 0.11015224304613917,
      "median": 3.2230119944,
      "user": 2.8614502,
      "system": 3.2246396000000006,
      "min": 3.1287990019,
      "max": 3.4523203269000002,
      "times": [
        3.2210356119,
        3.2338050509,
        3.1430254949000003,
        3.3089945619,
        3.3988797109,
        3.1287990019,
        3.1661597889000004,
        3.2249883769000003,
        3.4523203269000002,
        3.1598943979
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.2266264417999997,
      "stddev": 0.11575729836589044,
      "median": 3.1991894994,
      "user": 2.83823,
      "system": 3.2028068,
      "min": 3.1155399359000002,
      "max": 3.4763228269,
      "times": [
        3.2292305659,
        3.1155399359000002,
        3.3306230269,
        3.1363418299,
        3.3146041199000003,
        3.4763228269,
        3.1341687579000004,
        3.2011643289,
        3.1972146699,
        3.1310543559000004
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.364 ± 0.008 1.356 1.381 1.00
pacquet@main 1.402 ± 0.036 1.357 1.469 1.03 ± 0.03
pnpr@HEAD 1.456 ± 0.032 1.425 1.540 1.07 ± 0.02
pnpr@main 1.497 ± 0.059 1.443 1.654 1.10 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.36418462932,
      "stddev": 0.008246343328447436,
      "median": 1.36280320942,
      "user": 1.3279975800000001,
      "system": 1.72087766,
      "min": 1.3556463919200001,
      "max": 1.38116154592,
      "times": [
        1.35640653292,
        1.36524958692,
        1.3556463919200001,
        1.36035683192,
        1.3567106769200001,
        1.35828975492,
        1.36775351492,
        1.38116154592,
        1.3706046869200001,
        1.36966676992
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.40151802832,
      "stddev": 0.03622597568938649,
      "median": 1.40239276892,
      "user": 1.3596073800000001,
      "system": 1.7365408600000003,
      "min": 1.35691820692,
      "max": 1.46943087192,
      "times": [
        1.42729745592,
        1.3780067009199999,
        1.35691820692,
        1.46943087192,
        1.40467992492,
        1.40269782492,
        1.35803641792,
        1.37634628392,
        1.43967888292,
        1.40208771292
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.45573674712,
      "stddev": 0.03200943329401633,
      "median": 1.44664547142,
      "user": 0.5829908799999999,
      "system": 1.59636336,
      "min": 1.42458534092,
      "max": 1.54019439992,
      "times": [
        1.46531819192,
        1.54019439992,
        1.46189546492,
        1.42458534092,
        1.43952750492,
        1.44471435692,
        1.4485765859200002,
        1.45424142292,
        1.4385699729199999,
        1.43974422992
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4974314435200002,
      "stddev": 0.05937186737439882,
      "median": 1.49274052442,
      "user": 0.5987802799999999,
      "system": 1.61771646,
      "min": 1.44320719092,
      "max": 1.65398685792,
      "times": [
        1.44320719092,
        1.65398685792,
        1.50488425092,
        1.50058872992,
        1.5023158629200002,
        1.45401208892,
        1.4994011549200001,
        1.47010864292,
        1.48607989392,
        1.45972976192
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.030 ± 0.030 2.998 3.092 2.10 ± 0.04
pacquet@main 3.060 ± 0.042 3.009 3.141 2.12 ± 0.05
pnpr@HEAD 1.441 ± 0.027 1.402 1.482 1.00
pnpr@main 1.470 ± 0.069 1.429 1.661 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.03010442634,
      "stddev": 0.03041355256158757,
      "median": 3.02743172774,
      "user": 1.7761979999999997,
      "system": 1.9727306599999999,
      "min": 2.99771821674,
      "max": 3.09231717774,
      "times": [
        3.01049970874,
        2.99771821674,
        3.0493526037399996,
        3.02656438574,
        3.00296996774,
        3.00012555374,
        3.06169508774,
        3.0282990697399996,
        3.09231717774,
        3.03150249174
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.0604852904399995,
      "stddev": 0.042356601633237505,
      "median": 3.06339613324,
      "user": 1.8201568000000001,
      "system": 1.99150746,
      "min": 3.00924192474,
      "max": 3.1411501397399997,
      "times": [
        3.0245466837399997,
        3.09118301474,
        3.07474522874,
        3.0818929307399996,
        3.00924192474,
        3.0110819897399996,
        3.03115738774,
        3.05204703774,
        3.1411501397399997,
        3.08780656674
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4408531342400002,
      "stddev": 0.026838750152778548,
      "median": 1.43548881224,
      "user": 0.5876474,
      "system": 1.5818355599999996,
      "min": 1.40160454174,
      "max": 1.4820100067400002,
      "times": [
        1.46075321574,
        1.45517024374,
        1.4820100067400002,
        1.4767617047400001,
        1.41794142774,
        1.4392102877400001,
        1.42398796274,
        1.40160454174,
        1.4317673367400001,
        1.41932461474
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4702314740399998,
      "stddev": 0.06861136220855411,
      "median": 1.45276381574,
      "user": 0.5922243999999999,
      "system": 1.5786685599999999,
      "min": 1.42919701474,
      "max": 1.6612683887400002,
      "times": [
        1.46588917674,
        1.6612683887400002,
        1.46818549374,
        1.45188033774,
        1.46321507874,
        1.44041827974,
        1.42919701474,
        1.45364729374,
        1.43847130074,
        1.43014237574
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12671
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
4,816.31 ms
(+1.17%)Baseline: 4,760.58 ms
5,712.70 ms
(84.31%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,030.10 ms
(-0.50%)Baseline: 3,045.28 ms
3,654.33 ms
(82.92%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,364.18 ms
(+0.44%)Baseline: 1,358.19 ms
1,629.83 ms
(83.70%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
5,071.58 ms
(+5.49%)Baseline: 4,807.72 ms
5,769.27 ms
(87.91%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
647.59 ms
(-1.36%)Baseline: 656.50 ms
787.80 ms
(82.20%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12671
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

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

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
3,243.79 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
1,440.85 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
1,455.74 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,926.31 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
712.57 ms
🐰 View full continuous benchmarking report in Bencher

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

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7164a00

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

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7164a00

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

qodo-free-for-open-source-projects Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

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

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

… command

- Pass bare_specifier to resolve_registry_dependency for npm: alias support
- Pass bare_specifier to pick_registry_for_package for correct registry routing
- Redact credentials from URL before printing on browser launch failure
- Replace star import with explicit use super::is_http_url in tests
- Remove duplicate url dependency in Cargo.toml
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 120ae0d

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

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 120ae0d

The closure parameter `|mut u|` in docs.rs:131 triggers the
perfectionist::single-letter-closure-param lint. Rename to
`parsed_url` to match the codestyle.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

@zkochan
zkochan merged commit 6bd7ba8 into pnpm:main Jun 26, 2026
31 checks passed
@kairosci
kairosci deleted the feat/paquet-docs branch June 28, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants