Parent
Part of #1402. Depends on Phase 2.
Goal
Move the sensor collector and per-sensor history state into the root-level core crate (core/src/collector/), behind a Core-owned API. Strip the AppHandle dependency from collector setup.
Workspace Context
core/ is the Tauri-independent workspace crate at the repo root. Anything moved "into Core" in this phase lands under core/src/... and stops compiling against tauri.
Scope
- Relocate
src-tauri/src/workers/system_monitor.rs → core/src/collector/ (split into submodules as needed).
- Move
models::hardware::HardwareMonitorState (the Arc<Mutex<...>> bag for CPU / memory / GPU / process histories) into core/src/collector/history.rs (or similar) behind a Core read API such as core::collector::history::cpu(...).
- Replace direct mutex access in
src-tauri/src/commands/hardware.rs with calls into the Core read API.
- Move
src-tauri/src/platform/ and the sensor-side of src-tauri/src/infrastructure/providers/ (NVAPI, WMI, procfs, drm_sys, …) into the core crate (core/src/platform/, core/src/infrastructure/providers/) so Core's dependencies remain legal under the no-tauri rule.
- Drop
AppHandle from SystemMonitorController::setup.
Out of Scope
- Persistence relocation (Phase 4).
- Settings split (Phase 3.5).
- Lifecycle changes (Phase 5).
Migration Strategy
- 3a — Introduce the Core read API alongside existing direct
Arc<Mutex> access. Both paths work.
- 3b — Migrate all command callers to the Core API.
- 3c — Remove the old direct-mutex path and
models::hardware::HardwareMonitorState.
Definition of Done
commands/hardware.rs no longer references Arc<Mutex<History*>> directly.
SystemMonitorController does not take AppHandle.
core/src/collector/ has unit tests that run via cargo test -p <core-crate> without a Tauri runtime.
- No user-visible regression on the dashboard or 1-minute usage graphs.
Parent
Part of #1402. Depends on Phase 2.
Goal
Move the sensor collector and per-sensor history state into the root-level
corecrate (core/src/collector/), behind a Core-owned API. Strip theAppHandledependency from collector setup.Workspace Context
core/is the Tauri-independent workspace crate at the repo root. Anything moved "into Core" in this phase lands undercore/src/...and stops compiling againsttauri.Scope
src-tauri/src/workers/system_monitor.rs→core/src/collector/(split into submodules as needed).models::hardware::HardwareMonitorState(theArc<Mutex<...>>bag for CPU / memory / GPU / process histories) intocore/src/collector/history.rs(or similar) behind a Core read API such ascore::collector::history::cpu(...).src-tauri/src/commands/hardware.rswith calls into the Core read API.src-tauri/src/platform/and the sensor-side ofsrc-tauri/src/infrastructure/providers/(NVAPI, WMI, procfs, drm_sys, …) into thecorecrate (core/src/platform/,core/src/infrastructure/providers/) so Core's dependencies remain legal under the no-taurirule.AppHandlefromSystemMonitorController::setup.Out of Scope
Migration Strategy
Arc<Mutex>access. Both paths work.models::hardware::HardwareMonitorState.Definition of Done
commands/hardware.rsno longer referencesArc<Mutex<History*>>directly.SystemMonitorControllerdoes not takeAppHandle.core/src/collector/has unit tests that run viacargo test -p <core-crate>without a Tauri runtime.