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:
@@ -13,7 +13,7 @@ last_verified: 2026/05/09
|
||||
|
||||
## At a glance
|
||||
|
||||
- Crate: `magnotia-llm`
|
||||
- Crate: `lumotia-llm`
|
||||
- Path: `crates/llm/src/model_manager.rs`
|
||||
- LOC: 486
|
||||
- Public surface:
|
||||
@@ -31,7 +31,7 @@ last_verified: 2026/05/09
|
||||
- `pub fn is_downloaded(id: LlmModelId) -> bool` (`:254`)
|
||||
- `pub fn delete_model(id: LlmModelId) -> io::Result<()>` (`:258`)
|
||||
- `pub async fn download_model<F>(id: LlmModelId, on_progress: F) -> Result<(), DownloadError>` where `F: FnMut(u64, u64) + Send + 'static` (`:272`)
|
||||
- External deps that matter: `reqwest` with `rustls-tls` and `stream` features (no native TLS, no compress), `sha2`, `tokio` for async file IO, `futures-util::StreamExt`, `magnotia-core` for `paths::app_paths()`.
|
||||
- External deps that matter: `reqwest` with `rustls-tls` and `stream` features (no native TLS, no compress), `sha2`, `tokio` for async file IO, `futures-util::StreamExt`, `lumotia-core` for `paths::app_paths()`.
|
||||
- Tauri command that calls this (slice 2, best guess): `commands::models::download_model` (`src-tauri/src/commands/models.rs:516`), wired via `src-tauri/src/lib.rs:325`. Plus `commands::llm::*` calls `model_manager::recommend_tier` at `src-tauri/src/commands/llm.rs:35` and `model_manager::download_model` at `src-tauri/src/commands/llm.rs:70`.
|
||||
|
||||
## What's in here
|
||||
@@ -66,7 +66,7 @@ Tier selection logic, ordered most-capable first:
|
||||
|
||||
### Path helpers (`crates/llm/src/model_manager.rs:242-256`)
|
||||
|
||||
- `model_dir()` → `magnotia_core::paths::app_paths().llm_models_dir()`. The on-disk root, owned by `magnotia-core` (slice 5).
|
||||
- `model_dir()` → `lumotia_core::paths::app_paths().llm_models_dir()`. The on-disk root, owned by `lumotia-core` (slice 5).
|
||||
- `model_path(id)` → `model_dir().join(id.file_name())`. The final destination once a download completes.
|
||||
- `partial_download_path(id)` → `model_path(id).with_extension("gguf.part")`. Where in-flight downloads accumulate.
|
||||
- `is_downloaded(id)` → `model_path(id).exists()`. Cheap check; does not validate SHA.
|
||||
@@ -84,7 +84,7 @@ The flagship entry point. Steps:
|
||||
`download_impl` internals:
|
||||
|
||||
- **Resume detection.** `resume_from = tokio::fs::metadata(&tmp).await.ok().map(|m| m.len()).unwrap_or(0)`. If a `.gguf.part` file exists, we resume from its length.
|
||||
- **`reqwest` client** with a 30-second connect timeout, `magnotia/0.1.0` user-agent, no aggressive compression (`stream` feature).
|
||||
- **`reqwest` client** with a 30-second connect timeout, `lumotia/0.1.0` user-agent, no aggressive compression (`stream` feature).
|
||||
- **`Range: bytes={resume_from}-` header** when `resume_from > 0`. If the server responds with anything other than 206 PARTIAL_CONTENT to a ranged request, we return `DownloadError::ResumeUnsupported` rather than starting over silently.
|
||||
- **Total-size resolution.** For a 200 OK response, `Content-Length` is the total. For a 206, parse `Content-Range: bytes start-end/total` to recover the underlying size; fall back to `content_length() + resume_from` if the header is missing.
|
||||
- **Hasher pre-feed.** When resuming, the existing `.gguf.part` content is read once and fed into the SHA hasher so the final hash covers the entire file, not just the new chunks.
|
||||
@@ -112,7 +112,7 @@ Download path:
|
||||
|
||||
```
|
||||
Tauri command (commands::models::download_model)
|
||||
→ magnotia_llm::model_manager::download_model(id, on_progress)
|
||||
→ lumotia_llm::model_manager::download_model(id, on_progress)
|
||||
→ DownloadReservation::acquire(id) (Http error if duplicate)
|
||||
→ tokio::fs::create_dir_all(model_dir())
|
||||
→ if dest.exists(): sha256_file(dest); short-circuit if match, else delete
|
||||
@@ -130,14 +130,14 @@ Tauri command (commands::models::download_model)
|
||||
Tier-recommend path:
|
||||
|
||||
```
|
||||
sysinfo or magnotia_core::system → (ram_bytes, Option<vram_bytes>)
|
||||
sysinfo or lumotia_core::system → (ram_bytes, Option<vram_bytes>)
|
||||
→ recommend_tier(ram, vram) → LlmModelId
|
||||
→ load_model(id, model_path(id), use_gpu)
|
||||
```
|
||||
|
||||
## Watch-outs
|
||||
|
||||
- **`DownloadReservation` is process-local.** A user running two Magnotia processes against the same on-disk directory could race. We do not file-lock the `.gguf.part`. Realistically rare — but if it ever happens, the SHA check catches a corrupt result.
|
||||
- **`DownloadReservation` is process-local.** A user running two Lumotia processes against the same on-disk directory could race. We do not file-lock the `.gguf.part`. Realistically rare — but if it ever happens, the SHA check catches a corrupt result.
|
||||
- **No retry, no exponential backoff.** A flaky network surfaces as `DownloadError::Http` and the frontend has to ask the user to retry. Resume keeps that retry cheap (only the missing tail re-fetches).
|
||||
- **HF revision pinning is manual.** `hf_url()` includes the commit hash. Updating to a new upstream revision means changing the URL and the SHA in lockstep. No tooling enforces that the SHA still matches the URL — manual verification at upgrade time.
|
||||
- **`size_bytes` is informational, not enforced.** It is shown in the UI before download starts. The download trusts `Content-Length` (or computed from `Content-Range`) for actual progress, so a server that lies about size shows a misleading bar but still verifies SHA at the end.
|
||||
|
||||
Reference in New Issue
Block a user