docs: architecture map (initial 5-slice generation, 105 pages)

Five-slice navigable map of the entire codebase under
docs/architecture-map/. Each slice is a self-contained
breadcrumbed sub-tree:

  01-frontend (16)              Svelte/SvelteKit UI
  02-tauri-runtime (26)         src-tauri commands + lifecycle
  03-audio-transcription (16)   audio + transcription crates
  04-llm-formatting-mcp (19)    llm, ai-formatting, mcp, cloud
  05-core-storage-hotkey-build  core, storage, hotkey, workspace,
                          (26) CI, dev glue

Plus master README.md and data-flow-end-to-end.md tracing
audio bytes from microphone to FTS5 search to MCP read.

Generated by 5 parallel subagents on 2026/05/09 against
HEAD 3c47000. Each page has YAML frontmatter, file:line code
refs, sibling cross-links, plain-English summaries.

Aggregated debt surfaced (full lists in master README):
RB-08 macOS power assertion, schema head drift v14 vs v15,
VAD blocked on ort version conflict, streaming primitives
not wired into live.rs, no prompt versioning, MCP has no
auth, cloud-providers in-memory keystore, SettingsPage
2 484 LOC, commands/live.rs 1 737 LOC, dual theme system,
brand rename to Lumenote pending across the codebase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jars
2026-05-09 14:04:13 +01:00
parent 3c47000ea9
commit a1f3f3f134
105 changed files with 11266 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
---
name: Audio VAD (currently a stub)
type: architecture-map-page
slice: 03-audio-transcription
last_verified: 2026/05/09
---
# Audio VAD (currently a stub)
> **Where you are:** [Architecture map](../README.md) → [Audio + Transcription](README.md) → Audio VAD
**Plain English summary.** `magnotia-audio` exposes a `SpeechDetector` type, but right now its `is_speech()` returns `true` for every input. This is a deliberate stub: both candidate Silero VAD bindings pin an older `ort` version than `transcribe-rs` (Parakeet) requires, so adding either today would force a workspace-wide downgrade. Live capture uses the energy-based `RmsVadChunker` from the transcription crate as the working fallback until the `ort` ecosystem aligns.
## At a glance
- Crate: `magnotia-audio`
- Path: `crates/audio/src/vad.rs`
- LOC: 35
- External deps: none (pulls `VAD_SPEECH_THRESHOLD` from `magnotia_core::constants`).
- Internal callers (best effort): unused in production today. The threshold is read but never compared, because `is_speech` always returns `true`.
Public surface:
- `pub struct SpeechDetector``crates/audio/src/vad.rs:14`, derives `Default`.
- `pub fn SpeechDetector::new() -> Self``crates/audio/src/vad.rs:19`.
- `pub fn SpeechDetector::is_speech(&self, _samples: &[f32]) -> bool``crates/audio/src/vad.rs:26`.
- `pub fn SpeechDetector::threshold(&self) -> f64``crates/audio/src/vad.rs:30`.
- `pub fn SpeechDetector::reset(&mut self)``crates/audio/src/vad.rs:34`.
## What's in here
The whole file is the stub plus an explanatory header:
> Both `voice_activity_detector` and `silero-vad-rust` pin ort 2.0.0-rc.10 which conflicts with transcribe-rs requiring ort 2.0.0-rc.12. When the ort ecosystem aligns (likely at 2.0.0 stable), add Silero VAD here.
>
> For now, all audio is treated as speech. This matches v0.2 behaviour (no VAD) and doesn't affect core functionality.
The threshold comes from `VAD_SPEECH_THRESHOLD` (slice 5) and is currently dead weight.
## Data flow
`SpeechDetector::is_speech(samples) -> true`. There is no flow.
## Watch-outs
- **The other VAD lives in the transcription crate.** `RmsVadChunker` (see [transcription-streaming.md](transcription-streaming.md)) is the live-capture chunker that actually decides what gets transcribed. When Silero lands here, expect to consolidate the two: the chunker becomes a thin shell around a real VAD predicate.
- **`is_speech` returning `true` is a feature, not a bug.** v0.2 had no VAD at all. The stub keeps the interface stable so callers can switch to a real Silero impl without a code change.
- **Do not reach for `voice_activity_detector` 0.x or `silero-vad-rust` 6.x without a workspace-wide ort audit.** The conflict is documented, has bitten before, and will bite again until upstream `ort` reaches a stable that both crates target.
- **`reset()` is a no-op.** The trait shape exists for future Silero state.
## See also
- [Transcription streaming](transcription-streaming.md) — `RmsVadChunker`, the actual gating today.
- `magnotia_core::constants::VAD_SPEECH_THRESHOLD` (slice 5) — wired but unused.
- `Cargo.toml` of `magnotia-audio` — the commented-out `silero-vad-rust = "6"` line documents the deferred dep.