CLI: buzz moderation reports --status silently returns empty for invalid values
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start with ModerationCmd::Reports in crates/buzz-cli/src/lib.rs and cmd_reports in crates/buzz-cli/src/commands/moderation.rs; compare their argument handling with PatchesCmd::Status and feed get --types. Reproduce the invalid-status command, then verify that unknown values are rejected with CliError::Usage before any request while the four documented statuses still work.
Written by the indexing model from the issue text.
Description
Describe the bug
buzz moderation reports --status opne (typo) prints [] and exits 0. That is indistinguishable from “the queue is empty.” A moderator or agent that meant --status open can miss real open reports.
Help text documents four values (open | resolved | dismissed | escalated) but nothing enforces them. The status string is appended to the query as-is. The DB filter is status = $2, so an unknown token matches zero rows and looks like success.
This is the same fail-open class as #6945 (messages get --kinds): invalid CLI input must not look like a successful empty result. Agents cannot inspect stderr interactively.
Steps to reproduce
- With a relay that has at least one open report, run:
buzz moderation reports --status open
Observe: open reports are returned. - Run:
buzz moderation reports --status opne - Observe:
[], exit code 0. - Same with
--status pending,--status OPEN,--status "open ".
Expected behavior
Exit 1 with CliError::Usage, naming the bad value, e.g.
invalid status "opne" — must be one of: open, resolved, dismissed, escalated
Actual behavior
The invalid status is forwarded to GET /moderation/reports?status=opne. The SQL is WHERE … ($2::text IS NULL OR status = $2), so unknown status returns an empty list with no error.
Version and platform
- Buzz CLI: current main
- OS: any
Logs / additional context
crates/buzz-cli/src/commands/moderation.rs (cmd_reports) — no validation; status is interpolated into the path.
crates/buzz-cli/src/lib.rs (ModerationCmd::Reports) — status: Option<String> with no value_parser. Contrast PatchesCmd::Status, which uses value_parser = ["open", "merged", "closed", "draft"], and feed get --types, which rejects unknown tokens before the query.
crates/buzz-db/src/moderation.rs (list_reports) — equality filter, not an enum check.
Suggested fix
Validate before the request (clap value_parser or an explicit allow-list in cmd_reports) and return CliError::Usage on the first unknown value. Do not send the request.
- Dominant language
- Rust
- Stars
- 33.7k
- Forks
- 4.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 239
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from block/buzz
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
workflow_sink's mention parser never masks code regions — @name inside a code span wakes the agent Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 Half a day Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100