Repository navigation
Description
id(cli): pkgs/id does not compile on main — PR #3738 inserted parse_result_limit between Command's derive and the enum
Evidence (verified 2026-11-01, main e49c0be)
pkgs/id/src/cli.rs lines ~199–212 on current main:
#[derive(Subcommand, Debug)]
/// Parses a result limit (`--first` / `--last` / peek `--lines`): zero is
/// rejected with a clear error instead of silently producing an empty result
/// or a header-only preview (#3059). ...
fn parse_result_limit(raw: &str) -> Result<usize, String> { ... }
pub enum Command {The parse_result_limit function (added by PR #3738, "id(cli/repl): reject zero result limits at both boundaries (#3059)", merged 2026-11-01 09:03 CST as 5fa0650) was inserted between #[derive(Subcommand, Debug)] and the pub enum Command it belongs to. The derive now targets a function and the enum has no derive.
cargo test --lib in pkgs/id on main therefore fails with 24 errors, including:
error[E0774]: derive may only be applied to structs, enums and unions(the misplaced attribute)error[E0277]: cli::Command doesn't implement Debug(×15, from test code formatting{other:?})error[E0277]: the trait bound cli::Command: Subcommand is not satisfiederror[E0609]: no field format / format_error on Result<FindArgs, anyhow::Error>(cascade)
Full log from the discovering run: laptop /tmp/test-4789.log (queue task 4789's verification build, 2026-11-01).
Impact
pkgs/id does not compile on main at all — every id change is unverifiable and any CI leg building pkgs/id is red until this is fixed. Discovered while verifying task 4789 / PR #3748 (directory_auth, #1732), which is unrelated and blocked on this for its test run.
Fix
Move parse_result_limit (with its doc comment) so #[derive(Subcommand, Debug)] sits directly above pub enum Command again — e.g. place the function after the enum or above the derive. No behaviour change: the function body and all value_parser = parse_result_limit call sites stay as PR #3738 wrote them.
Acceptance
cargo check/cargo test --libin pkgs/id compiles on main.- The id(find/search/show/peek): a zero count is accepted everywhere — '--first 0'/'--last 0' report 'no matches found' for queries that do match, and 'peek --lines 0' renders a preview with no content lines #3059 zero-limit rejection still works (existing tests from PR id(cli/repl): reject zero result limits at both boundaries (#3059) #3738 pass).
- No other behaviour change.
Activity
developing-today commentedon Nov 1, 2026
CODE-1519
dezren39 commentedon Nov 1, 2026
Fixed on main by PR #3754 (merged as dad9ddd, commit 47b0620) — an independent lane repaired the same break in parallel with this issue being filed. Verified on current main:
#[derive(Subcommand, Debug)]sits directly abovepub enum Commandin pkgs/id/src/cli.rs, and the stale parse_find_args test call sites in pkgs/id/src/repl/runner.rs all unwrap the Result. A duplicate fix PR (#3757, from queue task 4789) was closed after a salvage diff found nothing unique. Closing as completed.