Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
14 changes: 14 additions & 0 deletions tasks/cii-v1/CANDIDATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ composition targets and the admission gate.
| oss-cli-required-single-arg | cli#2393 | 2026-08-16 | go | system/medium | 4-file feature: API + parse + errors + usage rendering |
| oss-hono-regexp-wildcard-middleware | hono#5266 | 2026-08-19 | ts | multi_file/hard | router association logic; SmartRouter masks it |

### Wave 2 (2026-08-22, PRs verified vs both waves' dedup sweep)

| Task | Source PR | Merged | Lang | Complexity | Why |
|---|---|---|---|---|---|
| oss-packaging-interpreter-tag-identifier | packaging#1351 | 2026-07-28 | py | multi_file/easy | deliberate easy anchor; vivid mis-parse symptom |
| oss-echo-problem-details | echo#3062 | 2026-07-30 | go | multi_file/medium | RFC 9457 feature with a rich behavioral contract |
| oss-zod-codepoint-length | zod#6441 | 2026-08-19 | ts | system/hard | 3 files incl. compiled codegen path; perf-aware fix |
| oss-clap-mangen-override-usage | clap#6467 | 2026-08-06 | rust | system/medium | cross-crate (clap_builder + clap_mangen) |
| oss-sqlglot-multi-table-ddl | sqlglot#8229 | 2026-08-20 | py | system/hard | 6-file breaking AST change; human-authored PR |

Wave-2 dedup catch: anyio#1228 and attrs#1592 were already python-1 tasks
(oss-anyio-fail-at-deadline, oss-attrs-generator-on-setattr) — the shortlist
below is re-checked, but always re-run the grep before building.

## Triage rules learned

- **Dedup against every existing suite first** (`grep -rh '"url"' tasks/*/*/metadata.json`):
Expand Down
101 changes: 101 additions & 0 deletions tasks/cii-v1/oss-clap-mangen-override-usage/gold_patch.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
diff --git a/clap_builder/src/builder/command.rs b/clap_builder/src/builder/command.rs
index 2d789b955c8..12183406550 100644
--- a/clap_builder/src/builder/command.rs
+++ b/clap_builder/src/builder/command.rs
@@ -3822,6 +3822,14 @@ impl Command {
self.long_about.as_ref()
}

+ /// Get the usage message specified via [`Command::override_usage`].
+ ///
+ /// [`Command::override_usage`]: Command::override_usage()
+ #[inline]
+ pub fn get_overridden_usage(&self) -> Option<&StyledStr> {
+ self.usage_str.as_ref()
+ }
+
/// Get the custom section heading specified via [`Command::flatten_help`].
#[inline]
pub fn is_flatten_help_set(&self) -> bool {
@@ -4305,10 +4313,6 @@ impl Command {

// Internally used only
impl Command {
- pub(crate) fn get_override_usage(&self) -> Option<&StyledStr> {
- self.usage_str.as_ref()
- }
-
pub(crate) fn get_override_help(&self) -> Option<&StyledStr> {
self.help_str.as_ref()
}
diff --git a/clap_builder/src/output/usage.rs b/clap_builder/src/output/usage.rs
index 7c4ddc5ffca..0cb93d498b8 100644
--- a/clap_builder/src/output/usage.rs
+++ b/clap_builder/src/output/usage.rs
@@ -74,7 +74,7 @@ impl<'cmd> Usage<'cmd> {
// Creates a usage string (*without title*) if one was not provided by the user manually.
fn write_usage_no_title(&self, styled: &mut StyledStr, used: &[Id]) -> bool {
debug!("Usage::create_usage_no_title");
- if let Some(u) = self.cmd.get_override_usage() {
+ if let Some(u) = self.cmd.get_overridden_usage() {
styled.push_styled(u);
true
} else {
diff --git a/clap_mangen/src/render.rs b/clap_mangen/src/render.rs
index c2a7bef41ed..fa6c70cbb9f 100644
--- a/clap_mangen/src/render.rs
+++ b/clap_mangen/src/render.rs
@@ -31,6 +31,12 @@ pub(crate) fn description(roff: &mut Roff, cmd: &clap::Command) {

pub(crate) fn synopsis(roff: &mut Roff, cmd: &clap::Command) {
let name = cmd.get_bin_name().unwrap_or_else(|| cmd.get_name());
+
+ if let Some(usage) = cmd.get_overridden_usage() {
+ override_synopsis(roff, name, &usage.to_string());
+ return;
+ }
+
let mut line = vec![bold(name), roman(" ")];

let required_groups: Vec<Vec<&Arg>> = cmd
@@ -178,6 +184,40 @@ fn render_synopsis_arg(arg: &Arg) -> Vec<Inline> {
inline
}

+/// Render the usage set with [`clap::Command::override_usage`].
+///
+/// Such a usage may document several invocation forms, one per line, indented
+/// to line up under the `Usage: ` prefix of the help output. Each line is
+/// trimmed and given a line of its own, so that commands documenting more than
+/// one form keep them all visible instead of having them collapsed into the
+/// single line derived from the arguments. Empty lines are dropped.
+///
+/// A form starting with the name of the command has that name set in bold, to
+/// match the synopsis derived from the arguments.
+fn override_synopsis(roff: &mut Roff, name: &str, usage: &str) {
+ let mut first = true;
+
+ for form in usage.lines().map(str::trim).filter(|l| !l.is_empty()) {
+ // Each form is rendered as its own text line, separated by an explicit
+ // break, rather than as a single line holding `Inline::LineBreak`s: a
+ // form starting with a control character is only escaped by `roff` when
+ // it starts the line it is rendered on.
+ if !first {
+ roff.control("br", []);
+ }
+ first = false;
+
+ match form.strip_prefix(name) {
+ Some(rest) if rest.is_empty() || rest.starts_with(' ') => {
+ roff.text([bold(name), roman(rest)]);
+ }
+ _ => {
+ roff.text([roman(form)]);
+ }
+ }
+ }
+}
+
pub(crate) fn options(roff: &mut Roff, items: &[&Arg]) {
let mut sorted_items = items.to_vec();
sorted_items.sort_by_key(|opt| option_sort_key(opt));
31 changes: 31 additions & 0 deletions tasks/cii-v1/oss-clap-mangen-override-usage/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# clap_mangen: SYNOPSIS ignores Command::override_usage

A command that sets `Command::override_usage` gets a man page whose SYNOPSIS
is still derived from the declared arguments. The help output honors the
override; the man page contradicts it.

```rust
let cmd = clap::Command::new("my-app")
.about("Check file types and compare values")
.override_usage("my-app [OPTION]... EXPRESSION")
.arg(clap::Arg::new("all").short('a').long("all").action(clap::ArgAction::SetTrue));

let mut buf = Vec::new();
clap_mangen::Man::new(cmd).render(&mut buf).unwrap();
// SYNOPSIS shows the derived "my-app [-a]" form, not the override.
```

The SYNOPSIS should render the overridden usage instead of the derived one:

- An override may document several invocation forms, one per line (indented
to line up under help's `Usage: ` prefix). Each non-empty form gets a line
of its own in the SYNOPSIS rather than being collapsed; empty lines are
dropped.
- A form starting with the command name gets the name set in bold, matching
the derived synopsis style; other forms (e.g. `./my-app ...`) are rendered
as plain text.
- Commands without an override keep today's derived SYNOPSIS, and the help
output's handling of `override_usage` must not change.

`clap_builder` currently only exposes the overridden usage internally — the
man-page generator lives in a separate crate and needs a way to read it.
73 changes: 73 additions & 0 deletions tasks/cii-v1/oss-clap-mangen-override-usage/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"id": "oss-clap-mangen-override-usage",
"category": "bug_fix",
"languages": [
"rust"
],
"difficulty": "medium",
"task_complexity": "system",
"created": "2026-08-22",
"repo_scale": "xlarge",
"source": "oss",
"decontaminated": true,
"image": "vulcanbench/sandbox:rust-2024",
"base_commit": "4684d7abc545cef1d78708864cfe8c7668ed49c1",
"upstream": {
"url": "https://github.com/clap-rs/clap/pull/6467",
"issue": "https://github.com/clap-rs/clap/pull/6467",
"commit": "4684d7abc545cef1d78708864cfe8c7668ed49c1"
},
"upstream_merged": "2026-08-06",
"decontamination_notes": "Real bug fix from clap-rs/clap PR #6467, merged 2026-08-06, after the training cutoffs of the models this suite targets; re-check upstream_merged against any newer model's cutoff before reusing. clap_mangen derived the man-page SYNOPSIS from the declared arguments even when Command::override_usage was set, contradicting the help output. The fix spans three files across two crates (system complexity): clap_builder/src/builder/command.rs promotes the internal get_override_usage to a public get_overridden_usage, clap_builder/src/output/usage.rs follows the rename, and clap_mangen/src/render.rs renders the override in the SYNOPSIS \u2014 one line per non-empty form with explicit breaks, bolding the command name only on forms that start with it. Workspace sliced at the PR base commit (4684d7ab) with cargo-prune to the closure of clap_mangen (clap root, clap_builder, clap_derive, clap_lex, clap_mangen), third-party deps vendored (lock regenerated for the pruned workspace; offline builds via .cargo/config.toml); rust-2024 image for headroom on vendored dev-dep MSRVs. MIT/Apache LICENSEs preserved. Hidden tests are integration tests of clap_mangen compiled independently per --test target: vb_synopsis.rs (fail_to_pass, 4 tests) compiles at base and fails behaviorally \u2014 single-form override rendering with bold name, multi-form preservation with .br separators, override replacing the derived synopsis, and non-name forms staying roman; vb_reg.rs (pass_to_pass, 3 tests) guards the derived synopsis without an override, help output still honoring override_usage, and man-page section structure. Assertions check rendered roff/help content from the tests' own inputs, never library error text.",
"grader": "tests",
"setup": [
{
"name": "warm-build",
"cmd": "cargo build --offline -p clap_mangen --tests"
}
],
"setup_timeout_s": 900,
"tests": {
"fail_to_pass": [
{
"name": "single_form",
"cmd": "cargo test --offline -p clap_mangen --test vb_synopsis vb_single_form_override_is_rendered"
},
{
"name": "multi_form",
"cmd": "cargo test --offline -p clap_mangen --test vb_synopsis vb_multi_form_override_keeps_every_form"
},
{
"name": "replaces_derived",
"cmd": "cargo test --offline -p clap_mangen --test vb_synopsis vb_override_replaces_derived_synopsis"
},
{
"name": "non_name_roman",
"cmd": "cargo test --offline -p clap_mangen --test vb_synopsis vb_non_name_form_is_not_bolded"
}
],
"pass_to_pass": [
{
"name": "derived_without_override",
"cmd": "cargo test --offline -p clap_mangen --test vb_reg vb_derived_synopsis_still_rendered_without_override"
},
{
"name": "help_override",
"cmd": "cargo test --offline -p clap_mangen --test vb_reg vb_help_output_still_shows_override_usage"
},
{
"name": "sections",
"cmd": "cargo test --offline -p clap_mangen --test vb_reg vb_man_page_sections_present"
}
]
},
"test_timeout_s": 300,
"agent_hints": {
"entry_paths": [
"clap_mangen/src/render.rs",
"clap_builder/src/builder/command.rs"
],
"suggested_max_steps": 320,
"suggested_timeout_s": 5760
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
13 changes: 13 additions & 0 deletions tasks/cii-v1/oss-clap-mangen-override-usage/repo/.clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
allow-print-in-tests = true
allow-expect-in-tests = true
allow-unwrap-in-tests = true
allow-dbg-in-tests = true
disallowed-methods = [
{ path = "std::option::Option::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
{ path = "std::option::Option::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
{ path = "std::result::Result::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
{ path = "std::result::Result::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
{ path = "std::iter::Iterator::for_each", reason = "prefer `for` for side-effects" },
{ path = "std::iter::Iterator::try_for_each", reason = "prefer `for` for side-effects" },
]
doc-valid-idents = ["PowerShell", ".."]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: clap-rs
open_collective: clap
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Bug report
description: An issue with clap, clap_complete, clap_derive, or clap_mangen
labels: ["C-bug", "S-triage"]
body:
- type: checkboxes
attributes:
label: Please complete the following tasks
options:
- label: I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
required: true
- label: I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=is%3Aissue+label%3AS-wont-fix+is%3Aclosed) issues
required: true
- type: input
attributes:
label: Rust Version
description: Output of `rustc -V`
validations:
required: true
- type: input
attributes:
label: Clap Version
description: Can be found in Cargo.lock or Cargo.toml of your project (i.e. `grep -C1 clap Cargo.lock`). PLEASE DO NOT PUT "latest" HERE, use precise version. Put `master` (or other branch) if you're using the repo directly.
validations:
required: true
- type: textarea
attributes:
label: Minimal reproducible code
description: Please write a minimal complete program which has this bug. Do not point to an existing repository.
value: |
```rust
fn main() {}
```
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce the bug with the above code
description: A command like `cargo run -- options...` or multiple commands.
validations:
required: true
- type: textarea
attributes:
label: Actual Behaviour
description: When I do like *this*, *that* is happening and I think it shouldn't.
validations:
required: true
- type: textarea
attributes:
label: Expected Behaviour
description: I think *this* should happen instead.
validations:
required: true
- type: textarea
attributes:
label: Additional Context
description: Add any other context about the problem here.
- type: textarea
attributes:
label: Debug Output
description: |
Compile clap with `debug` feature:

```toml
[dependencies]
clap = { version = "*", features = ["debug"] }
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Ask a question
about: For support or brainstorming
url: https://github.com/clap-rs/clap/discussions/new
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Feature request
description: Suggest an idea for this project
labels: ["C-enhancement", "S-triage"]
body:
- type: checkboxes
attributes:
label: Please complete the following tasks
options:
- label: I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
required: true
- label: I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=is%3Aissue+label%3AS-wont-fix+is%3Aclosed) issues
required: true
- type: input
attributes:
label: Clap Version
description: Can be found in Cargo.lock or Cargo.toml of your project (i.e. `grep clap Cargo.lock`). PLEASE DO NOT PUT "latest" HERE, use precise version. Put `master` (or other branch) if you're using the repo directly.
validations:
required: true
- type: textarea
attributes:
label: Describe your use case
description: Describe the problem you're trying to solve. This is not mandatory and we *do* consider features without a specific use case, but real problems have priority.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: Please explain what the wanted solution should look like. You are **strongly encouraged** to attach a snippet of (pseudo)code.
validations:
required: true
- type: textarea
attributes:
label: Alternatives, if applicable
description: A clear and concise description of any alternative solutions or features you've managed to come up with.
- type: textarea
attributes:
label: Additional Context
description: Add any other context about the feature request here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Thanks for helping out! -->

### What does this PR try to solve?

<!-- a maintainer-approved Issue is required for non-trivial changes -->
Closes #<!-- Issue # -->

### Notes to reviewers

<!--
Examples:
- Larger context this fits within
- Manual testing and why it wasn't automated
-->
Loading
Loading