ROCm / ROCm/rocm-cli

Derive the assistant verb allowlists from the clap command tree

Open
#188 0 comments 0 reactions 0 assignees View on GitHub

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:

  • STRUCTURED in treat_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.