Repository navigation
fix(fleet-search): align the search client surface with atlas-search - #13326
Conversation
…13281) - cli.rs run(): `serve` gets its own arm naming the routed shape (`fleet search serve` is routed to `fleet serve search` by the binary); the old arm lumped it with the init/fetch-model rejection and called it "not part of the surface". - proto_request: --expand validated 0..=100 (atlas-core MAX_EXPAND_NEIGHBORS) and --hydrate at most 1000 (atlas-proto request validation); both were checked only >= 0. - parse_search_args: accept `--flag=value` alongside `--flag value`, splitting on `=` like the serve role's parser (and clap); switches reject an attached value. - Help: the search options are named as the wire-translating subset of atlas-search search (not "mirroring"); the --model default is spelled in full; get-chunk's verbatim delegation of atlas-search's --context/--backend/--db/--vecdb/--via-service/ --service-url is documented in both usage texts. - Books: atlas chapter records the aligned state and pins the omitted-flag count at 20 (verified against atlas-search's parser); fleet chapter drops the resolved model-spelling discrepancy note and documents the delegation.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4b325476f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let spaced = parse_search_args(&args(&["q", "--k", "5", "--mode", "fts"])).unwrap(); | ||
| let joined = parse_search_args(&args(&["q", "--k=5", "--mode=fts"])).unwrap(); | ||
| assert_eq!(joined.k, spaced.k); | ||
| assert_eq!(joined.mode, spaced.mode); |
There was a problem hiding this comment.
Cover the argument-spelling invariant with property tests
The new --flag=value behavior establishes an equivalence invariant for every value-taking flag, but this test compares the two spellings only for fixed --k and --mode examples. This violates the repository testing doctrine requiring property tests for meaningful parser invariants; example tests do not replace that coverage. Add a proptest generating supported flags and values and comparing the parsed results of spaced and joined forms, with parsed-result equivalence as the oracle. The crate already has a proptest dev-dependency.
AGENTS.md reference: AGENTS.md:L36-L39
Useful? React with 👍 / 👎.
Aligns the fleet search client surface with atlas-search on the four disagreements the Atlas book survey recorded:
fleet search serve— help, behaviour, and the client parser's error string disagreed. The binary routessearch serveto the serve role before the client parser runs (live behaviour: it starts the service), so the rejection arm incli.rswas dead forserveand its text wrongly lumped serve withinit/fetch-model.servenow has its own arm naming the routed shape;init/fetch-modelkeep the rejection.atlas-search search. The omitted-flag count is pinned at 20, verified name-by-name against atlas-search's argument parser (the survey said 21 in one place; its own enumeration is 20).--expandis validated 0..=100 and--hydrateat most 1000 in the request builder, matching atlas-search's caps; the--modeldefault is spelled in full in help.--neighbors/--textis forwarded verbatim toatlas-search get-chunk, whose--context/--backend/--db/--vecdb/--via-service/--service-urltherefore work through the verb.=spelling —parse_search_argssplits--flag=valuelike the serve role's parser (and clap); switches reject an attached value.Books updated per the docs-sync contracts: the Atlas chapter records the aligned state; the fleet chapter drops the resolved model-spelling discrepancy note and documents the delegation.
Verification:
cargo test -p fleet-search— 98 passed, 0 failed (laptop route);nix build .#atlas-docsandnix build .#fleet-docsboth build. A remote dispatch of the same suite is running on this head.Closes #13281
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.