>_EXECUTIVE SUMMARY
AUDIO_HAXOR is a Tauri v2 desktop application for cataloging, analyzing, and arranging music-production assets. The Rust backend (src-tauri/) walks the filesystem to index VST2/VST3/AU/CLAP/AAX plugins, audio samples, DAW projects across 13 formats, MIDI files, presets, PDFs, and video reference material into a SQLite catalog. A separate JUCE 8 sidecar process (audio-engine) handles device I/O, plugin hosting, sample-accurate playback, and waveform / spectrogram rendering over a stdin/stdout JSON protocol. The frontend is a WebKit-rendered cyberpunk HUD with 57 JS modules driving the grid views, command palette, tray popover, lifecycle scripting hooks (stryke), and ALS Ableton-project generator.
Source Distribution — 220,479 total lines
Production = Rust src (66,416) + Frontend JS (51,706) + frontend HTML (17,303) + audio-engine C++ (4,659). Tests & benches = 118 Rust integration modules under src-tauri/tests/ (64,892) + criterion bench (273) + 7 example binaries (6,665). Tooling = 66 build / i18n / packaging scripts (Bash + Node + Python, 8,565).
#SUBSYSTEM BREAKDOWN
The Rust backend (66,416 LOC across 52 files) is partitioned below by role. db.rs dominates — the entire SQLite schema (36 tables, 76 indices), all CRUD helpers, plus filter / facet / stats queries live in a single file. lib.rs is the Tauri-command surface (320 registered IPC handlers) plus app setup. ALS / MIDI / track generators are the largest concentration of domain logic, including the trance-arrangement state machine and Ableton-project XML emitter. Lifecycle scripting hooks (hooks.rs) and the stryke language-server bridge (stryke_lsp.rs / stryke_runner.rs) are the newest modules.
| Subsystem | Key Files | Lines | % | Share | Description |
|---|---|---|---|---|---|
| Database | db | 13,331 | 20.1% | SQLite schema (36 tables, 76 indices), connection management, all CRUD queries, filter facets, stats aggregations, palette preview, cache tables, migration paths | |
| App Core / IPC | lib, main | 13,002 | 19.6% | Tauri entry point, 320 registered IPC handlers (287 #[tauri::command] in lib.rs), event emission, window setup, prefs load/save, panic handler, async runtime wiring | |
| ALS / Track Generators | track_generator, als_generator, midi_generator, trance_generator, trance_starter, als_project | 16,773 | 25.3% | Ableton Live Set (.als) project synthesizer: scene/track/clip layout, sample auditioning + filtering, BPM-locked alignment, kit selection, group routing, sidechain compressor templates, gzip XML emission | |
| Scanners | scanner, audio_scanner, daw_scanner, midi_scanner, preset_scanner, pdf_scanner, video_scanner, unified_walker, bulk_stat, scanner_skip_dirs, file_watcher, similarity, content_hash | 1,444 | 2.2% | Rayon-parallel filesystem walkers for plugins, samples, DAW projects, MIDI, presets, PDFs, video; unified scan orchestration; bulk stat(); notify-based watchers; SHA-256 content hashing; similarity fingerprinting. Most scanner bodies (audio_scanner, daw_scanner, unified_walker, etc.) are now 3-line re-export stubs — the implementations were extracted into the zpwr-crate workspace crate | |
| Audio Analysis | sample_analysis, bpm, key_detect, lufs, sample_filters | 5,895 | 8.9% | Per-sample BPM autocorrelation, key detection (chromagram), LUFS loudness (BS.1770), filter classification (kick / snare / hat / bass / lead / pad), batch analysis runner with cancellation | |
| History | history | 3,399 | 5.1% | Per-domain scan snapshot store: save / load / diff / list / delete for plugins, audio, DAW, presets, MIDI, PDFs, videos; preferences JSON round-trip | |
| Tray / Menu (macOS) | tray_menu, native_menu, tray_popover_escape_macos, app_activity_macos, space_preview_macos | 3,080 | 4.6% | Status-bar tray icon with now-playing waveform, tray popover positioning, native NSMenu, Cmd+Q passthrough, space-switch preview, app-activation tracking via objc2 / objc2-app-kit | |
| Cross-Reference | xref | 2,218 | 3.3% | DAW-project ↔ plugin / sample cross-reference graph: parses every supported project format for plugin instances and sample references, builds bidirectional lookup tables | |
| i18n | app_i18n | 2,044 | 3.1% | Runtime string catalog loader: 3,506 English keys mirrored across 27 locales; toast strings; placeholder substitution; fallback resolution to en | |
| Audio Engine Bridge | audio_engine, audio_extensions | 1,325 | 2.0% | Sidecar process management: spawn / restart / health-check the JUCE engine; stdin/stdout JSON RPC; EOF watchdog; next-track hinting; process-stats sampling | |
| Hooks / stryke / KVR / Misc | hooks, stryke_lsp, stryke_runner, midi, kvr, waveform_container_extract, waveform_prefetch, terminal, open_with_app, pdf_meta, path_norm, drop_router, fb_watcher, webview_keepalive | 3,905 | 5.9% | Lifecycle scripting hooks (scan-complete / file-watcher-change / playback-advanced) run through the standalone stryke interpreter subprocess; stryke LSP bridge for the in-app hooks editor; SMF parser; KVR plugin database scraper; ALS-embedded waveform extraction; prefetch worker pool; PTY terminal; "Open With" launcher; PDF metadata extractor; path normalizer | |
| Tests | tests/*.rs | 64,892 | +97.7%* | 118 integration test modules: handcrafted tables (table-driven regression catchers), behavioral suites (focused / heavy / ton / ultra / expanded / more), DB / IPC / history serde round-trips, BPM detection edge cases, file-watcher patterns, parser corner cases | |
| Benches / Examples | benches/benchmarks.rs, examples/generate_*.rs | 6,938 | +10.4%* | Criterion HTML-report bench harness (273 LOC); 7 example binaries (6,665 LOC) for generating empty / toy / schranz / techno / true-techno ALS projects and sample-filter dry-runs | |
| PRODUCTION TOTAL | 66,416 | 100% | 52 files in src-tauri/src/ | ||
* Test / bench percentages are relative to production LOC (66,416), not part of the 100% above.
$TOP 15 FILES BY SIZE
The largest files in src-tauri/src/ by role weight. db.rs is by far the heaviest — SQLite is the catalog spine, every query routes through it, and inlined SQL templates plus filter-stat aggregations keep the file past 13k lines even after the schema partition. Three former scanner heavyweights (unified_walker, audio_scanner, daw_scanner) are now 3-line re-export stubs — their implementations were extracted into the zpwr-crate workspace crate.
| File | Lines | Role |
|---|---|---|
| src-tauri/src/db.rs | 13,331 | SQLite schema (36 tables, 76 indices), connection pool, all CRUD + filter + stats queries, palette preview, cache tables (table/row definitions now shared from crates/zpwr-crate) |
| src-tauri/src/lib.rs | 12,989 | 287 #[tauri::command] handlers (of 320 registered), Tauri setup, event emission, window restore, panic handler |
| src-tauri/src/track_generator.rs | 7,177 | Per-track ALS clip layout: BPM-locked alignment, scene assembly, automation lanes, kit routing, group sidechain |
| src-tauri/src/history.rs | 3,399 | Per-domain scan-history store: save / load / diff / list / delete for 7 inventory domains plus prefs round-trip |
| src-tauri/src/sample_analysis.rs | 3,252 | Background batch analyzer: BPM + key + LUFS for unanalyzed samples; cancellation tokens; stats aggregation |
| src-tauri/src/midi_generator.rs | 2,882 | SMF synthesis: lead / chord / drum-kit MIDI emission with scale + key + velocity humanization |
| src-tauri/src/als_generator.rs | 2,927 | Ableton Live Set composer: scene / track allocation, sample selection, blacklist / whitelist, kit picker, gzip XML emission |
| src-tauri/src/xref.rs | 2,218 | DAW-project cross-reference graph: parses every supported project format for plugin + sample references |
| src-tauri/src/app_i18n.rs | 2,044 | Runtime i18n: catalog loader for 27 locales, placeholder substitution, fallback resolution |
| src-tauri/src/als_project.rs | 1,790 | Standalone ALS-project file emitter: empty / techno / schranz starter templates with embedded XML fragments |
| src-tauri/src/tray_menu.rs | 1,501 | Status-bar tray icon, now-playing waveform render, tray popover positioning, IPC for popover actions |
| src-tauri/src/unified_walker.rs | 3 | Re-export stub — single-pass 7-domain walker now lives in crates/zpwr-crate (1,433 LOC there) |
| src-tauri/src/audio_scanner.rs | 3 | Re-export stub — Symphonia metadata-probe scanner extracted to crates/zpwr-crate (1,334 LOC there) |
| src-tauri/src/audio_engine.rs | 1,322 | JUCE sidecar lifecycle: spawn / restart / health-check, stdin/stdout JSON RPC, EOF watchdog |
| src-tauri/src/daw_scanner.rs | 3 | Re-export stub — 13-format DAW-project scanner extracted to crates/zpwr-crate (1,231 LOC there) |
| TOP 15 SUBTOTAL | 54,841 | 82.6% of 66,416-line Rust production slice |
$TOP 10 FRONTEND MODULES
The largest frontend JS modules. The frontend/js/ slice is now 51,706 LOC across 57 modules; audio.js at 8,797 lines is the playback / waveform / spectrogram / drag-source / player-history controller — the longest single JS file in the app. file-browser.js (shown below) was extracted into the crates/zpwr-file-browser/webui bundle and is no longer part of the frontend/js/ count.
| File | Lines | Role |
|---|---|---|
| frontend/js/audio.js | 8,797 | Playback controller, waveform / spectrogram canvas, native file drag, player history |
| crates/zpwr-file-browser/webui/file-browser.js | 5,398 | Power file browser: multi-pane state, drag-resize/swap/reorder, Spotlight FTS, modal toolset (extracted to the zpwr-file-browser crate; served into the file-browser pane) |
| frontend/js/audio-engine.js | 4,491 | Browser-side bridge to the JUCE sidecar: device list, MIDI device list, plugin host UI, transport |
| frontend/js/context-menu.js | 3,320 | Right-click menu builder per row type: 50+ actions across all inventory grids |
| frontend/js/settings.js | 2,278 | Settings tab: directory pickers, theme selector, scan throttle, audio device routing, watcher toggle |
| frontend/js/ipc.js | 2,304 | Wrapper around window.__TAURI__.core.invoke: typed helpers per IPC command (~320 wrappers) |
| frontend/js/utils.js | 1,784 | Shared formatters, debounce / throttle, dataset diff helpers, format-size / format-duration |
| frontend/js/command-palette.js | 1,726 | Cmd-K palette: fuzzy match across actions, inventory rows, settings, tutorial steps |
| frontend/js/video.js | 1,706 | Video tab: thumbnail strip, scrub bar, metadata pane |
| frontend/js/visualizer.js | 1,634 | Live FFT visualizer + analyzer modes (oscilloscope, spectrum, spectrogram) |
| TOP 10 SUBTOTAL | 33,438 | these 10 modules; frontend/js/ slice is 51,706 LOC / 57 modules (file-browser.js now in the zpwr-file-browser crate) |
@PROCESS ARCHITECTURE
Three processes per running instance: the Tauri shell (main), the WebKit frontend, and the JUCE audio-engine sidecar. The shell owns the SQLite catalog and filesystem walkers; the WebView drives the UI; the sidecar holds juce::AudioDeviceManager, hosts plugin instances, and renders waveforms. The shell talks to the frontend over Tauri's IPC bus (320 commands), and to the sidecar over a stdin/stdout JSON line protocol.
┌──────────────────────────────────────────────────────────────────┐
│ AUDIO_HAXOR DESKTOP (Tauri v2) │
├──────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────┐ ┌────────────────────────────┐ │
│ │ WebView frontend │ ◀─────▶ │ Rust shell (src-tauri) │ │
│ │ (frontend/) │ IPC │ ──────────────────── │ │
│ │ 57 JS modules │ 320 │ • 320 IPC handlers │ │
│ │ 51,706 LOC │ cmds │ • SQLite catalog (db.rs) │ │
│ │ WebKit (release) │ events │ 36 tables / 76 indices │ │
│ │ http (dev) │ ──────▶ │ • Rayon-parallel walkers │ │
│ │ │ │ • Symphonia metadata │ │
│ │ • Grid views │ │ • SHA-256 fingerprinter │ │
│ │ • Cmd palette │ │ • ALS generator (XML+gz) │ │
│ │ • Tray popover │ │ • i18n catalog loader │ │
│ │ • Visualizer │ │ 27 locales / 3,506 keys│ │
│ │ • Settings │ │ • objc2 macOS bindings │ │
│ └────────────────────┘ └─────────────┬──────────────┘ │
│ │ │
│ stdin/stdout JSON line protocol │
│ ▼ │
│ ┌─────────────────────────────┐ │
│ │ audio-engine sidecar │ │
│ │ ───────────────────────── │ │
│ │ • C++20 / JUCE 8.0.4 │ │
│ │ • 4,659 LOC (14 files) │ │
│ │ • juce::AudioDeviceManager │ │
│ │ • Plugin hosts: │ │
│ │ VST3 / AU / CLAP* │ │
│ │ • Sample-accurate playback │ │
│ │ • Waveform render │ │
│ │ • Spectrogram (FFT) │ │
│ │ • AU CocoaUI patch (JUCE 8)│ │
│ │ • Crash handler / watchdog │ │
│ └─────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────┘
│
│ persistent state
▼
┌──────────────────────────────────────────────────────────────────┐
│ ~/Library/Application Support/com.menketechnologies.audio-haxor │
│ ─────────────────────────────────────────────────────────── │
│ • catalog.sqlite (36 tables, FTS-eligible search) │
│ • prefs.json (window state, scan dirs, theme) │
│ • cache/ (waveform PNGs, spectrogram PNGs) │
│ • history/ (per-domain snapshot JSONs) │
└──────────────────────────────────────────────────────────────────┘
&SCANNERS & WALKERS
Seven independent scanners plus a unified walker that classifies and emits inventory rows for all domains in one filesystem traversal. Every scanner is Rayon-parallel; cancellation is via AtomicBool stop-flags checked per file. The unified_walker at 1,433 lines collapses 7 individual walkdir passes into one, which is the path used by the "Scan All" button. These scanner / walker implementations were extracted into the shared crates/zpwr-crate workspace crate; src-tauri/src/ now keeps thin 3-line re-export stubs and the LOC figures below are for the implementations in zpwr-crate.
Plugin Scanner
scanner.rs (1,046 LOC) — walks the user's plugin directories for VST2 / VST3 / AU / CLAP / AAX. Architecture badges (ARM64 / x86_64 / Universal) come from direct Mach-O / PE binary parsing, no file(1) shellout.
Audio Sample Scanner
audio_scanner.rs (1,334 LOC) — Symphonia-based metadata probe: duration, channels, sample rate, bit depth pulled from file headers. walkdir + rayon::par_bridge.
DAW Project Scanner
daw_scanner.rs (1,231 LOC) — 13 project formats: .als, .flp, .rpp, .cpr, .logic, .ptx, .bwproject, .song, .reason, .aup3, .band, .ardour, .dawproject.
MIDI Scanner
midi_scanner.rs (481 LOC) — SMF (Standard MIDI File) walker. Tempo, track count, duration extracted from track header chunks via midi.rs (752 LOC).
Preset Scanner
preset_scanner.rs (692 LOC) — format-tagged preset file discovery with per-format size bucketing; stacked disk-usage bar in the grid header.
PDF Scanner
pdf_scanner.rs (450 LOC) — PDF file walker with deferred metadata extraction via pdf_meta.rs (220 LOC) using lopdf; page-count and size pulled lazily.
Video Scanner
video_scanner.rs (484 LOC) — video reference walker. Metadata via Symphonia where supported; falls back to size + extension.
Unified Walker
unified_walker.rs (1,433 LOC) — single-pass walker that classifies every dirent into one of the 7 domains and emits inventory rows in one traversal. Used by "Scan All".
File Watcher
file_watcher.rs (471 LOC) — notify-based recursive watcher per scan-root directory. Debounced changes trigger targeted re-scans, not full re-walks.
Bulk Stat
bulk_stat.rs (524 LOC) — batched stat() + size accumulator that avoids a per-file syscall round-trip when totalizing inventory size.
Skip Filter
scanner_skip_dirs.rs (127 LOC) — hand-curated skip list for known-noise paths (node_modules, .git, system caches) applied at every walker.
Cross-Reference
xref.rs (2,218 LOC) — parses every supported DAW-project format for embedded plugin instances and sample references, then builds a bidirectional graph queryable from the project row or the plugin row.
!ALS PROJECT GENERATOR
16,773 lines across six files compose the Ableton Live Set generator — the largest single feature in the app by code mass (21.7% of the Rust slice). Output is gzip'd XML that opens natively in Ableton Live; the generator selects samples from the catalog by genre / BPM / key constraints, lays out scenes, routes groups, attaches sidechain compressors, and emits the complete project file with no post-processing required.
| File | Lines | Role |
|---|---|---|
| track_generator.rs | 7,177 | Per-track clip layout: BPM-locked alignment, automation lanes, kit routing, group sidechain insertion |
| midi_generator.rs | 2,882 | SMF synthesis: lead, chord, and drum-kit MIDI emission with scale + key + velocity humanization |
| als_generator.rs | 2,927 | Top-level project synthesizer: scene allocation, sample selection by genre / kit, blacklist + whitelist enforcement |
| als_project.rs | 1,790 | Standalone ALS-project file emitter: empty / toy / techno / schranz / true-techno starter templates |
| trance_generator.rs | 1,354 | Trance-specific arrangement state machine: intro / breakdown / build / drop / outro section sequencing |
| trance_starter.rs | 643 | Trance-only starter project: standalone short arrangement scaffolding |
| ALS GENERATOR TOTAL | 16,773 | 21.7% of Rust production slice |
// EMBEDDED XML TEMPLATES (raw inline assets in src-tauri/src/)
empty_project_template.als.gz— gzip'd minimal Ableton 11+ project, deserialized then mutatedaudio_track_template.xml—<AudioTrack>fragment with default routingmidi_track_template.xml—<MidiTrack>fragment with default channelgroup_track_template.xml—<GroupTrack>fragment with default colorgroup_sidechain_compressor_template.xml—<DeviceChain>with sidechain wiringmaster_eq8_hpf_template.xml—<Eq8>with high-pass enabledmaster_limiter_template.xml—<Limiter>with ceiling -0.3 dB
~AUDIO ENGINE SIDECAR
A separate process built with JUCE 8.0.4 (pulled via CMake FetchContent) handles all device I/O, plugin hosting, sample-accurate playback, and offscreen rendering. The Rust shell spawns it as a child process; communication is line-delimited JSON over stdin/stdout. Crash isolation: a sidecar segfault never takes the main app down — the shell restarts it with state reload. Shared DSP primitives (channel strip, OLA time-stretch, stereo file source, lock-free streaming, spectrogram analysis) were extracted into the header-only crates/zdsp-core library consumed by the sidecar, which is why the in-tree C++ count is smaller than earlier reports.
| File | Lines | Role |
|---|---|---|
| audio-engine/src/Engine.cpp | 3,490 | Core engine: juce::AudioDeviceManager wiring, plugin hosting (VST3 / AU / CLAP), transport, scrubbing, command dispatch |
| audio-engine/src/VisualPreview.cpp | 328 | Offscreen waveform + spectrogram render to PNG; FFT for spectrum view |
| audio-engine/src/CrashHandler.cpp | 289 | Signal handler that emits a crash JSON before terminating; restartable from shell |
| audio-engine/src/AppLog.cpp | 121 | Rotating log file under ~/Library/Logs/audio-haxor/audio-engine.log |
| audio-engine/src/Main.cpp | 120 | Entry point: arg parse, JUCE init, message-loop pump |
| audio-engine/src/ParentWatchdog.cpp | 95 | Watches the parent Rust process; exits if parent dies (no orphan sidecars) |
| audio-engine/src/CocoaHelpers.mm | 53 | Objective-C++ bridge for macOS-specific NSWindow / NSApplication calls |
| audio-engine/src/ZdspLibCheck.cpp | 34 | Link-time check that the zdsp-core DSP library is present and ABI-compatible at sidecar startup |
| AUDIO ENGINE TOTAL | 4,530 | 8 .cpp/.mm files shown (+ 6 .hpp headers = 4,659 LOC total, 14 files), C++20 |
The CMake build patches juce::AudioUnitPluginWindowCocoa::createView at configure-time: stock JUCE 8 prefers the async RequestViewController path over the legacy CocoaUI path, but the XPC delivery never arrives in a spawned sidecar process, so AUv2 plugins (UAD, Sonimus, etc.) would render permanently blank. The patch gates the async branch on pluginView == nil, restoring the legacy attach path. Idempotent — re-running CMake is a no-op.
%SQLITE CATALOG
36 source-declared tables (6 of them FTS5 virtual tables, which spawn additional shadow tables at runtime) and 76 indices, all bundled in src-tauri/src/db.rs (13,331 LOC; row/table type definitions shared from crates/zpwr-crate). The catalog covers every inventory domain plus history snapshots, KVR plugin metadata, waveform / spectrogram caches, and per-row notes / tags / favorites. rusqlite with the bundled feature so the binary ships its own SQLite — no system dependency.
// SCHEMA DOMAINS
Inventory Tables
One per domain: plugins, audio, daw, midi, presets, pdfs, video
History
Per-domain snapshots: *_history_runs, *_history_items
Analysis
BPM / key / LUFS cache, fingerprint cache, content-hash cache, similarity index
KVR
Scraped plugin database: latest version, download URL, manufacturer link
Annotations
notes, tags, favorites, player_history, smart playlists
Cross-Reference
DAW-project ↔ plugin / sample edges built by xref.rs
Render Caches
Waveform PNG cache, spectrogram PNG cache (paths + hash + mtime)
Filter Stats
Pre-aggregated facet counts per domain to avoid per-query GROUP BY on millions of rows
^IPC COMMAND SURFACE
320 IPC commands registered via tauri::generate_handler! in lib.rs. The frontend invokes them through window.__TAURI__.core.invoke(name, args); frontend/js/ipc.js (2,331 LOC) wraps each one with a typed helper. Domains below break down what the frontend can ask the shell to do.
| Domain | Cmds (approx) | Examples |
|---|---|---|
| Scanning | 14 | scan_plugins, scan_audio_samples, scan_daw_projects, scan_midi_files, scan_presets, scan_pdfs, scan_video_files, scan_unified, stop_* |
| History | 42 | history_get_scans, history_diff, *_history_save / get_scans / get_detail / delete / clear / latest / diff for each domain |
| Database Queries | 22 | db_query_audio, db_query_plugins, db_query_daw, db_*_filter_stats, db_*_stats, db_cache_stats |
| Audio Engine | 9 | audio_engine_invoke, audio_engine_restart, EOF watchdog start/stop, playback flags, BG-job throttle |
| Analysis | 10 | estimate_bpm, detect_audio_key, measure_lufs, batch_analyze, compute_fingerprint, find_similar_samples, find_content_duplicates |
| ALS Generator | 14 | generate_als_project, cancel_als_generation, blacklist / whitelist add / remove / clear / count, generate_midi_lead, generate_midi_kits, generate_trance_starter |
| Annotations | 26 | favorites_*, note_*, tags_*, tag_*, player_history_* |
| Export / Import | 16 | export_plugins_json / csv, export_audio_json / dsv, export_daw_*, export_presets_*, export_pdfs_*, export_videos_*, export_toml, export_pdf |
| Filesystem | 12 | fs_list_dir, delete_file, rename_file, write_text_file, write_binary_file, read_text_file, open_with_app, open_*_folder |
| Tray / Window | 8 | tray_menu::update_tray_now_playing, tray_popover_action / resize / get_state / push_subtitle / get_ui_theme / hide, show_main_window |
| Terminal (PTY) | 4 | terminal::terminal_spawn / write / resize / kill |
| Hooks / stryke | 15 | hooks_list / events / save / delete / set_enabled / get_script / script_path / set_script / test_run, stryke_lsp_start / send / stop, stryke_filter_rows, stryke_transform_rows |
| Misc | 100 | prefs, KVR, file watcher, i18n, log, similarity, waveform prefetch, sample-analysis, crate filters, palette preview, etc. |
| TOTAL REGISTERED | 320 | From generate_handler! in src-tauri/src/lib.rs |
*INTERNATIONALIZATION
3,506 English keys mirrored across 27 locales. Catalogs ship as JSON under i18n/; app_i18n.rs (2,044 LOC) handles runtime resolution with English fallback. The frontend pulls catalogs once on startup and substitutes keys at render time. 45 Python scripts under scripts/ (6,443 LOC) handle catalog generation, gap-fill, audit, and locale-key sync.
Locales: cs, da, de, el, en, es, es_419, fi, fr, hi, hu, id, it, ja, ko, nb, nl, pl, pt, pt_br, ro, ru, sv, tr, uk, vi, zh. Audit tooling: i18n_catalog_audit.py diffs each non-EN catalog against EN for missing keys, placeholder drift, and empty values.
.TESTS
9,503 #[test] functions across 118 Rust integration modules in src-tauri/tests/, totaling 64,892 LOC. The largest single test file (handcrafted_tables_massive.rs at 22,878 LOC) is a table-driven regression catcher pinning behaviors that earlier bugs broke. Rule: never delete a test file; never write generic boilerplate tests; every test catches a real bug or pins a real behavior.
// TOP TEST MODULES
| File | Lines | Role |
|---|---|---|
| tests/handcrafted_tables_massive.rs | 22,878 | Mega table-driven regression catcher pinning behaviors fixed bugs introduced |
| tests/behavioral_ultra.rs | 10,984 | Largest behavioral suite: end-to-end scenarios across scan / DB / history / IPC |
| tests/handcrafted_tables_radix_grid.rs | 6,002 | Path-radix / grid-render regression tables |
| tests/handcrafted_tables_fingerprint_grid.rs | 4,869 | Audio fingerprint / similarity regression tables |
| tests/handcrafted_tables_normalize_generated.rs | 1,551 | Generated path-normalization tables |
| tests/behavioral_focused.rs | 796 | Targeted behavioral scenarios — single-feature paths |
| tests/backend_handwritten_history_snapshots.rs | 591 | History snapshot save / load / diff round-trip |
| tests/behavioral_heavy.rs | 587 | Heavy scenarios: large inventories, parallel scan throttling |
| tests/backend_handwritten_db_ipc_json.rs | 585 | DB ↔ IPC JSON serde-shape contracts |
+DEPENDENCIES
50 direct dependency entries in src-tauri/Cargo.toml across [dependencies], target-specific macOS, [build-dependencies], and [dev-dependencies]. Strict preference for foundational crates over fashionable ones; every dep is audited against the build-clean-in-5-years bar.
Tauri Stack
tauri (tray-icon, protocol-asset, image-png, macos-private-api), tauri-plugin-shell, tauri-plugin-dialog, tauri-plugin-drag
Async Runtime
tokio (rt-multi-thread, macros, time), rayon, dashmap
SQLite
rusqlite (bundled, functions, hooks) — bundled SQLite, no system dependency
Audio
symphonia (mp3, aac, flac, ogg, pcm, isomp4, mkv, vorbis) — pure-Rust audio metadata + decode
Serde / Formats
serde, serde_json (preserve_order), toml, plist, flate2, zip (deflate-only)
Filesystem
walkdir, notify, dirs, sysinfo, libc, num_cpus
Hashing
sha2, base16ct — SHA-256 for content fingerprints
HTTP / Web
reqwest (rustls, no default features) — KVR scraper, plugin update checker
printpdf (images, png), lopdf — PDF export + metadata extraction
Terminal
portable-pty — embedded terminal in the in-app PTY tab
macOS Bridge
objc2, objc2-foundation, objc2-app-kit, objc2-web-kit, block2 — native NSMenu, tray, space-switch detection
Bench
criterion (html_reports), seq-macro — dev-only
;PUBLIC API SURFACE
The Rust shell is built as a single rlib (app_lib) consumed by src-tauri/src/main.rs. The public surface is the 320 Tauri-IPC commands registered from lib.rs; internally the crate spans 52 source files.
| Surface | Count | Notes |
|---|---|---|
| IPC commands (registered) | 320 | Entries in the generate_handler! macro in lib.rs |
#[tauri::command] fns (all) | 311 | Defined across lib.rs (287), hooks.rs (9), tray_menu.rs (8), terminal.rs (4), stryke_lsp.rs (3) |
| Structs | 156 | Data shapes — DB rows, IPC payloads, walker state, settings |
| Enums | 8 | Small — most variants are flat tagged-union JSON shapes |
| Frontend modules | 57 | JS modules under frontend/js/ |
| Tutorial pages | 20 | HTML walkthrough under docs/tutorial/ |
?KEY DESIGN DECISIONS
Where the implementation could have gone either way, and why this path was taken.
Sidecar Audio Engine, Not In-Process
A plugin crash inside the host process would take the whole app down. Spawning JUCE as a separate process means a misbehaving VST3 / AU only kills the sidecar — the shell respawns it and reloads state. Cost: a stdin/stdout JSON protocol layer.
SQLite Bundled, Not System
rusqlite with features = ["bundled"] compiles SQLite into the binary. The user never has version drift between system SQLite and what the app expects; the catalog opens identically on every macOS / Linux / Windows install.
Rayon for Walkers, Not Tokio
Filesystem walks are CPU-bound after the kernel returns dirents — metadata probing, header parsing, hashing. Rayon's work-stealing fits this; Tokio's task scheduler would force every probe into a future. Tokio is reserved for the async IPC handlers + reqwest.
Unified Walker
The "Scan All" path used to do 7 separate walkdir passes — one per domain — redoing every readdir() 7 times. unified_walker.rs collapses them into one traversal that classifies and emits per-domain rows in lockstep.
WebKit Frontend, Not Bundled Chromium
Tauri v2 uses the OS WebView (WKWebView on macOS). Saves ~150 MB binary size vs Electron's bundled Chromium; cost: CSS / JS quirks diverge between http://localhost dev and tauri://localhost release WebKit. Mitigated by an explicit Tauri-v2 ruleset (no inline JS, no dynamic canvas resize, no inline styles on innerHTML-inserted elements).
Filter-Stats Cache Tables
Naively, every grid render would GROUP BY on the full inventory to populate facet counts. With millions of files that's hundreds of ms per render. Pre-aggregated *_filter_stats tables are written once after each scan and read instantly on grid open.
Patched JUCE 8 AU CocoaUI Path
Stock JUCE 8 favors the async RequestViewController path for AUv2 plugins, but the XPC delivery doesn't arrive in a spawned sidecar. The CMake build patches the JUCE source at configure-time to gate the async branch on pluginView == nil — AUv2 editors render correctly in the sidecar.
Embedded ALS Templates
Ableton's .als format is gzip'd XML with a strict element schema. Hand-emitting the full XML tree would be brittle; the generator instead deserializes a real Ableton-produced empty project (shipped as empty_project_template.als.gz) and mutates the in-memory tree, then re-emits. Real-DAW round-trip parity.
Locale Catalogs as Plain JSON
27 catalog files under i18n/ — one JSON per locale, sorted-key invariant enforced by sort_app_i18n_catalogs.py --check. Trivial to diff in PRs, trivial to merge, no .po / .mo / .ftl tooling required.
Native macOS Tray via objc2
Tauri's cross-platform tray API can't render a live waveform on the status-bar icon. tray_menu.rs uses objc2-app-kit directly to draw the waveform PNG into an NSImage and assign it — native, no extra process.
Cargo Workspace with Extracted Sub-Crates
src-tauri is still the single Tauri binary / rlib, but reusable engine pieces now live in their own workspace crates consumed as path deps: zpwr-crate (catalog schema + scanners + unified walker), zpwr-embed-terminal, zpwr-file-browser, and zpwr-clip-engine, plus the vendored ztranslator plugin and the header-only zdsp-core C++ DSP library — 5+ sub-crates in all. Sharing these across sibling apps and shrinking the monolith won out over the old single-crate setup.
Table-Driven Regression Tests
handcrafted_tables_massive.rs at 22,878 LOC pins behaviors that fixed bugs touched. Each row is one input → expected output; refactors that silently break a row fail the test. The rule: never delete a test file, never write generic boilerplate — every row catches a real bug.