Skip to content

test(clap): preserve choices in external adopter probes - #1157

Merged
jdx merged 1 commit into
agent/clap-micro-matrixfrom
agent/external-clap-adopters
Aug 21, 2026
Merged

test(clap): preserve choices in external adopter probes#1157
jdx merged 1 commit into
agent/clap-micro-matrixfrom
agent/external-clap-adopters

Conversation

@jdx

@jdx jdx commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Replaces #1145, which GitHub closed when dependent branch refs temporarily matched during a restack. It retains the original external adopter probes and addresses the choice-alias review feedback with typed ValueEnum shadows.\n\n_This pull request was generated by Codex._


Note

Medium Risk
Changes argv token classification so declared digit shorts outrank negative-number values, which can alter parse results for CLIs that mix both. The rest is generated shadows, fixtures, and tests.

Overview
Pins three non-jdx clap CLIs (fd, tokei, starship) as captured KDL, typed shadows, and reduced probes, with remaining clap-bridge gaps recorded in benches/external/README.md.

The parser now treats an exact declared digit short (e.g. fd’s -0) as a flag instead of a negative number, while undeclared forms like -1 stay values when allow_negative_numbers applies.

Generated shadows emit ValueEnum types instead of string choices, and the mise shadow/tests now honor arg_required_else_help on a bare invocation.

Reviewed by Cursor Bugbot for commit df4693f. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: b34a2c93-645e-4e54-94e1-001cfcc3be73

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@jdx
jdx force-pushed the agent/external-clap-adopters branch 2 times, most recently from 75b6cba to 4bb45f1 Compare August 21, 2026 02:43
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 4bb45f1 to 8e526ba Compare August 21, 2026 02:47
@jdx
jdx force-pushed the agent/external-clap-adopters branch 2 times, most recently from e7a7590 to 198f5c1 Compare August 21, 2026 03:20
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review (149 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@jdx
jdx force-pushed the agent/external-clap-adopters branch from 198f5c1 to a7492f1 Compare August 21, 2026 03:41
@jdx
jdx force-pushed the agent/external-clap-adopters branch 2 times, most recently from 1cb1bdc to a7492f1 Compare August 21, 2026 03:49
@jdx
jdx force-pushed the agent/external-clap-adopters branch from a7492f1 to 21b48ce Compare August 21, 2026 03:56
Comment thread conformance/tests/external_clap_adopters.rs
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 21b48ce to 0aee704 Compare August 21, 2026 04:10
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 0aee704 to dd279f9 Compare August 21, 2026 04:19
@jdx
jdx force-pushed the agent/external-clap-adopters branch from dd279f9 to 15af64f Compare August 21, 2026 04:31
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 15af64f to 6b34ec2 Compare August 21, 2026 04:41
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 6b34ec2 to 0aeb9ad Compare August 21, 2026 04:41
@jdx
jdx force-pushed the agent/external-clap-adopters branch from d566978 to a2c4ce4 Compare August 21, 2026 06:11
@jdx
jdx force-pushed the agent/external-clap-adopters branch 2 times, most recently from 29f6b1b to 88d7762 Compare August 21, 2026 06:35
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 88d7762 to fab400b Compare August 21, 2026 06:46
@jdx
jdx force-pushed the agent/external-clap-adopters branch from fab400b to 8f50a4d Compare August 21, 2026 06:56
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 8f50a4d to 57b2d31 Compare August 21, 2026 07:10
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 57b2d31 to 4a97c25 Compare August 21, 2026 07:23
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
markdown ▁██ 226,007,723 → 226,075,460 +0.03% 20.86 → 20.76ms -0.50%
startup ▁▁█ 1,224,666 → 1,226,233 +0.13% 1.32 → 1.36ms +2.98%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

framework instructions, cold parse vs usage
usage 8316
argh 6307 0.8x
clap 6316072 759x
bpaf 21909147 2634x
                                              min       p01       p10    median
usage-rs: argv -> struct                      437       443       448       459  ns
argh: argv -> struct                          307       313       323       340  ns
clap: build tree + parse -> struct         516325    516946    518972    524590  ns
bpaf: build parser + parse -> struct      1607411   1607411   1612220   1627554  ns

usage: argv -> struct                             419 ns      0.42 µs
clap: build tree + parse -> struct             526418 ns    526.42 µs
clap: parse -> struct, tree reused              25107 ns     25.11 µs
clap: build tree only                          319078 ns    319.08 µs

df4693ff99fc vs 3a71d7c1fbbb · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/external-clap-adopters branch from 4a97c25 to adc47d5 Compare August 21, 2026 07:30
@jdx
jdx force-pushed the agent/external-clap-adopters branch from adc47d5 to 1b62ecc Compare August 21, 2026 07:49
@jdx
jdx force-pushed the agent/external-clap-adopters branch 3 times, most recently from fc7355a to bd2a1a9 Compare August 21, 2026 08:25
@jdx
jdx force-pushed the agent/external-clap-adopters branch from bd2a1a9 to e16dd51 Compare August 21, 2026 08:26
@jdx
jdx force-pushed the agent/external-clap-adopters branch from e16dd51 to 52732fa Compare August 21, 2026 08:32

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 52732fa. Configure here.

Comment thread benches/shadows/external-starship/src/lib.rs
@jdx
jdx force-pushed the agent/external-clap-adopters branch from 52732fa to 53e4eb7 Compare August 21, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant