Phase 2 QC found three explicit blockers + a broader sweep needed:
Explicit (QC-named):
- crates/mcp/src/lib.rs:15 — SERVER_NAME public MCP wire identity
- crates/transcription/build.rs:59 — panic message prefix
- crates/llm/tests/content_tags_smoke.rs:7 — docstring -p flag
Swept (string literals + dev env vars + doc comments + test fixtures):
- crates/mcp/src/main.rs — eprintln log prefixes
- src-tauri/src/commands/diagnostics.rs — diagnostic filename + MAGNOTIA_VERSION
- src-tauri/src/commands/audio.rs — recording filename pattern lumotia-<secs>-...wav
- src-tauri/src/commands/fs.rs — test placeholder path
- crates/transcription/src/model_manager.rs — .lumotia-verified marker
- crates/storage/src/database.rs — lumotia-storage-ro-<pid> temp dirs + doc comments
- crates/cloud-providers/src/keystore.rs — LUMOTIA_API_KEY_<PROVIDER> env var
- crates/audio/src/{wav,decode}.rs — lumotia_test_* / lumotia_decode_* test fixtures
- crates/core/src/tuning.rs — LUMOTIA_INFERENCE_THREADS env var
- All MAGNOTIA_LLM_TEST_MODEL / MAGNOTIA_WHISPER_TEST_* env vars
- Doc comments referencing crate names
Excluded (intentional Phase 4/5 scope):
- magnotia_preferences, magnotia_history, magnotia_morning_triage_last_shown
DB setting keys (Phase 5 paths.rs migration)
- magnotia_startup tracing target (Phase 4)
- crates/core/src/paths.rs (Phase 5 wholesale rewrite + migration shim)
cargo build --workspace passes. cargo test --workspace: 330 pass, 0 fail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
54 lines
1.9 KiB
Rust
54 lines
1.9 KiB
Rust
//! Smoke test: whisper-rs 0.16 loads a GGUF model, transcribes silence, and
|
|
//! accepts set_initial_prompt without panicking.
|
|
//!
|
|
//! Runs only when `LUMOTIA_WHISPER_TEST_MODEL` is set to the path of a
|
|
//! ggml/gguf whisper model on disk. Otherwise the test exits quiet.
|
|
|
|
use std::env;
|
|
|
|
#[test]
|
|
fn whisper_rs_smoke_loads_and_transcribes() {
|
|
let model_path = match env::var("LUMOTIA_WHISPER_TEST_MODEL") {
|
|
Ok(p) => p,
|
|
Err(_) => {
|
|
eprintln!("LUMOTIA_WHISPER_TEST_MODEL not set — skipping");
|
|
return;
|
|
}
|
|
};
|
|
|
|
use whisper_rs::{FullParams, SamplingStrategy, WhisperContext, WhisperContextParameters};
|
|
|
|
let ctx = WhisperContext::new_with_params(&model_path, WhisperContextParameters::default())
|
|
.expect("whisper model load");
|
|
|
|
let mut state = ctx.create_state().expect("whisper state");
|
|
|
|
let mut params = FullParams::new(SamplingStrategy::Greedy { best_of: 1 });
|
|
params.set_language(Some("en"));
|
|
params.set_initial_prompt("Wren, CORBEL, ADHD");
|
|
params.set_n_threads(2);
|
|
params.set_print_special(false);
|
|
params.set_print_progress(false);
|
|
params.set_print_realtime(false);
|
|
|
|
// 1 second of silence at 16 kHz.
|
|
let samples = vec![0.0_f32; 16_000];
|
|
|
|
state.full(params, &samples).expect("transcribe");
|
|
|
|
// full_n_segments is infallible in whisper-rs 0.16 — returns c_int.
|
|
let n = state.full_n_segments();
|
|
// Silence may produce zero segments; the test only confirms the pipeline runs.
|
|
assert!(n >= 0, "segment count must be non-negative");
|
|
|
|
// Exercise the segment accessor API we will use in WhisperRsBackend.
|
|
for i in 0..n {
|
|
let seg = state
|
|
.get_segment(i)
|
|
.expect("get_segment returns Some for in-range index");
|
|
let _text: &str = seg.to_str().unwrap_or("");
|
|
let _t0: i64 = seg.start_timestamp();
|
|
let _t1: i64 = seg.end_timestamp();
|
|
}
|
|
}
|