Repository navigation
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughPacquet adds shared argv boundary detection for ChangesArgument forwarding
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI as CLI argv
participant Boundary as passthrough_from
participant PreClap as ConfigOverrides and shorthands
participant Script as Executed script
CLI->>Boundary: Analyze command, options, and separators
Boundary-->>PreClap: Return passthrough index
PreClap->>PreClap: Parse only tokens before index
PreClap->>Script: Forward remaining tokens unchanged
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 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 |
PR Summary by QodoFix pre-clap argv rewriting to stop at the script escape boundary
AI Description
Diagram
High-Level Assessment
Files changed (19)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (6): Last reviewed commit: "test(cli): assert the whole forwarded sl..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
pnpm/crates/cli/src/cli_args/run/tests.rs (1)
92-92: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove redundant test doc comments.
pnpm/crates/cli/src/cli_args/run/tests.rs#L92-L92: Remove the comment; the test name and assertions state this ordering contract.pnpm/crates/cli/src/cli_args/run/tests.rs#L106-L107: Remove the comment; the test name and assertions state the no-positional behavior.As per coding guidelines, “Do not duplicate test behavior in documentation”; as per path instructions, comments should explain only non-obvious reasons or invariants.
🤖 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/run/tests.rs` at line 92, Remove the redundant test doc comments in pnpm/crates/cli/src/cli_args/run/tests.rs at lines 92 and 106-107; the test names and assertions already document the ordering and no-positional behavior, so leave the test logic unchanged.Sources: Coding guidelines, Path instructions
pnpm/crates/cli/tests/run.rs (1)
84-90: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse regular comments for private test rationale.
These
///blocks document private test behavior rather than public API contracts. Keep only the non-obvious forwarding rationale in//comments.
pnpm/crates/cli/tests/run.rs#L84-L90: replace the rustdoc block with a concise regular comment explaining why the recorder checks lifecycle-stage forwarding.pnpm/crates/cli/src/shorthands/tests.rs#L43-L45: replace the rustdoc block with a concise regular comment explaining the no-rewrite invariant.As per coding guidelines, “Use rustdoc comments for public API contracts and regular comments for implementation rationale. Do not duplicate test behavior in documentation.”
🤖 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/tests/run.rs` around lines 84 - 90, Replace the rustdoc block at pnpm/crates/cli/tests/run.rs:84-90 with a concise regular comment retaining only the non-obvious lifecycle-stage forwarding rationale for the recorder assertion. Also replace the rustdoc block at pnpm/crates/cli/src/shorthands/tests.rs:43-45 with a concise regular comment explaining the no-rewrite invariant; do not document private test behavior as public API.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 `@pnpm/crates/cli/tests/run.rs`:
- Around line 119-149: Update the run argument regression test around the
pacquet invocation and recorded assertions to add --config.foo=bar immediately
after foo, without a -- separator, and assert that this override is forwarded to
the recorder as part of the expected arguments. Keep the existing post-script
arguments and other recorded entries unchanged.
---
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/run/tests.rs`:
- Line 92: Remove the redundant test doc comments in
pnpm/crates/cli/src/cli_args/run/tests.rs at lines 92 and 106-107; the test
names and assertions already document the ordering and no-positional behavior,
so leave the test logic unchanged.
In `@pnpm/crates/cli/tests/run.rs`:
- Around line 84-90: Replace the rustdoc block at
pnpm/crates/cli/tests/run.rs:84-90 with a concise regular comment retaining only
the non-obvious lifecycle-stage forwarding rationale for the recorder assertion.
Also replace the rustdoc block at pnpm/crates/cli/src/shorthands/tests.rs:43-45
with a concise regular comment explaining the no-rewrite invariant; do not
document private test behavior as public API.
🪄 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: a8f9c13b-7a91-42b9-8170-5d4ccc2e7a46
📒 Files selected for processing (18)
.changeset/pacquet-preclap-escape-boundary.md.changeset/pacquet-run-forwards-script-args.mdpnpm/crates/cli/src/cli_args/clean.rspnpm/crates/cli/src/cli_args/dispatch_install.rspnpm/crates/cli/src/cli_args/dispatch_script.rspnpm/crates/cli/src/cli_args/restart.rspnpm/crates/cli/src/cli_args/run.rspnpm/crates/cli/src/cli_args/run/recursive.rspnpm/crates/cli/src/cli_args/run/tests.rspnpm/crates/cli/src/cli_args/stop.rspnpm/crates/cli/src/cli_args/tests.rspnpm/crates/cli/src/config_overrides.rspnpm/crates/cli/src/lib.rspnpm/crates/cli/src/parse_boundary.rspnpm/crates/cli/src/parse_boundary/tests.rspnpm/crates/cli/src/shorthands.rspnpm/crates/cli/src/shorthands/tests.rspnpm/crates/cli/tests/run.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13309 +/- ##
=======================================
Coverage 87.05% 87.05%
=======================================
Files 532 533 +1
Lines 91601 91626 +25
=======================================
+ Hits 79741 79763 +22
- Misses 11860 11863 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
All three findings were correct — my design was unsound in two ways. Reworked in 13aa3f6; I had put the PR into draft while fixing it. Greptile: value options misplace the boundary — and Qodo: wrong option width tableSame root defect, and the more serious of the two. I carried the hand-listed set of value-taking option names over from Confirmed exactly as Greptile described: pnpm's own Fixed by taking arity from clap instead of a name list — Greptile:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/cli/src/parse_boundary.rs (1)
15-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse regular comments for private implementation rationale.
These explain deliberate internal behavior rather than public API contracts, so use
//instead of///.
pnpm/crates/cli/src/parse_boundary.rs#L15-L26: convert the foreign-command exception rationale to regular comments.pnpm/crates/cli/src/parse_boundary.rs#L117-L123: convert the option-arity rationale to regular comments.As per coding guidelines, “Use rustdoc comments for public API contracts and regular comments for implementation rationale.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/parse_boundary.rs` around lines 15 - 26, Convert the implementation-rationale documentation comments near parse-boundary handling from rustdoc comments to regular comments: update pnpm/crates/cli/src/parse_boundary.rs lines 15-26 for the foreign-command exception and lines 117-123 for the option-arity rationale, preserving their text and behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pnpm/crates/cli/src/parse_boundary.rs`:
- Around line 15-26: Convert the implementation-rationale documentation comments
near parse-boundary handling from rustdoc comments to regular comments: update
pnpm/crates/cli/src/parse_boundary.rs lines 15-26 for the foreign-command
exception and lines 117-123 for the option-arity rationale, preserving their
text and behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7ec9bdd7-42e0-48a0-8c95-805b6abfcaba
📒 Files selected for processing (3)
pnpm/crates/cli/src/flag_relocation.rspnpm/crates/cli/src/parse_boundary.rspnpm/crates/cli/src/parse_boundary/tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm/crates/cli/src/parse_boundary/tests.rs
|
Code review by qodo was updated up to the latest commit 13aa3f6 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Both correct again — fixed in 9bc9e8c. Greptile's Greptile: versioned
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/parse_boundary.rs`:
- Around line 83-95: Update the with-current branch in the boundary inference
logic to continue scanning from version + 1 instead of returning None,
preserving nested run/exec/dlx and fallback-script boundaries before
ConfigOverrides::extract or flag rewriting. Add regression coverage for with
current run cases involving --config.foo=bar and --silent, and keep pacquet and
the TypeScript pnpm CLI behaviorally identical.
🪄 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: 752b2b2a-6d9a-49f2-b9cf-0e1ae46ed177
📒 Files selected for processing (3)
pnpm/crates/cli/src/parse_boundary.rspnpm/crates/cli/src/parse_boundary/tests.rspnpm/crates/cli/tests/run.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- pnpm/crates/cli/tests/run.rs
- pnpm/crates/cli/src/parse_boundary/tests.rs
|
Code review by qodo was updated up to the latest commit 9bc9e8c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4229464618799996,
"stddev": 0.11181339259244279,
"median": 2.39014032318,
"user": 1.5953270199999996,
"system": 1.3232614200000001,
"min": 2.36196986818,
"max": 2.73666574318,
"times": [
2.41811483118,
2.41511293818,
2.73666574318,
2.36196986818,
2.37035002918,
2.37848765918,
2.37140913418,
2.39632595018,
2.38395469618,
2.39707376918
]
},
{
"command": "pacquet@main",
"mean": 2.5446684103800004,
"stddev": 0.18166156597541447,
"median": 2.46972729368,
"user": 1.59000512,
"system": 1.3472185199999998,
"min": 2.37145141318,
"max": 2.78938052118,
"times": [
2.7429723311800003,
2.77774604418,
2.42008242018,
2.37543316318,
2.78938052118,
2.67900421218,
2.37145141318,
2.5193721671800002,
2.38174207918,
2.38949975218
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5058517892800003,
"stddev": 0.11297103164898903,
"median": 1.48061276018,
"user": 1.0804106199999999,
"system": 1.15512062,
"min": 1.34395020518,
"max": 1.7373457971800002,
"times": [
1.56132111318,
1.41462721118,
1.7373457971800002,
1.4358191951800001,
1.34395020518,
1.49302782818,
1.60596028418,
1.43970824518,
1.55856032118,
1.46819769218
]
},
{
"command": "pnpr@main",
"mean": 1.4912409840800003,
"stddev": 0.11844978470909605,
"median": 1.47312765218,
"user": 1.09567312,
"system": 1.18014462,
"min": 1.35933117418,
"max": 1.7606858731800001,
"times": [
1.35933117418,
1.56883422118,
1.47488810318,
1.7606858731800001,
1.38881421218,
1.47136720118,
1.50184467318,
1.41109969418,
1.5669523661800002,
1.40859232218
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2610259745,
"stddev": 0.004397037204080372,
"median": 0.2609187352,
"user": 0.21095146000000004,
"system": 0.53955744,
"min": 0.2561217462,
"max": 0.2704902682,
"times": [
0.2614075402,
0.2586929792,
0.26090592619999997,
0.2573475742,
0.25624587919999997,
0.2640327762,
0.2704902682,
0.2640835112,
0.2609315442,
0.2561217462
]
},
{
"command": "pacquet@main",
"mean": 0.2607261415,
"stddev": 0.005929214120927965,
"median": 0.2609192012,
"user": 0.22711166,
"system": 0.5185880399999999,
"min": 0.2511094852,
"max": 0.2708067932,
"times": [
0.26420525019999996,
0.2545922662,
0.2595832442,
0.2708067932,
0.2628041512,
0.26689586719999997,
0.2554259552,
0.26032103419999997,
0.2511094852,
0.2615173682
]
},
{
"command": "pnpr@HEAD",
"mean": 0.28377491359999996,
"stddev": 0.00996579919093516,
"median": 0.28015418319999996,
"user": 0.21244266,
"system": 0.56064694,
"min": 0.2730396202,
"max": 0.3042590172,
"times": [
0.2791481432,
0.3042590172,
0.2948387652,
0.2898289202,
0.2785711272,
0.2860420782,
0.2811602232,
0.2750899872,
0.2757712542,
0.2730396202
]
},
{
"command": "pnpr@main",
"mean": 0.2774283636,
"stddev": 0.005295717586275186,
"median": 0.2790268612,
"user": 0.21501086000000003,
"system": 0.55327384,
"min": 0.2689875382,
"max": 0.2856006872,
"times": [
0.2734762612,
0.2807345532,
0.2689875382,
0.2698802392,
0.2814831632,
0.2800909802,
0.2788103182,
0.2792434042,
0.2856006872,
0.2759764912
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7953806834400003,
"stddev": 0.018314569203673064,
"median": 2.7997395660400004,
"user": 1.7189428599999999,
"system": 1.38138112,
"min": 2.7577661260400004,
"max": 2.81645577604,
"times": [
2.7998995920400005,
2.8080577890400003,
2.7577661260400004,
2.7995795400400003,
2.7937283190400004,
2.8145910830400003,
2.77996962504,
2.8046710800400003,
2.7790879040400003,
2.81645577604
]
},
{
"command": "pacquet@main",
"mean": 2.7977879873400004,
"stddev": 0.019483955807159403,
"median": 2.8018075510400005,
"user": 1.7614190600000001,
"system": 1.34089312,
"min": 2.75380911904,
"max": 2.82663546904,
"times": [
2.8007927240400003,
2.80282237804,
2.7855261660400004,
2.82663546904,
2.8068917050400004,
2.80834962204,
2.79108335604,
2.75380911904,
2.81112768304,
2.7908416510400005
]
},
{
"command": "pnpr@HEAD",
"mean": 1.66022196174,
"stddev": 0.12336260805198988,
"median": 1.6504260575399998,
"user": 1.0397287599999998,
"system": 1.19725572,
"min": 1.43843701804,
"max": 1.84990722304,
"times": [
1.43843701804,
1.66010082204,
1.84990722304,
1.64075129304,
1.73408706504,
1.56616996904,
1.5785107600400001,
1.83059576504,
1.67703081504,
1.62662888704
]
},
{
"command": "pnpr@main",
"mean": 1.5708618915399999,
"stddev": 0.11650657461060938,
"median": 1.57975118604,
"user": 1.0436113599999999,
"system": 1.1940651199999999,
"min": 1.42558123804,
"max": 1.70696093404,
"times": [
1.46253086304,
1.67830200004,
1.42558123804,
1.67478046704,
1.43380240004,
1.58897254504,
1.70696093404,
1.5705298270399999,
1.70403612704,
1.46312251404
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6039930237400001,
"stddev": 0.021769364841533276,
"median": 0.6033264441400001,
"user": 0.7276943200000001,
"system": 0.69101438,
"min": 0.5799251676400001,
"max": 0.6362315956400001,
"times": [
0.5960638786400001,
0.6146040706400001,
0.6180510906400001,
0.6105890096400001,
0.6362315956400001,
0.6346366416400001,
0.58270411064,
0.5799251676400001,
0.5823617256400001,
0.5847629466400001
]
},
{
"command": "pacquet@main",
"mean": 0.5966065840400001,
"stddev": 0.014090809333677824,
"median": 0.5988791946400001,
"user": 0.7340362199999999,
"system": 0.6830461800000001,
"min": 0.57389824864,
"max": 0.6116589446400001,
"times": [
0.6034242576400001,
0.6116589446400001,
0.59433413164,
0.5867606486400001,
0.6089411666400001,
0.6115320656400001,
0.57389824864,
0.5862896436400001,
0.6088757636400001,
0.5803509696400001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31510570194,
"stddev": 0.0053897143663152675,
"median": 0.31404914464,
"user": 0.21020332000000003,
"system": 0.5580249799999998,
"min": 0.30704419864000004,
"max": 0.32565795964,
"times": [
0.31824088264,
0.31401193864000004,
0.31222830064,
0.31331744164,
0.31408635064,
0.32565795964,
0.31070805764000003,
0.32154276964,
0.31421911964000004,
0.30704419864000004
]
},
{
"command": "pnpr@main",
"mean": 0.3097030116400001,
"stddev": 0.005590906145483713,
"median": 0.30991842564000005,
"user": 0.20763151999999999,
"system": 0.54780018,
"min": 0.29938864264000004,
"max": 0.32073869664000004,
"times": [
0.31177691064,
0.30910105264000004,
0.31329974964,
0.31057565864000003,
0.29938864264000004,
0.32073869664000004,
0.30770101564,
0.30430060264000003,
0.31088659464,
0.30926119264
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.92235789516,
"stddev": 0.008482875133230127,
"median": 1.92514675476,
"user": 0.9429354400000001,
"system": 0.8017791599999999,
"min": 1.90330840526,
"max": 1.93203062426,
"times": [
1.92596407926,
1.92432943026,
1.92167776726,
1.93203062426,
1.90330840526,
1.91969511426,
1.92923953726,
1.92766979026,
1.92609352326,
1.9135706802599999
]
},
{
"command": "pacquet@main",
"mean": 1.9198894379600002,
"stddev": 0.011026645886821522,
"median": 1.92107001376,
"user": 0.9774687400000002,
"system": 0.7657859599999999,
"min": 1.90416475826,
"max": 1.94218782026,
"times": [
1.92103890526,
1.94218782026,
1.92188919526,
1.92127328626,
1.9299891092600001,
1.9180022752600001,
1.91314320626,
1.90610470126,
1.90416475826,
1.92110112226
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31207254946,
"stddev": 0.009463445599593398,
"median": 0.30909554126,
"user": 0.20448474,
"system": 0.5405823599999999,
"min": 0.30314855726,
"max": 0.33467826226,
"times": [
0.33467826226,
0.31921589326,
0.31089418326,
0.30444396726,
0.30482125826,
0.31674929926,
0.30953643626,
0.30858299126,
0.30865464626,
0.30314855726
]
},
{
"command": "pnpr@main",
"mean": 0.30783411796,
"stddev": 0.003665793549691105,
"median": 0.30808536426,
"user": 0.20821853999999998,
"system": 0.5391000599999999,
"min": 0.30151039326,
"max": 0.31343785426,
"times": [
0.30964671426,
0.30312528326,
0.30541416326,
0.30151039326,
0.30749494126,
0.31104946626,
0.31049163526,
0.30754035826,
0.30863037026,
0.31343785426
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36721032724,
"stddev": 0.007368729206572527,
"median": 0.36459681914000003,
"user": 0.36126122,
"system": 0.05293469999999999,
"min": 0.36191456364,
"max": 0.38652858564000003,
"times": [
0.36409153364,
0.36191456364,
0.36582110064,
0.36279822764,
0.36430730864000005,
0.36488632964,
0.36240596864,
0.36776930864,
0.37158034564000003,
0.38652858564000003
]
},
{
"command": "pacquet@main",
"mean": 0.3668307531400001,
"stddev": 0.006905076351650309,
"median": 0.36797291664000004,
"user": 0.35561412000000003,
"system": 0.058114,
"min": 0.34979942864,
"max": 0.37484690664000003,
"times": [
0.36468473964000003,
0.37317862564000004,
0.34979942864,
0.36739849964000004,
0.36877624464000003,
0.36366306664000003,
0.37484690664000003,
0.36700762464000003,
0.37040506164000003,
0.36854733364000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08755081744645163,
"stddev": 0.0012724343831311028,
"median": 0.08737601064000002,
"user": 0.022651926451612906,
"system": 0.007611616129032255,
"min": 0.08547883764000001,
"max": 0.09115957464,
"times": [
0.09115957464,
0.08937110764000002,
0.08983732564000001,
0.08597545264,
0.08961559764000002,
0.08587367164000001,
0.08737601064000002,
0.08677563964000001,
0.08719233364000001,
0.08751727564,
0.08688559664,
0.08736308564,
0.08745378664,
0.08739264164,
0.08727449964,
0.08814898564000001,
0.08631908064,
0.08876974464000001,
0.08547883764000001,
0.08767857964,
0.08689509464,
0.08774046664000001,
0.08593690064000001,
0.08899192264000001,
0.08772651064,
0.08771581964000001,
0.08619743064,
0.08705012664,
0.08707467264,
0.08831398664000001,
0.08697358164
]
},
{
"command": "pnpr@main",
"mean": 0.08687018170249998,
"stddev": 0.0011903042240228512,
"median": 0.08685820064000001,
"user": 0.020734213749999997,
"system": 0.008729134375,
"min": 0.08431211964000002,
"max": 0.08889348764,
"times": [
0.08749989364,
0.08666059264,
0.08818857964000001,
0.08711290464000002,
0.08669046964,
0.08754594064000001,
0.08854751664,
0.08569702864,
0.08768080464000001,
0.08887121564000001,
0.08604500364,
0.08810149564000001,
0.08595480364000001,
0.08685497964000001,
0.08690758864,
0.08842077764,
0.08889348764,
0.08537963164000001,
0.08763272364000001,
0.08684127364000001,
0.08707002364000001,
0.08621920164,
0.08574875564000001,
0.08591571964000001,
0.08809253964000001,
0.08466008464000001,
0.08614648464,
0.08515998764,
0.08686142164,
0.08774647764000001,
0.08638628664,
0.08431211964000002
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.508498818720001,
"stddev": 0.13328875127371917,
"median": 4.47002883682,
"user": 1.78012158,
"system": 1.4001327399999999,
"min": 4.43006653432,
"max": 4.87379774132,
"times": [
4.44181971832,
4.44723046632,
4.43025433932,
4.46309942132,
4.87379774132,
4.55014223332,
4.43006653432,
4.49465020732,
4.47695825232,
4.47696927332
]
},
{
"command": "pacquet@main",
"mean": 4.59357203542,
"stddev": 0.15956476647097595,
"median": 4.5487044788199995,
"user": 1.7971449800000001,
"system": 1.36520284,
"min": 4.4517247303200005,
"max": 4.90823468732,
"times": [
4.90823468732,
4.81031811632,
4.45765215532,
4.4517247303200005,
4.58147543632,
4.46554004532,
4.63612013132,
4.46186679932,
4.64685473132,
4.51593352132
]
},
{
"command": "pnpr@HEAD",
"mean": 3.55686254052,
"stddev": 0.1513505622421991,
"median": 3.47992976482,
"user": 1.21507998,
"system": 1.2590696400000003,
"min": 3.45622009332,
"max": 3.86359617732,
"times": [
3.86359617732,
3.81269341332,
3.52246134932,
3.5476357693200002,
3.45622009332,
3.47300855632,
3.46617466332,
3.47455411932,
3.46697585332,
3.48530541032
]
},
{
"command": "pnpr@main",
"mean": 3.59176861622,
"stddev": 0.16063720174423554,
"median": 3.52225056632,
"user": 1.1941501799999998,
"system": 1.27838434,
"min": 3.44855013832,
"max": 3.87493372932,
"times": [
3.59045808732,
3.48246281632,
3.87493372932,
3.80782629432,
3.56203831632,
3.46331945832,
3.44855013832,
3.75066391332,
3.4685625243200002,
3.4688708843200002
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13309 |
| Testbed | pnpr |
⚠️ 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-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,438.44 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 303.15 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 307.04 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.48 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,343.95 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,456.22 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 273.04 ms |
|
Code review by qodo was updated up to the latest commit 548e101 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The versioned-`with` case only checked that the forwarded argv contained the last token, so it would have passed with the child's command dropped — `install` missing leaves the child pnpm nothing to run, which is precisely the failure worth catching. Assert the exact slice, as the rest of the table already does. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Weak
|
|
Code review by qodo was updated up to the latest commit 09573f4 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…13309) Two passes rewrite argv before clap sees it, and neither stopped where pnpm stops parsing, so tokens meant for a script were consumed or rewritten on the way through: command pnpm pacquet run show --config.foo=bar forwarded swallowed run show --silent --silent --reporter=silent exec node show.js --config.foo=bar forwarded swallowed The `--silent` case is the worse one: the script received a token the user never typed, not merely one fewer. `ConfigOverrides::extract` stopped at an explicit `--` and at `external_command_index`, the first positional naming no known command. That covers the `pnpm <script>` fallback but not an explicit `run` / `exec`, where the command *is* known, so no boundary was found and the scan covered the whole argv. `expand_universal_shorthands` stopped only at `--`. Rather than give the shorthand pass a third boundary rule, both now consult one `parse_boundary::passthrough_from`: the first index that must reach the child untouched, whether that comes from a `--`, the fallback command, or a command taking a foreign command line (`run` / `exec` / `dlx` / `with` — pnpm's `SPECIALLY_ESCAPED_CMDS` plus `exec`). The separator is scanned independently of the command, so `pnpm install -- --config.foo=bar` still ends parsing. `recursive` / `multi` / `m` defer the classification by one positional, so `pnpm -r run build --silent` lands on the same boundary. A package sharing an escaping command's name does not: `pnpm add run --config.foo=bar` keeps the setting, because only the command position is classified. One existing shorthand test asserted the old behavior — that `--silent` "stays universal" past the script name. Both stacks disagree with it: `pnpm run show --silent` forwards the flag and does not silence the echo, while `pnpm run --silent show` silences it. Split into the two positions. Closes pnpm#13302
Note
Follows #13300, now merged — that PR fixed the clap layer of this
same boundary, this one fixes the two passes that run before clap. Rebased
onto
main, so the diff here is this change alone.Summary
pacquet rewrites argv in two passes before clap sees it —
ConfigOverrides::extractandexpand_universal_shorthands— and neither stopped where pnpm stops parsing. Tokens meant for a script were consumed or rewritten on the way through:run show --config.foo=barrun show --silent--silent--reporter=silentexec node show.js --config.foo=barThe
--silentcase is the worse one: the script received a token the user never typed, not merely one fewer.Found by Greptile while reviewing #13300, which fixed the clap layer of the same boundary.
Root cause
ConfigOverrides::extractstopped at two things: an explicit--, andexternal_command_index— the first positional naming no known command. That covers thepnpm <script>fallback, sopnpm show --config.foo=barwas already fine, but with an explicitrun/execthe command is known, no boundary was found, and the scan covered the whole argv.expand_universal_shorthandsstopped only at--.Approach
Rather than give the shorthand pass a third ad-hoc boundary rule, both passes now consult one helper —
parse_boundary::passthrough_from, the first argv index that must reach the child untouched. It has three sources, all of which pnpm honors:--, scanned independently of the command sopnpm install -- --config.foo=barstill ends parsing;pnpm <script>fallback (existing behavior, moved);run/dlx/with— pnpm'sSPECIALLY_ESCAPED_CMDS— plusexec, which reaches the same place through its argv shape.Two subtleties the tests pin:
recursive/multi/mdefer the classification by one positional, sopnpm -r run build --silentlands on the same boundary.pnpm add run --config.foo=barstill keeps the setting.One existing test asserted the old behavior
silent_long_form_expands_for_any_commandclaimed the long--silent"stays universal" past the script name. Both stacks disagree, verified against v11.17.0:pnpm run --silent showpnpm run show --silentSplit into the two positions accordingly.
Verification
All ten cases in the matrix match the TypeScript CLI byte for byte, 2214
pacquet-clitests pass, lint and dylint clean. I confirmed the new tests catch a regression: disabling the foreign-command-line rule fails twoparse_boundarytests and oneshorthandstest.TypeScript CLI: no change needed — it is the reference.
Closes #13302
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.Rust-only: the TypeScript CLI is the reference behavior being matched.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
A boundary table over every source and command shape, plus the shorthand positions.
Written by an agent (Claude Code, claude-opus-5).
Summary by CodeRabbit
pnpm run,pnpm exec,pnpm dlx, andpnpm with.--config.foo=barand--silent, are no longer incorrectly consumed or rewritten.pnpm withcommands.