Repository navigation
ROCMAI-762: split rocm-core fix.rs, automation.rs, net.rs and openmpi.rs by domain - #886
Merged
jussielo-amd merged 12 commits intoNov 5, 2026
Conversation
…to config.rs config.rs imported BuiltinWatcherSpec from automation.rs while automation.rs imported WatcherMode from config.rs, a two-way module cycle. The catalog (BuiltinWatcherSpec, the BUILTIN_WATCHERS table, builtin_watchers, builtin_watcher) now sits in config.rs beside WatcherMode, whose values its entries carry, so only automation.rs depends on config.rs. Pure move: the code and the four builtin_watchers_include_* tests are byte-for-byte the same, and lib.rs re-exports the same names from config instead of automation, so every rocm_core:: path still resolves. docs/architecture.md and both module docs stop describing the cycle. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
net.rs imported ManagedServiceRecord while service_record.rs imported the inference state-file key and format_http_base_url from net.rs, a two-way cycle, and the file mixed the generic HTTP/TCP client and downloads with the readiness policy built on a service record. The readiness seam (openai_chat_completion_probe/_status, openai_models_endpoint_has_model, managed_service_endpoint_model_ready, EndpointReadiness and its outcome, managed_service_endpoint_readiness, merge_json_state_file, engine_state_inference_verified, INFERENCE_PROBE_TIMEOUT and the model-reference matching helpers) moves to the new private endpoint_readiness.rs. The three inference state-file keys and probe retry interval move to service_record.rs, where the record that stores them lives. endpoint_readiness depends on net, service_record and model_catalog; neither net nor service_record depends back on it. Pure move: lib.rs re-exports every moved public name at the crate root, so rocm_core:: paths are unchanged. The readiness tests move with the code, together with the two HTTP read-bound tests that drive read_http_response_bounded through openai_chat_completion_probe. docs/architecture.md lists the new module and stops describing the cycle. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
automation.rs was about 60% a generic JSONL store engine (lock file, single-line appends, torn-tail repair, size-based rotation, tail-first readers) wrapped around three small record types. The engine now lives in the new private jsonl_store.rs and automation.rs keeps the record types, the runtime state, the store accessors and the per-store policy (EVENT_LOG_ROTATION and the proposal compaction). jsonl_lock_path stays public and is re-exported at the crate root as before. JsonlRotation, append_jsonl_record, parse_jsonl_records, load_recent_jsonl_records and jsonl_generation_path become pub(crate), the only widening, because automation.rs and its remaining tests call them. The engine still calls crate::write_atomic for torn-tail repair exactly as before. The module doc is split between the two files. The tests that exercise the engine itself (torn-tail repair and its fallback, rotation, the reverse scanner and its mid-scan shrink hook, landed_despite_the_error, the lock and generation paths) move with it and keep their names; the tests that go through the append_*/load_* wrappers stay. The four audit-store fixtures both sides use move to test_support.rs. The two re-exec tests that select themselves by test path get the new jsonl_store::tests path. Comments that pointed at a test in the other file now name the file. docs/testing.md, docs/architecture.md and the path mentions in comments follow. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
After the readiness seam left net.rs, the streaming file download (resume with a Range request, retry with exponential backoff, size and digest checks, the partial-file handling) was still the larger half of a file whose other half is a loopback HTTP/TCP client. It now lives in the new private download.rs, together with Backoff, DownloadRequest, DownloadOutcome, DOWNLOAD_MAX_ATTEMPTS and the download_file_* functions; net.rs keeps the default local host and port, endpoint formatting and parsing, and the loopback client. Pure move: lib.rs re-exports every moved public name at the crate root, so rocm_core:: paths are unchanged, and the download tests and their server fixture move with the code and keep their names. docs/architecture.md lists the new module. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…nmpi.rs openmpi.rs mixed three per-library concerns (OpenMPI, libatomic and libnuma detection and their install plans) with plumbing that knows nothing about any of those libraries: the package-manager model and its resolution from an os-release ID/ID_LIKE, the plan and command types, planning from a read os-release with a caller-supplied builder, install hints, the root and passwordless-sudo checks, and the apt-get -s helpers that keep an automatic install from removing the ROCm stack. That plumbing moves to the new private package_plan.rs (the apps/rocm crate has its own system_packages.rs, which runs these plans, so the rocm-core module takes a different name). openmpi.rs re-exports the public items, so rocm_core::openmpi::running_as_root, plan_for_os_release_read, InstallPlanBuilder and the rest keep resolving, and pub(crate)-re-exports PackageManager and resolve_package_manager for diagnose.rs. Both cfg variants of running_as_root and can_autoinstall move together. InstallCommand::sudo and install_hint_for_at/_read are widened to pub(crate), the only widening, because the per-library builders and hints in openmpi.rs call them. Pure move. The apt-simulation, protected-package and InstallCommand tests move with the code; the os-release plan and hint tests stay in openmpi.rs because they drive the generic functions through the three per-library builders. docs/architecture.md lists both modules, and docs/testing.md gains the package_plan::tests filter. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…d consent fix.rs holds the closed fix catalog, the host-mutating runners, the rendering and the JSON contract in one 5,300-line file. It stays the module root, as examine.rs does for examine/, so every link to it and every crate::fix:: path keeps working, and its children go under fix/. This first step moves the two leaves that depend on nothing else in the file. fix/options.rs takes the named exit codes (the exit module), FixOptions and FixClass with its impl. fix/consent.rs takes the consent decision (consent_without_prompt, confirm), the run and query timeouts, current_os, relay_output and the fail! macro, which it re-exports by path (pub(super) use fail) so the sibling modules that follow can import it rather than depend on declaration order; the macro text is unchanged. The root re-exports exit, FixOptions and FixClass, so crate::fix::exit, rocm_core::fix_exit and rocm_core::fix::FixClass resolve as before. The consent items are widened to pub(super), the only widening. Pure move. The consent tests move with the code and keep their names. The exit-code lint test now scans fix.rs and the new files, so a runner moved out of fix.rs cannot drop out of the net; the pre-commit cargo-catalog hook pattern now covers fix/, and the AGENTS.md, docs/architecture.md and confirm.rs citations of confirm() name fix/consent.rs. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
The host-mutating runners of rocm fix (render-group, HSA override, PATH export and HIP_VISIBLE_DEVICES pin) and their helpers (home_dir, is_root, shell_rc_file, append_line, the Windows PATH and environment-scope helpers, and the newest-ROCm-install lookup with its test seam) are about 600 lines with their own tests, and nothing else in fix.rs depends on their internals. They move to fix/runners.rs, importing run and which from probe_exec.rs and the fail!, confirm and timeout helpers from fix/consent.rs. The root names the four entry points through runners:: in the catalog; only those four are widened to pub(super). The *_windows runners are ordinary functions that every platform compiles, so the Linux and Windows cross-checks both build them. Pure move: the runner tests, their scratch-directory and consent fixtures and the PROCESS_ENV_TEST_LOCK that serializes the one test reading ROCM_PATH move with the code and keep their names (the xtask environment-mutation contract walks the whole tree and still finds the lock). The exit-code lint test scans fix/runners.rs as well, so the runners stay in its net. The section banner above the home_dir group no longer says consent, which moved. Comments that named crate::fix::path_export_windows now name its new path, and docs/architecture.md lists the child. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…fix.rs The last three clusters of fix.rs leave the root: fix/catalog.rs takes FixRecipe, Platform with the PRINT_ON_*/AUTO_ON_* shorthands, RECIPES, find_recipe, is_catalog_id, class_on, needs_on, COMGR_CONFLICT_NEITHER_OPTION_RECOMMENDED and the cfg(test) oracles that diagnose.rs and the e2e crate hold their copies to; fix/render.rs takes list_recipes, format_flags, print_recipe, verify_lines, verify_steps, indent_continuation and the diagnosis-position refusal; fix/manifest.rs takes CATALOG_CONTRACT_VERSION, ManifestPlatform, ManifestEntry, CatalogManifest, catalog_manifest and catalog_manifest_json. render and manifest read RECIPES from catalog; nothing in catalog reads either. fix.rs keeps apply, Plan, plan_of and act_on, and re-exports class_on, needs_on, format_flags, is_catalog_id, COMGR_CONFLICT_NEITHER_OPTION_RECOMMENDED, list_recipes, the manifest names, and (under cfg(test), with the same cfg(all(test, windows)) split the items carry) the oracles, so diagnose.rs, report.rs, windows_driver.rs, quoting.rs, lib.rs and apps/rocm resolve every crate::fix:: and rocm_core::fix:: path unchanged. Pure move. FixRecipe, Platform, their fields and methods, RECIPES, find_recipe, on, print_recipe, verify_lines, verify_steps and the two position helpers are widened to pub(super) so the siblings can read them; nothing is wider than the fix module. The tests move to the module that owns what they exercise and keep their names: the catalog tests (including the Windows-only shell-run ones) to catalog.rs, the rendering tests to render.rs, the manifest tests to manifest.rs; the apply, plan and exit-code tests and the lint infrastructure stay in the root. The one include_str! in the moved tests (the shared PowerShell rule cases) gets one more ../. The exit-code lint now scans every fix file. The path mentions follow: the pre-existing pin in apps/rocm/src/advised_commands.rs for the format_flags wording now names fix/render.rs (reverting it fails exclusions_still_match_something), AGENTS.md, docs/architecture.md, docs/testing.md, tests/e2e-cucumber/README.md, the comments and messages in the e2e features and tests, and the comments in diagnose.rs name the child that now holds what they point at. doctor-catalog.json and skills/rocm-doctor are unchanged; cargo xtask catalog --check passes. Part of the rocm-core module split-up work. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
AGENTS.md, tests/e2e-cucumber/README.md and docs/architecture.md named some of the moved or new files as bare backticked paths, which the docs-links check cannot see go stale. They are now relative markdown links, and every link target in the lines changed by the series was checked to exist. docs/architecture.md also states plainly that the jsonl_store -> automation edge exists only in the engine's own tests. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Missing extraction hunks and base history prevent verification of move-only parity, requiring review of the complete diff and native Windows CI results.
No open issues 🎉
What changed in this PR
This PR reorganizes rocm-core by domain, separating storage, networking, package planning, and fix responsibilities while removing two production import cycles. It preserves crate-root APIs and intends no CLI behavior changes; unused module-qualified paths are deliberately dropped.
Changes:
- Extract domain-specific implementations and move their existing tests alongside them.
- Adjust module visibility and re-exports to preserve callers.
- Update documentation, source-path checks, and catalog-hook coverage for the new layout.
| File | Description |
|---|---|
| tests/e2e-cucumber/tests/skill_reference.rs | Update source paths in comments and assertion messages. |
| tests/e2e-cucumber/tests/e2e/skill_steps.rs | Point contract-version guidance at fix/manifest.rs. |
| tests/e2e-cucumber/tests/e2e/diagnose_steps.rs | Update catalog references in comments. |
| tests/e2e-cucumber/src/powershell_text_rule.rs | Update the documented rule-source location. |
| tests/e2e-cucumber/README.md | Link to the relocated authoritative catalog. |
| tests/e2e-cucumber/fixtures/powershell_text_rule_cases.txt | Update the catalog path in fixture comments. |
| tests/e2e-cucumber/features/rocm_doctor_skill.feature | Update runner-test references in comments. |
| tests/e2e-cucumber/features/diagnose.feature | Update Windows verification-test references in comments. |
| tests/e2e-cucumber/features/automations.feature | Update JSONL-test references in comments. |
| docs/testing.md | Update test filters and links for moved code. |
| docs/architecture.md | Describe module responsibilities and dependency directions. |
| crates/rocm-core/src/test_support.rs | Centralize shared audit-store fixtures. |
| crates/rocm-core/src/service_record.rs | Own inference state keys and the probe retry interval. |
| crates/rocm-core/src/quoting.rs | Update runner references in documentation. |
| crates/rocm-core/src/process.rs | Update the lock-helper reference in documentation. |
| crates/rocm-core/src/package_plan.rs | Extract generic package planning and its tests. |
| crates/rocm-core/src/openmpi.rs | Retain library-specific logic and re-export generic planning APIs. |
| crates/rocm-core/src/lib.rs | Declare extracted modules and preserve crate-root exports. |
| crates/rocm-core/src/fix/render.rs | Extract fix rendering, flag wording, and related tests. |
| crates/rocm-core/src/fix/options.rs | Extract fix options, classifications, and named exit codes. |
| crates/rocm-core/src/fix/manifest.rs | Extract catalog JSON serialization and its tests. |
| crates/rocm-core/src/fix/consent.rs | Extract consent, platform selection, and execution helpers. |
| crates/rocm-core/src/diagnose.rs | Update catalog and runner references in comments. |
| crates/rocm-core/src/confirm.rs | Update the documented consent-helper location. |
| crates/rocm-core/src/config.rs | Move the watcher catalog beside its configuration types. |
| crates/rocm-core/Cargo.toml | Update the JSONL dependency comment only. |
| apps/rocm/src/advised_commands.rs | Retarget the wording exclusion to fix/render.rs. |
| AGENTS.md | Update consent-helper and catalog documentation links. |
| .pre-commit-config.yaml | Extend the catalog hook to cover fix/ children. |
Review effort: Balanced
…lit-fix-automation-net-openmpi Signed-off-by: Jussi Elo <jussi.elo@amd.com> # Conflicts: # crates/rocm-core/src/test_support.rs
The exit-code literal lint listed the fix/ files it scans by hand, so a new child module added without extending the list would silently not be scanned even though the comment said every file is. The list is now held to the directory: the test reads fix/ through CARGO_MANIFEST_DIR and fails, naming the unlisted file, when the two differ. With a scratch fix/zz_scratch.rs added the test fails; without it, it passes. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…lit-fix-automation-net-openmpi The only conflict was the module doc comment in crates/rocm-core/src/quoting.rs, where main repointed the comfyui citation to comfyui/process.rs and this branch repointed the path_export_windows citation to fix/runners.rs; the merged text keeps both. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
juhovainio
approved these changes
Nov 5, 2026
juhovainio
left a comment
Collaborator
There was a problem hiding this comment.
I went through this as a pure-move refactor and found no behavior changes.
- Compared every added and removed line as a multiset, ignoring whitespace. What differs is visibility widening,
use/mod/re-exports, doc and comment paths, and the new lint test. No logic line changed. - 133
#[test]removed and 133 added, so nothing was dropped. - Crate-root re-exports in
lib.rsare preserved, and thecfg(windows)gates moved intact. - Path pins are updated: the pre-commit hook,
advised_commands.rs, theRULE_CASESinclude_str!path and the re-exec test paths. - CI is green and the change matches the ROCMAI-762 scope.
Non-blocking notes:
- The
jsonl_storetests import fromautomation. That is a test-only edge against the ticket wording, but the PR discloses it. - The exit-code lint is hardened, which is slightly beyond a pure move.
- I only read the diff, so a repo-wide grep for stale "fix.rs / automation.rs / net.rs" claims in docs is worth running before merge.
This reflects a diff read plus CI status, not a runtime check.
jussielo-amd
deleted the
refactor-rocm-core-split-fix-automation-net-openmpi
branch
November 5, 2026 13:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four files in
crates/rocm-coreeach held several unrelated jobs, and two pairs of modules imported each other.automation.rs(3,653 lines) was about 60% a generic JSONL store engine wrapped around three small record types.net.rs(2,385 lines) mixed the loopback HTTP/TCP client with streaming downloads and the managed-service readiness policy.openmpi.rs(2,010 lines) carried distro package-manager plumbing that knows nothing about OpenMPI.fix.rs(5,344 lines) held the fix catalog, the host-mutating runners, the rendering and the JSON contract. Anyone looking for the torn-tail repair, the download retry loop or the package planner had to read a file that was mostly something else, unrelated edits collided in the same files, andconfig<->automationandnet<->service_recordwere import cycles. This series splits the four files by domain and removes both cycles. It is a pure move: no behaviour change, no renamed symbol, no changed output.It is twelve commits in one branch, in the order they should land (eight moves, a commit that turns the bare file citations the series edited into relative links, a merge of origin/main, a commit that hardens the exit-code lint, and a second merge of origin/main), and each move compiles and passes clippy for
rocm-core(Linux and thex86_64-pc-windows-msvctarget) and its tests on its own. Everyrocm_core::,rocm_core::openmpi::,crate::fix::andcrate::openmpi::path that was in use still resolves through a re-export.Completes ROCMAI-762.
What moved
Commit 1 moves the watcher catalog from
automation.rstoconfig.rs, which removes theconfig<->automationcycle (onlyautomationnow depends onconfig, forWatcherMode). Commit 2 splitsnet.rs: the readiness policy goes to a newendpoint_readiness.rsand the inference state keys go toservice_record.rs, which removes thenet<->service_recordcycle. Commits 3 to 5 move the JSONL engine, the downloads and the package planning into new modules. Commits 6 to 8 splitfix.rsinto children underfix/, withfix.rskept as the module root (asexamine.rsis forexamine/) so every link to it stays live.BuiltinWatcherSpec,BUILTIN_WATCHERS,builtin_watchers,builtin_watcherand their fourbuiltin_watchers_include_*testsconfig.rsINFERENCE_VERIFIED_STATE_KEY,INFERENCE_PROBE_ATTEMPTED_STATE_KEY,INFERENCE_PROBE_RETRY_INTERVALservice_record.rsopenai_chat_completion_probe,openai_chat_completion_status,openai_models_endpoint_has_model,managed_service_endpoint_model_ready,EndpointReadiness,EndpointReadinessOutcome,managed_service_endpoint_readiness,openai_loaded_model_ids,model_refs_matchand its three helpers,INFERENCE_PROBE_TIMEOUT,merge_json_state_file,engine_state_inference_verified, with their testsendpoint_readiness.rsjsonl_lock_path,JSONL_SCAN_CHUNK,JsonlRotation,jsonl_generation_path,rotate_jsonl_generations,open_jsonl_for_append,append_jsonl_record,repair_torn_tail_and_append,truncate_jsonl_in_place,rotation_failure_warning,append_or_tolerate_a_missing_newline,landed_despite_the_error,TailState,inspect_tail,read_range,parse_jsonl_records,load_recent_jsonl_records(and_from),open_jsonl_generations,scan_recent_jsonl_records,is_blank,is_torn_record,ReverseLines, thecfg(test)test_hooks, and the engine testsjsonl_store.rsaudit_record,audit_line,audit_messages,seed_audit_store(fixtures both sides' tests use)test_support.rsDOWNLOAD_MAX_ATTEMPTS,DOWNLOAD_CHUNK_BYTES,Backoff,DownloadRequest,DownloadOutcome,download_file_streaming(_with_progress),download_file_to_path(_with_progress),partial_download_path, the attempt/retry helpers, and the download tests with their server fixturedownload.rsInstallCommand,SystemPackageInstallPlan,running_as_root,can_autoinstall,sudo_noninteractive_available(both cfg variants),PackageManager,InstallPlanBuilder,plan_for_os_release_at/_read,InstallHint,install_hint_for_at/_read,apt_simulate_argv,parse_apt_simulate_removals,is_protected_rocm_package,resolve_package_manager, and their testspackage_plan.rs(re-exported fromopenmpi.rs)exitmodule,FixOptions,FixClassfix/options.rsfail!,relay_output,RUN_TIMEOUT,QUERY_TIMEOUT,current_os,consent_without_prompt,confirm, and their testsfix/consent.rshome_dir,is_root,shell_rc_file,append_line,run_render_group,run_unset_override*,report_persistent_override,report_and_clear_override_windows,run_path_export*,windows_path_prepend,path_export_windows,run_hip_visible_devices*,pin_device_in_rc_file,ps_env_scope,newest_rocm_install_dir,first_install_path,newest_rocm_install_dir_in, and the runner testsfix/runners.rsFixRecipe,Platform,PRINT_ON_*/AUTO_ON_*,RECIPES,find_recipe,is_catalog_id,class_on,needs_on,COMGR_CONFLICT_NEITHER_OPTION_RECOMMENDED, thecfg(test)oracles, and the catalog testsfix/catalog.rslist_recipes,format_flags,print_recipe,verify_lines,verify_steps,indent_continuation,diagnosis_position_refusal,looks_like_a_diagnosis_position, and their testsfix/render.rsCATALOG_CONTRACT_VERSION,ManifestPlatform,ManifestEntry,CatalogManifest,catalog_manifest,catalog_manifest_json, and their testsfix/manifest.rsapply,Plan,plan_of,act_onand the exit-code lint infrastructure stay infix.rs;net.rskeeps the default local host and port, endpoint formatting and parsing, and the loopback client;automation.rskeeps the record types, the runtime state, the store accessors and the per-store policy (EVENT_LOG_ROTATION, proposal compaction). The new modules are private, andlib.rsre-exports their public names.Where the work went beyond the move itself, it was only as far as the move required. Visibility is widened only as far as callers need:
pub(crate)onJsonlRotation,append_jsonl_record,parse_jsonl_records,load_recent_jsonl_records,jsonl_generation_path,InstallCommand::sudoandinstall_hint_for_at/_read;pub(super)insidefix/on the consent helpers, the four runner entry points, andFixRecipe/Platformwith their fields, methods and a few helpers that the catalog's siblings read. The two re-exec tests that select themselves by test path (a_failed_rotation_prints_its_warning_once_to_stderrandrotation_under_concurrent_processes_loses_no_records) name the newjsonl_store::testspath, and the oneinclude_str!in the moved catalog tests (RULE_CASES) gets one more../. The exit-code lint test (fix_runners_return_named_exit_constants_not_integers) now scans every file underfix/as well asfix.rs, so splitting a runner out cannot take it out of its net; with a bare-> i32literal planted infix/options.rsit fails, and without it it passes. Thefail!macro is re-exported by path fromfix/consent.rs(pub(super) use fail) instead of relying on declaration order; its text is unchanged and each user importsstd::io::Writeas before.Path pins and docs that name moved code are updated in the commit that moves it: the
.pre-commit-config.yamlcargo-catalog hook now matchesfix/(commit 6; the hook did run on commits 6 to 8),AGENTS.md(theconfirm()citation in commit 6, the catalog's location in commit 8),docs/architecture.md(every commit; it lists the new modules and no longer describes the two cycles),docs/testing.md(thejsonl_store::testsandpackage_plan::testsfilters and the links that namedfix.rstests), thesame-filecomment incrates/rocm-core/Cargo.toml,tests/e2e-cucumber/README.md, and the comments and messages in the e2e features and tests that namedfix.rsorautomation.rs. The pin inapps/rocm/src/advised_commands.rsthat keys on theformat_flagswording (rocm fix can run it) now namesfix/render.rs; pointing it back atfix.rsfailsexclusions_still_match_somethingandevery_advised_command_parses.Dropped module paths
The new modules are private and their names are re-exported at the crate root only, so these module paths no longer resolve:
rocm_core::net::for the 21 names that moved todownload.rs,endpoint_readiness.rsandservice_record.rs(the download functions and types,Backoff,DOWNLOAD_MAX_ATTEMPTS, theINFERENCE_*constants, theopenai_*probes,managed_service_endpoint_*,EndpointReadiness*,merge_json_state_file,engine_state_inference_verified),rocm_core::automation::{BuiltinWatcherSpec, builtin_watcher, builtin_watchers, jsonl_lock_path}, and thecfg(all(test, windows))crate::fix::run_typed_in_cmdandcrate::fix::run_typed_in_powershell. They are deliberately not re-exported: a re-export fromnet.rsofendpoint_readinessitems would bring back thenet<->service_recordcycle this change removes.rocm-coreispublish = false, a grep ofapps/,engines/,crates/,xtask/,tests/anddocs/found no user of any of these paths, every crate-rootrocm_core::path is unchanged, andcargo check --workspace --all-targetspasses. The ticket's acceptance wording about every existingrocm_core::path resolving was read as crate-root paths for this reason.Deviations
The moved JSONL-engine tests (
jsonl_store::tests) drive the engine throughappend_audit_event,load_recent_audit_eventsandAuditEventRecord, so there is an edge fromjsonl_store's test module toautomation, contrary to what the ticket text and the message of the JSONL commit say. It exists in test builds only and was kept rather than moved back: the production cycle is gone (automation->jsonl_storeis the only production edge), anddocs/architecture.mdsays the edge is test-only.Verification
Ran on each of the eight move commits (against the previous base, 44f8bcf; the final tip was re-run after the last rebase), checked out on its own in a clean worktree:
cargo fmt --all --check;cargo clippy -p rocm-core --all-targets -- -D warningson Linux and onx86_64-pc-windows-msvc; the test-name diff,cargo test -p rocm-core --lib -- --list | grep ': test$' | sed 's/: test$//; s/.*:://' | sortagainst origin/main, with and without--features e2e-test-hooks, which is empty for every commit (1,010 tests default, 1,014 with the hooks on the final base); andcargo test -p rocm-core --no-fail-fast(1,007 passed, 3 ignored on the final tip).cargo check --workspace --all-targetsran on the working tree of commits 2 to 8 as each was built, and again on the final tree. On the final tree also:cargo xtask catalog --check(doctor-catalog.jsonis byte-identical),cargo xtask manifest --check,cargo xtask check-crate-edges,cargo test -p xtask env_mutation(the whole-tree environment-mutation contract still finds the moved lock),cargo test -p rocm advised_commands(20 passed),cargo test -p e2e-cucumber --test skill_referenceand thee2e-cucumberlib tests. A source-level check shows the same 1,008#[test]functions with the samecfgattributes before and after, so Windows-only tests that the Linux list cannot show are not lost.skills/rocm-doctoris untouched, so thereference.mdfixture and the two sentences inSKILL.mdstay as they were.Not run:
cargo xtask e2eand the full workspace test gate (CI carries them);scripts/smoke_local.py; any test on Windows. The Windows cross-check is clippy only, with a stub archiver standing in forlib.exeso thatring's build script succeeds on a Linux host; it type-checks and lints every Windows-gated item, including the Windows-only oracles and tests that moved in commit 8, but does not execute them, so the Windows CI job is the first run of those.The last commit makes the exit-code lint test read the
fix/directory and fail, naming the file, when a child module is not in its scan list (shown red with a scratchfix/zz_scratch.rs), so a new child cannot silently go unscanned.User-visible behaviour
None. This is an internal reorganisation of
rocm-core: no command output, exit code, file path or engine selection changes, so no Gherkin scenario is added. The existing scenarios that exercise the moved code (automations-07throughautomations-10for rotation and torn-tail repair, thediagnose-*andfix-catalog-is-completescenarios for the catalog and manifest) are untouched and still apply; only comments in them that named a moved file changed.Notes for reviewers
The branch was first merged with origin/main at 3944380 (that merge resolved
test_support.rsby keeping both the four audit fixtures and main'sproptest_cases) and again at 6e424e7 (that merge had one conflict, in the module doc ofquoting.rs, where main repointed the ComfyUI citation tocomfyui/process.rsand this branch repointed thepath_export_windowscitation tofix/runners.rs; both are kept), and it ends at the final commit listed bygit log; thefix.rstest that landed there in the meantime (the_utilization_hint_states_the_bound_the_parser_accepts) now lives with the other catalog tests infix/catalog.rs. Suggested reading order is the commit order, and because every commit is a move,git diff --color-moved=dimmed-zebraper commit makes the few lines that are not moves stand out. Commit 1 is the smallest and shows the cycle break. Commit 2 is the next cycle break; its one judgement call is that two HTTP read-bound tests (http_read_is_bounded_across_reads_not_just_per_readandhttp_read_survives_a_signal_arriving_mid_response) move toendpoint_readiness.rswith the readiness tests because they driveread_http_response_boundedthroughopenai_chat_completion_probe, and leaving them innet.rswould makenet's tests depend on a module that depends onnet. Commit 3 is the largest judgement call: the engine tests that call engine internals, or fixtures that do, moved; the tests that go through theappend_*/load_*wrappers stayed inautomation.rs, and the four audit-store fixtures both groups use moved totest_support.rs. The moved tests drive the engine through the audit-store records, sojsonl_store's test module (test builds only) imports types fromautomation; the production edge runs one way,automation->jsonl_store. Commit 5 keeps the os-release plan and hint tests inopenmpi.rs, because they drive the generic functions through the three per-library builders. The rocm-core module is namedpackage_planrather thansystem_packagesbecauseapps/rocm/src/system_packages.rsnow exists. Commits 6 to 8 are thefix.rssplit in dependency order: the leaves first, then the runners, then the catalog with the rendering and manifest that read it.Two things differ from what the plan assumed. The
*_windowsrunners infix.rsare ordinary functions with nocfg, so they compile on every platform; only thecfg(all(test, windows))oracles and thecfg(windows)tests are Windows-only, and they all moved in commit 8. And the module pathsrocm_core::net::...androcm_core::automation::...no longer carry the moved names (rocm_core::net::download_file_to_path,rocm_core::net::openai_chat_completion_probe,rocm_core::automation::builtin_watcherand so on), because the new modules are private and the names are re-exported at the crate root only. Nothing in the repository uses those module paths (checked by grep over every crate and the e2e crate), and every crate-root path is unchanged, but it is the one place where the visible path of a public item changes.service_record.rsstill has two doc comments that link tocrate::managed_service_endpoint_readinessandcrate::INFERENCE_PROBE_TIMEOUTthrough the crate-root re-exports; those are links in prose, not imports. Risk is low: each commit is a move checked by the unchanged test-name list and the existing tests, and the two cycles are checked by greppingcrate::<module>both ways (netandservice_recordno longer importendpoint_readiness, andconfigno longer importsautomation). The remaining watch item is the Windows CI job, for the reason above.Other open pull requests that touch the same files, so authors may need to rebase over a moved block:
lib.rs's re-export block is touched by #883, #879, #854, #826, #817, #811, #775, #725, #724, #723, #678, #610, #581, #569, #541, #447, #437, #299 and #243, which conflicts with commits 1 to 5 mechanically.config.rs(#811, #724, #723, #631, #610, #541, #299) conflicts with commit 1;automation.rs(#811, #299) with commits 1 and 3;service_record.rs(#883, #811, #725, #724, #723, #447, #299, #243) with commit 2;net.rs(#826, #817, #725, #724, #299) with commits 2 and 4;test_support.rs(#811, #557) with commit 3; the comment edit inprocess.rs(#854, #800, #447, #437, #243) is one line. #811 (the atomic-writer retirement) and #610 are deliberately not touched here: the engine still callscrate::write_atomic, so whichever lands second rebases. No open pull request touchesopenmpi.rsorfix.rs; the comment-only edits indiagnose.rs(#394) andquoting.rs(#563, #884), the pin inadvised_commands.rs(#678, #563),AGENTS.md(#878, #588, #372),.pre-commit-config.yaml(#370, #369, different hook), the e2e feature and test comments (#826, #818, #518, #517, #241, #292) anddocs/architecture.mdanddocs/testing.md(many) can conflict textually in a few lines.