Derive the assistant verb allowlists from the clap command tree
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 40
- Forks
- 9
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 59
Description
Problem
There are four hand-maintained lists of rocm verbs that must each be updated whenever a verb is added:
STRUCTUREDintreat_as_natural_language(apps/rocm/src/main.rs)chat_rocm_command_action_from_args(apps/rocm/src/main.rs)ensure_rocm_command_is_read_only(apps/rocmd/src/lib.rs)- the guard test for
treat_as_natural_language, which is itself a hardcoded array
Adding rocm storage in #172 missed two of the four, and the guard test could not catch it because the test enumerates the same list by hand. The lists are fail-closed, so a miss is not a security hole — it shows up as a working read-only command being rejected as unsupported.
Suggested direction
Iterate Cli::command().get_subcommands() plus get_visible_aliases() and assert coverage in a test, so a newly added verb fails CI until it is classified in each list. That makes the whole class visible rather than relying on the author remembering four places.
Context
Out of scope for #172, which fixes the immediate storage omissions in all the lists but does not restructure them. Raised from review feedback on that PR.
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.
Research direction
Start in apps/rocm/src/main.rs and apps/rocmd/src/lib.rs, then inspect the guard test for treat_as_natural_language. Read how Cli::command().get_subcommands() and get_visible_aliases() expose verbs. Done means the allowlists are checked against the command tree and CI catches a newly added verb that is not classified in each location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, testing-qa
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100