Skip to content

ROCMAI-210: extract update-surfaces rendering into update_cmd.rs and fold automation-proposal/daemon rendering into automations.rs - #752

Draft
jussielo-amd wants to merge 5 commits into
rocmai-214-gpu-policyfrom
rocmai-210-update-automations
Draft

jussielo-amd wants to merge 5 commits into
rocmai-214-gpu-policyfrom
rocmai-210-update-automations

Conversation

@jussielo-amd

Copy link
Copy Markdown
Collaborator

Summary

Phase 6f-3 of the main.rs modularization (epic ROCMAI-27). Mechanical relocation, no behavior change, split across two destinations:

  1. New file apps/rocm/src/update_cmd.rs — the rocm update command's rendering/activation logic: render_update_text, append_update_surfaces, apply_runtime_update, append_update_activate_summary, select_runtime_update_source, select_installed_update_runtime, plus update_should_preview_or_apply (interleaved, not named in the original ticket summary but part of the same cluster).
  2. Folded into the existing apps/rocm/src/automations.rs — that file's own doc comment already anticipated this ("Render/policy helpers remain in the crate root... reached through crate::"), now rewritten since they live here: render_automations_text, ProposalKind, proposal_kind/proposal_plain_summary/proposal_plain_reason/proposal_status_label/proposal_bool_argument, fallback_tool_for_automation_action, automation_event_plain_summary, audit_event_plain_summary, watcher_last_check/watcher_plain_name/watcher_plain_trigger/watcher_plain_action/watcher_policy_note/watcher_mode_plain_label, render_daemon_text.
  • Real external callers fixed beyond main.rs/chat.rs: therock_version_proptests.rs, runtimes_cmd.rs/runtime_install_finalize.rs (via the ROLLBACK_RECOVERY_HINT const, which stayed in main.rs since it has other callers).
  • Removing render_automations_text's production call site from main.rs orphaned several now-dead rocm_core imports — cleaned up in this same commit (confirmed dead by grep, not just removed speculatively).
  • dispatch() confirmed byte-identical (independently re-verified by SHA-256).
  • 9 tests partitioned (5 to update_cmd.rs, 4 to a new test module in automations.rs, which had none before); total workspace test count unchanged.
  • docs/architecture.md: new update_cmd.rs bullet, rewritten automations.rs bullet, and a stale cross-reference elsewhere in the doc corrected.

Test plan

  • cargo build --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • cargo xtask manifest --check
  • cargo xtask check-crate-edges
  • python scripts/smoke_local.py --profile debug --skip-build
  • cargo test --workspace --no-fail-fast — 4322 passed, 0 failed, 17 ignored (independently re-run, matches baseline exactly). One pre-existing unrelated timing flake observed this run — comfyui::tests::reinstall_is_refused_while_comfyui_starts_until_it_is_stopped, in a file this PR does not touch; confirmed passing in isolation. (Two other known pre-existing flakes in this repo, therock/cli_progress, did not trigger this run.)
  • dispatch() call sites confirmed byte-identical (SHA-256 of the function body)

Depends on #750 (ROCMAI-214) — fifth PR in the ROCMAI-86 (Phase 6f) stack.
Part of Jira ROCMAI-210 / epic ROCMAI-27.

🤖 Generated with Claude Code

…d sidebar) from main.rs

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…d module

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…into engine_ipc.rs

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
… into gpu_policy.rs

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…fold automation-proposal/daemon rendering into automations.rs

Signed-off-by: Jussi Elo <jussi.elo@amd.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Dependency #750's merge status and the reported build/test results remain independently unverified, so maintainer confirmation is needed.

No open issues 🎉

What changed in this PR

Continues the main.rs modularization by relocating update and automation rendering into focused modules, preserving existing behavior and dispatch wiring.

Changes:

  • Extracts update reporting, runtime selection, and activation into update_cmd.rs.
  • Moves automation/proposal and daemon rendering into automations.rs, updating callers and imports.
  • Relocates nine existing tests and updates the architecture documentation.
File Description
docs/​architecture.md Documents module responsibilities and updates cross-references.
apps/​rocm/​src/​update_cmd.rs Houses update logic and five relocated tests.
apps/​rocm/​src/​therock_version_proptests.rs Points property tests at the relocated selector.
apps/​rocm/​src/​main.rs Removes relocated helpers and tests; updates module imports.
apps/​rocm/​src/​chat.rs Imports renderers from their new modules.
apps/​rocm/​src/​automations.rs Houses automation and daemon rendering plus four relocated tests.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants