docs: assert a CLI message together with the behavior it describes (ROCMAI-383) - #458
Conversation
…OCMAI-383) Four times in a month a command printed a claim about its own actions that the code did not perform: a "no existing SDK" line over an install that displaced the active default, an "Approved by --yes" line on a path with no such flag, and uninstall advice naming a command that re-hit the same unparseable record. All four are now fixed, but nothing stops the next one — the message and the code it describes sit in different functions, and no convention asks for the two to be asserted together. The fourth instance is the one that shapes this rule. Its wording was pinned by a unit test, and the pin held the false claim in place while CI reported green, so "add a pinning test" on its own is not the remedy. AGENTS.md §3 now names the three shapes that need it, and the e2e README carries the same rule for Then steps that match printed output. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
efa0b15 to
e97e463
Compare
juhovainio
left a comment
There was a problem hiding this comment.
Reviewed this against ROCMAI-383 and its parent epic. This is exactly the two documentation remedies that ticket has left outstanding (the AGENTS.md convention and the PR-template checkbox) — the other two remedies (threading the approval source, and the ~56-string grep audit) were already completed separately and reported clean in the ticket, so this PR is correctly scoped and closes out the ticket's remaining work.
I checked the worked examples in the new AGENTS.md text rather than taking them on faith — setup_reset_cli_output_is_plain_and_persists_first_time_prompt, startup_focus_gate_only_opens_onboarding_for_explicit_setup_focus, and preapproved_install_line all exist exactly where cited against current main. I also checked the test-plan's claim that this PR is exempt from needing a Gherkin scenario under AGENTS.md §3's own docs exemption — it holds, since the new sub-rule only governs CLI-printed messages and this PR doesn't add one, so there's no circularity in a PR claiming exemption under the rule it's amending.
One very minor, non-blocking note: the rule is stated twice (AGENTS.md for unit tests, the e2e README for Gherkin steps) in near-duplicate prose. That's fine here since the two docs serve different audiences and the README explicitly cross-references AGENTS.md §3, but flagging it in case future edits let the two drift apart.
No blocking issues. Approving as a diff-only read — this doesn't substitute for CI or a maintainer's own pass, but nothing here needs code review since it's docs-only.
|
🔴 Automated review · pr-review-watcher · e97e463 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. SummaryDocumentation-only convention change: adds an AGENTS.md §3 rule that a message about the CLI's own behavior is asserted together with that behavior, mirrors it as a design principle in the e2e README, and adds a PR-template checkbox. No blocking findings. Verified: the cited exemplar genuinely exemplifies — 🚫 Blocking (must fix before merge)None. Non-blocking
|
Summary
Four times in a month a
rocmcommand printed a claim about its own actions that the code did not perform — a "No existing ROCm SDK found" line over an install that silently displaced the active default, an "Approved by --yes" line on a path with no such flag, uninstall advice naming a command that re-hit the same unparseable record, and an onboarding line promising setup would reappear when nothing reopens it.All four are now fixed in-tree. This PR addresses what was never fixed: nothing stops the next one. The message and the code it describes sit in different functions and often different files, with no assertion linking them, so the whole class is invisible at review time.
The fourth instance is the one that shapes the rule. Its wording was pinned by a unit test — and the pin held the false claim in place while CI reported green. So "add a pinning test" is not on its own the remedy, and the convention has to say more than that.
Changes, all docs:
AGENTS.md§3 — a message about the CLI's own behavior is asserted together with the behavior. Names the three shapes that need it (claims of an outcome, remediation advice naming a command, promises that something will not happen), and points atpreapproved_install_lineas the stronger pattern: a message derived from the value the branch is taken on cannot disagree with it.tests/e2e-cucumber/README.md— the same rule as a design principle forThensteps that match printed output..github/pull_request_template.md— one checkbox, so the omission is visible at review time rather than after merge.Tracked as ROCMAI-383, under epic ROCMAI-20 (CI Coverage and Hardening).
Audit
While writing the convention I ran the bounded audit the ticket asked for — roughly 56 strings in
apps/rocm/src/main.rsandapps/rocm/src/therock.rsthat assert an outcome, name a remediation command, or promise something will not happen. No further defects found. Notable confirmations:ROLLBACK_RECOVERY_HINTis gated onprevious_runtime_key.is_some()at all three call sites, and its text discloses its own limitation.confirm_overwrite_existing_sdk's "becomes the active default runtime" is only reachable viaSdkInstallConsent::Ask, which onlyinstall sdkpasses — the non-activatingupdate --applypath always preapproves, so it cannot reach the prompt.gpu-thermal-protectexits only viarecord_eventorqueue_proposal_with_arguments;driver-upgraderunsSandboxToolArg::DriverPlanand validates the returned tool name;cache-warmnever downloads;gpu-metricshas a singlerecord_eventexit.rocm mcp-call --allow-mutation(Command::McpCall::allow_mutation).Two observations that are not defects and are out of scope here:
append_manual_alternative_linesis#[allow(dead_code)], so its "none is selected automatically" policy line is currently unreachable. If it is ever wired up, the claim is unverified.build_uninstall_planwarns that "background processes are not stopped automatically in this pass", which is true today. PR fix(uninstall): stop managed services before removing the tooling that stops them (EAI-8014) #299 adds service-stopping to uninstall — worth re-checking that warning when it merges.Test plan
Docs-only; no code paths change, so there is no behavior to cover with a scenario (per AGENTS.md §3, which exempts docs changes provided the reason is stated).
prek run --all-filespasses