Files
Lumotia/docs/architecture-map/05-core-storage-hotkey-build/storage-file-paths.md
jars a1f3f3f134 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>
2026-05-09 14:04:13 +01:00

3.1 KiB

name, type, slice, last_verified
name type slice last_verified
Storage file paths architecture-map-page 05-core-storage-hotkey-build 2026/05/09

Storage file paths

Where you are: Architecture mapCore, Storage, Hotkey, Build → Storage file paths

Plain English summary. Thin re-export layer. magnotia-storage::file_storage proxies the magnotia-core::paths::AppPaths accessors so callers that already depend on magnotia-storage do not need to add an explicit magnotia-core import to reach the database path.

At a glance

  • File: crates/storage/src/file_storage.rs (28 LOC).
  • External deps: standard library only. Forwards into magnotia_core::paths.
  • Public surface: app_data_dir, database_path, recordings_dir, crashes_dir, logs_dir. Re-exported from crates/storage/src/lib.rs:23.
  • Consumers: slice 2 startup; the diagnostic-report bundler; the live-session recorder writing audio to recordings_dir.

What's in here

Every function is a one-liner forwarding into the core path API:

pub fn app_data_dir() -> PathBuf {
    magnotia_core::paths::app_paths().app_data_dir()
}
pub fn database_path() -> PathBuf {
    magnotia_core::paths::app_paths().database_path()
}
pub fn recordings_dir() -> PathBuf {
    magnotia_core::paths::app_paths().recordings_dir()
}
pub fn crashes_dir() -> PathBuf {
    magnotia_core::paths::app_paths().crashes_dir()
}
pub fn logs_dir() -> PathBuf {
    magnotia_core::paths::app_paths().logs_dir()
}

Notes per directory

  • database_path<app_data>/magnotia.db. Where magnotia_storage::init creates / opens the SQLite database. Absent on first run; created with create_if_missing(true).
  • recordings_dir<app_data>/recordings/. Audio captures live here. The transcription command (slice 2) writes WAV files; their relative path is stamped onto transcripts.audio_path.
  • crashes_dir<app_data>/crashes/. The Rust panic hook writes <unix-ts>-<short-id>.crash files here. Read by the diagnostic-report bundler in Settings → About.
  • logs_dir<app_data>/logs/. Rolling log file (magnotia.log, rotated magnotia.log.1, etc). The tracing-subscriber set up in slice 2 startup (src-tauri/src/lib.rs) writes here.

The model directories (models_dir, speech_model_dir, llm_models_dir) are not re-exported here. Callers reach them directly via magnotia_core::paths::AppPaths — those calls live in slices 3 (speech models) and 4 (LLM models).

Watch-outs

  • No directory-creation side effects. These functions return paths only. Callers that need the directory to exist are responsible for std::fs::create_dir_all. The storage init function does this for the database parent (crates/storage/src/database.rs:10); other consumers should follow.
  • Repeated calls re-resolve env vars. Each invocation rebuilds AppPaths from scratch. Cheap, but noisy. Slice 2 caches a OnceLock<AppPaths> for the app lifetime.

See also