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>
5.0 KiB
name, type, slice, last_verified
| name | type | slice | last_verified |
|---|---|---|---|
| Core constants | architecture-map-page | 05-core-storage-hotkey-build | 2026/05/09 |
Core constants
Where you are: Architecture map → Core, Storage, Hotkey, Build → Core constants
Plain English summary. A flat list of pub const values that other crates reach for so the same magic numbers (sample rate, mel-spectrogram dimensions, RAM thresholds, chunk timing) are not duplicated. If you change one of these, the change propagates by recompile to every consumer.
At a glance
- File:
crates/core/src/constants.rs(38 LOC). - All items are
pub constwith concrete primitive types. - No external deps.
- Consumers: slice 3 (transcription, audio capture), slice 4 (formatting paragraph break heuristic),
core::types::AudioSamples::mono_16khz(slice 5 internal).
What's in here
Audio pipeline (Whisper baseline)
pub const WHISPER_SAMPLE_RATE: u32 = 16_000; // crates/core/src/constants.rs:2
pub const WHISPER_CHANNELS: u16 = 1; // crates/core/src/constants.rs:3
Used by AudioSamples::mono_16khz, the audio capture worklet target rate (cross-link to static-assets.md), and the Whisper engine (slice 3). The frontend pcm-processor.js worklet uses literal 16000 rather than importing this constant, so a change here without a coordinated worklet edit produces silently wrong audio. Documented in static-assets.md.
Parakeet mel spectrogram (crates/core/src/constants.rs:6-12)
pub const PARAKEET_N_FFT: usize = 512;
pub const PARAKEET_HOP_LENGTH: usize = 160;
pub const PARAKEET_WIN_LENGTH: usize = 400;
pub const PARAKEET_N_MELS: usize = 80;
pub const PARAKEET_PRE_EMPHASIS: f32 = 0.97;
pub const PARAKEET_BLANK_TOKEN: usize = 1024;
pub const PARAKEET_LOG_GUARD: f32 = 5.960_464_5e-8; // 2^-24
These match the Parakeet TDT 0.6B v2 ONNX export's expected feature shape. Consumed by the Parakeet engine in slice 3. Touch only in lock-step with the model file revision pinned in core-model-registry.md.
Live chunk timing (crates/core/src/constants.rs:14-16)
pub const CHUNK_INTERVAL_MS: u64 = 3000;
pub const MIN_CHUNK_SAMPLES: usize = 8000; // 0.5 s at 16 kHz
Used by the live-session loop (slice 3). 3-second chunks at 16 kHz mean 48 000-sample buffers per inference call. The 8 000-sample minimum prevents very short final chunks producing garbage transcriptions when a session ends mid-buffer.
Smart paragraph break (crates/core/src/constants.rs:18-19)
pub const SMART_PARAGRAPH_GAP_SECS: f64 = 2.0;
Consumed by lumotia_ai_formatting::pipeline (slice 4). When the gap between adjacent Segments exceeds 2 seconds, a paragraph break is inserted. Cross-link: Slice 4 formatting pipeline.
History limits (crates/core/src/constants.rs:21-22)
pub const HISTORY_MAX_ENTRIES: usize = 100;
Used by the history page query path (slice 1 / slice 2). Today the storage layer pages with explicit limit arguments rather than reading this constant directly — the constant is a soft cap consumed by the frontend.
RAM thresholds (crates/core/src/constants.rs:24-28)
pub const RAM_MINIMUM_FOR_LOCAL_STT: f64 = 2.0; // GB
pub const RAM_THRESHOLD_LIGHTWEIGHT: f64 = 4.0;
pub const RAM_THRESHOLD_STANDARD: f64 = 8.0;
pub const RAM_THRESHOLD_COMFORTABLE: f64 = 16.0;
Used by the recommendation scoring path (core-recommendation.md) and the runtime-capabilities banner (slice 2). The "comfortable" threshold drives the +10 score bonus.
VAD configuration (crates/core/src/constants.rs:30-35)
pub const VAD_SPEECH_THRESHOLD: f64 = 0.5;
pub const VAD_MIN_SPEECH_DURATION_MS: u32 = 250;
pub const VAD_MAX_SPEECH_DURATION_S: u32 = 30;
pub const VAD_MIN_SILENCE_DURATION_MS: u32 = 300;
pub const VAD_SPEECH_PAD_MS: u32 = 100;
Defaults for the Silero VAD wrapper (slice 3). User-tunable via settings; these are the cold-start values.
Model download (crates/core/src/constants.rs:37-38)
pub const DOWNLOAD_CHUNK_BYTES: usize = 65_536; // 64 KiB
The chunk size at which the resumable HTTP downloader emits DownloadProgress events. 64 KiB is fine for both the Parakeet ONNX shards and the Whisper GGML files. Consumed by the model manager paths in slices 3 and 4.
Watch-outs
- No grouping or namespacing. Everything is flat. Discoverability via
grepagainst the constant names. - No serialisation. These are compile-time constants. Changing one requires a rebuild; persisted user data is unaffected.
PARAKEET_BLANK_TOKEN = 1024is the model's vocabulary index. Hard-coded to the 0.6B v2 export. A different Parakeet variant would use a different blank index — coordinate with the registry.