Repository navigation
Description
Bug
fleet search --version (and -V) silently ignores all trailing arguments — including a real verb. The version shortcut in fleet_search::run matches only the first argument and returns success, discarding the rest.
This is the exact bug class fixed today for the queue domain in #5603 / PR #5605 (and earlier for the root built-ins in #5572). The search domain was missed because it does not use fleet main's shortcut: run_domain delegates the whole arg vector to fleet_search::run (pkgs/fleet/crates/fleet/src/main.rs, search branch), whose own shortcut never checks arity.
Evidence
pkgs/fleet/crates/fleet-search/src/lib.rs:528 pub fn run(...); :544:
Some("--version") | Some("-V") => {
println!("fleet search {}", env!("CARGO_PKG_VERSION"));
EXIT_OK
}No args.get(1) check — compare the queue-domain fix at pkgs/fleet/crates/fleet/src/main.rs (commit 7912457), which rejects a trailing argument with a usage error naming it.
Verified this run with a probe crate on the laptop against current main (7912457), calling fleet_search::run(&Config::default(), args) directly (probe: ~/git/fleet/probe-search-version on the laptop):
fleet search 0.1.0
PROBE ["--version"] -> exit 0
fleet search 0.1.0
PROBE ["--version", "--bogus-junk"] -> exit 0
fleet search 0.1.0
PROBE ["-V", "extra"] -> exit 0
fleet search 0.1.0
PROBE ["--version", "get-chunk"] -> exit 0
The last case is the sharp one: fleet search --version get-chunk … prints the version and exits 0 instead of running (or rejecting) the chunk request — a typo'd or scripted invocation silently does nothing while reporting success. The same path serves the atlas-search argv0 route (see the run doc comment), so the flaw is reachable there too.
Why it matters
Silent success on malformed input is the fleet CLI's recurring correctness trap (#5488, #5560, #5575, #5592, #5603): scripts and agents that compose flags cannot trust exit 0. The queue domain was hardened today; the search domain should match the house contract — a version flag takes no trailing arguments.
Acceptance criteria
fleet search --version <anything>and-V <anything>exit with the usage code (2), print a usage error naming the first unexpected argument, and print no version line.- Bare
fleet search --version/-Vstill printfleet search <version>and exit 0. - A pinning test in
fleet-searchcovers both flags with a trailing argument plus the bare controls (mirroringqueue_domain_version_rejects_trailing_argumentsfrom fix(fleet): queue-domain --version rejects trailing arguments (#5603) #5605). cargo test -p fleet-searchpasses.
Activity
developing-today commentedon Nov 4, 2026
CODE-1387
dezren39 commentedon Nov 4, 2026
agent-note:v1
state: filed
Found via: filed this run (creator lane B) — probe crate on the laptop against current main 7912457 calling fleet_search::run directly: ["--version","--bogus-junk"], ["-V","extra"], and ["--version","get-chunk"] all exit 0 with the version printed and the trailing argument silently discarded. Same bug class as #5603 (queue domain, fixed in #5605 today); the search domain was missed because run_domain delegates to fleet_search::run, whose shortcut at pkgs/fleet/crates/fleet-search/src/lib.rs:544 never checks arity.
Plan: guarded self-solve this run — reject trailing arguments on the --version/-V shortcut with a usage error naming the first extra argument, add a pinning test mirroring #5605's, verify with cargo test -p fleet-search on the laptop, PR and merge when green.
fix(fleet): search --version rejects trailing arguments (#5607) (#5609)
dezren39 commentedon Nov 4, 2026
agent-note:v1
state: done
Self-solved this run (guarded): PR #5609 squash-merged (aebeb02) — the --version/-V shortcut in fleet_search::run now rejects any trailing argument with a usage error naming it (exit 2, no version line); pinning test version_shortcut_rejects_trailing_arguments added. cargo test -p fleet-search 18 passed on the laptop; probe crate re-run against the fixed tree: bare --version exit 0, --version --bogus-junk / -V extra / --version get-chunk all exit 2. Issue closed by the merge; work labels stripped.