chore: remove 11 orphan Tauri commands and downstream dead code

Sweep of registered-but-never-invoked commands surfaced by an audit
against the frontend invoke() call sites. Each was confirmed dead via
grep across src-tauri, src, and crates: no caller anywhere.

Removed commands:
- check_model, count_transcripts_command, get_profile_cmd,
  install_update, list_feedback_examples_cmd (utility/CRUD shapes
  never wired)
- save_audio, start_native_capture, stop_native_capture (native-capture
  path superseded by the live transcription session)
- transcribe_pcm, transcribe_pcm_parakeet (PCM commands superseded by
  live session; no frontend caller)
- close_preview_window (preview window is hidden via the
  core:window:allow-hide capability, not the command)

Cascade in audio.rs (~430 lines removed):
- CaptureWorker, NativeCaptureState struct + impl, stop_worker,
  append_recorded_chunk, MAX_NATIVE_CAPTURE_RETURN_SAMPLES,
  persist_audio_samples
- The two cfg(test) tests that exercised stop_worker (the
  recording_filename tests stay, supporting resolve_recording_path
  which the live session uses)

Cascade elsewhere:
- FeedbackDto struct and its From<FeedbackRow> impl
- Stale storage imports in feedback.rs, profiles.rs, transcripts.rs
- tauri::Emitter import in transcription.rs
- app.manage(NativeCaptureState::new()) in lib.rs setup

generate_handler entries removed for all 11 commands. cargo check passes
cleanly with zero warnings; no tests reference any deleted symbols.

Net: 709 deletions, 17 insertions across 9 files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jars
2026-05-09 16:03:19 +01:00
parent 2a45cb8033
commit b16fc179b3
9 changed files with 17 additions and 709 deletions

View File

@@ -294,7 +294,6 @@ pub fn run() {
app.manage(PreferencesScript(init_script));
app.manage(commands::hotkey::HotkeyState::new());
app.manage(commands::audio::NativeCaptureState::new());
app.manage(commands::live::LiveTranscriptionState::default());
app.manage(commands::tts::TtsState::new());
app.manage(commands::meeting::MeetingState::new());
@@ -323,7 +322,6 @@ pub fn run() {
save_preferences,
// Whisper model management
commands::models::download_model,
commands::models::check_model,
commands::models::list_models,
commands::models::load_model,
commands::models::prewarm_default_model_cmd,
@@ -346,13 +344,8 @@ pub fn run() {
commands::models::load_parakeet_model,
commands::models::check_parakeet_engine,
// Transcription
commands::transcription::transcribe_pcm,
commands::transcription::transcribe_file,
commands::transcription::transcribe_pcm_parakeet,
// Audio
commands::audio::save_audio,
commands::audio::start_native_capture,
commands::audio::stop_native_capture,
commands::audio::list_audio_devices,
// Tasks (canonical SQLite-backed task CRUD)
commands::tasks::create_task_cmd,
@@ -369,7 +362,6 @@ pub fn run() {
commands::tasks::list_recent_completions_cmd,
// HITL feedback (Phase 2 roadmap)
commands::feedback::record_feedback,
commands::feedback::list_feedback_examples_cmd,
// Read aloud (Phase 4 roadmap)
commands::tts::tts_speak,
commands::tts::tts_stop,
@@ -387,7 +379,6 @@ pub fn run() {
commands::intentions::delete_implementation_rule,
// Profiles + profile terms (canonical SQLite-backed profile CRUD) — Task 12
commands::profiles::list_profiles_cmd,
commands::profiles::get_profile_cmd,
commands::profiles::create_profile_cmd,
commands::profiles::update_profile_cmd,
commands::profiles::delete_profile_cmd,
@@ -398,7 +389,6 @@ pub fn run() {
// Transcripts (canonical SQLite-backed history) — Day 4
commands::transcripts::add_transcript,
commands::transcripts::list_transcripts,
commands::transcripts::count_transcripts_command,
commands::transcripts::get_transcript,
commands::transcripts::update_transcript,
commands::transcripts::update_transcript_meta_cmd,
@@ -417,7 +407,6 @@ pub fn run() {
commands::windows::open_task_window,
commands::windows::open_viewer_window,
commands::windows::open_preview_window,
commands::windows::close_preview_window,
// Clipboard
commands::clipboard::copy_to_clipboard,
// Filesystem (Phase 9 save-dialog path)
@@ -441,7 +430,6 @@ pub fn run() {
commands::hotkey::stop_evdev_hotkey,
// Updater
commands::update::check_for_update,
commands::update::install_update,
])
.run(tauri::generate_context!())
.expect("error while running Magnotia");