Repository navigation
Conversation
|
I read through this PR in full (the new What I checked specifically:
This looks safe to approve after final validation (CI green, a maintainer's own pass) — this is a diff-only read on my end, not a substitute for that. |
juhovainio
left a comment
There was a problem hiding this comment.
Reviewed the full diff (the new advised_commands.rs scanner, the three dashboard label fixes, the README tweak, and the new argv-tying unit test) against AGENTS.md/CONTRIBUTING.md. No blocking issues.
What I checked:
- The three claimed CLI bugs are real and the fixes are correct:
rocm install --channel/--formatneeds the nestedsdksubcommand,rocm update --checkisn't a flag (barerocm updatealready does the check), androcm doctorisn't a real subcommand (only a natural-language-planner alias) — confirmed directly againstapps/rocm/src/main.rs'sCommandenum rather than trusting the PR body. - The scanner's extraction logic (backtick-span parity, literal-invocation detection skipping comments/
#[cfg(test)], synopsis expansion, placeholder substitution) looks sound and is routed through the realclapparsing entry points, not a reimplementation. NOT_INVOCATIONSentries all look like genuinely non-advice text, and there's a dedicated test guarding against an exclusion going stale.- The new
rocm_runs_labels_name_what_each_manager_spawnstest genuinely ties the dashboard labels to the real argv-producing code, not just a restated string. - Scope is tight, no internal-content leaks, test-only module is properly
#[cfg(test)]-gated.
Looks good to merge pending CI.
|
The merge-queue run failed on Verified locally: |
2e88b6c to
ca0e0ad
Compare
siloteemu
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · ca0e0ad
This automation never files a GitHub approval, so no approving review will
appear here whatever the outcome — the merge decision stays with a human
reviewer.
Review — no blocking findings
Full review of the whole change.
Closes #534 completely: the three wrong dashboard Runs: labels and the README rocm storage synopsis are fixed, and the new check is what found them.
Blocking
None
Non-blocking
-
The checker lets some commands through that clap would reject, and the docs say it checks "every" command —
apps/rocm/src/advised_commands.rs:462-473,apps/rocm/src/advised_commands.rs:992-995,apps/rocm/src/advised_commands.rs:1036,docs/testing.md:118-142
To test this I added a fenced block to a scratch doc underdocs/and ranevery_advised_command_parses. Only the barerocm frobnicateline was reported. Three lines that would fail for a user passed:rocm update && rocm frobnicate --x:command_partcuts the line at&&, so only the first command is checked. The same happens at;,|and||.rocm install sdk --channel release --bogus-flag:command_partalso cuts at a double space, so the bad flag is never seen.rocm frobnicate <TEXT>: the checker's own placeholder fills<TEXT>with"start a local model". That value contains whitespace, sois_deliberate_natural_languageaccepts it as a deliberate natural-language request. A removed subcommand with a required text-like argument is therefore never caught. Advice like this only exists today asrocm --yes <request>, so this is latent, not a current miss.
docs/testing.mdsays the test "checks every command that the CLI or its docs tell a user to run" and that "a command that clap rejects" fails it. The cases above show both statements are wider than what the code does. The same section saysevery_source_is_scanned"requires each source to still yield a known command". In the code (advised_commands.rs:1117-1152), only the help and Rust sources are checked for a named command. Markdown and tapes are checked by count alone.
Confidence 100 (reproduced by running the test) · logic · Fix: the code should govern, because it is what actually runs. Three options:- Check every
&&/;-separatedrocmsegment. - Stop cutting at a double space for anything except help EXAMPLES rows.
- Only accept a request as deliberate natural language when the multi-word value came from the advice text, not from a filled-in placeholder.
Otherwise, list these limits in
docs/testing.mdthe way that file already lists the blind spots of the environment-test scan, and correct theevery_source_is_scannedsentence.
Decisions for the author
-
A text scanner over source code, versus structured advice — tradeoff
advised_commands.rsfinds advice by reading Rust and Markdown as text. It works line by line, matches labels likenext step:, and skips#[cfg(test)]items by counting braces. That needs no change to production code and covers every surface today, including help and tapes.
The cost is that each heuristic has edges that pass silently:- A
rocm …line inside a raw or multi-line Rust string is never extracted. - A backtick span that wraps across lines in rendered help is dropped.
- A
{or}inside a string within a#[cfg(test)]item could make the skip run to the end of the file.
The other choice is to keep advice in typed constants that tests can list, which is more reliable but means changing every call site. The minimum-count floors are a reasonable backstop. Confirm the text approach is deliberate.
- A
-
The Install label test checks only a prefix and the flag names — tradeoff
rocm_runs_labels_name_what_each_manager_spawnschecks that the label starts withrocm install sdkand contains--channeland--format. A label with literal values, extra flags or reordered flags would still pass. The flag list is written out by hand rather than taken frombuild_args(). Exact matching is impossible because the label shows…for values the user picks, so a partial check is defensible. Confirm it is enough.
Positive signals
- The Update and Examine labels are checked against what the screen actually runs (
UpdateAction::Check.args()and the newEXAMINE_ARGS, whichrun_examinenow uses), so the test proves the label is true rather than pinning a string. I confirmed each of the three label fixes is caught on its own: putting each old label back one at a time made the test fail atrocm.rs:207,:212and:225. rocmd_verdictappends--help, soCli::try_parse_fromstops at the parser before the tokio runtime is built. rocmd advice is checked against the real definition without running anything.- Each
NOT_INVOCATIONSentry is keyed by file plus exact text and carries a reason.exclusions_still_match_somethingkeeps the list from going stale.
Deployment notes
None
What this covered
I read every file in the change in full: all 1,354 lines of advised_commands.rs, the four dash-tui files, and the README and docs/testing.md hunks. I also read the routing in apps/rocm/src/main.rs that the checker reuses (run, parse_freeform_invocation, should_treat_as_freeform, command_invocation_error, cli_command), the clap definitions for storage, install sdk, update and examine, and rocmd::run_from_args. Range: 2d45c61…ca0e0ada.
Tests I ran:
cargo test -p rocm --bin rocm advised_commands: 7 passed, 1 ignored.- The three-way revert of the labels described above.
- The false-pass probe described in the finding, using a scratch doc that I deleted afterwards.
The four code passes ran as separate read-only workers. History, agent-instruction adherence and code-comment compliance ran as one combined worker. I did not run separate Step 7 workers for the design questions. I settled those myself from the worker reports and my own runs, so that step was not independent. The prior-changes pass did not run, because earlier reviews of these files are not readable from here.
CI at review time: E2E tests (MI300X) and E2E tests (MI350P) were still queued and had not reported, so nothing here rests on them. Skill checks (skillscope) had not reported at handoff and has since reported as skipped. Every other check passed.
The PR text explains why there is no Gherkin scenario (the dashboard fix changes display text only, and dash-01 does not assert the Runs: text), as AGENTS.md §3 requires. The leak scan of the diff found nothing beyond the license headers and sign-off identities.
This review was not reconciled against the PR discussion.
ca0e0ad to
9ad9f3d
Compare
|
Addressing the automated review on
The rebase surfaced a semantic conflict with main. Main's out-of-memory recipes (#251) advise On the two decisions: (a) Text scanner vs typed advice constants: deliberate. A scanner needs no production change and reaches help output, tapes and docs, which typed constants could not. The per-source named-command checks and count floors guard against an extractor going blind. The edges you listed are now in a "Known gaps" list in
(b) Install label: tightened in Re-ran locally on the rebased head, all clean:
|
Stale: approved 2e88b6c; head is now 9ad9f3d, so a fresh look is needed on the current head. Since the approval: rebased onto main, with a model-readiness exemption for a semantic conflict (b6b9500); the automated review's three false passes closed: shell lists, double space, placeholder-filled requests (b24da21, 0fa6ba4); docs say exactly what is checked (8ee20a4); the Install label is derived from build_args() (c79e9f7); and an options-placeholder rule for a second semantic conflict with main's OOM recipes (9ad9f3d).
9ad9f3d to
4c69543
Compare
|
Rebased onto Earlier extractions on main (#483, #487, #528) moved four strings this check excludes out of
Exclusions are keyed by file, so after the move the checker reported those strings as advice that does not parse, and the old entries as matching nothing. The branch still merged cleanly into main; I found this by running the checker against a merge of current main. Re-ran locally:
|
jussielo-amd
left a comment
There was a problem hiding this comment.
Reviewed the full diff (origin/main...HEAD at commit 4c69543) covering the new apps/rocm/src/advised_commands.rs scanner, the three dashboard Runs: label fixes in crates/rocm-dash-tui/src/ui/tabs/rocm.rs, the README storage synopsis fix, and the docs/testing.md addition.
This PR already had two review rounds. @juhovainio approved (dismissed by a later push) at 2e88b6c, and an automated review at ca0e0ada flagged three non-blocking precision gaps in the scanner (shell-list splitting only checking the first command, a double-space cut hiding bad flags, and a filled-in placeholder being misread as a deliberate natural-language request) plus a note that the Install label test only checked a prefix and hard-coded flag names. I verified each of these against the current HEAD rather than trusting the earlier review's resolution: split_shell_list() (apps/rocm/src/advised_commands.rs:490) now splits on &&/||/;/bare |, the double-space cut in command_part is now gated to indented EXAMPLES rows only (advised_commands.rs:432-434), is_deliberate_natural_language (advised_commands.rs:1150) now checks whether the request words are multi-word in the advised text rather than the substituted placeholder, and rocm_runs_labels_name_what_each_manager_spawns in rocm.rs:191 now derives the expected Install label from InstallManagerState::build_args() rather than a hand-written prefix/flag check. All four corresponding regression tests (every_command_in_a_shell_list_is_checked, a_double_space_does_not_hide_the_rest_of_a_command, only_advised_text_makes_a_request_deliberate, and the updated dash-tui test) pass locally. The prior findings are resolved.
My own pass surfaced a few more precision gaps in the scanner, none of which are currently triggered by any shipped advice text: may_omit_required_values (advised_commands.rs:1179) suppresses the missing-argument check if any word in the command ends in an ellipsis, not specifically the word next to the omitted value; rust_production_lines's #[cfg(test)] skip (advised_commands.rs:199) only matches when the attribute is the entire trimmed line, so a one-line #[cfg(test)] fn ... would be scanned as production text (no such one-liner exists in the tree today); and the new rocm_runs_labels_name_what_each_manager_spawns loop in rocm.rs:202 has no arm for a trailing boolean flag with no value after it, so it only passes today because --dry-run happens to be last in build_args(). These are all in the same spirit as the scanner's already-documented "Known gaps" in docs/testing.md:166, and worth a follow-up, but none produce a wrong result against the advice text that exists in the repo right now, and the core bugs this PR set out to fix (the three wrong dashboard labels and the README synopsis) are correctly fixed and verified against the actual clap definitions.
The "no Gherkin scenario" justification in the PR body holds: this changes display-only text in the ROCm tab's detail pane, not spawned behavior, and the new unit test ties each label to the real argv the manager builds rather than pinning a string.
CI is green except for E2E tests (MI300X), which fails on bench-load-real-serve, chat-end-to-end-local-model, serve-vllm-inference, and the live ROCm-10 install scenario — all GPU-hardware-dependent serving/install paths this diff does not touch (it only touches the CLI advice scanner and dashboard label strings), so this looks like a pre-existing hardware/infra flake rather than a regression from this change.
No blocking issues. Approving.
4c69543 to
fb7bad2
Compare
|
The merge queue ejected this on Rebased onto main
The approval's three precision notes are separate from this fix and will follow in a separate PR:
Verified locally:
|
siloteemu
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · fb7bad2
This automation never files a GitHub approval, so no approving review will
appear here whatever the outcome — the merge decision stays with a human
reviewer.
Review — needs work
Full review of the whole change (prw-base...HEAD, 14 commits, 8 files).
Fixes #534 (dashboard Runs: labels that do not parse, plus a README synopsis). The change also adds the advised-command checker that the issue's root cause calls for, which the description covers.
Blocking
-
new · A removed subcommand followed by a quoted multi-word argument passes as "deliberate natural language" —
apps/rocm/src/advised_commands.rs:1222-1230(call site:1276),docs/testing.md:148-152
is_deliberate_natural_languageends inrequest_words.iter().any(|word| word.advised.contains(char::is_whitespace)), so a quoted word anywhere in the request counts. Real routing (command_invocation_error,apps/rocm/src/main.rs:1689) treats the request as prose only when its first word has whitespace. I ran a scratch fixture:rocm frobnicate "two words"yields 0 findings, whilerocm frobnicate <TEXT>yields 1. docs/testing.md promises that "a removed subcommand that took a text argument ... still fails". That holds for a placeholder but not for a quoted argument. No self-test covers theany:only_advised_text_makes_a_request_deliberateuses only<TEXT>. The code is the side that governs, because the doc states the intent and the PR description lists "a single word falls through to the planner" as a failure condition.
Confidence 100 · logic · Fix: judge only the first request word, which is what real routing judges. Addrocm frobnicate "two words"as a failing fixture. -
new ·
rocmdcommands are checked with--helpappended, which skips conflict and required-argument validation, and the docs do not say so —apps/rocm/src/advised_commands.rs:1032-1050,docs/testing.md:147(and the "every command that runsrocmorrocmdis checked" sentence at:135)
clap returnsDisplayHelpbefore it validatesconflicts_withand required arguments. Scratch fixture:rocmd supervise x --engine e --model-ref m --canonical-model-id c --port 1 --runtime-id a --env-id byields 0 findings. The two ids are declared conflicting inapps/rocmd/src/cli.rs:38-40.rocmd frobnicateyields 1.
The code comment admits that missing required values are not checked, but nothing admits conflicts. docs/testing.md lists "a command that clap rejects" with norocmdcaveat, and its known-gaps list omits this. Only two self-tests touchrocmd, and both use an unknown flag. The behaviour is a deliberate trade, so the docs must say it. Alternatively, close the gap by parsing without--helpwhere possible.
Confidence 100 · logic · Fix: state the limitation (unknown words and invalid values only) in docs/testing.md, or close it. Add a self-test that pins whichever is chosen. -
new · Two branches of the Markdown extractor can be broken with every test still green —
apps/rocm/src/advised_commands.rs:362-363($andPS>prefix stripping),:388(wrapped inline-span joining)
I ran each mutation alone againstcargo test -p rocm --bin rocm advised_commands:- Replacing both prefixes with non-matching strings leaves 13 passed, 0 failed.
- Changing
% 2 == 1to% 2 == 7leaves 13 passed, 0 failed. - By contrast, disabling fenced
\/`continuation does turnevery_advised_command_parsesred, through real docs content.
The floors in
every_source_is_scannedare far looser than one branch, and no self-test feeds these shapes. The description says "Every guard was mutation-checked". These two were not, or were not pinned by a test. Advice written behind a$prompt or in a wrapped span is then silently unchecked.
Confidence 100 · logic · Fix: add a self-test forextract_markdowncovering a$/PS>fenced line and a span wrapped across two lines, each with a bad command that must be reported. -
new · The dashboard
Runs:text change has no Gherkin scenario, and the stated exemption is not one the rule allows —crates/rocm-dash-tui/src/ui/tabs/rocm.rs:33,47,57,61,crates/rocm-dash-tui/src/ui/tabs/pane.rs:273; AGENTS.md §3
§3 requires a scenario for anything a user of the CLI can observe. It says a unit test on the helper "does NOT discharge this", and its only exemption is purely internal changes (refactors, CI plumbing, docs). The PR text argues the labels are "display-only text" proved by a unit test, and notes thatdash-01does not assertRuns:. Rendered text in the ROCm tab is what the user sees. The new test reads theVERBSdata rather than the rendered line, so it would stay green ifpane.rsstopped printingcmd. A scenario is cheap to add:dash-01(tests/e2e-cucumber/features/dash.feature:8) already opens the ROCm tab.
Confidence 75 · architectural · Fix: extenddash-01, or add a sibling scenario, to assert one correctedRuns:line (for exampleRuns: rocm examine) with its step definition. Or have the PR text name a lane that cannot run it.
Non-blocking
-
new · A fenced line ending in
\leaks state across the closing fence and EOF —apps/rocm/src/advised_commands.rs:337-399
The closing fence takes thecontinueat the fence test without clearingpending, and EOF never flushes it. The stranded command is not checked, and the next fence's first line is glued onto it:rocm serve foo \as the last line of a fence becomesrocm serve foo rocm examine. This is latent today.
Confidence 70 · logic · Fix: clearpending(after pushing it) on a fence line and at EOF. -
new · Wrapped inline spans in
--helpoutput are not seen, and the known-gaps list omits this —apps/rocm/src/advised_commands.rs:515-531,docs/testing.md"Known gaps"
help.lines()is scanned span by span, and clap wraps at a fixed width. A span broken across lines leaves an odd backtick on each and is dropped. A wrapped EXAMPLES row is checked only up to the wrap. Markdown wrapping is handled and help wrapping is not.
Confidence 70 · logic · Fix: add it to the known gaps, or join wrapped help lines as Markdown prose is joined. -
new · Synopsis expansion mishandles a group whose first word is
a|b, and nested groups —apps/rocm/src/advised_commands.rs:840-867
[a|b]as the first word of a group extendscurrentwith both values (argv... a b) instead of branching.[report [--json]]closes at the first], sorocm storage reportalone is never tried. Nothing in the current docs uses the first-word form.synopsis_notation_expands_to_each_documented_formcovers neither case, including the README form this PR introduces.
Confidence 70 · logic · Fix: test and handle both forms, or list them as known gaps. -
new · "Comments are skipped" overclaims —
docs/testing.md:126,apps/rocm/src/advised_commands.rs:292
Only whole-line//comments are dropped. A trailing// ... \rocm x`comment or a/* */block on a production line is scanned, becausebacktick_spans` runs over the whole line. The code governs; narrow the doc.
Confidence 70 · mechanical. -
new · The label test's docstring promises more than it checks —
crates/rocm-dash-tui/src/ui/tabs/rocm.rs:198-200, loop at:224-236
"a user who copies it to a shell gets the same command" cannot hold for the Install label:- It contains
…. - The form defaults to
--dry-run, which the derivation drops, as it does any boolean flag. --prefixis never exercised, because the default is empty.
I mutated the Update label back to
rocm update --checkand the test went red, so the claimed regression coverage is real. Only the docstring is too wide.
Confidence 70 · mechanical · Fix: narrow it to "names the subcommand and value flags". - It contains
-
new · Brittle and redundant bits in the new test file —
apps/rocm/src/advised_commands.rs:457,:1610,:1441-1450name == "advised_commands.rs"is already covered by the#[cfg(test)] mod advised_commands;declaration.#[cfg(test)]onfixturesits in a module that is already test-only.checker_rejects_what_users_would_hitusesrocm doctorandrocm update --checkas negatives. A future legitimatedoctoralias or--checkflag would break it for no regression reason. Other tests usefrobnicate.
Confidence 70 · mechanical.
-
new · Commit history carries follow-up noise —
e2827e5,c9f568a,632877c,e06c2c8
These read as fixups ofd3389bb: a clippy fix, a one-line test pin with no body, and doc and rustfmt follow-ups. The catch-up commits (4179081,ebb5575,0e0216f,fb7bad2) explain themselves.
Confidence 70 · mechanical · Fix: fixup-squash before merge if history cleanliness matters here.
Decisions for the author
-
Text scanner over Rust source versus typed advice constants — tradeoff
The scanner reaches README, docs, skills, tapes and Rust literals with one mechanism and needs no refactor. The cost is a lexer with documented gaps and a hand-maintainedNOT_INVOCATIONSlist. About 15 of its 27 entries today are error, log or heading text, so an unrelated PR that addsbail!("rocm serve failed: ...")will fail this test and need an entry. The failure is loud and its message says what to do. Exclusions are keyed by file plus exact text, so they cannot go stale silently. A typed-constant registry would drop the lexer but means changing hundreds of call sites. Confirm the recurring cost is accepted. -
The routing replica mirrors
run()'s sequence rather than calling one shared function — non-blocking-improvement
rocm_verdict(advised_commands.rs:1011-1030) calls the real helpers but repeats the order fromapps/rocm/src/main.rs:1443-1470. It already omits theapprovebail. No false pass results today, becauseClihas no top-level--yes. A pre-dispatch step added torun()later would not be mirrored. A small sharedroute()helper used by both would remove the drift risk. -
One PR for a label fix and a 1,790-line checker — tradeoff
The fixes are exactly what the checker finds, and it cannot land green without them, so one change is defensible. The PR explains this. Against that, a small user-visible bug fix and a large test framework review differently. A fix PR followed by a stacked checker PR would be easier to read. AGENTS.md §11 does not forbid either.
Positive signals
rocm_runs_labels_name_what_each_manager_spawnsderives its expected labels frombuild_args(),UpdateAction::Check.args()and the newEXAMINE_ARGSthatrun_examineactually consumes, not from a second hard-coded copy. Reverting the Update label turns it red.rocm_verdictcalls the realparse_freeform_invocation,should_treat_as_freeform,command_invocation_errorandcli_command()instead of re-implementing routing.- Exclusions are keyed by
(file, exact text)withexclusions_still_match_something, so moved or edited text fails loudly instead of going stale. service_action_retry_advice_parses_for_generated_idsruns the real message function over a character-class corpus and asserts the exact argv. That makes excluding the templated line honest.- The checker found a real README defect:
rocm storage [report] [--json]implied a rejectedrocm storage --json. The fix matchesStorageCommand::Report { json }.
Deployment notes
None.
What this covered
I read every file in the change completely: apps/rocm/src/advised_commands.rs, the main.rs module declaration, the four rocm-dash-tui files, docs/testing.md and the README hunk. I also read the clap definitions and routing in apps/rocm/src/main.rs, apps/rocmd/src/cli.rs, and the dashboard pane renderer. All of it was read against ee3131be…fb7bad26 (prw-base...HEAD, merge base ec07bf7a…).
Four read-only workers covered the scanner, the dashboard labels, the source-reading passes and the design questions. I ran:
cargo test -p rocm --bin rocm advised_commands(13 passed, 1 ignored)cargo test -p rocm-dash-tui rocm_runs_labels(1 passed)- scratch fixtures for the first two blocking findings
- single-branch mutations of the Markdown extractor and of the Update label
I read the description and #534 after the findings were settled. The description's "every guard was mutation-checked" claim is partly contradicted by the third blocking finding.
CI at this head (live rollup): E2E tests (Strix Halo, Ubuntu) (release) and E2E tests (Strix Halo, Ubuntu) (nightly) concluded CANCELLED, and Skill checks (skillscope) was SKIPPED. None of the three passed. I did not establish why, and a cancelled or skipped check is not evidence for or against the change. All other checks concluded SUCCESS, including clippy, prek, build-and-test, windows-build-and-test, MI300X, Strix Halo Windows and WSL2 E2E, coverage, docs and signatures.
Did not run:
- A full-workspace test, clippy, or
scripts/smoke_local.py. - Windows-specific behaviour, which was reviewed by reading only; the Windows CI lane passed.
The "Prior changes" pass made two API queries for review comments on earlier changes to the touched dashboard file and found none. Not reconciled against any discussion on the PR here.
|
Rebased onto main Rebase catch-up
Blocking
Non-blocking
Decisions: I accept the recurring cost of maintaining Each new test was checked by breaking the code it covers. Verified locally:
The one local failure was the known spinner timing flake. |
fb7bad2 to
dc06c3c
Compare
The ROCm tab's "Runs:" line named commands that do not exist: `rocm install --channel … --format …` (the install manager runs `rocm install sdk …`; clap rejects --channel on `install`), `rocm update --check` (no such flag; the manager runs `rocm update`), and `rocm doctor` (not a subcommand; from a shell it reaches the natural-language planner and prints "No ROCm action matched"; the manager runs `rocm examine`). A user copying them hits an error. The README storage synopsis `rocm storage [report] [--json]` implied `rocm storage --json`, which clap rejects: --json belongs to `report`. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Remediation and help text name commands for users to run, but tests only pin the wording, so a renamed flag or removed subcommand strands users silently. Enumerate every advised invocation (rendered --help of every visible command, production Rust string literals, README/docs/skills markdown, VHS tapes), substitute placeholders, and route each through the same entry points run() uses: the natural-language router, then the real clap tree (rocmd via its own parser). A single-word request that falls through to the planner is flagged too: it means the advised subcommand does not exist. Templated retry advice for services stop/restart is checked through the real message function for every engine and every character class a model ref can contribute. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Also apply rustfmt to the new module. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
A label that parses is not a label that is true. Pin each label to the argv its manager builds: Update to UpdateAction::Check, doctor to the examine screen's argv (now one EXAMINE_ARGS constant), and Install to build_args()'s subcommand and value flags. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
A missing required argument was always accepted as a prose reference, so if a command gained a required argument every bare copy of it in RECIPES, next-step lines, fenced examples and help EXAMPLES would stay green. Record which kind of text each invocation came from and allow the omission only in inline prose spans or text that marks it with an ellipsis. A single total floor also let one extractor break silently while the others kept the count up; require each source to still yield a known command and a minimum count. Skip clap's generated help subcommand so a help-text problem is reported once. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Satisfies clippy::case_sensitive_file_extension_comparisons. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
…and check #407 landed `render_model_readiness_text`, whose first line is `rocm diagnose --model <ref>: <verdict>`: a heading naming the command that produced the report, not advice to run anything. The advised-command check reads it as an invocation, substitutes both placeholders, and fails because `<verdict>` becomes a second positional argument. That is what ejected this change from the merge queue once main gained #407. Exempt it in NOT_INVOCATIONS with that reason, beside the other status headings. It is the only new hit from rebasing onto current main. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
- Check every command of a shell list: split at `&&`, `||`, `;` and a
standalone `|` (not inside quotes, `<…>`, `[…]` or `{…}`), and check
each part that runs `rocm`/`rocmd`. Before, only the first was seen.
- Stop cutting a command at a double space. Only an indented EXAMPLES
row (rendered help, or the after_help literal it is written in) has a
description column after one; README synopsis rows are now checked
past their alignment padding.
- Treat a freeform verdict as a deliberate request only when the advice
itself is multi-word (a quoted request or `<natural language
request>`), not when a placeholder filled in several words:
`rocm frobnicate <TEXT>` no longer passes.
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
The section said it checks "every command" and that each source must still yield a known command, but only help and Rust were held to a named command; Markdown and tapes were checked by count alone. Hold those two to a named command as well (README fenced and inline lines, the CLI tape), and describe the shell-list split, the EXAMPLES-row column cut, the natural-language rule, and the scanner's known gaps. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
The label test checked the subcommand prefix and two hard-coded flag names, so a label that grew an invented flag still passed. Build the expected label from the default form's argv instead: the subcommand, then every value flag with its value elided as `…`. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
…rose notes Main's out-of-memory recipes advise `rocm serve <model> <case-appropriate options above>`, and the checker filled that placeholder with an invented value that clap rejects. A placeholder naming options stands for flags the reader picks from the text above it, so it now contributes no words and `rocm serve <model>` is still checked. The code object manager probe's notes start with `rocm serve/rocm chat` as prose about what those commands load; they are listed as not advice. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
…ed to Main's rocmd and rocm-core extractions moved four excluded log and error strings out of `apps/rocmd/src/lib.rs` and `crates/rocm-core/src/lib.rs` into `sandbox.rs`, `service.rs` and `host_gpu.rs`. Exclusions are keyed by file, so the moved strings were reported as advice that does not parse and the old entries as matching nothing. Point the entries at the strings' new files. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
main gained deletion_properties.rs (#562) and archive_props.rs (#559), declared as #[cfg(all(test, unix))] modules, the second through #[path]. Their comments and ignore reasons read as advised commands (`rocm dirs`, `rocm uninstall applies no guard ...`), so every_advised_command_parses failed on main merged with this branch. The scanner skipped only whole *tests.rs files and items gated on exactly #[cfg(test)]. Skip every file declared only as a test module, following #[path], and treat #[cfg(all(test, ...))] items like #[cfg(test)] ones. Removing either change, or ignoring #[path], turns a test red. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Main moved the service hints into service_hints.rs (#604), added the runtime-activation retry hint (#424) and moved the labelled `stop:` line out of a literal (#625). Re-key the services exclusion and add one for the runtimes hint; both are format templates, so each gets a test that checks every real value against the parser: the literal verbs callers pass to service_action_hint (found in the source, so a new caller is covered), and the refusal for every `rocm runtimes` subcommand taking --restart-services, re-parsed to show following it clears the refusal. That check is hoisted into ensure_runtime_service_restart_approved so the test exercises the dispatch's own hint, not a copy of it. README advertised `[--restart-services] [--yes]`, but --yes requires --restart-services, so `rocm runtimes rollback --yes` fails. Nest the flag, and teach the scanner nested groups: each prefix of a nested group is now its own form, so `[--distro [NAME]]` also checks bare --distro. The architecture doc names the hint's real verbs, so it is checked rather than excluded. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Natural language: a quoted argument after one word passed as a deliberate request, so `rocm frobnicate "two words"` was never reported. Judge only the first request word, which is what routing judges. rocmd: the check appended `--help`, and clap stops at help before it validates conflicting or required arguments. Parse with rocmd's own parser through a new run-nothing `rocmd::parse_args` instead, so rocmd advice gets the same validation as rocm advice. Markdown: the `$ `/`PS> ` prompt stripping and the wrapped-span join had no test. Add one carrying a removed subcommand in each shape. A `\` continuation cut off by the closing fence or the end of the file is now checked as it stands instead of swallowing the next fence's first line. Swap negatives that a future alias or flag could make legitimate for `frobnicate`. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
A span an author breaks across `--help` lines is joined and checked, as wrapped Markdown spans already are. In a synopsis group a value list now branches the alternative and later words extend every branch, so `[stop|restart <id>]` yields both forms with the id rather than `stop restart <id>`; nested groups are tried with and without their inner part. Say exactly what is skipped: whole-line comments only, not a trailing comment on a line of code. Narrow the dashboard label test's doc to what it checks, drop a skip the test-module rule already covers, and bring the testing guide up to date with these and the earlier fixes. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
The ROCm view's `Runs:` line is a command a user can copy into a shell, and it named `rocm doctor`, which does not exist. The unit test checks the labels against what each screen runs; this checks the rendered line through the real TUI. It extends dash-01 rather than opening another dashboard session on the no-GPU lane, whose dash timing scenarios are sensitive to added load. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
…CII scan
`advised_commands.rs` is declared only as `#[cfg(test)] mod advised_commands;`,
so none of its literals reach a binary. The ASCII-output contract's test-only
detection is path-based and cannot see that, so the checker's prose markers
(em dash, en dash, arrow), its ellipsis needle and a Unicode model-reference
fixture were reported as output. Exempt the file with the reason; `\u{..}`
escapes would not help, since the scan flags those too.
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Main moved `chat_tool_call_display_label` and its `rocm command` fallback label out of main.rs into chat.rs. The NOT_INVOCATIONS entry still named main.rs, so the label was reported as unparseable advice and the entry as stale. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
`command_parts` cuts a command at an em dash, en dash or arrow so the description after it is not read as arguments, but no test exercised those markers: removing any of them passed the suite, before and after main's ASCII conversion of CLI output. Pin each one. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Main's chat/MCP-bridge extraction moved the `rocm tools: {}` status row,
the planner's natural-language phrases (`rocm install folder`, `rocm
installed at`, `rocm installed`, `rocm please`) and the `rocm` tool's
empty-argv validation error from main.rs into chat.rs, verbatim. None of
them is advice to run a command; only the file the exclusions name changes.
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
|
Rebased onto main
Merged with current main, |
dc06c3c to
9074965
Compare
juhovainio
left a comment
There was a problem hiding this comment.
Reviewed the full diff against the current repo state (no blocking findings).
Verified by hand-tracing rather than taking the PR's claims at face value:
advised_commands::rocm_verdictmirrors the real dispatch inmain.rs::run()(parse_freeform_invocation -> should_treat_as_freeform -> command_invocation_error) for every path I could construct. One minor divergence:rocm_verdictdoesn't replicate the--yes-without-freeform-request bail, but no argv shape makes that produce a false "Parses" result since clap rejects it too, just with a different error. Non-blocking.- The dashboard "Runs:" label test derives its expectation from the real
InstallManagerState::build_args()defaults, and I confirmed the label-building loop correctly drops the trailing dry-run flag and matches the static label. Same pattern checked for update/doctor labels. ensure_runtime_service_restart_approvedbeing hoisted out of the match arms is behaviorally identical to the inline checks it replaces, and the new standalone function is an exhaustive match over allRuntimesCommandvariants, so a future variant can't silently skip the check.
Non-blocking notes:
- The advised-command variant generator only toggles one optional flag group at a time, so it wouldn't catch a bug that only manifests when two optional flags combine. Likely an intentional tradeoff given current advice shapes, but worth a one-line mention in the "Known gaps" section alongside the other documented limitations.
is_test_cfg's string-prefix matching (e.g. won't match#[cfg(any(test, ...))]) is already disclosed as a known limitation of the text-scanner approach, so not a hidden defect.
CI: one failing check, Strix Halo Windows E2E (diagnose-fix-path-prepends-with-apostrophe-intact), which is a known PATH-apostrophe flake that fails identically on main and is unrelated to this diff. Everything else is green.
Scope matches issue #534 (the three broken dashboard labels + README synopsis bug), with the additional README runtimes-flag fix and the scanner module itself transparently called out in the PR description as "Also in this PR" rather than undisclosed scope creep.
Good use of real manager state (build_args()/EXAMINE_ARGS) to derive expected labels instead of re-encoding them as string literals, that's exactly what closes the gap the ticket describes.
|
Thanks.
|
Fixes #534.
Remediation lines, help examples and docs tell users which
rocmcommands to run, but tests pin only their wording at most. A renamed flag or a removed subcommand therefore leaves users with advice that fails.This adds a test that collects every
rocm/rocmdcommand the project advises, from:--helpof every visible commandnext step:/Try:/apply with:lines, therocm fixrecipe commands and dashboard labelsREADME.md,docs/,skills/, and the demo tapesIt fills in placeholders and routes each command through the same entry points
rocmuses: the natural-language router, then the real clap definition. It fails when:…, may leave values out)Each source must still yield a known command and a minimum count, so a broken extractor cannot pass silently. The templated retry advice for
services stop/restartis checked through the real message function.It found four broken commands, fixed here:
The dashboard's ROCm tab showed three:
Runs: rocm install --channel … --format …(missingsdk)Runs: rocm update --check(no such flag)Runs: rocm doctor(not a subcommand; from a shell it reaches the planner and does nothing)They now name what each screen actually runs, and a new unit test,
rocm_runs_labels_name_what_each_manager_spawns, ties each label to the argv that screen's manager builds.README's
rocm storage [report] [--json]impliedrocm storage --json, which is rejected. It is nowrocm storage [report [--json]].Scenario.
dash-01(@id:dash-opens-and-navigates) now selects the diagnose action and assertsRuns: rocm examineand norocm doctoron screen. It fails against the old label and runs on the Linux lanes (@requires-os:linux). The unit test still derives each expected label from the argv the manager builds.Verification. Every guard was mutation-checked. The test goes red for each of these:
rocm examinerequire an argument (19 findings)rocm update --applyThe new tests run in about 1 s and are pure: no environment, filesystem or process side effects.
rocmdadvice goes through a newrocmd::parse_args, which runs nothing, so it gets full clap validation (conflicts and required values included).Local gates:
cargo fmt --all --check: 0cargo xtask manifest --check: 0cargo test -p rocm --all-targets: 975 passed. Two tests unrelated to this change failed once under the parallel run and pass in isolation.rocm-dash-tuiui::tests: 0docs/testing.mddescribes the check and when an exclusion is appropriate.Also in this PR
rocm runtimes activate|rollback [--restart-services] [--yes]advertised a--yesthe parser rejects on its own. It is now[--restart-services [--yes]].every_service_action_hint_verb_parses, andruntime_restart_retry_advice_parses_and_clears_the_refusal. The latter needed the runtimes approval check moved intoensure_runtime_service_restart_approved, with no change in behaviour.-would make the runtimesTry:line unrunnable, because that hint (from EAI-7404: make runtime activation and rollback transactional #424) does no shell quoting. Such a selector can't match a real runtime.