-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
Several user-visible failure paths currently feel less robust than they should:
-q/--queryexpects one token unless quoted, so natural unquoted multi-term usage fails with clap parse errors.- Stream-mode fetch failures can be surfaced as generic provider errors, obscuring the original error category and exit code.
- GitHub
--idfetch failures on HTTP 404 do not clearly explain whether the repository identifier is wrong versus the issue/PR id being missing. - Some config/instance selection mistakes surface as internal errors instead of usage errors.
Together, these reduce CLI usability and make automation behavior less predictable.
Design
Address these UX and robustness gaps in one focused pass:
- Allow
-q/--queryto accept multi-token input and join tokens internally. - Preserve structured
AppErrorcategories/exit codes in stream mode, while adding partial-output hints when relevant. - On GitHub
--id404, probe repository existence and return repo-aware diagnostic messages. - Reclassify user-caused config-resolution failures as usage errors.
This keeps existing command shape intact while improving ergonomics and diagnostic quality.
Scope
- Update
getquery parsing to support unquoted multi-token values. - Preserve original categorized errors in stream output flow.
- Add GitHub-specific 404-by-id diagnostic mapping with conditional repo probe.
- Convert config/instance-selection user errors to usage-category failures.
- Add/adjust tests for parser behavior, error categorization, and 404 mapping.
- Update help/README/man docs for new query/error behavior.
Boundary
- No new top-level commands or breaking command-model changes.
- No cross-platform 404 probing in this phase (only GitHub
--idpath). - No redesign of global error schema or exit-code table.
- No expansion into pagination/retry/rate-limit policy changes.
Acceptance Criteria
99problems get -q is:issue state:closed outputparses successfully and uses the full query string.- Stream fetch failures preserve original error category and exit code.
- GitHub wrong-repo scenarios under
--idproduce clearer repo-aware diagnostics. - Config/instance user mistakes return usage-category errors (exit code 2), not internal errors.
- Unit/integration tests and pedantic clippy checks remain green.
- Help/man/README examples reflect updated query behavior.
Context
CLI tools are most usable when common free-text inputs do not require brittle quoting and when failures are categorized consistently for both humans and automation.
For repository APIs, plain 404 responses often hide multiple causes (missing repo, missing issue id, visibility constraints). Adding narrow, context-aware diagnostics improves supportability without overhauling the architecture.
This task aligns with prior work on error-contract stability and help/man consistency by tightening real-world UX edges discovered during manual testing.