Repository navigation
refactor(cli): split the audit command into per-concern modules - #13657
Conversation
`cli_args/audit.rs` held four unrelated jobs in one file: the command itself, the registry wire format, the dependency graph sent for audit, and everything the `--fix` flag does. Split along those lines: - `report` — the audit response and the report derived from it - `request` — turning a lockfile into the graph the registry audits - `paths` — the dependency paths reported with each advisory - `render` — the JSON and text renderings - `version_ranges` — the semver questions asked of advisory ranges - `fix` — overrides, ignores, and dependency updates `audit.rs` keeps the argument types and the command body, at 2126 lines down to 624. Re-exports are explicit rather than glob, and cover only what is used outside the owning module; the tests now import each item from the module that defines it. Pure code motion: no behaviour change, verified by comparing every content line of the original against the union of the new modules. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
📝 WalkthroughWalkthroughThe audit CLI is split into focused modules for dependency graph construction, path analysis, report modeling, rendering, semver handling, and advisory fixes. The fix workflow supports overrides, ignores, minimum-release-age exclusions, interactive selection, and guarded dependency updates. ChangesAudit CLI
Estimated code review effort: 5 (Critical) | ~90 minutes Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, build, or maintainability issues identified. The extracted implementations preserve their prior behavior, constants and helper bindings resolve to the same definitions, external audit command entry points remain unchanged, and the updated tests retain their existing assertions. Reviews (1): Last reviewed commit: "refactor(cli): split the audit command i..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (4)
pnpm/crates/cli/src/cli_args/audit/version_ranges.rs (1)
11-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument why
satisfies_including_prereleasere-parses the range from its string form.The function converts
Rangeback to a string, splits on||and whitespace, and re-evaluates each comparator by hand. The reason is not obvious from the code:node_semverexcludes prerelease versions from comparator matches unless the comparator itself carries a prerelease, so the manual pass restores npm audit's prerelease-inclusive behavior.Add a short comment stating that invariant.
caret_range_for_patchedat lines 76-80 already documents its rationale this way.As per coding guidelines, pnpm/CODE_STYLE_GUIDE.md requires comments that "explain only non-obvious reasons or invariants".
📝 Proposed comment
+/// Prerelease-inclusive range matching. `node_semver` excludes prerelease +/// versions from a comparator unless that comparator carries a prerelease of +/// the same tuple, but npm audit reports prereleases inside a vulnerable +/// range. The fallback re-evaluates the normalized comparator set by hand to +/// restore that behavior. pub(crate) fn satisfies_including_prerelease(version: &Version, range: &Range) -> bool {🤖 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/version_ranges.rs` around lines 11 - 18, Document the non-obvious rationale in satisfies_including_prerelease: explain that node_semver excludes prerelease versions unless comparators explicitly include a prerelease, so the range is re-parsed and manually evaluated to preserve npm audit’s prerelease-inclusive behavior. Place the short invariant comment immediately before the string-based re-evaluation.Source: Coding guidelines
pnpm/crates/cli/src/cli_args/audit/report.rs (1)
1-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReconsider placing the whole
AuditErrorenum inreport.rs.The module doc says this module holds "The registry audit response, and the report shape derived from it." Four variants do not belong to that scope:
UnknownSubcommandandInvalidFixOptionare produced by the command body inaudit.rs.NoLockfileAfterUpdateandMissingGhsaare produced byfix.rs.Only
Network,InvalidJson,UnexpectedBody,EndpointNotExists, andBadStatusare report/response concerns.A shared error enum across modules is a reasonable choice, but then it should not live inside one concern-specific module. Move
AuditErrortoaudit.rsnext to the command body, or narrow the module doc to state thatreport.rsalso owns the shared audit error type.As per path instructions, REVIEW_GUIDE.md requires you to "Ensure logic remains in its owning module".
🤖 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/report.rs` around lines 1 - 12, The AuditError definition in report.rs mixes report/response errors with command and fix errors, violating module ownership. Move AuditError to audit.rs alongside the audit command body, update imports and references in report.rs and fix.rs, and preserve all existing variants and behavior.Source: Path instructions
pnpm/crates/cli/src/cli_args/audit/request.rs (1)
200-214: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMake module-internal audit request helpers private.
AuditRequestBuilder,VersionState,append_importer_edges,collect_optional_only_keys,walk_reachable, andselected_root_edgesare used only insiderequest.rs. Make them private instead of exposing them on the module boundary, and keeppub(crate) uselimited to the exported symbols used outsideaudit::request.🤖 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/request.rs` around lines 200 - 214, Restrict the audit request helpers to module visibility: remove `pub(crate)` from `AuditRequestBuilder`, `VersionState`, `append_importer_edges`, `collect_optional_only_keys`, `walk_reachable`, and `selected_root_edges`. Preserve `pub(crate) use` only for symbols referenced outside `audit::request`, leaving externally consumed exports unchanged.Source: Coding guidelines
pnpm/crates/cli/src/cli_args/audit.rs (1)
29-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the
AuditGraphinherent impl intorequest.rs.
AuditGraph,Edge,GraphImporter,DepKind, andempty_snapshotslive inpnpm/crates/cli/src/cli_args/audit/request.rs, butmain,env, andchildrenremain inpnpm/crates/cli/src/cli_args/audit.rs. Move the impl block next toAuditGraphinrequest.rsso the graph logic stays in its owning module.🤖 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 29 - 56, Move the inherent impl for AuditGraph, including its main, env, and children methods, from audit.rs into request.rs alongside the AuditGraph definition and related graph symbols. Remove the original impl from audit.rs while preserving all method behavior and visibility.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.
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/audit.rs`:
- Around line 29-56: Move the inherent impl for AuditGraph, including its main,
env, and children methods, from audit.rs into request.rs alongside the
AuditGraph definition and related graph symbols. Remove the original impl from
audit.rs while preserving all method behavior and visibility.
In `@pnpm/crates/cli/src/cli_args/audit/report.rs`:
- Around line 1-12: The AuditError definition in report.rs mixes report/response
errors with command and fix errors, violating module ownership. Move AuditError
to audit.rs alongside the audit command body, update imports and references in
report.rs and fix.rs, and preserve all existing variants and behavior.
In `@pnpm/crates/cli/src/cli_args/audit/request.rs`:
- Around line 200-214: Restrict the audit request helpers to module visibility:
remove `pub(crate)` from `AuditRequestBuilder`, `VersionState`,
`append_importer_edges`, `collect_optional_only_keys`, `walk_reachable`, and
`selected_root_edges`. Preserve `pub(crate) use` only for symbols referenced
outside `audit::request`, leaving externally consumed exports unchanged.
In `@pnpm/crates/cli/src/cli_args/audit/version_ranges.rs`:
- Around line 11-18: Document the non-obvious rationale in
satisfies_including_prerelease: explain that node_semver excludes prerelease
versions unless comparators explicitly include a prerelease, so the range is
re-parsed and manually evaluated to preserve npm audit’s prerelease-inclusive
behavior. Place the short invariant comment immediately before the string-based
re-evaluation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 16182a6e-3ecc-45dd-8508-652fb4cf5723
📒 Files selected for processing (8)
pnpm/crates/cli/src/cli_args/audit.rspnpm/crates/cli/src/cli_args/audit/fix.rspnpm/crates/cli/src/cli_args/audit/paths.rspnpm/crates/cli/src/cli_args/audit/render.rspnpm/crates/cli/src/cli_args/audit/report.rspnpm/crates/cli/src/cli_args/audit/request.rspnpm/crates/cli/src/cli_args/audit/tests.rspnpm/crates/cli/src/cli_args/audit/version_ranges.rs
Micro-Benchmark ResultsLinux |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13657 +/- ##
==========================================
- Coverage 88.07% 88.07% -0.01%
==========================================
Files 590 596 +6
Lines 98802 98812 +10
==========================================
+ Hits 87016 87024 +8
- Misses 11786 11788 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.60152707902,
"stddev": 0.1902924678930185,
"median": 2.5677835039200003,
"user": 1.9632614199999998,
"system": 1.50022892,
"min": 2.3859032729200003,
"max": 2.86780840892,
"times": [
2.8161985939200003,
2.55808579192,
2.4560925999200003,
2.3859032729200003,
2.40917150292,
2.83630962392,
2.4088842879200003,
2.6993354919200003,
2.5774812159200002,
2.86780840892
]
},
{
"command": "pacquet@main",
"mean": 2.67071990852,
"stddev": 0.18305174851515482,
"median": 2.6751907504200005,
"user": 2.40460232,
"system": 1.8450805200000002,
"min": 2.44764615792,
"max": 2.92012352992,
"times": [
2.5888497159200003,
2.90020823492,
2.7889964909200002,
2.47066161092,
2.52522079492,
2.80381581592,
2.7615317849200003,
2.92012352992,
2.50014494892,
2.44764615792
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6061989323199999,
"stddev": 0.08671542334794848,
"median": 1.61721450292,
"user": 1.6469375200000003,
"system": 1.49552692,
"min": 1.4521834309200001,
"max": 1.71138882892,
"times": [
1.6854326159200002,
1.65145456692,
1.6249117129200001,
1.4521834309200001,
1.65961554192,
1.6095172929200001,
1.71138882892,
1.46012806892,
1.60414171992,
1.6032155439200002
]
},
{
"command": "pnpr@main",
"mean": 1.61829264912,
"stddev": 0.17830485509506164,
"median": 1.58202989792,
"user": 1.8754489199999997,
"system": 1.7806130199999999,
"min": 1.44276724392,
"max": 1.9212067859200002,
"times": [
1.60455757692,
1.9212067859200002,
1.4538177969200001,
1.60361817192,
1.56044162392,
1.7007093209200002,
1.5299052619200002,
1.4486455659200002,
1.91725714292,
1.44276724392
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36542352240000003,
"stddev": 0.021927432261257904,
"median": 0.36631146020000005,
"user": 0.29900462,
"system": 0.7215267799999999,
"min": 0.3341242012,
"max": 0.40779240220000007,
"times": [
0.36016102120000004,
0.3443215552,
0.38511043320000005,
0.37556799320000006,
0.37234040720000006,
0.36615019520000003,
0.36647272520000007,
0.40779240220000007,
0.3341242012,
0.34219429020000003
]
},
{
"command": "pacquet@main",
"mean": 0.3061318128,
"stddev": 0.020622171449979833,
"median": 0.3078337727,
"user": 0.25573462,
"system": 0.6102730800000001,
"min": 0.28013775720000006,
"max": 0.33958528220000006,
"times": [
0.33958528220000006,
0.32212308720000005,
0.31897605320000005,
0.32533002120000004,
0.31240135020000004,
0.30326619520000003,
0.2883807272,
0.28142010120000005,
0.28013775720000006,
0.2896975532
]
},
{
"command": "pnpr@HEAD",
"mean": 0.2982020523,
"stddev": 0.014021478677466042,
"median": 0.30350557170000003,
"user": 0.24384962,
"system": 0.56658898,
"min": 0.27540225220000003,
"max": 0.31303411020000005,
"times": [
0.28822232620000005,
0.3023553452,
0.27749446920000004,
0.27540225220000003,
0.3087869112,
0.2920337042,
0.30465579820000005,
0.31303411020000005,
0.31256580720000005,
0.30746979920000006
]
},
{
"command": "pnpr@main",
"mean": 0.3303141186000001,
"stddev": 0.014827119013973085,
"median": 0.3305039042000001,
"user": 0.27454342,
"system": 0.62309938,
"min": 0.30251202720000003,
"max": 0.35888325220000006,
"times": [
0.34026225420000006,
0.32684391020000003,
0.30251202720000003,
0.32332229320000005,
0.31822926920000005,
0.33276099020000005,
0.32824681820000007,
0.33408239520000005,
0.33799797620000005,
0.35888325220000006
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.8381568418200005,
"stddev": 0.07428958556468954,
"median": 2.8159839782200002,
"user": 2.41157164,
"system": 1.93139592,
"min": 2.73136434172,
"max": 2.96182622172,
"times": [
2.73136434172,
2.78724165172,
2.8297538867200003,
2.80221406972,
2.7831784867200002,
2.7978023207200002,
2.85093505672,
2.89360761872,
2.96182622172,
2.94364476372
]
},
{
"command": "pacquet@main",
"mean": 2.78474953212,
"stddev": 0.0430934467407228,
"median": 2.77895997772,
"user": 2.36798394,
"system": 1.9207880200000003,
"min": 2.72458670672,
"max": 2.8600581747200002,
"times": [
2.76670532372,
2.74519962272,
2.72458670672,
2.74686812072,
2.79121463172,
2.81717919372,
2.8600581747200002,
2.83366693372,
2.79808567272,
2.76393094072
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6893473539200001,
"stddev": 0.11949472191770749,
"median": 1.71575327422,
"user": 1.7171949399999995,
"system": 1.64284782,
"min": 1.51875061272,
"max": 1.87596524372,
"times": [
1.74182879872,
1.74891987072,
1.73161279172,
1.60450419472,
1.83257680972,
1.57427961472,
1.56514184572,
1.69989375672,
1.51875061272,
1.87596524372
]
},
{
"command": "pnpr@main",
"mean": 1.6753356494199998,
"stddev": 0.1444438528440505,
"median": 1.6101224572200001,
"user": 1.6035572399999996,
"system": 1.5601790199999996,
"min": 1.52566137972,
"max": 1.9286658297200001,
"times": [
1.61551254372,
1.56550146772,
1.60473237072,
1.52566137972,
1.81582655672,
1.88604266372,
1.9286658297200001,
1.59587457572,
1.63002870972,
1.5855103967200002
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.51772236636,
"stddev": 0.043909876545733674,
"median": 0.50419261456,
"user": 0.7020188999999999,
"system": 0.92802312,
"min": 0.45955882006000004,
"max": 0.61330338506,
"times": [
0.50702176806,
0.49077312606000006,
0.50136346106,
0.54385135506,
0.49726519906000005,
0.51810105406,
0.45955882006000004,
0.48715512106000003,
0.61330338506,
0.55883037406
]
},
{
"command": "pacquet@main",
"mean": 0.4737907335600001,
"stddev": 0.04439968243814334,
"median": 0.4788071010600001,
"user": 0.6219252999999999,
"system": 0.89424622,
"min": 0.41128993406000003,
"max": 0.53519726906,
"times": [
0.52353259206,
0.53519726906,
0.41327619406000005,
0.4897798580600001,
0.51186043806,
0.44217924306000006,
0.49575013006000007,
0.44720733306000005,
0.4678343440600001,
0.41128993406000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.32056762016000007,
"stddev": 0.013806069080274735,
"median": 0.31994930806000005,
"user": 0.20896699999999999,
"system": 0.54824032,
"min": 0.29307496006000006,
"max": 0.34110912906000007,
"times": [
0.31050334606,
0.31904333506000004,
0.34110912906000007,
0.33655655206000007,
0.32645541206000006,
0.31917638106000007,
0.29307496006000006,
0.32072223506,
0.32787139406000004,
0.31116345706000004
]
},
{
"command": "pnpr@main",
"mean": 0.30754999266000005,
"stddev": 0.01007227566903217,
"median": 0.30518787406000003,
"user": 0.20476450000000002,
"system": 0.5126900200000001,
"min": 0.29553770506000004,
"max": 0.32422793506,
"times": [
0.29971323006000006,
0.30675864306000006,
0.29553770506000004,
0.30136219206000003,
0.29817661606000007,
0.32422793506,
0.30361710506000006,
0.31059604506000005,
0.31186549106000006,
0.32364496406000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8159221114799997,
"stddev": 0.07517211592894503,
"median": 1.77751400788,
"user": 0.8550708199999999,
"system": 0.9763972000000001,
"min": 1.75181953088,
"max": 1.96391745488,
"times": [
1.78232851388,
1.90993501588,
1.96391745488,
1.87935828588,
1.81522756988,
1.77269950188,
1.76431598088,
1.75181953088,
1.76339196488,
1.75622729588
]
},
{
"command": "pacquet@main",
"mean": 1.7506014799799998,
"stddev": 0.030394213605474677,
"median": 1.74370488588,
"user": 0.79538862,
"system": 0.8345556999999999,
"min": 1.70956812688,
"max": 1.79633587488,
"times": [
1.70956812688,
1.7710616048799999,
1.7257818228800001,
1.7521421048799999,
1.73526766688,
1.79204703288,
1.72815257088,
1.72513857088,
1.7705194238800002,
1.79633587488
]
},
{
"command": "pnpr@HEAD",
"mean": 0.33793073267999996,
"stddev": 0.015010336691774807,
"median": 0.33777611838,
"user": 0.23931831999999997,
"system": 0.5650786,
"min": 0.31839903788,
"max": 0.36878128888,
"times": [
0.32872289388,
0.34020730588,
0.33534493088,
0.32428430788,
0.34132253488,
0.36878128888,
0.31839903788,
0.32492474588,
0.34803998188,
0.34928029888
]
},
{
"command": "pnpr@main",
"mean": 0.35671101118000004,
"stddev": 0.011461032183295576,
"median": 0.35841923488,
"user": 0.24422812,
"system": 0.6309454,
"min": 0.33633543488,
"max": 0.37513757588,
"times": [
0.34804102688,
0.34889172288,
0.35845659788,
0.33633543488,
0.36018598988,
0.35036151188,
0.35838187188,
0.37513757588,
0.35962533688,
0.37169304288
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.18415881010666668,
"stddev": 0.006177917395805713,
"median": 0.18458068844,
"user": 0.15649923999999996,
"system": 0.09697322,
"min": 0.17269370844,
"max": 0.19297426944,
"times": [
0.19096262544,
0.19172960744,
0.19297426944,
0.18954009744,
0.18852534944000002,
0.18458068844,
0.18693845844,
0.17905373644,
0.17738779344,
0.18631623744,
0.17812919744,
0.17269370844,
0.18314025244,
0.18339985444,
0.17701027544
]
},
{
"command": "pacquet@main",
"mean": 0.21940993065428568,
"stddev": 0.014699337373058854,
"median": 0.21455365944000002,
"user": 0.19519412571428568,
"system": 0.11779849142857145,
"min": 0.19718419144000002,
"max": 0.24507666844,
"times": [
0.19791493544000002,
0.21408439244000002,
0.22327839744000003,
0.21054064044,
0.20971181644,
0.21132355844,
0.23901457444000002,
0.23638095444,
0.23091372344000002,
0.21463769744000002,
0.22720785744000002,
0.21446962144,
0.24507666844,
0.19718419144000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.09277726969806453,
"stddev": 0.0032819918926794926,
"median": 0.09207477344000001,
"user": 0.024381452903225805,
"system": 0.011498890322580644,
"min": 0.08704216644,
"max": 0.10026948644,
"times": [
0.08963477444000001,
0.08738511344000001,
0.08704216644,
0.09120079544000001,
0.09445822544,
0.09503424144,
0.09185160944000001,
0.09346089944000001,
0.09288705644,
0.09702783944,
0.09318094244,
0.09667867244,
0.09580275444,
0.10026948644,
0.09421716344,
0.09113562044000001,
0.08952558444,
0.08805922044,
0.09511064944,
0.09190251844,
0.09117226144,
0.09199611844000001,
0.08991267744,
0.09623728644,
0.09090538044,
0.08889806644,
0.09477745644,
0.09207477344000001,
0.09855794544,
0.09577943344,
0.08991862744000001
]
},
{
"command": "pnpr@main",
"mean": 0.09505782616413792,
"stddev": 0.0036964600192832923,
"median": 0.09454676844,
"user": 0.022014081379310345,
"system": 0.015168419999999998,
"min": 0.08946370944,
"max": 0.10493876044,
"times": [
0.09681783244,
0.09367417244000001,
0.09654133044,
0.09368176544000001,
0.09192870844,
0.09159632544,
0.10001869544,
0.09477647244000001,
0.08946370944,
0.09102597344,
0.09079819044000001,
0.09753521344,
0.09848138244,
0.09573958644000001,
0.10493876044,
0.09175688544,
0.09472201744,
0.09235415044,
0.09304941644,
0.09434925044,
0.09338897544000001,
0.09653410144,
0.10166550544,
0.09265542044000001,
0.09454676844,
0.09128996744000001,
0.09581906544,
0.09518514644,
0.10234216944
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.027670306988889,
"stddev": 0.3349839614385386,
"median": 0.9199141391000001,
"user": 0.977008502222222,
"system": 0.29322141555555553,
"min": 0.6617895811000001,
"max": 1.5796583491,
"times": [
1.1571317361,
0.8155252501000001,
0.6617895811000001,
0.7704474321,
0.8002839611,
1.5445170020999999,
0.9997653121000001,
0.9199141391000001,
1.5796583491
]
},
{
"command": "pacquet@main",
"mean": 1.0592274729888889,
"stddev": 0.34384095776733725,
"median": 0.8857375901000001,
"user": 0.9952789466666666,
"system": 0.30544841555555563,
"min": 0.7097318321,
"max": 1.6807526321000001,
"times": [
0.8857375901000001,
1.6807526321000001,
0.8245049531,
0.7097318321,
1.2713555481,
1.4714688681,
0.8242924931000001,
1.0906756811,
0.7745276591000001
]
},
{
"command": "pnpm@HEAD",
"mean": 2.985963129766667,
"stddev": 0.11392494070932863,
"median": 2.9448952181000005,
"user": 4.244740946666665,
"system": 0.3103421933333333,
"min": 2.8591414801000004,
"max": 3.1533122451000004,
"times": [
2.8769248561,
2.8591414801000004,
3.1179549391,
3.0395804251,
3.0861356931,
2.9448952181000005,
3.1533122451000004,
2.8853951571,
2.9103281541
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.6187608761600005,
"stddev": 0.15862498761666735,
"median": 4.575664936959999,
"user": 2.1498853799999997,
"system": 1.7023193999999997,
"min": 4.46320455196,
"max": 4.90021146696,
"times": [
4.46432070996,
4.46320455196,
4.47516255896,
4.74919211796,
4.49563708296,
4.80993104096,
4.61142221996,
4.67861935796,
4.539907653959999,
4.90021146696
]
},
{
"command": "pacquet@main",
"mean": 4.63983032136,
"stddev": 0.1792949859126578,
"median": 4.542923781459999,
"user": 2.3907333799999995,
"system": 1.8027994,
"min": 4.43804590396,
"max": 4.95006402396,
"times": [
4.5613713879599995,
4.8729593399599995,
4.523975688959999,
4.683578273959999,
4.524476174959999,
4.43804590396,
4.50886230596,
4.51827306896,
4.95006402396,
4.81669704496
]
},
{
"command": "pnpr@HEAD",
"mean": 3.61140670276,
"stddev": 0.07382513571364868,
"median": 3.6036285499600003,
"user": 1.79545338,
"system": 1.6802677000000004,
"min": 3.4939617209600002,
"max": 3.71313737596,
"times": [
3.5991507349600003,
3.70988903996,
3.61075414596,
3.71313737596,
3.6081063649600003,
3.56324189996,
3.6957732789600004,
3.54715898696,
3.57289347896,
3.4939617209600002
]
},
{
"command": "pnpr@main",
"mean": 3.5859401813600003,
"stddev": 0.13390022964704915,
"median": 3.54963147146,
"user": 1.41948638,
"system": 1.3149186,
"min": 3.46496039696,
"max": 3.9230635779600003,
"times": [
3.67068382896,
3.61236981996,
3.4998958789600003,
3.57585149796,
3.9230635779600003,
3.50395175796,
3.5832407079600004,
3.46496039696,
3.5234114449600002,
3.50197290196
]
}
]
} |
Picks up sixteen commits, most of them module splits: the optimistic repeat-install check (#13661), the frozen install and its build phase (#13659, #13662), `create_virtual_store` (#13649), the tarball crate root (#13652), and the audit command (#13657). Also the move to the `rc` lane and pacquet 12.0.0-rc.0 (#13666, #13667). #13661 split `optimistic_repeat_install.rs` into per-concern modules, moving one of this branch's two `build_workspace_state::<Host>` call sites into the new `deps_status.rs`. The turbofish is re-applied at both of its new homes. # Conflicts: # pnpm/crates/package-manager/src/optimistic_repeat_install.rs
Summary
cli_args/audit.rswas 2126 lines holding four unrelated jobs: the command itself, the registry wire format, the dependency graph sent for audit, and everything--fixdoes. Split along those lines:reportrequestpathsrenderversion_rangesfixaudit.rskeeps the argument types and the command body, at 624 lines.Re-exports are explicit rather than glob —
pub(crate) use report::{…}— and list only what is actually used outside the owning module, so the crate root no longer advertises module-internal helpers. The tests import each item from the module that defines it, which makes an item's home visible at the use site.Squash Commit Body
Split the 2126-line
cli_args/audit.rsinto per-concern modules (report,request,paths,render,version_ranges,fix), leaving the command's argument types and body in the root at 624 lines. Pure code motion; no behaviour change.Checklist
rustfmt-reflowed signatures)cargo clippy --all-targets -D warnings,cargo doc --document-private-items -D warnings, andcargo dylint --allall cleanpacquet-clitests passWritten by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
audit --fixworkflows with interactive selection, override generation, vulnerability validation, and lockfile rechecking.Refactor