agent: lumotia-rebrand — docs, scripts, root config, residuals
Phase 9 of the rebrand cascade. Sweep covers everything the Phase 8
frontend pass deliberately skipped: docs/, root markdown, scripts,
Cargo.toml descriptions, code comments that survived earlier
word-boundary sed, plus a handful of identifiers caught on the final
verify pass.
transcription-app changes:
- README.md, HANDOVER.md, KNOWN-ISSUES.md, run.sh — magnotia/Magnotia
-> lumotia/Lumotia.
- docs/ — sweep across all subdirs except docs/handovers/ (preserved
as immutable audit trail). Includes architecture-map references
to magnotia_core::*, magnotia_storage::*, etc. now pointing at
lumotia_*; dev-setup.md tracing output examples (lumotia_startup
target); brief/ + superpowers/ + issues/ + whisper-ecosystem/ +
audit/.
- Cargo.toml descriptions on 9 crates (core, audio, cloud-providers,
hotkey, llm, mcp, plus referenced others).
- crates/core/src/{error,hardware,recommendation,paths}.rs +
crates/audio/src/wav.rs + crates/llm/src/model_manager.rs +
crates/cloud-providers/src/keystore.rs + crates/mcp/src/lib.rs —
doc comments and a model-manager user-agent string.
- Caught on final pass: BroadcastChannel("magnotia_task_sync") -> ...
("lumotia_task_sync"); magnotia_locale i18n localStorage key
renamed + migration shim added; CSS keyframe names
magnotiaPulse / magnotiaBar / magnotiaFade renamed in the design-
system kit; magnotia_viewer_item / magnotia_viewer_mode handoff
keys renamed in HistoryPage + viewer/+page.svelte; src/assets/
wordmark.svg text.
- src-tauri/src/lib.rs comment cleanup ("magnotia era" was sed'd
to "lumotia era" earlier — restored).
Preserved (intentional):
- crates/core/src/paths.rs — keeps "magnotia" / "Magnotia" / ".magnotia"
legacy detection strings in legacy_and_target_paths() so the
migration shim can still find user data from the magnotia era.
- src/lib/stores/{page,focusTimer}.svelte.ts + src/lib/i18n/index.ts
— migration call sites reference the legacy magnotia keys
deliberately.
- docs/handovers/ — historical audit trail.
cargo build --workspace passes. npm run check: 0 errors / 0 warnings
(3958 files). cargo test --workspace: 339 pass / 0 fail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
|
||||
**Goal:** Add power-aware and GPU-offload-aware clamps to `inference_thread_count` so Lumenote drops to ~half threads on battery and to a workload-specific floor when fully GPU-offloaded.
|
||||
|
||||
**Architecture:** Two new modules in `magnotia-core`: `power.rs` (Linux sysfs probe with TTL cache) and `tuning.rs` (Workload enum + helper). Both whisper and LLM call sites compute a `gpu_offloaded` bool and pass it in. `vulkan_loader_available()` moves from `src-tauri` to `magnotia-core::hardware` so transcription can call it. Old `constants::inference_thread_count` is removed once both call sites migrate.
|
||||
**Architecture:** Two new modules in `lumotia-core`: `power.rs` (Linux sysfs probe with TTL cache) and `tuning.rs` (Workload enum + helper). Both whisper and LLM call sites compute a `gpu_offloaded` bool and pass it in. `vulkan_loader_available()` moves from `src-tauri` to `lumotia-core::hardware` so transcription can call it. Old `constants::inference_thread_count` is removed once both call sites migrate.
|
||||
|
||||
**Tech Stack:** Rust 2021, `magnotia-core` (existing pure-Rust crate), `num_cpus`, `libloading`, `tracing`, `tempfile` (dev). No Tauri or platform FFI for the core probe — Linux sysfs only in v1.
|
||||
**Tech Stack:** Rust 2021, `lumotia-core` (existing pure-Rust crate), `num_cpus`, `libloading`, `tracing`, `tempfile` (dev). No Tauri or platform FFI for the core probe — Linux sysfs only in v1.
|
||||
|
||||
**Spec:** [docs/superpowers/specs/2026-05-09-battery-gpu-aware-thread-tuning-design.md](../specs/2026-05-09-battery-gpu-aware-thread-tuning-design.md)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
- `crates/core/src/lib.rs` — register new modules, re-export public API.
|
||||
- `crates/core/src/hardware.rs` — add `vulkan_loader_available()`, ported from src-tauri.
|
||||
- `crates/core/src/constants.rs` — remove `inference_thread_count` and the related min/max constants (move semantically to `tuning.rs`; the audio/RAM/VAD/etc. constants stay).
|
||||
- `src-tauri/src/commands/models.rs` — delete local `vulkan_loader_available` definition, replace with `magnotia_core::hardware::vulkan_loader_available` call.
|
||||
- `src-tauri/src/commands/models.rs` — delete local `vulkan_loader_available` definition, replace with `lumotia_core::hardware::vulkan_loader_available` call.
|
||||
- `src-tauri/Cargo.toml` — keep `libloading` since src-tauri still depends on it elsewhere; verify with `cargo tree`.
|
||||
- `crates/transcription/src/whisper_rs_backend.rs` — compute `gpu_offloaded`, call `tuning::inference_thread_count(Workload::Whisper, gpu_offloaded)`.
|
||||
- `crates/llm/src/lib.rs` — compute `gpu_offloaded` after model load, call `tuning::inference_thread_count(Workload::Llm, gpu_offloaded)`.
|
||||
@@ -91,13 +91,13 @@ pub mod power;
|
||||
|
||||
- [ ] **Step 3: Run the test**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib power::tests::power_state_variants_are_distinct`
|
||||
Run: `cargo test -p lumotia-core --lib power::tests::power_state_variants_are_distinct`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
|
||||
```bash
|
||||
cd /home/jake/Documents/CORBEL-Projects/magnotia
|
||||
cd /home/jake/Documents/CORBEL-Projects/lumotia
|
||||
git add crates/core/Cargo.toml crates/core/src/power.rs crates/core/src/lib.rs
|
||||
git commit -m "feat(core): add PowerState skeleton in new power module"
|
||||
```
|
||||
@@ -183,7 +183,7 @@ mod tests {
|
||||
|
||||
- [ ] **Step 2: Run tests, expect compile failure**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib power::tests`
|
||||
Run: `cargo test -p lumotia-core --lib power::tests`
|
||||
Expected: compile error — `parse_power_state_from_dir` not found.
|
||||
|
||||
- [ ] **Step 3: Implement parser**
|
||||
@@ -244,7 +244,7 @@ fn read_trimmed(path: &Path) -> Option<String> {
|
||||
|
||||
- [ ] **Step 4: Run tests, expect pass**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib power::tests`
|
||||
Run: `cargo test -p lumotia-core --lib power::tests`
|
||||
Expected: all 6 tests pass.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -317,7 +317,7 @@ Append inside `mod tests` in `crates/core/src/power.rs`:
|
||||
|
||||
- [ ] **Step 2: Run tests, expect compile failure**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib power::tests`
|
||||
Run: `cargo test -p lumotia-core --lib power::tests`
|
||||
Expected: compile error — `probe_power_state`, `with_override` not found.
|
||||
|
||||
- [ ] **Step 3: Implement probe + overrides**
|
||||
@@ -397,7 +397,7 @@ pub(crate) fn with_override<R>(state: Option<PowerState>, body: impl FnOnce() ->
|
||||
|
||||
- [ ] **Step 4: Run tests, expect pass**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib power::tests`
|
||||
Run: `cargo test -p lumotia-core --lib power::tests`
|
||||
Expected: all tests in the module pass (sysfs parser tests from Task 1.2 plus the 5 new override tests).
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -512,7 +512,7 @@ Append inside `mod tests` in `crates/core/src/power.rs`:
|
||||
|
||||
- [ ] **Step 4: Run tests, expect pass**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib power::tests`
|
||||
Run: `cargo test -p lumotia-core --lib power::tests`
|
||||
Expected: all power tests pass (sysfs parser + override + cache).
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -648,7 +648,7 @@ pub mod tuning;
|
||||
|
||||
- [ ] **Step 3: Run the test**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib tuning::tests`
|
||||
Run: `cargo test -p lumotia-core --lib tuning::tests`
|
||||
Expected: 3 tests pass.
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
@@ -700,7 +700,7 @@ But wait — these test helpers are gated `#[cfg(test)]` so they're only availab
|
||||
|
||||
- [ ] **Step 2: Run, expect failure**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib tuning::tests::battery_halves_thread_count`
|
||||
Run: `cargo test -p lumotia-core --lib tuning::tests::battery_halves_thread_count`
|
||||
Expected: FAIL — assertion that on_battery <= on_ac fails because helper currently ignores power state. (On a 1c host, on_ac and on_battery would both be 2 and the test would no-op via the early `if on_ac > MIN_INFERENCE_THREADS` check; in that environment the test isn't useful. CI hosts with >2 physical cores will exercise it.)
|
||||
|
||||
- [ ] **Step 3: Implement battery clamp**
|
||||
@@ -736,7 +736,7 @@ pub fn inference_thread_count(workload: Workload, gpu_offloaded: bool) -> usize
|
||||
|
||||
- [ ] **Step 4: Run, expect pass**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib tuning::tests`
|
||||
Run: `cargo test -p lumotia-core --lib tuning::tests`
|
||||
Expected: 4 tests pass.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -802,7 +802,7 @@ Add to `mod tests` in `crates/core/src/tuning.rs`:
|
||||
|
||||
- [ ] **Step 2: Run, expect failure**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib tuning::tests`
|
||||
Run: `cargo test -p lumotia-core --lib tuning::tests`
|
||||
Expected: GPU-offload tests fail because the helper still ignores `gpu_offloaded`.
|
||||
|
||||
- [ ] **Step 3: Implement GPU-offload clamp**
|
||||
@@ -842,7 +842,7 @@ pub fn inference_thread_count(workload: Workload, gpu_offloaded: bool) -> usize
|
||||
|
||||
- [ ] **Step 4: Run, expect pass**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib tuning::tests`
|
||||
Run: `cargo test -p lumotia-core --lib tuning::tests`
|
||||
Expected: 8 tests pass.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -879,7 +879,7 @@ Add to `mod tests` in `crates/core/src/tuning.rs`:
|
||||
|
||||
- [ ] **Step 2: Run, expect pass (already passes, the test is a smoke)**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib tuning::tests::logging_does_not_panic`
|
||||
Run: `cargo test -p lumotia-core --lib tuning::tests::logging_does_not_panic`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 3: Implement per-process log cache**
|
||||
@@ -941,7 +941,7 @@ pub fn inference_thread_count(workload: Workload, gpu_offloaded: bool) -> usize
|
||||
if let Ok(mut seen) = log_seen().lock() {
|
||||
if seen.insert(key) {
|
||||
tracing::info!(
|
||||
target: "magnotia_core::tuning",
|
||||
target: "lumotia_core::tuning",
|
||||
threads = final_value,
|
||||
workload = ?workload,
|
||||
gpu_offloaded,
|
||||
@@ -968,7 +968,7 @@ pub enum Workload {
|
||||
|
||||
- [ ] **Step 4: Run all tests**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib`
|
||||
Run: `cargo test -p lumotia-core --lib`
|
||||
Expected: all power + tuning tests pass.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -982,7 +982,7 @@ git commit -m "feat(core): per-process INFO log on first thread-count call per t
|
||||
|
||||
## Phase 3 — Move `vulkan_loader_available` to core
|
||||
|
||||
### Task 3.1: Port function to `magnotia-core::hardware`
|
||||
### Task 3.1: Port function to `lumotia-core::hardware`
|
||||
|
||||
**Files:**
|
||||
- Modify: `crates/core/Cargo.toml` (add `libloading = "0.8"`)
|
||||
@@ -1011,7 +1011,7 @@ Add to `crates/core/src/hardware.rs` inside the existing `#[cfg(test)] mod tests
|
||||
|
||||
- [ ] **Step 3: Run, expect compile failure**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib hardware::tests::vulkan_loader_available_does_not_panic`
|
||||
Run: `cargo test -p lumotia-core --lib hardware::tests::vulkan_loader_available_does_not_panic`
|
||||
Expected: compile error — function not defined.
|
||||
|
||||
- [ ] **Step 4: Add `vulkan_loader_available` to hardware.rs**
|
||||
@@ -1056,7 +1056,7 @@ pub fn vulkan_loader_available() -> bool {
|
||||
|
||||
- [ ] **Step 5: Run, expect pass**
|
||||
|
||||
Run: `cargo test -p magnotia-core --lib hardware::tests::vulkan_loader_available_does_not_panic`
|
||||
Run: `cargo test -p lumotia-core --lib hardware::tests::vulkan_loader_available_does_not_panic`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
@@ -1075,10 +1075,10 @@ git commit -m "feat(core): port vulkan_loader_available from src-tauri"
|
||||
|
||||
- [ ] **Step 1: Replace local definition with re-export**
|
||||
|
||||
Find the local `fn vulkan_loader_available()` in `src-tauri/src/commands/models.rs` (lines around 322–350 of the file as of the spec date). Delete the function entirely. Add at the top of the file (or near other `magnotia_core` imports):
|
||||
Find the local `fn vulkan_loader_available()` in `src-tauri/src/commands/models.rs` (lines around 322–350 of the file as of the spec date). Delete the function entirely. Add at the top of the file (or near other `lumotia_core` imports):
|
||||
|
||||
```rust
|
||||
use magnotia_core::hardware::vulkan_loader_available;
|
||||
use lumotia_core::hardware::vulkan_loader_available;
|
||||
```
|
||||
|
||||
The two existing call sites in `models.rs` (around lines 401 and 419) will now resolve to the imported function. Verify with grep that no other callers exist inside src-tauri:
|
||||
@@ -1091,19 +1091,19 @@ Expected output: only the `use` line and the two existing call sites.
|
||||
|
||||
- [ ] **Step 2: Build and run src-tauri's tests**
|
||||
|
||||
Run: `cargo test -p magnotia` (the src-tauri crate name as listed in `src-tauri/Cargo.toml`; verify if unsure with `grep '^name' src-tauri/Cargo.toml`).
|
||||
Run: `cargo test -p lumotia` (the src-tauri crate name as listed in `src-tauri/Cargo.toml`; verify if unsure with `grep '^name' src-tauri/Cargo.toml`).
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 3: Run the existing accelerator-list smoke**
|
||||
|
||||
Run: `cargo test -p magnotia compose_accelerators`
|
||||
Run: `cargo test -p lumotia compose_accelerators`
|
||||
Expected: PASS — confirms the move didn't change behaviour.
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
|
||||
```bash
|
||||
git add src-tauri/src/commands/models.rs
|
||||
git commit -m "refactor(tauri): use magnotia_core::hardware::vulkan_loader_available"
|
||||
git commit -m "refactor(tauri): use lumotia_core::hardware::vulkan_loader_available"
|
||||
```
|
||||
|
||||
---
|
||||
@@ -1126,14 +1126,14 @@ params.set_n_threads(inference_thread_count() as i32);
|
||||
…and the import at the top:
|
||||
|
||||
```rust
|
||||
use magnotia_core::constants::inference_thread_count;
|
||||
use lumotia_core::constants::inference_thread_count;
|
||||
```
|
||||
|
||||
Replace the import:
|
||||
|
||||
```rust
|
||||
use magnotia_core::tuning::{inference_thread_count, Workload};
|
||||
use magnotia_core::hardware::vulkan_loader_available;
|
||||
use lumotia_core::tuning::{inference_thread_count, Workload};
|
||||
use lumotia_core::hardware::vulkan_loader_available;
|
||||
```
|
||||
|
||||
Replace the call site:
|
||||
@@ -1145,7 +1145,7 @@ params.set_n_threads(inference_thread_count(Workload::Whisper, gpu_offloaded) as
|
||||
|
||||
- [ ] **Step 2: Build and run the existing whisper smoke**
|
||||
|
||||
Run: `cargo test -p magnotia-transcription whisper_rs_smoke`
|
||||
Run: `cargo test -p lumotia-transcription whisper_rs_smoke`
|
||||
Expected: PASS — the helper returns a sensible value (likely 4 or 6 depending on host).
|
||||
|
||||
- [ ] **Step 3: Commit**
|
||||
@@ -1173,7 +1173,7 @@ let gpu_layers = if use_gpu { u32::MAX } else { 0 };
|
||||
let params = LlamaModelParams::default().with_n_gpu_layers(gpu_layers);
|
||||
// ... LlamaModel::load_from_file_with_params(...) returns `model` ...
|
||||
|
||||
let thread_count = i32::try_from(magnotia_core::constants::inference_thread_count())
|
||||
let thread_count = i32::try_from(lumotia_core::constants::inference_thread_count())
|
||||
.unwrap_or(4);
|
||||
let ctx_params = LlamaContextParams::default()
|
||||
.with_n_ctx(Some(NonZeroU32::new(n_ctx).expect("n_ctx must be non-zero")))
|
||||
@@ -1185,10 +1185,10 @@ The model has been loaded by this point (the `model` binding above this block re
|
||||
|
||||
- [ ] **Step 2: Replace the import + computation**
|
||||
|
||||
Replace the existing `use magnotia_core::constants::inference_thread_count;` (or wherever `constants::inference_thread_count` is referenced) with:
|
||||
Replace the existing `use lumotia_core::constants::inference_thread_count;` (or wherever `constants::inference_thread_count` is referenced) with:
|
||||
|
||||
```rust
|
||||
use magnotia_core::tuning::{inference_thread_count, Workload};
|
||||
use lumotia_core::tuning::{inference_thread_count, Workload};
|
||||
```
|
||||
|
||||
Replace the thread-count computation block. The new shape uses the `gpu_layers` value already computed above and cross-checks against the loaded model's layer count:
|
||||
@@ -1203,7 +1203,7 @@ The cross-check is trivially true today (`gpu_layers = u32::MAX` when `use_gpu`)
|
||||
|
||||
- [ ] **Step 3: Build and run LLM smoke**
|
||||
|
||||
Run: `cargo test -p magnotia-llm`
|
||||
Run: `cargo test -p lumotia-llm`
|
||||
Expected: PASS (smoke tests in `crates/llm/tests/` exercise the load path; if any fail unrelated to this change, investigate before moving on).
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
@@ -1227,7 +1227,7 @@ git commit -m "feat(llm): LLM threads use Workload::Llm + GPU offload detection"
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd /home/jake/Documents/CORBEL-Projects/magnotia
|
||||
cd /home/jake/Documents/CORBEL-Projects/lumotia
|
||||
grep -rn "constants::inference_thread_count\|MIN_INFERENCE_THREADS\|MAX_INFERENCE_THREADS" \
|
||||
--include='*.rs' \
|
||||
crates/ src-tauri/
|
||||
@@ -1255,7 +1255,7 @@ Expected: clean build, no warnings about unused items.
|
||||
- [ ] **Step 4: Run the full test suite**
|
||||
|
||||
Run: `cargo test --workspace`
|
||||
Expected: PASS for `magnotia-core`, `magnotia-llm`, `magnotia-transcription`, `magnotia` (src-tauri). Other crate tests should be unaffected.
|
||||
Expected: PASS for `lumotia-core`, `lumotia-llm`, `lumotia-transcription`, `lumotia` (src-tauri). Other crate tests should be unaffected.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
|
||||
@@ -1330,8 +1330,8 @@ For the GPU panels: the fixture sweep doesn't reload the whisper context with th
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd /home/jake/Documents/CORBEL-Projects/magnotia
|
||||
MAGNOTIA_THREAD_SWEEP=1 cargo test -p magnotia-transcription --release thread_count_scaling -- --nocapture
|
||||
cd /home/jake/Documents/CORBEL-Projects/lumotia
|
||||
MAGNOTIA_THREAD_SWEEP=1 cargo test -p lumotia-transcription --release thread_count_scaling -- --nocapture
|
||||
```
|
||||
|
||||
Expected: 4 RTF panels print. Note the per-panel sweet spots — they inform whether the constants in `tuning.rs` need adjusting.
|
||||
@@ -1356,8 +1356,8 @@ This is a manual step; no commit unless the smoke uncovers a defect that needs f
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd /home/jake/Documents/CORBEL-Projects/magnotia
|
||||
cargo build --release -p magnotia-transcription -p magnotia-llm
|
||||
cd /home/jake/Documents/CORBEL-Projects/lumotia
|
||||
cargo build --release -p lumotia-transcription -p lumotia-llm
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Unplug the laptop, run a transcription session**
|
||||
@@ -1365,7 +1365,7 @@ cargo build --release -p magnotia-transcription -p magnotia-llm
|
||||
Open Lumenote, dictate a short clip, watch the log output (Tauri devtools or stdout if running via `cargo tauri dev`). Expect a line of the shape:
|
||||
|
||||
```
|
||||
INFO magnotia_core::tuning: inference_thread_count threads=3 workload=Whisper gpu_offloaded=false on_battery=true clamps=["battery"]
|
||||
INFO lumotia_core::tuning: inference_thread_count threads=3 workload=Whisper gpu_offloaded=false on_battery=true clamps=["battery"]
|
||||
```
|
||||
|
||||
(Numbers vary by host. On a 6c12t Ryzen 4650U the expected `threads` is 3.)
|
||||
|
||||
Reference in New Issue
Block a user