Skip to content

fix(audit): correct patched version ranges against actually published versions - #13832

Merged
zkochan merged 9 commits into
pnpm:mainfrom
btea:fix/audit-unpublished-patched-versions
Aug 20, 2026
Merged

zkochan merged 9 commits into
pnpm:mainfrom
btea:fix/audit-unpublished-patched-versions

Conversation

@btea

@btea btea commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Summary

close #13824 #13678 (comment)

Squash Commit Body

`pnpm audit` no longer reports a patched version that was never published or is deprecated. The inferred patched range (e.g. `>=4.17.24` from `<=4.17.23`) is now checked against the registry packument, and the report is corrected to the lowest non-deprecated published version that satisfies it (e.g. `>=4.18.1` when `4.17.24` does not exist and `4.18.0` is deprecated). When no published version satisfies the range, the report shows `Patched versions: None`. This also prevents `pnpm audit --fix` from adding overrides or `minimumReleaseAgeExclude` entries for patches that do not exist [#13824](https://github.com/pnpm/pnpm/issues/13824).

`pnpm audit --fix` and `pnpm audit --fix update` no longer add a `minimumReleaseAgeExclude` entry when the registry packument shows that the minimum patched version was never published. Previously such entries were written for versions that do not exist, which would have let a later publish of that version bypass the `minimumReleaseAge` gate [#11563](https://github.com/pnpm/pnpm/issues/11563).

The `--json` output of `pnpm audit` now returns `patched_versions: null` for advisories whose inferred patch is not available (never published, skipped, yanked, or deprecated), making it easier for tooling to distinguish "no fix available" from "fix available at version X".

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

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

Summary by CodeRabbit

  • Bug Fixes
    • Audit now ignores inferred patched versions that are not published in the registry.
    • Audit fix no longer adds invalid overrides or minimum-release-age exclusions for unpublished versions.
    • The lowest published version satisfying a patch range is selected when calculating exclusions.
    • Audit output displays None when no valid patched version is available.
    • Existing exclusions are preserved when registry metadata is unavailable or cannot be interpreted.
  • Tests
    • Expanded coverage for unpublished versions and unavailable publication metadata.

@btea
btea requested a review from zkochan as a code owner August 11, 2026 14:26
Copilot AI lite review requested due to automatic review settings August 11, 2026 14:26
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 11, 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: 2399840e-159b-41b2-93bf-d5790695c7da

📥 Commits

Reviewing files that changed from the base of the PR and between cc2d466 and ed2d6cd.

📒 Files selected for processing (1)
  • pnpm/crates/cli/src/cli_args/audit/tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/crates/cli/src/cli_args/audit/tests.rs

Important

Approval pending

CodeRabbit has no unresolved comments, but it has not reviewed the latest commit.

Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Audit now validates inferred patched versions against published registry versions. Unpublished versions are removed from audit results and do not create overrides or minimumReleaseAgeExclude entries. TypeScript and Rust implementations include matching tests and output updates.

Changes

Published patched-version validation

Layer / File(s) Summary
TypeScript advisory filtering
pnpm11/deps/compliance/audit/src/{index.ts,types.ts}, pnpm11/deps/compliance/commands/src/audit/{audit.ts,publishTimes.ts}
The audit flow checks patched ranges against published package versions before reporting or fixing. Unsatisfiable ranges are cleared and marked as unpublished.
TypeScript minimum-release-age handling
pnpm11/deps/compliance/commands/src/audit/{fix.ts,fixWithUpdate.ts}, pnpm11/deps/compliance/commands/test/audit/fix.ts
Missing versions in successful packument results no longer receive age exclusions. Unknown or invalid publish times retain existing handling.
Rust validation, output, and regression coverage
pnpm/crates/cli/src/cli_args/audit/{audit.rs,fix.rs,render.rs,report.rs}, pnpm/crates/cli/src/cli_args/audit/tests.rs, pnpm/crates/cli/tests/suite/audit.rs, .changeset/audit-fix-age-excludes-unpublished-versions.md
The Rust audit flow shares publish-time maps between validation and fixes. Rendering uses None for unpublished patched versions. Tests cover shared requests, omitted fixes, and omitted exclusions.

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

Sequence Diagram(s)

sequenceDiagram
  participant AuditCommand
  participant PublishTimeValidator
  participant Registry
  participant AuditFix
  AuditCommand->>PublishTimeValidator: pass audit advisories
  PublishTimeValidator->>Registry: fetch package publish-time metadata
  Registry-->>PublishTimeValidator: published version map
  PublishTimeValidator->>PublishTimeValidator: match patched ranges
  PublishTimeValidator-->>AuditCommand: filtered advisories
  AuditCommand->>AuditFix: pass shared publish-time data
Loading

Possibly related PRs

  • pnpm/pnpm#13159: This PR extends its unpublished patched-version validation.
  • pnpm/pnpm#13614: Both changes prevent unpublished inferred patched versions from producing audit fixes or exclusions.
  • pnpm/pnpm#13657: This PR modifies the audit modules and APIs introduced there.

Suggested labels: product: pacquet, product: pnpm@11

Suggested reviewers: zkochan

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

@greptile-apps

greptile-apps Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 3/5

The PR is not yet safe to merge because exact-version age exclusions can miss the version selected by a caret override, and Rust update remediation can still advertise a fix outside the dependency's selectable range.

The current TypeScript fix path exempts only one published version even though its override may resolve to another fresh version, while the Rust update path does not constrain resolution to the published version advertised by the corrected report; both previously reported installation failures remain reachable.

Files Needing Attention: pnpm11/deps/compliance/commands/src/audit/fix.ts; pnpm/crates/cli/src/cli_args/audit/fix.rs

Reviews (12): Last reviewed commit: "fix(audit): match deprecations on the pa..." | Re-trigger Greptile

@codecov-commenter

codecov-commenter commented Aug 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.15%. Comparing base (eead54f) to head (369f0bb).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/cli/src/cli_args/audit/fix.rs 95.65% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #13832    +/-   ##
========================================
  Coverage   88.15%   88.15%            
========================================
  Files         644      644            
  Lines      106710   106818   +108     
========================================
+ Hits        94074    94170    +96     
- Misses      12636    12648    +12     

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

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Caution

CodeRabbit couldn't update its existing comment. The review summary may be out of date.

Error details
putComment timed out

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

🧹 Nitpick comments (1)
pnpm/crates/cli/src/cli_args/audit.rs (1)

247-251: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy lift

Reuse publish-time maps across audit fix processing.

The validator fetches each packument and discards the result. The minimum-release-age flow then fetches the same packument again. This doubles registry traffic and serial request latency for audit --fix with minimumReleaseAge.

  • pnpm/crates/cli/src/cli_args/audit.rs#L247-L251: return the fetched Option<HashMap<String, String>> values with the normalization result.
  • pnpm/crates/cli/src/cli_args/audit/fix.rs#L198-L208: consume the pre-fetched map while preserving the None fail-open distinction.
  • pnpm/crates/cli/tests/suite/audit.rs#L731-L741: change the old-patch fixture to expect one packument request.
  • pnpm/crates/cli/tests/suite/audit.rs#L839-L847: change the multi-advisory fixture to expect one packument request.

As per path instructions, “Avoid unnecessary registry requests.”

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

In `@pnpm/crates/cli/src/cli_args/audit.rs` around lines 247 - 251, Reuse fetched
publish-time packument maps through audit fix processing instead of refetching
them: update drop_unsatisfiable_patched_versions in
pnpm/crates/cli/src/cli_args/audit.rs:247-251 to return the fetched
Option<HashMap<String, String>> values with the normalization result, and update
the audit fix flow in pnpm/crates/cli/src/cli_args/audit/fix.rs:198-208 to
consume those maps while preserving None as the fail-open case. Update the
old-patch and multi-advisory fixtures in
pnpm/crates/cli/tests/suite/audit.rs:731-741 and
pnpm/crates/cli/tests/suite/audit.rs:839-847 to expect one packument request.

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 `@pnpm/crates/cli/src/cli_args/audit.rs`:
- Around line 516-523: The `fix_published` logic in the audit version-time
handling must fail open for invalid non-metadata keys: parse every key as a
`Result`, retain `advisory.patched_versions` if any parse fails, and set it to
`None` only when all keys parse successfully and none satisfies `range`. Apply
the same behavior in `publishTimes.ts` and add corresponding regression tests.

In `@pnpm/crates/cli/src/cli_args/audit/render.rs`:
- Line 81: Add a regression test alongside the existing text-report rendering
test, configuring the advisory’s patched_versions field to None and asserting
that the rendered table displays “Patched versions” with the value “None.”

In `@pnpm11/deps/compliance/commands/src/audit/audit.ts`:
- Around line 248-250: Update the audit flow around
dropUnsatisfiablePatchedVersions so advisories are first filtered according to
the selected operation’s auditLevel, ignoreGhsas, and fix eligibility, then
validate patched versions only for that selected set. Preserve report and fix
behavior while avoiding registry requests for advisories that cannot affect the
operation.

In `@pnpm11/deps/compliance/commands/src/audit/publishTimes.ts`:
- Around line 76-85: In publishTimes.ts, update the version-key evaluation
around getPublishTimes so unparsable non-created/modified keys are treated as
unknown metadata: retain patched_versions rather than clearing it, while
preserving the existing satisfiesSafe behavior for valid versions. Apply the
corresponding retention behavior in fix.ts, and add regression coverage in
commands/test/audit/fix.ts for both the TypeScript report flow and Rust
age-exclusion flow; changes are required at
pnpm11/deps/compliance/commands/src/audit/publishTimes.ts:76-85,
pnpm11/deps/compliance/commands/src/audit/fix.ts:99-102, and
pnpm11/deps/compliance/commands/test/audit/fix.ts:367-383.

---

Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/audit.rs`:
- Around line 247-251: Reuse fetched publish-time packument maps through audit
fix processing instead of refetching them: update
drop_unsatisfiable_patched_versions in
pnpm/crates/cli/src/cli_args/audit.rs:247-251 to return the fetched
Option<HashMap<String, String>> values with the normalization result, and update
the audit fix flow in pnpm/crates/cli/src/cli_args/audit/fix.rs:198-208 to
consume those maps while preserving None as the fail-open case. Update the
old-patch and multi-advisory fixtures in
pnpm/crates/cli/tests/suite/audit.rs:731-741 and
pnpm/crates/cli/tests/suite/audit.rs:839-847 to expect one packument request.
🪄 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: bae18e81-e7cb-44ca-b5e7-cf4de818c269

📥 Commits

Reviewing files that changed from the base of the PR and between f756b62 and cf9302c.

📒 Files selected for processing (11)
  • .changeset/audit-fix-age-excludes-unpublished-versions.md
  • pnpm/crates/cli/src/cli_args/audit.rs
  • pnpm/crates/cli/src/cli_args/audit/fix.rs
  • pnpm/crates/cli/src/cli_args/audit/render.rs
  • pnpm/crates/cli/src/cli_args/audit/tests.rs
  • pnpm/crates/cli/tests/suite/audit.rs
  • pnpm11/deps/compliance/audit/src/index.ts
  • pnpm11/deps/compliance/commands/src/audit/audit.ts
  • pnpm11/deps/compliance/commands/src/audit/fix.ts
  • pnpm11/deps/compliance/commands/src/audit/publishTimes.ts
  • pnpm11/deps/compliance/commands/test/audit/fix.ts

Comment thread pnpm/crates/cli/src/cli_args/audit.rs Resolved

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.

Pull request overview

Ensures pnpm audit and pnpm audit --fix don’t claim or act on “patched versions” that were never published by verifying the inferred patched range against the registry packument, and aligning this behavior across the TypeScript CLI and the Rust (pacquet) port.

Changes:

  • Verify inferred patched_versions against published versions and drop the range when no published version satisfies it (so the report can show no available fix).
  • Skip writing minimumReleaseAgeExclude (and related fix artifacts) when the minimum patched version is absent from a successfully fetched packument (i.e. unpublished).
  • Add/adjust TS + Rust test coverage and ship a changeset for the user-facing behavior change.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm11/deps/compliance/commands/test/audit/fix.ts Adds tests to ensure --fix doesn’t write overrides/age-excludes for unpublished patched versions.
pnpm11/deps/compliance/commands/src/audit/publishTimes.ts Adds dropUnsatisfiablePatchedVersions and publish-time fetching support used for patched-range validation.
pnpm11/deps/compliance/commands/src/audit/fix.ts Updates minimumReleaseAgeExclude generation to treat missing versions in fetched packuments as “unpublished”.
pnpm11/deps/compliance/commands/src/audit/audit.ts Runs the new patched-range validation before reporting/fixing; updates patched version rendering.
pnpm11/deps/compliance/audit/src/index.ts Exports satisfiesSafe for reuse in patched-range validation.
pnpm/crates/cli/tests/suite/audit.rs Adds/updates pacquet e2e tests for unpublished patch behavior and packument-fetch expectations.
pnpm/crates/cli/src/cli_args/audit/tests.rs Adjusts unit tests for minimum-release-age exclusion logic and adds coverage for unpublished versions.
pnpm/crates/cli/src/cli_args/audit/render.rs Updates patched version rendering in Rust output.
pnpm/crates/cli/src/cli_args/audit/fix.rs Updates Rust age-exclude logic to skip unpublished versions; exposes packument time fetcher for reuse.
pnpm/crates/cli/src/cli_args/audit.rs Adds Rust-side patched-range validation (drop_unsatisfiable_patched_versions) before rendering/fixing.
.changeset/audit-fix-age-excludes-unpublished-versions.md Release note + version bumps for TS CLI + pacquet parity.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pnpm/crates/cli/src/cli_args/audit.rs Resolved
Copilot AI review requested due to automatic review settings August 11, 2026 14:36
@btea
btea force-pushed the fix/audit-unpublished-patched-versions branch from cf9302c to 41d30f4 Compare August 11, 2026 14:36

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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (2)

pnpm11/deps/compliance/commands/src/audit/audit.ts:369

  • Rendering patched_versions as None when the field is undefined conflates two different cases. In @pnpm/deps.compliance.audit the inference can return undefined when the patched range cannot be inferred from vulnerable_versions (see inferPatchedVersions comment in pnpm11/deps/compliance/audit/src/index.ts), which is closer to “unknown” than “no fix”. With this change, advisories with non-inferable fixes will now be reported as having no patched versions.

Consider keeping (unknown) (or similar) for the “could not infer” case, while still showing None specifically when an inferred range was dropped by dropUnsatisfiablePatchedVersions. That likely requires carrying an explicit marker for “dropped as unpublished” rather than overloading undefined.

      ['Package', advisory.module_name],
      ['Vulnerable versions', advisory.vulnerable_versions],
      ['Patched versions', advisory.patched_versions ?? 'None'],
      [

pnpm/crates/cli/src/cli_args/audit/render.rs:82

  • This renders missing patched_versions as None, but patched_versions == None can also mean the patched range could not be inferred (not necessarily that there is no fix). That makes the report potentially misleading for advisories where inference fails.

Consider rendering an “unknown” label for the “cannot infer” case, while still rendering None specifically when an inferred range was dropped because no published version satisfies it. This likely needs an explicit marker for “dropped as unpublished” rather than overloading None.

        .push_record(vec!["Vulnerable versions".to_string(), advisory.vulnerable_versions.clone()]);
    builder.push_record(vec![
        "Patched versions".to_string(),
        advisory.patched_versions.clone().unwrap_or_else(|| "None".to_string()),
    ]);

@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 369f0bb70e73

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.600 ± 0.191 2.385 2.849 1.70 ± 0.18
pacquet@main 2.632 ± 0.162 2.313 2.779 1.72 ± 0.17
pnpr@HEAD 1.648 ± 0.052 1.578 1.744 1.08 ± 0.09
pnpr@main 1.527 ± 0.122 1.292 1.673 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6000861640000004,
      "stddev": 0.19077370919718883,
      "median": 2.5528686449,
      "user": 1.6296920799999999,
      "system": 1.62718248,
      "min": 2.3854455099000003,
      "max": 2.8493317199000003
    },
    {
      "command": "pacquet@main",
      "mean": 2.6316150901000004,
      "stddev": 0.1615231760671021,
      "median": 2.6881056054,
      "user": 1.4517761799999997,
      "system": 1.49082318,
      "min": 2.3134736589,
      "max": 2.7787123819
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6476524287999996,
      "stddev": 0.05190495170403015,
      "median": 1.6511596029,
      "user": 1.17768308,
      "system": 1.23998658,
      "min": 1.5775958289,
      "max": 1.7444472308999999
    },
    {
      "command": "pnpr@main",
      "mean": 1.5269871590999997,
      "stddev": 0.1215766989629595,
      "median": 1.5509793124,
      "user": 1.0732794799999996,
      "system": 1.21739308,
      "min": 1.2915898779,
      "max": 1.6734814979
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 262.0 ± 8.0 247.9 279.7 1.00 ± 0.04
pacquet@main 263.8 ± 10.6 255.4 288.3 1.01 ± 0.05
pnpr@HEAD 265.6 ± 9.7 254.6 287.1 1.02 ± 0.05
pnpr@main 261.4 ± 7.4 250.4 276.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2619818318600001,
      "stddev": 0.008030345063135633,
      "median": 0.26027869346,
      "user": 0.20016946,
      "system": 0.48121973999999995,
      "min": 0.24790313396000002,
      "max": 0.27967044896000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.2637805490600001,
      "stddev": 0.010618809851295354,
      "median": 0.25940454046000005,
      "user": 0.20715096000000002,
      "system": 0.46550193999999995,
      "min": 0.25543151796,
      "max": 0.28828449296
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26559189156000007,
      "stddev": 0.009691919158122066,
      "median": 0.26376822246000003,
      "user": 0.21042435999999998,
      "system": 0.47427063999999997,
      "min": 0.25462914996,
      "max": 0.28713059196
    },
    {
      "command": "pnpr@main",
      "mean": 0.26136023246000006,
      "stddev": 0.007430713562492839,
      "median": 0.26145048846,
      "user": 0.19796966000000002,
      "system": 0.47626694,
      "min": 0.25036184496,
      "max": 0.27663859996000006
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 6.2 ± 0.3 5.6 8.3 1.02 ± 0.07
pacquet@main 6.3 ± 0.4 5.5 9.3 1.04 ± 0.09
pnpr@HEAD 6.0 ± 0.3 5.5 7.2 1.00
pnpr@main 6.2 ± 0.3 5.6 7.3 1.03 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.006178230741642513,
      "stddev": 0.0003228035178612183,
      "median": 0.00613672386,
      "user": 0.004189119613526572,
      "system": 0.00203488768115942,
      "min": 0.00560252036,
      "max": 0.00831568236
    },
    {
      "command": "pacquet@main",
      "mean": 0.006272905398095234,
      "stddev": 0.0004336526633670376,
      "median": 0.00621851886,
      "user": 0.004182365714285718,
      "system": 0.0021343083333333324,
      "min": 0.00547833536,
      "max": 0.00928336136
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.006047380416701031,
      "stddev": 0.00028325751412564085,
      "median": 0.00602320086,
      "user": 0.003929834639175258,
      "system": 0.00216327706185567,
      "min": 0.00547922836,
      "max": 0.0072460903600000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.006212831029014082,
      "stddev": 0.0002686351423676198,
      "median": 0.0062135433600000005,
      "user": 0.0042186400938967125,
      "system": 0.002039556338028169,
      "min": 0.00557128036,
      "max": 0.00732023936
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 6.1 ± 0.3 5.7 7.6 1.00
pacquet@main 6.3 ± 0.4 5.5 9.0 1.03 ± 0.08
pnpr@HEAD 6.7 ± 1.2 5.4 12.2 1.10 ± 0.21
pnpr@main 7.3 ± 0.9 5.8 13.8 1.18 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.006127301031428573,
      "stddev": 0.00025193518884967115,
      "median": 0.00608318094,
      "user": 0.004490074285714285,
      "system": 0.0016772017142857147,
      "min": 0.00566858194,
      "max": 0.007575227940000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.006340766643488372,
      "stddev": 0.0004356914901133136,
      "median": 0.006288417940000001,
      "user": 0.004402096279069771,
      "system": 0.0019715824418604644,
      "min": 0.00548842294,
      "max": 0.00904298794
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.006716145530659341,
      "stddev": 0.0012450879530310132,
      "median": 0.006210074440000001,
      "user": 0.004418032197802197,
      "system": 0.0023147038461538445,
      "min": 0.005402851940000001,
      "max": 0.01223471994
    },
    {
      "command": "pnpr@main",
      "mean": 0.007256466653804722,
      "stddev": 0.0009480339335948192,
      "median": 0.00712190394,
      "user": 0.004829416026936026,
      "system": 0.002445885656565658,
      "min": 0.005849390940000001,
      "max": 0.01380180594
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.905 ± 0.101 2.777 3.026 1.90 ± 0.17
pacquet@main 2.777 ± 0.023 2.737 2.822 1.82 ± 0.15
pnpr@HEAD 1.526 ± 0.126 1.403 1.804 1.00
pnpr@main 1.665 ± 0.172 1.473 1.880 1.09 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.9054411604799997,
      "stddev": 0.10066266335826383,
      "median": 2.90030709188,
      "user": 1.92269522,
      "system": 1.51840996,
      "min": 2.7768657338800002,
      "max": 3.02558547388
    },
    {
      "command": "pacquet@main",
      "mean": 2.77698752298,
      "stddev": 0.022951162176844866,
      "median": 2.77380969738,
      "user": 1.56990182,
      "system": 1.2715200599999998,
      "min": 2.73717874088,
      "max": 2.8215413588800002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5259074300799997,
      "stddev": 0.12593560694706413,
      "median": 1.4930253383799998,
      "user": 1.09624372,
      "system": 1.32053376,
      "min": 1.4032186868799998,
      "max": 1.80385319188
    },
    {
      "command": "pnpr@main",
      "mean": 1.66528764618,
      "stddev": 0.17249916976386565,
      "median": 1.67845876438,
      "user": 1.33370042,
      "system": 1.56691126,
      "min": 1.4728009498799999,
      "max": 1.87996133788
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 583.3 ± 94.5 483.0 795.4 1.59 ± 0.28
pacquet@main 574.8 ± 70.0 459.2 713.7 1.56 ± 0.22
pnpr@HEAD 392.6 ± 13.7 372.8 411.7 1.07 ± 0.09
pnpr@main 367.6 ± 27.2 335.5 417.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.58334242072,
      "stddev": 0.0945163713705823,
      "median": 0.54629531202,
      "user": 0.72726088,
      "system": 0.7690127199999999,
      "min": 0.48301050652000005,
      "max": 0.7953648455200001
    },
    {
      "command": "pacquet@main",
      "mean": 0.5747583537200001,
      "stddev": 0.06996123598239305,
      "median": 0.57997215652,
      "user": 0.74239228,
      "system": 0.76306432,
      "min": 0.45919770052000003,
      "max": 0.71367060352
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3926389572200001,
      "stddev": 0.013701387172720259,
      "median": 0.39120912001999997,
      "user": 0.29791838,
      "system": 0.54670602,
      "min": 0.37277924452,
      "max": 0.41166284952000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.36757299572,
      "stddev": 0.027216845726023522,
      "median": 0.36172438852,
      "user": 0.24255178000000002,
      "system": 0.55123092,
      "min": 0.33547252652000004,
      "max": 0.41748361452000005
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.244 ± 0.038 2.198 2.343 5.52 ± 0.44
pacquet@main 2.365 ± 0.079 2.250 2.496 5.82 ± 0.49
pnpr@HEAD 0.428 ± 0.026 0.388 0.488 1.05 ± 0.10
pnpr@main 0.407 ± 0.032 0.365 0.456 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.24380452668,
      "stddev": 0.0380480946830769,
      "median": 2.2355131465799998,
      "user": 1.20674532,
      "system": 0.9750617999999998,
      "min": 2.19785830408,
      "max": 2.3432005450799998
    },
    {
      "command": "pacquet@main",
      "mean": 2.36491533478,
      "stddev": 0.07945495306461006,
      "median": 2.3531977880799997,
      "user": 1.3064305199999997,
      "system": 1.0850114000000002,
      "min": 2.24985945208,
      "max": 2.4958820570799998
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.42827304008,
      "stddev": 0.025826026922872922,
      "median": 0.42502780908000004,
      "user": 0.33126372,
      "system": 0.5870687,
      "min": 0.38813705708,
      "max": 0.48754847308000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.40654580058,
      "stddev": 0.0316562185516684,
      "median": 0.40712097608000003,
      "user": 0.27782452,
      "system": 0.5901973999999999,
      "min": 0.36518755908000006,
      "max": 0.45571214108
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 216.3 ± 20.6 176.9 250.4 2.33 ± 0.23
pacquet@main 206.6 ± 18.7 181.7 245.9 2.23 ± 0.21
pnpr@HEAD 93.1 ± 1.8 89.4 97.1 1.00 ± 0.03
pnpr@main 92.7 ± 2.3 88.6 97.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21633654165538463,
      "stddev": 0.020596871877895204,
      "median": 0.21946038504,
      "user": 0.16804062769230768,
      "system": 0.05119428307692308,
      "min": 0.17690821404,
      "max": 0.25035357403999997
    },
    {
      "command": "pacquet@main",
      "mean": 0.2066261425015385,
      "stddev": 0.01874372306189702,
      "median": 0.20208330204000002,
      "user": 0.1528777815384615,
      "system": 0.05775174461538461,
      "min": 0.18170649704000003,
      "max": 0.24592101904000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09310399636258063,
      "stddev": 0.001778124701522972,
      "median": 0.09291746804,
      "user": 0.027624320000000004,
      "system": 0.008253055483870966,
      "min": 0.08939855104000001,
      "max": 0.09707515604000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.09274164097750003,
      "stddev": 0.00226611787551307,
      "median": 0.09223872704000001,
      "user": 0.02586232,
      "system": 0.009241056249999999,
      "min": 0.08857127704000001,
      "max": 0.09703867704000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 492.1 ± 78.0 422.2 666.9 1.00
pacquet@main 496.1 ± 54.0 392.3 564.2 1.01 ± 0.19
pnpm@HEAD 2992.6 ± 106.5 2888.3 3189.3 6.08 ± 0.99
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4920743306022222,
      "stddev": 0.0780316100491552,
      "median": 0.47152479538000003,
      "user": 0.46079260666666666,
      "system": 0.09764613777777778,
      "min": 0.42220334638,
      "max": 0.66693527238
    },
    {
      "command": "pacquet@main",
      "mean": 0.4960540579355555,
      "stddev": 0.053959646952385115,
      "median": 0.50834786338,
      "user": 0.47013949555555556,
      "system": 0.10031736,
      "min": 0.39233653838,
      "max": 0.56422749238
    },
    {
      "command": "pnpm@HEAD",
      "mean": 2.9925777208244444,
      "stddev": 0.10651718978674374,
      "median": 2.96750530838,
      "user": 4.5853629399999996,
      "system": 0.2518249155555556,
      "min": 2.8882634413800004,
      "max": 3.18928268338
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.454 ± 0.152 4.294 4.687 1.32 ± 0.05
pacquet@main 4.338 ± 0.047 4.301 4.432 1.28 ± 0.02
pnpr@HEAD 3.377 ± 0.042 3.341 3.456 1.00
pnpr@main 3.404 ± 0.056 3.338 3.529 1.01 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.454129032359999,
      "stddev": 0.15176744973286738,
      "median": 4.402916236259999,
      "user": 1.2739849199999997,
      "system": 1.3950809999999998,
      "min": 4.293801526259999,
      "max": 4.68728006126
    },
    {
      "command": "pacquet@main",
      "mean": 4.337924575859999,
      "stddev": 0.04664651122961663,
      "median": 4.31877772276,
      "user": 1.24558422,
      "system": 1.4069514,
      "min": 4.30146815126,
      "max": 4.4320999282599995
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.376630331359999,
      "stddev": 0.04240210756877795,
      "median": 3.35907364326,
      "user": 1.2309433200000002,
      "system": 1.2994544,
      "min": 3.34068259226,
      "max": 3.45573170826
    },
    {
      "command": "pnpr@main",
      "mean": 3.403956126460001,
      "stddev": 0.05639416541659109,
      "median": 3.3842619962600002,
      "user": 1.19250752,
      "system": 1.2887875999999998,
      "min": 3.33823017126,
      "max": 3.52923258726
    }
  ]
}

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

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store — the layout pnpm 12 installs into by default. Comparable to that scenario head-to-head.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 153.0 ± 4.9 145.1 162.3 1.00
pacquet@main 155.6 ± 5.7 148.7 168.4 1.02 ± 0.05
pnpr@HEAD 164.1 ± 7.9 152.0 181.7 1.07 ± 0.06
pnpr@main 166.2 ± 5.6 158.6 180.6 1.09 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.15304219490235293,
      "stddev": 0.0048878366102864616,
      "median": 0.15337583702,
      "user": 0.17387205411764708,
      "system": 0.16936111411764707,
      "min": 0.14507356602,
      "max": 0.16228139102
    },
    {
      "command": "pacquet@main",
      "mean": 0.1556157883325,
      "stddev": 0.005688967091397181,
      "median": 0.15568446802,
      "user": 0.1797624475,
      "system": 0.1744922575,
      "min": 0.14873353702,
      "max": 0.16835458102
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.16414239389500002,
      "stddev": 0.007877027845511851,
      "median": 0.16470422802,
      "user": 0.17785901,
      "system": 0.18884781999999994,
      "min": 0.15201243302,
      "max": 0.18167664202
    },
    {
      "command": "pnpr@main",
      "mean": 0.16618368889500001,
      "stddev": 0.005591001726430327,
      "median": 0.16636416902,
      "user": 0.18696926000000003,
      "system": 0.17381607,
      "min": 0.15857356002,
      "max": 0.18060023702
    }
  ]
}

@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13832
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
145.07 ms
(-10.32%)Baseline: 161.76 ms
194.12 ms
(74.74%)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,776.87 ms
(+1.26%)Baseline: 2,742.30 ms
3,290.75 ms
(84.38%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
2,197.86 ms
(+16.19%)Baseline: 1,891.55 ms
2,269.86 ms
(96.83%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
483.01 ms
(+10.84%)Baseline: 435.77 ms
522.93 ms
(92.37%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
176.91 ms
(-13.22%)Baseline: 203.85 ms
244.62 ms
(72.32%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,385.45 ms
(+2.55%)Baseline: 2,326.04 ms
2,791.24 ms
(85.46%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,293.80 ms
(-2.07%)Baseline: 4,384.58 ms
5,261.50 ms
(81.61%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
247.90 ms
(-6.37%)Baseline: 264.77 ms
317.72 ms
(78.02%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
422.20 ms
(-10.88%)Baseline: 473.75 ms
568.50 ms
(74.27%)
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
🚷 view threshold
5.67 ms
(-6.55%)Baseline: 6.07 ms
7.28 ms
(77.88%)
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
🚷 view threshold
5.60 ms
(-7.88%)Baseline: 6.08 ms
7.30 ms
(76.77%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13832
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)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
152.01 ms
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,403.22 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
388.14 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
372.78 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
89.40 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,577.60 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,340.68 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
254.63 ms
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
5.40 ms
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
5.48 ms
🐰 View full continuous benchmarking report in Bencher

Copilot AI review requested due to automatic review settings August 11, 2026 23:04
@btea
btea force-pushed the fix/audit-unpublished-patched-versions branch from 41d30f4 to 15f092a Compare August 11, 2026 23:04

@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/cli/src/cli_args/audit/fix.rs (1)

141-166: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the historical porting notes.

Ports ... describes implementation history. It does not document a current contract. Remove those clauses and retain the behavior and fail-open invariants.

As per coding guidelines, comments must document contracts or non-obvious constraints and “describe current behavior rather than historical implementation details.”

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

In `@pnpm/crates/cli/src/cli_args/audit/fix.rs` around lines 141 - 166, Remove the
historical porting notes from the comments above
resolve_minimum_release_age_excludes and minimum_release_age_excludes, including
references to pnpm and createMinimumReleaseAgeExcludes. Retain comments
describing the current overflow fail-open behavior and the minimum-release-age
exclusion rules.

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 `@pnpm11/deps/compliance/commands/src/audit/fix.ts`:
- Around line 99-102: Select the lowest published version satisfying
patchedVersions instead of requiring the theoretical range minimum, then use it
for timestamp lookup and the exclusion spec in the TypeScript fix flow around
getPublishTimes. Apply equivalent semver selection in
pnpm/crates/cli/src/cli_args/audit/fix.rs:175-188, and add regression coverage
in pnpm/crates/cli/src/cli_args/audit/tests.rs:1343-1360 for both audit fix
modes where the lower bound is unpublished but a later satisfying version is
recent and requires exclusion.

---

Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/audit/fix.rs`:
- Around line 141-166: Remove the historical porting notes from the comments
above resolve_minimum_release_age_excludes and minimum_release_age_excludes,
including references to pnpm and createMinimumReleaseAgeExcludes. Retain
comments describing the current overflow fail-open behavior and the
minimum-release-age exclusion rules.
🪄 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: c824e008-7151-4445-9950-e102302db100

📥 Commits

Reviewing files that changed from the base of the PR and between 41d30f4 and 15f092a.

📒 Files selected for processing (12)
  • pnpm/crates/cli/src/cli_args/audit.rs
  • pnpm/crates/cli/src/cli_args/audit/fix.rs
  • pnpm/crates/cli/src/cli_args/audit/render.rs
  • pnpm/crates/cli/src/cli_args/audit/report.rs
  • pnpm/crates/cli/src/cli_args/audit/tests.rs
  • pnpm/crates/cli/tests/suite/audit.rs
  • pnpm11/deps/compliance/audit/src/types.ts
  • pnpm11/deps/compliance/commands/src/audit/audit.ts
  • pnpm11/deps/compliance/commands/src/audit/fix.ts
  • pnpm11/deps/compliance/commands/src/audit/fixWithUpdate.ts
  • pnpm11/deps/compliance/commands/src/audit/publishTimes.ts
  • pnpm11/deps/compliance/commands/test/audit/fix.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • pnpm11/deps/compliance/commands/test/audit/fix.ts
  • pnpm/crates/cli/tests/suite/audit.rs
  • pnpm11/deps/compliance/commands/src/audit/publishTimes.ts
  • pnpm/crates/cli/src/cli_args/audit/render.rs
  • pnpm/crates/cli/src/cli_args/audit.rs

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (1)

pnpm11/deps/compliance/commands/src/audit/audit.ts:261

  • AuditOptions now supports an injected getPublishTimes, but handler() always creates a new fetcher and ignores opts.getPublishTimes. This makes the new option ineffective and can reintroduce extra network calls in programmatic uses/tests that want to share a memoized fetcher.
  const getPublishTimes = createPublishTimesFetcher(opts)

Copilot AI review requested due to automatic review settings August 11, 2026 23:31

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm11/deps/compliance/commands/src/audit/fix.ts (1)

68-69: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Describe metadata absence without making a historical claim.

A version can be published and later removed from the registry. The fetched map proves only that the version is absent from the successful metadata response. Replace “was never published” and “no fix has shipped” with wording such as “is not available in the fetched metadata.” This matches the skipped and yanked release cases. (docs.npmjs.com)

As per path instructions, comments must describe current behavior rather than historical implementation details.

Also applies to: 82-89

🤖 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 `@pnpm11/deps/compliance/commands/src/audit/fix.ts` around lines 68 - 69,
Update the documentation around the resolved publish-time map to describe only
current metadata absence: replace claims that a missing version was never
published or that no fix shipped with wording that the version is not available
in the fetched metadata, including the related comments around the skipped and
yanked release handling.

Sources: Path instructions, MCP tools

🤖 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 `@pnpm11/deps/compliance/commands/src/audit/fix.ts`:
- Around line 117-121: Update the publish-time validation around publishedAt to
use a strict ISO timestamp parser rather than Date’s permissive constructor,
treating non-conforming values—including "0" and malformed calendar dates—as
unknown and returning lowestSpec. Add regression coverage for "0" and another
malformed timestamp.
- Around line 102-116: Update the published-version selection in the audit fix
flow to retain each original registry key alongside its parsed semver value
through filtering and sorting, then use that original key when reading the
publish timestamp instead of lowest.version. Preserve the existing
lowest-version resolution and add a regression test covering a normalized key
such as v1.2.3.

---

Outside diff comments:
In `@pnpm11/deps/compliance/commands/src/audit/fix.ts`:
- Around line 68-69: Update the documentation around the resolved publish-time
map to describe only current metadata absence: replace claims that a missing
version was never published or that no fix shipped with wording that the version
is not available in the fetched metadata, including the related comments around
the skipped and yanked release handling.
🪄 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: 1e414215-db85-4894-859e-cfb3b974fb88

📥 Commits

Reviewing files that changed from the base of the PR and between 15f092a and cc2d466.

📒 Files selected for processing (4)
  • pnpm/crates/cli/src/cli_args/audit/fix.rs
  • pnpm/crates/cli/src/cli_args/audit/tests.rs
  • pnpm11/deps/compliance/commands/src/audit/fix.ts
  • pnpm11/deps/compliance/commands/test/audit/fix.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • pnpm/crates/cli/src/cli_args/audit/tests.rs
  • pnpm11/deps/compliance/commands/test/audit/fix.ts
  • pnpm/crates/cli/src/cli_args/audit/fix.rs

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (1)

pnpm11/deps/compliance/commands/src/audit/audit.ts:261

  • AuditOptions now allows injecting a memoized getPublishTimes fetcher, but the handler always creates a new fetcher and ignores opts.getPublishTimes. This makes the option ineffective for callers (e.g. tests or higher-level orchestration) and contradicts the option’s doc comment about consumers reusing the shared fetcher when provided.
  const getPublishTimes = createPublishTimesFetcher(opts)

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

…e fixes

The deprecation set is built from the packument's `versions` keys but was
consulted with the raw `time` key. Both maps normally spell a release the
same way, but nothing guarantees it — the surrounding code already
documents that a `time` key may carry a leading `v` — and when they
differ the deprecated release passes the filter and gets advertised as
the fix. Parse both sides and compare the parsed versions.

Selecting the lowest satisfying version by semver order alone picks a
prerelease over the stable release that follows it: for an inferred
`>=1.9.10` with `2.0.0-beta.1` and `2.0.0` published, `2.0.0-beta.1`
sorts lower and won. A beta is not a remediation to point users at, and
`--fix update` cannot select one through the dependent's original range
anyway. Rank stable releases above prereleases, falling back to a
prerelease only when nothing else satisfies the range, so a
prerelease-only line still reports a fix instead of `None`.
Copilot AI review requested due to automatic review settings August 17, 2026 19:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 369f0bb

@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 cf1d35b into pnpm:main Aug 20, 2026
44 of 48 checks passed
@btea
btea deleted the fix/audit-unpublished-patched-versions branch August 21, 2026 00:22
toiroakr added a commit to tailor-platform/actions that referenced this pull request Sep 10, 2026
[email protected] (GHSA-w5p7-h5w8-2hfq) no longer has a non-deprecated patched
version, so pnpm/pnpm#13832 makes `pnpm audit` report
patched_versions: null and propose no fix for it, breaking the
test-fixable-advisory-updates-lockfile job. That pnpm change shipped on
main (both the 11.x and 12.x release lines), so it affects any pnpm
release cut after 2026-08-20, not just v12. Switch the fixture to
[email protected] (GHSA-xvch-5gv4-984h), whose patched versions (>=1.2.6)
are not deprecated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm audit lies about vulnerabilities with patched versions not yet released, claiming they are already delivered

5 participants