Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(audio): attach a live recorder when recovering a failed device (#7805)

Ezra Elletteb7ed5eb96bea
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rs b/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rs
index 82dde6a4a..6d6e1e20d 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rs
@@ -856,6 +856,24 @@ mod tests {
assert!(!report.contains("[email protected]"));
}
+ #[tokio::test]
+ async fn audio_recorder_handoff_survives_collection_and_redaction() {
+ let diagnostic = include_str!(
+ "../../../../crates/screenpipe-audio/tests/fixtures/audio-recorder-handoff-diagnostic.txt"
+ );
+ let dir = tempfile::tempdir().unwrap();
+ tokio::fs::write(dir.path().join("screenpipe-app.2026-10-28.log"), diagnostic)
+ .await
+ .unwrap();
+
+ let report = collect_redacted_from_dirs(&[dir.path().to_path_buf()])
+ .await
+ .unwrap();
+ assert!(report.contains("detected stale recording handle"));
+ assert!(report.contains("starting recording for device"));
+ assert!(report.contains("attaching replacement recorder"));
+ }
+
#[cfg(windows)]
#[tokio::test]
async fn settings_access_recovery_survives_rotation_and_redaction_without_private_data() {
diff --git a/crates/screenpipe-audio/src/audio_manager/device_monitor.rs b/crates/screenpipe-audio/src/audio_manager/device_monitor.rs
index 55e773eb8..8278dcd3f 100644
--- a/crates/screenpipe-audio/src/audio_manager/device_monitor.rs
+++ b/crates/screenpipe-audio/src/audio_manager/device_monitor.rs
@@ -1608,22 +1608,23 @@ pub async fn start_device_monitor(
// This handles cases where audio stream was hijacked by another app
let stale_devices = audio_manager.check_stale_recording_handles().await;
let user_disabled_for_stale = audio_manager.user_disabled_devices().await;
- for device_name in stale_devices {
+ for stale in stale_devices {
+ let device_name = &stale.device_name;
// Don't restart user-disabled devices — they're supposed to be stopped
- if user_disabled_for_stale.contains(&device_name) {
+ if user_disabled_for_stale.contains(device_name) {
debug!(
"[DEVICE_RECOVERY] stale handle for user-disabled device {}, cleaning up only",
device_name
);
- let _ = audio_manager.cleanup_stale_device(&device_name).await;
+ let _ = audio_manager.cleanup_stale_device(&stale).await;
continue;
}
warn!(
"[DEVICE_RECOVERY] detected stale recording handle for {}, cleaning up for restart",
device_name
);
- let _ = audio_manager.cleanup_stale_device(&device_name).await;
- disconnected_devices.insert(device_name);
+ let _ = audio_manager.cleanup_stale_device(&stale).await;
+ disconnected_devices.insert(device_name.clone());
}
// Check central handler health (audio-receiver + transcription-receiver)
diff --git a/crates/screenpipe-audio/src/audio_manager/manager.rs b/crates/screenpipe-audio/src/audio_manager/manager.rs
index b69b889c4..bc9e300fe 100644
--- a/crates/screenpipe-audio/src/audio_manager/manager.rs
+++ b/crates/screenpipe-audio/src/audio_manager/manager.rs
@@ -1084,14 +1084,7 @@ impl AudioManager {
return Ok(());
}
- if !self.recording_handles.contains_key(device) {
- if let Some(is_running) = self.device_manager.is_running_mut(device) {
- is_running.store(true, Ordering::Relaxed);
- }
- let handle = self.record_device(device).await?;
- self.recording_handles
- .insert(device.clone(), Arc::new(Mutex::new(handle)));
- }
+ self.ensure_recording_handle(device).await?;
if !self.enabled_devices().await.contains(&device.to_string()) {
self.options
@@ -1245,24 +1238,45 @@ impl AudioManager {
return Err(anyhow!("screen locked while opening {}", device));
}
- if !self.recording_handles.contains_key(device) {
- if let Some(is_running) = self.device_manager.is_running_mut(device) {
- is_running.store(true, Ordering::Relaxed);
- }
- match self.record_device(device).await {
- Ok(handle) => {
- self.recording_handles
- .insert(device.clone(), Arc::new(Mutex::new(handle)));
- }
- Err(e) => {
- self.session_devices
- .write()
- .unwrap()
- .remove(&device.to_string());
- return Err(e);
- }
+ if let Err(e) = self.ensure_recording_handle(device).await {
+ self.session_devices
+ .write()
+ .unwrap()
+ .remove(&device.to_string());
+ return Err(e);
+ }
+ Ok(())
+ }
+
+ /// Attach a recorder to the stream published by `DeviceManager`.
+ ///
+ /// Device recovery can replace a disconnected native stream before the
+ /// monitor has removed its finished recorder. The complete device operation
+ /// is serialized, so hand the map entry over here instead of leaving the
+ /// replacement stream without a consumer until the next monitor tick.
+ async fn ensure_recording_handle(&self, device: &AudioDevice) -> Result<()> {
+ let existing = self
+ .recording_handles
+ .get(device)
+ .map(|entry| entry.value().clone());
+ if let Some(existing) = existing {
+ if !existing.lock().await.is_finished() {
+ return Ok(());
}
+ self.recording_handles
+ .remove_if(device, |_, current| Arc::ptr_eq(current, &existing));
+ info!(
+ "[DEVICE_RECOVERY] attaching replacement recorder for {} after previous recording task finished",
+ device
+ );
+ }
+
+ if let Some(is_running) = self.device_manager.is_running_mut(device) {
+ is_running.store(true, Ordering::Relaxed);
}
+ let handle = self.record_device(device).await?;
+ self.recording_handles
+ .insert(device.clone(), Arc::new(Mutex::new(handle)));
Ok(())
}
@@ -2370,7 +2384,7 @@ impl AudioManager {
/// Check for recording handles that have finished (crashed or timed out)
/// Returns device names that need to be cleaned up and restarted
- pub async fn check_stale_recording_handles(&self) -> Vec<String> {
+ pub(crate) async fn check_stale_recording_handles(&self) -> Vec<StaleRecordingHandle> {
let mut stale_devices = Vec::new();
let session_devices = self.session_devices.read().unwrap().clone();
@@ -2389,7 +2403,10 @@ impl AudioManager {
// Check if the JoinHandle has finished (task completed/crashed)
if handle.lock().await.is_finished() {
- stale_devices.push(device.to_string());
+ stale_devices.push(StaleRecordingHandle {
+ device_name: device.to_string(),
+ handle: handle.clone(),
+ });
}
}
@@ -2480,7 +2497,11 @@ impl AudioManager {
/// Clean up a stale device that had its recording handle crash/timeout
/// This prepares the device for restart by the device monitor
- pub async fn cleanup_stale_device(&self, device_name: &str) -> anyhow::Result<()> {
+ pub(crate) async fn cleanup_stale_device(
+ &self,
+ stale: &StaleRecordingHandle,
+ ) -> anyhow::Result<()> {
+ let device_name = &stale.device_name;
// Defensive: never clean up a session device here. `check_stale_recording_handles`
// already omits them from the stale list (the only caller), but guard the
// public entry point too — only `stop_session_device` may tear these down.
@@ -2496,7 +2517,28 @@ impl AudioManager {
Err(_) => return Err(anyhow!("Device {} not found", device_name)),
};
- self.stop_device_recording(&device).await?;
+ let manager = self.clone();
+ let stale_handle = stale.handle.clone();
+ let target = device.clone();
+ self.device_manager
+ .run_device_operation(&device, async move {
+ let current = manager
+ .recording_handles
+ .get(&target)
+ .map(|entry| entry.value().clone());
+ let Some(current) = current else {
+ return Ok(());
+ };
+ if !Arc::ptr_eq(&current, &stale_handle) || !current.lock().await.is_finished() {
+ debug!(
+ "stale cleanup for {} no longer matches the current recording handle",
+ target
+ );
+ return Ok(());
+ }
+ manager.stop_device_recording_inner(&target).await
+ })
+ .await?;
debug!("cleaned up stale device {} for restart", device_name);
@@ -2504,6 +2546,12 @@ impl AudioManager {
}
}
+#[derive(Clone)]
+pub(crate) struct StaleRecordingHandle {
+ pub(crate) device_name: String,
+ handle: Arc<Mutex<JoinHandle<Result<()>>>>,
+}
+
/// Seed the embedding manager with named speakers from the DB.
/// This allows returning voices to be recognized immediately instead of
/// starting anonymous for the first 30+ seconds.
@@ -2641,6 +2689,7 @@ impl Drop for AudioManager {
mod tests {
use super::*;
use crate::core::device::{AudioDevice, DeviceType};
+ use crate::core::stream::AudioStream;
use std::path::Path;
use std::sync::{
atomic::{AtomicUsize, Ordering},
@@ -2648,6 +2697,88 @@ mod tests {
};
use tokio::sync::{Barrier, Notify, Semaphore};
+ #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+ async fn recovery_hands_replacement_stream_to_live_recorder_and_rejects_stale_cleanup() {
+ let db = Arc::new(
+ DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap(),
+ );
+ let manager = AudioManager::new(
+ AudioManagerOptions {
+ is_disabled: true,
+ audio_chunk_duration: Duration::from_secs(1),
+ ..Default::default()
+ },
+ db,
+ )
+ .await
+ .unwrap();
+ let device = AudioDevice::new("recovery microphone".into(), DeviceType::Input);
+
+ let finished = Arc::new(Mutex::new(tokio::spawn(async { Ok(()) })));
+ manager
+ .recording_handles
+ .insert(device.clone(), finished.clone());
+ while !finished.lock().await.is_finished() {
+ tokio::task::yield_now().await;
+ }
+ let stale = manager.check_stale_recording_handles().await;
+ assert_eq!(stale.len(), 1);
+
+ // Model DeviceManager's completed retry: the disconnected native stream
+ // has already been replaced, but its old finished recorder remains.
+ let (replacement, samples) =
+ AudioStream::from_sender_for_test(Arc::new(device.clone()), 16_000, 1);
+ manager
+ .device_manager
+ .install_stream_for_test(device.clone(), replacement, false);
+ manager.ensure_recording_handle(&device).await.unwrap();
+
+ let live = manager
+ .recording_handles
+ .get(&device)
+ .unwrap()
+ .value()
+ .clone();
+ assert!(!Arc::ptr_eq(&finished, &live));
+ assert!(!live.lock().await.is_finished());
+ while samples.receiver_count() == 0 {
+ tokio::task::yield_now().await;
+ }
+ manager.meeting_audio_tap.set_active(true);
+ let mut live_samples = manager.meeting_audio_tap.subscribe();
+ for _ in 0..170 {
+ samples.send(vec![0.25; 320]).unwrap();
+ }
+ let live_frame = tokio::time::timeout(Duration::from_secs(2), live_samples.recv())
+ .await
+ .expect("replacement recorder must deliver live samples")
+ .unwrap();
+ assert!(!live_frame.samples.is_empty());
+ let delivered = tokio::time::timeout(
+ Duration::from_secs(2),
+ manager.recording_receiver.recv_async(),
+ )
+ .await
+ .expect("replacement recorder must consume samples")
+ .unwrap();
+ assert!(!delivered.data.is_empty());
+
+ manager.cleanup_stale_device(&stale[0]).await.unwrap();
+ let current = manager
+ .recording_handles
+ .get(&device)
+ .unwrap()
+ .value()
+ .clone();
+ assert!(Arc::ptr_eq(&live, &current));
+ assert!(!current.lock().await.is_finished());
+ assert!(manager.device_manager.stream(&device).is_some());
+
+ manager.stop_device_recording(&device).await.unwrap();
+ }
+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn idle_audio_handlers_cancel_and_restart_without_stealing_queued_capture() {
let tmp = tempfile::tempdir().unwrap();
diff --git a/crates/screenpipe-audio/src/device/device_manager.rs b/crates/screenpipe-audio/src/device/device_manager.rs
index 9a8865d4d..009f12bac 100644
--- a/crates/screenpipe-audio/src/device/device_manager.rs
+++ b/crates/screenpipe-audio/src/device/device_manager.rs
@@ -243,6 +243,18 @@ impl DeviceManager {
self.streams.get(device).map(|s| s.value().clone())
}
+ #[cfg(test)]
+ pub(crate) fn install_stream_for_test(
+ &self,
+ device: AudioDevice,
+ stream: AudioStream,
+ is_running: bool,
+ ) {
+ self.streams.insert(device.clone(), Arc::new(stream));
+ self.states
+ .insert(device, Arc::new(AtomicBool::new(is_running)));
+ }
+
pub fn is_running(&self, device: &AudioDevice) -> bool {
self.states
.get(device)
diff --git a/crates/screenpipe-audio/tests/fixtures/audio-recorder-handoff-diagnostic.txt b/crates/screenpipe-audio/tests/fixtures/audio-recorder-handoff-diagnostic.txt
new file mode 100644
index 000000000..a9449d974
--- /dev/null
+++ b/crates/screenpipe-audio/tests/fixtures/audio-recorder-handoff-diagnostic.txt
@@ -0,0 +1,3 @@
+WARN [DEVICE_RECOVERY] detected stale recording handle for Default microphone (input), cleaning up for restart
+INFO starting recording for device: Default microphone (input)
+INFO [DEVICE_RECOVERY] attaching replacement recorder for Default microphone (input) after previous recording task finished
diff --git a/docs/COVERAGE.md b/docs/COVERAGE.md
index 6458c674f..b8bd64bb9 100644
--- a/docs/COVERAGE.md
+++ b/docs/COVERAGE.md
@@ -38,15 +38,15 @@ results and `cargo llvm-cov` data on top when judging release confidence.
- Mapped suites: 37
- Mapped Rust files: 402
-- Active test blocks: 3923
+- Active test blocks: 3927
- Ignored/manual test blocks: 188
-- Weighted coverage points: 3232.1
+- Weighted coverage points: 3235.2
| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| windows | 33 | 3760 | 170 | 3159.1 | 21 | 11 | 100% |
-| macos | 32 | 3803 | 149 | 3154.4 | 22 | 11 | 100% |
-| linux | 29 | 3338 | 145 | 2777.4 | 20 | 11 | 100% |
+| windows | 33 | 3764 | 170 | 3162.2 | 21 | 11 | 100% |
+| macos | 32 | 3807 | 149 | 3157.5 | 22 | 11 | 100% |
+| linux | 29 | 3342 | 145 | 2780.5 | 20 | 11 | 100% |
## Refresh
diff --git a/docs/coverage/CORE.md b/docs/coverage/CORE.md
index d6ff01206..9a6fad3c5 100644
--- a/docs/coverage/CORE.md
+++ b/docs/coverage/CORE.md
@@ -9,10 +9,10 @@ confidence, and criticality.
- Tracked crates: screenpipe-engine, screenpipe-db, screenpipe-sqlite-coordinator, screenpipe-audio, screenpipe-screen, screenpipe-a11y, screenpipe-fs
- Mapped suites: 37
- Mapped Rust files: 402
-- Active test blocks: 3923
+- Active test blocks: 3927
- Ignored/manual test blocks: 188
-- Declared test blocks: 4111
-- Weighted coverage points: 3232.1
+- Declared test blocks: 4115
+- Weighted coverage points: 3235.2
Confidence weights: strong=1.0, partial=0.7, conditional=0.4, smoke=0.3.
Criticality weights: high=1.0, medium=0.7, low=0.4.
@@ -23,18 +23,18 @@ are explicitly enabled in a runtime lane.
| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| windows | 33 | 3760 | 170 | 3159.1 | 21 | 11 | 100% |
-| macos | 32 | 3803 | 149 | 3154.4 | 22 | 11 | 100% |
-| linux | 29 | 3338 | 145 | 2777.4 | 20 | 11 | 100% |
+| windows | 33 | 3764 | 170 | 3162.2 | 21 | 11 | 100% |
+| macos | 32 | 3807 | 149 | 3157.5 | 22 | 11 | 100% |
+| linux | 29 | 3342 | 145 | 2780.5 | 20 | 11 | 100% |
## Crate Summary
| Crate | Suites | Integration files | Source unit files | Active tests | Ignored tests | Weighted points | Flows |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| screenpipe-engine | 12 | 22 | 131 | 1873 | 53 | 1441.8 | 10 |
+| screenpipe-engine | 12 | 22 | 131 | 1876 | 53 | 1443.9 | 10 |
| screenpipe-db | 5 | 69 | 29 | 636 | 32 | 606.4 | 9 |
| screenpipe-sqlite-coordinator | 1 | 0 | 3 | 27 | 0 | 27.0 | 2 |
-| screenpipe-audio | 8 | 29 | 54 | 705 | 56 | 616.0 | 5 |
+| screenpipe-audio | 8 | 29 | 54 | 706 | 56 | 617.0 | 5 |
| screenpipe-screen | 6 | 9 | 19 | 278 | 9 | 246.4 | 4 |
| screenpipe-a11y | 4 | 2 | 34 | 401 | 38 | 291.5 | 3 |
| screenpipe-fs | 1 | 0 | 1 | 3 | 0 | 3.0 | 3 |
@@ -63,26 +63,26 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| Layer | windows | macos | linux |
| --- | --- | --- | --- |
| accessibility | 4 suites / 384 active / 35 ignored / 349.0 pts | 4 suites / 440 active / 14 ignored / 350.7 pts | 4 suites / 342 active / 7 ignored / 314.0 pts |
-| audio | 10 suites / 843 active / 60 ignored / 754.0 pts | 9 suites / 837 active / 60 ignored / 749.8 pts | 8 suites / 758 active / 59 ignored / 694.5 pts |
-| audio-device | 2 suites / 242 active / 10 ignored / 218.3 pts | 2 suites / 242 active / 10 ignored / 218.3 pts | 1 suites / 163 active / 9 ignored / 163.0 pts |
+| audio | 10 suites / 844 active / 60 ignored / 755.0 pts | 9 suites / 838 active / 60 ignored / 750.8 pts | 8 suites / 759 active / 59 ignored / 695.5 pts |
+| audio-device | 2 suites / 243 active / 10 ignored / 219.3 pts | 2 suites / 243 active / 10 ignored / 219.3 pts | 1 suites / 164 active / 9 ignored / 164.0 pts |
| configuration | 2 suites / 153 active / 3 ignored / 138.7 pts | 2 suites / 153 active / 3 ignored / 138.7 pts | 2 suites / 153 active / 3 ignored / 138.7 pts |
| database | 7 suites / 592 active / 28 ignored / 562.4 pts | 7 suites / 592 active / 28 ignored / 562.4 pts | 7 suites / 592 active / 28 ignored / 562.4 pts |
| db-search | 2 suites / 120 active / 9 ignored / 120.0 pts | 2 suites / 120 active / 9 ignored / 120.0 pts | 2 suites / 120 active / 9 ignored / 120.0 pts |
| engine-lifecycle | 6 suites / 274 active / 1 ignored / 244.8 pts | 6 suites / 274 active / 1 ignored / 244.8 pts | 6 suites / 270 active / 9 ignored / 243.9 pts |
| local-api | 3 suites / 491 active / 12 ignored / 347.6 pts | 3 suites / 491 active / 12 ignored / 347.6 pts | 3 suites / 491 active / 12 ignored / 347.6 pts |
-| meeting | 6 suites / 1759 active / 32 ignored / 1438.6 pts | 6 suites / 1759 active / 32 ignored / 1438.6 pts | 4 suites / 1405 active / 28 ignored / 1108.3 pts |
+| meeting | 6 suites / 1762 active / 32 ignored / 1440.7 pts | 6 suites / 1762 active / 32 ignored / 1440.7 pts | 4 suites / 1408 active / 28 ignored / 1110.4 pts |
| ocr | 4 suites / 141 active / 7 ignored / 130.8 pts | 4 suites / 134 active / 7 ignored / 128.6 pts | 3 suites / 125 active / 6 ignored / 119.6 pts |
| os-integration | 1 suites / 6 active / 0 ignored / 1.7 pts | 1 suites / 6 active / 0 ignored / 1.7 pts | - |
-| performance | 13 suites / 1707 active / 86 ignored / 1507.4 pts | 14 suites / 1832 active / 94 ignored / 1557.4 pts | 13 suites / 1707 active / 86 ignored / 1507.4 pts |
-| pipes | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts |
-| privacy | 5 suites / 1013 active / 42 ignored / 816.8 pts | 5 suites / 1069 active / 21 ignored / 818.5 pts | 5 suites / 971 active / 14 ignored / 781.7 pts |
+| performance | 13 suites / 1708 active / 86 ignored / 1508.4 pts | 14 suites / 1833 active / 94 ignored / 1558.4 pts | 13 suites / 1708 active / 86 ignored / 1508.4 pts |
+| pipes | 1 suites / 554 active / 3 ignored / 387.8 pts | 1 suites / 554 active / 3 ignored / 387.8 pts | 1 suites / 554 active / 3 ignored / 387.8 pts |
+| privacy | 5 suites / 1016 active / 42 ignored / 818.9 pts | 5 suites / 1072 active / 21 ignored / 820.6 pts | 5 suites / 974 active / 14 ignored / 783.8 pts |
| real-app | - | 1 suites / 125 active / 8 ignored / 50.0 pts | - |
| speaker | 2 suites / 416 active / 18 ignored / 416.0 pts | 2 suites / 416 active / 18 ignored / 416.0 pts | 2 suites / 416 active / 18 ignored / 416.0 pts |
| storage | 4 suites / 705 active / 41 ignored / 588.0 pts | 4 suites / 705 active / 41 ignored / 588.0 pts | 4 suites / 705 active / 41 ignored / 588.0 pts |
-| sync | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts |
+| sync | 1 suites / 554 active / 3 ignored / 387.8 pts | 1 suites / 554 active / 3 ignored / 387.8 pts | 1 suites / 554 active / 3 ignored / 387.8 pts |
| timeline | 4 suites / 1253 active / 48 ignored / 1029.5 pts | 4 suites / 1253 active / 48 ignored / 1029.5 pts | 4 suites / 1253 active / 48 ignored / 1029.5 pts |
| transcription | 7 suites / 901 active / 53 ignored / 704.3 pts | 6 suites / 895 active / 53 ignored / 700.1 pts | 6 suites / 895 active / 53 ignored / 700.1 pts |
-| ui-events | 4 suites / 828 active / 34 ignored / 627.7 pts | 3 suites / 759 active / 5 ignored / 579.4 pts | 3 suites / 759 active / 5 ignored / 579.4 pts |
+| ui-events | 4 suites / 831 active / 34 ignored / 629.8 pts | 3 suites / 762 active / 5 ignored / 581.5 pts | 3 suites / 762 active / 5 ignored / 581.5 pts |
| vision-capture | 6 suites / 579 active / 32 ignored / 455.3 pts | 6 suites / 572 active / 32 ignored / 453.1 pts | 5 suites / 563 active / 31 ignored / 444.1 pts |
## Critical Flow Matrix
@@ -123,7 +123,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| a11y-linux-tree | screenpipe-a11y | linux | accessibility, privacy | accessibility-ui-events, privacy-and-redaction | medium | partial | unit | 4 | 27 | 1 | Linux-specific accessibility/incognito normalization tests. |
| a11y-macos-tree | screenpipe-a11y | macos | accessibility, privacy, real-app, performance | accessibility-ui-events, privacy-and-redaction, performance-liveness | high | conditional | mixed | 11 | 125 | 8 | macOS AX unit coverage, a scored 100-case click-attribution policy eval, and real TextEdit/Finder/Obsidian probes. Click attribution and Obsidian live tests are ignored by default when they require a logged-in desktop, app install, or AX permission. |
| a11y-windows-tree | screenpipe-a11y | windows | accessibility, privacy, ui-events | accessibility-ui-events, privacy-and-redaction | high | partial | unit | 7 | 69 | 29 | Windows UIA/accessibility parsing and privacy matching; some UIA tests are ignored where they require a live desktop. |
-| audio-device-stream-health | screenpipe-audio | windows, macos, linux | audio-device, audio, performance | audio-device-health, audio-record-transcribe, performance-liveness | high | strong | mixed | 15 | 163 | 9 | Device monitor, device manager, stream buffering, source lag, audio metrics, Bluetooth gap/hallucination regressions, and cross-platform process-tap watchdog counters (process_tap.rs split into src/core/process_tap/ modules). |
+| audio-device-stream-health | screenpipe-audio | windows, macos, linux | audio-device, audio, performance | audio-device-health, audio-record-transcribe, performance-liveness | high | strong | mixed | 15 | 164 | 9 | Device monitor, device manager, stream buffering, source lag, audio metrics, Bluetooth gap/hallucination regressions, and cross-platform process-tap watchdog counters (process_tap.rs split into src/core/process_tap/ modules). |
| audio-meetings-speakers-dedup | screenpipe-audio | windows, macos, linux | audio, meeting, speaker, transcription | audio-record-transcribe, meeting-live-notes, performance-liveness | high | strong | mixed | 28 | 281 | 14 | Meeting streaming config/controller logic, speaker embedding state, cross-device dedupe simulations, and overlap cleanup coverage. |
| audio-min-speech-ratio-gate | screenpipe-audio | windows, macos, linux | audio, transcription | audio-record-transcribe | high | partial | integration | 1 | 1 | 0 | Synthetic VAD input verifies that a minimum speech ratio of one rejects even a fully spoken chunk and emits no segments. Does not exercise physical devices or live model inference. |
| audio-models-filtering | screenpipe-audio | windows, macos, linux | audio, transcription, privacy | audio-record-transcribe, privacy-and-redaction | medium | partial | mixed | 6 | 20 | 10 | Model-download/TLS guards, ONNX startup smoke, and music-versus-speech filtering. |
@@ -143,7 +143,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| engine-focus-os | screenpipe-engine | windows, macos | engine-lifecycle, os-integration | engine-health-lifecycle, performance-liveness | medium | conditional | unit | 3 | 6 | 0 | Platform focus-tracker parsing/helpers. These files are cfg-gated and only execute on their target OS. The separately invoked harness=false tests/native_multi_monitor.rs acceptance is documented in scripts/native-test-fixtures/macos/README.md and is not counted as an automatic Rust test block. |
| engine-linux-keep-awake | screenpipe-engine | linux | engine-lifecycle | engine-health-lifecycle | high | conditional | mixed | 1 | 2 | 8 | Existing isolated-process missing/stalled bus regressions plus ignored live logind inhibitor tests. Live tests require logind and explicit execution. |
| engine-local-api-search-integration | screenpipe-engine | windows, macos, linux | local-api, db-search | local-api-search | high | strong | integration | 1 | 13 | 5 | Active /search route test builds an audio-disabled router, seeds captured-screen-shaped OCR data into an in-memory DB, and asserts the HTTP response and pagination. |
-| engine-meeting-privacy-sync | screenpipe-engine | windows, macos, linux | meeting, privacy, ui-events, pipes, sync | meeting-live-notes, privacy-and-redaction, accessibility-ui-events, performance-liveness | medium | strong | unit | 33 | 551 | 3 | Unit-heavy coverage for privacy filter policy, capture exclusions, UI recorder safety, pipes/live-view/structured-output helpers, sync helpers, and CLI parsing. Meeting detection moved to the engine-meeting-watcher suite. |
+| engine-meeting-privacy-sync | screenpipe-engine | windows, macos, linux | meeting, privacy, ui-events, pipes, sync | meeting-live-notes, privacy-and-redaction, accessibility-ui-events, performance-liveness | medium | strong | unit | 33 | 554 | 3 | Unit-heavy coverage for privacy filter policy, capture exclusions, UI recorder safety, pipes/live-view/structured-output helpers, sync helpers, and CLI parsing. Meeting detection moved to the engine-meeting-watcher suite. |
| engine-meeting-watcher | screenpipe-engine | windows, macos | meeting | meeting-live-notes | high | strong | mixed | 10 | 275 | 3 | Successor of src/meeting_detector.rs and src/meeting_telemetry.rs. Audio-process and UI-scan backend state machines, candidate resolution, shared telemetry, and a scored trajectory eval. ui_scan/macos.rs and ui_scan/windows.rs are cfg-gated and only execute on their target OS; both backends are null on Linux. |
| engine-retention-storage | screenpipe-engine | windows, macos, linux | storage, engine-lifecycle, performance | engine-health-lifecycle, performance-liveness | medium | strong | mixed | 5 | 43 | 0 | Local retention deletion (including lean-mode heavy-text stripping), cloud archive watermarking, atomic state-file replacement, and the low-disk capture monitor. |
| engine-telemetry-observability | screenpipe-engine | windows, macos, linux | engine-lifecycle, performance | engine-health-lifecycle, performance-liveness | medium | strong | unit | 8 | 40 | 0 | PostHog capture gating, telemetry context shaping, piggyback telemetry forwarding, crash-log helpers, resource monitoring, and the recording-coverage reliability metric. |
@@ -198,7 +198,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| a11y-macos-tree | screenpipe-a11y | tests/e2e_obsidian.rs | integration | 0 | 3 | 3 |
| a11y-macos-tree | screenpipe-a11y | tests/e2e_tree_walker.rs | integration | 8 | 0 | 8 |
| audio-device-stream-health | screenpipe-audio | src/audio_manager/device_monitor.rs | source | 44 | 0 | 44 |
-| audio-device-stream-health | screenpipe-audio | src/audio_manager/manager.rs | source | 29 | 1 | 30 |
+| audio-device-stream-health | screenpipe-audio | src/audio_manager/manager.rs | source | 30 | 1 | 31 |
| audio-meetings-speakers-dedup | screenpipe-audio | src/audio_manager/meeting_piggyback.rs | source | 59 | 0 | 59 |
| audio-meetings-speakers-dedup | screenpipe-audio | src/audio_manager/piggyback_listeners.rs | source | 2 | 0 | 2 |
| audio-meetings-speakers-dedup | screenpipe-audio | src/audio_manager/reconciliation.rs | source | 31 | 1 | 32 |
@@ -405,7 +405,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| engine-meeting-privacy-sync | screenpipe-engine | src/cli/view.rs | source | 2 | 0 | 2 |
| engine-meeting-privacy-sync | screenpipe-engine | src/cloud_search.rs | source | 3 | 0 | 3 |
| engine-capture-timeline | screenpipe-engine | src/compaction_encoder.rs | source | 8 | 0 | 8 |
-| engine-meeting-privacy-sync | screenpipe-engine | src/connections_api.rs | source | 96 | 0 | 96 |
+| engine-meeting-privacy-sync | screenpipe-engine | src/connections_api.rs | source | 99 | 0 | 99 |
| engine-telemetry-observability | screenpipe-engine | src/crash_log.rs | source | 4 | 0 | 4 |
| engine-retention-storage | screenpipe-engine | src/disk_pressure.rs | source | 11 | 0 | 11 |
| engine-meeting-privacy-sync | screenpipe-engine | src/drm_detector.rs | source | 19 | 2 | 21 |