diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 93e80370..a41623b0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,7 +24,7 @@ env: jobs: format: name: Format Check - runs-on: self-hosted + runs-on: [self-hosted, macOS] steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 @@ -37,7 +37,7 @@ jobs: quality: name: Clippy + Tests - runs-on: self-hosted + runs-on: [self-hosted, macOS] steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 diff --git a/core/audio/streaming_recorder.rs b/core/audio/streaming_recorder.rs index b8a81f05..d8340d15 100644 --- a/core/audio/streaming_recorder.rs +++ b/core/audio/streaming_recorder.rs @@ -476,6 +476,27 @@ mod tests { crate::config::Config::config_dir().join("transcriptions") } + fn is_terminal_no_speech_artifact(file_name: &str) -> bool { + file_name.contains("no-speech") || file_name.ends_with("_failed.wav") + } + + #[test] + fn terminal_no_speech_artifact_filter_is_name_bounded() { + assert!(is_terminal_no_speech_artifact( + "20260709_120000_no-speech_raw.wav" + )); + assert!(is_terminal_no_speech_artifact( + "20260709_120001_dictation_failed.wav" + )); + assert!(!is_terminal_no_speech_artifact( + "20260709_120002_failed-but-recovered_raw.wav" + )); + assert!(!is_terminal_no_speech_artifact( + "03_algorytm-ma-zlozonosc.wav" + )); + assert!(!is_terminal_no_speech_artifact("dictation_failed.m4a")); + } + fn collect_pairs( root: &Path, date_filter: Option<&str>, @@ -784,6 +805,11 @@ mod tests { for entry in entries.flatten() { let p = entry.path(); if p.extension().and_then(|s| s.to_str()) == Some("wav") { + let fname = p.file_name().unwrap_or_default().to_string_lossy(); + // Terminal failed/no-speech artifacts should not be scored as VAD segmentation misses. + if is_terminal_no_speech_artifact(&fname) { + continue; + } wavs.push(p); if wavs.len() >= 5 { break;