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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(macOS): stop ScreenCaptureKit leaks without forced restart (#6490)
Louis Beaumont6d12203db31e
diff --git a/COVERAGE.md b/COVERAGE.mdindex 85a381bd6..4dcc805b3 100644--- a/COVERAGE.md+++ b/COVERAGE.md@@ -19,28 +19,28 @@ results and `cargo llvm-cov` data on top when judging release confidence.### Tauri E2E- Mapped specs: 117-- Declared test blocks: 337-- Weighted coverage points: 263.7+- Declared test blocks: 338+- Weighted coverage points: 264.7| Platform | Specs | Declared tests | Weighted points | Layers | Features | Critical score || --- | --- | --- | --- | --- | --- | --- |-| windows | 89 | 291 | 237.8 | 15 | 94 | 92% |+| windows | 89 | 292 | 238.8 | 15 | 94 | 92% || macos | 113 | 300 | 234.5 | 17 | 100 | 90% || linux | 79 | 251 | 208.5 | 14 | 90 | 88% |### Core Engine- Mapped suites: 32-- Mapped Rust files: 327-- Active test blocks: 3175+- Mapped Rust files: 330+- Active test blocks: 3186- Ignored/manual test blocks: 137-- Weighted coverage points: 2606.2+- Weighted coverage points: 2613.9| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 29 | 3036 | 132 | 2542.8 | 21 | 11 | 100% |-| macos | 29 | 3094 | 112 | 2555.2 | 22 | 11 | 100% |-| linux | 25 | 2710 | 105 | 2246.1 | 20 | 11 | 100% |+| windows | 29 | 3047 | 132 | 2550.5 | 21 | 11 | 100% |+| macos | 29 | 3105 | 112 | 2562.9 | 22 | 11 | 100% |+| linux | 25 | 2721 | 105 | 2253.8 | 20 | 11 | 100% |## Refreshdiff --git a/Cargo.lock b/Cargo.lockindex 0fe377342..85ccedbac 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -8230,7 +8230,7 @@ dependencies = [[[package]]name = "sck-rs"version = "0.1.0"-source = "git+https://github.com/screenpipe/sck-rs?rev=8f0c74ef35737463c9c05fcdff375633dc143788#8f0c74ef35737463c9c05fcdff375633dc143788"+source = "git+https://github.com/screenpipe/sck-rs?rev=b372bd25e9164b45331a290ce4f3f9801bf506f3#b372bd25e9164b45331a290ce4f3f9801bf506f3"dependencies = ["cidre 0.16.1 (git+https://github.com/yury/cidre.git?rev=9c20f5ee5abaad4598843a33e13d6e48822d1f30)","image",diff --git a/apps/screenpipe-app-tauri/app/shortcut-reminder/page.test.tsx b/apps/screenpipe-app-tauri/app/shortcut-reminder/page.test.tsxindex c612d2655..20c6547c4 100644--- a/apps/screenpipe-app-tauri/app/shortcut-reminder/page.test.tsx+++ b/apps/screenpipe-app-tauri/app/shortcut-reminder/page.test.tsx@@ -16,6 +16,7 @@ import { formatShortcut } from "./format-shortcut";const mocks = vi.hoisted(() => ({getRecordingHealthState: vi.fn(),+ overlayRestartRecording: vi.fn(),listen: vi.fn(),storeGet: vi.fn(),storeSet: vi.fn(),@@ -116,7 +117,7 @@ vi.mock("@/lib/hooks/use-settings", () => ({vi.mock("@/lib/utils/tauri", () => ({commands: {getRecordingHealthState: mocks.getRecordingHealthState,- overlayRestartRecording: vi.fn(),+ overlayRestartRecording: mocks.overlayRestartRecording,overlayDismissIncident: vi.fn(),hideShortcutReminder: mocks.hideShortcutReminder,snoozeShortcutReminderForHour: mocks.snoozeShortcutReminderForHour,@@ -155,6 +156,7 @@ describe("recording health hover detail", () => {mocks.meetingOverlayState.stopping = false;mocks.meetingOverlayState.stopError = null;mocks.stopMeeting.mockReset();+ mocks.overlayRestartRecording.mockReset();mocks.storeSet.mockReset();mocks.hideShortcutReminder.mockReset();mocks.snoozeShortcutReminderForHour.mockReset();@@ -181,6 +183,39 @@ describe("recording health hover detail", () => {);});+ it("keeps terminal native recovery advisory and never invokes a restart action", async () => {+ mocks.getRecordingHealthState.mockResolvedValue(+ "failure|quit and reopen screenpipe to restore screen capture|screen|manual-reopen",+ );++ render(<ShortcutReminderPage />);++ const failureButton = await screen.findByRole("button", {+ name: "Screen capture needs help: quit and reopen screenpipe to restore screen capture",+ });+ expect(failureButton).toBeDisabled();+ expect(screen.getByText("quit & reopen")).toBeVisible();++ fireEvent.click(failureButton);+ expect(mocks.overlayRestartRecording).not.toHaveBeenCalled();+ expect(screen.queryByRole("button", { name: /restart recording/i })).toBeNull();+ });++ it("does not infer recovery behavior from user-facing wording", async () => {+ mocks.getRecordingHealthState.mockResolvedValue(+ "failure|quit and reopen screenpipe wording without an action|screen",+ );++ render(<ShortcutReminderPage />);++ const failureButton = await screen.findByRole("button", {+ name: /restart recording/i,+ });+ expect(failureButton).toBeEnabled();+ fireEvent.click(failureButton);+ await waitFor(() => expect(mocks.overlayRestartRecording).toHaveBeenCalledTimes(1));+ });+it("shows recovery confirmation instead of a broken or restart state", async () => {mocks.getRecordingHealthState.mockResolvedValue("recovering|screen capture is not updating|screen",diff --git a/apps/screenpipe-app-tauri/app/shortcut-reminder/page.tsx b/apps/screenpipe-app-tauri/app/shortcut-reminder/page.tsxindex dc72de747..28d9dfc58 100644--- a/apps/screenpipe-app-tauri/app/shortcut-reminder/page.tsx+++ b/apps/screenpipe-app-tauri/app/shortcut-reminder/page.tsx@@ -19,6 +19,7 @@ import {PanelLeft,Pin,PinOff,+ Power,RotateCw,Search,Square,@@ -78,6 +79,9 @@ export default function ShortcutReminderPage() {// "audio" | "screen" | "" — empty when the cause spans subsystems or could// not be attributed, which keeps the pill on its generic wording (#6126).const [healthSubsystem, setHealthSubsystem] = useState("");+ // Explicit wire behavior. Never infer whether a click is safe from the+ // human-readable detail string.+ const [healthAction, setHealthAction] = useState("");const [overlayShortcut, setOverlayShortcut] = useState<string | null>(null);const [chatShortcut, setChatShortcut] = useState<string | null>(null);const [searchShortcut, setSearchShortcut] = useState<string | null>(null);@@ -244,14 +248,14 @@ export default function ShortcutReminderPage() {// current via the event.useEffect(() => {let mounted = true;- // Payload is "state", "state|detail", or "state|detail|subsystem" —- // detail is a failure reason (or the boot phase label while fixing), and- // subsystem names what failed when the engine could attribute it to one.+ // Payload is "state", "state|detail", "state|detail|subsystem", or the+ // same with an explicit fourth action field.const apply = (payload: string) => {- const [state, detail = "", subsystem = ""] = payload.split("|");+ const [state, detail = "", subsystem = "", action = ""] = payload.split("|");setHealthState(state as RecordingHealthState);setHealthDetail(detail);setHealthSubsystem(subsystem);+ setHealthAction(action);};commands.getRecordingHealthState()@@ -452,6 +456,7 @@ export default function ShortcutReminderPage() {const smIconPx = 10 * overlayScale;const dotPx = Math.max(5 * overlayScale, 5);const failureReason = healthDetail || "recording stopped unexpectedly";+ const manualRecoveryRequired = healthAction === "manual-reopen";// Name the subsystem the engine identified. Anything else — both failed, a// persistence error, an unattributable stop — keeps the generic wording.// Must stay in sync with `healthHeadline` in@@ -499,16 +504,20 @@ export default function ShortcutReminderPage() {className="select-none w-full h-full border border-red-500/40 flex flex-col"style={{ background: "rgba(0, 0, 0, 0.88)", cursor: "grab" }}>- {/* The message row itself restarts — users click the thing that- says "recording needs help" expecting the fix. */}+ {/* The message row itself restarts recoverable failures. A terminal+ native failure is advisory only: never turn a health signal into+ an app-exit action. */}<buttononClick={handleRestartRecording}+ disabled={manualRecoveryRequired}onMouseDown={(e) => e.stopPropagation()}onPointerDown={(e) => e.stopPropagation()}- className="flex items-center justify-center flex-1 min-h-0 hover:bg-white/10 transition-colors cursor-pointer"+ className={`flex items-center justify-center flex-1 min-h-0 transition-colors ${manualRecoveryRequired ? "cursor-default" : "hover:bg-white/10 cursor-pointer"}`}style={{ gap: `${gap * 2}px`, padding: `${padY}px ${padX}px`, WebkitAppRegion: 'no-drag' } as React.CSSProperties}title={failureReason}- aria-label={`${failureHeadlineSentence}: ${failureReason}. Restart recording`}+ aria-label={manualRecoveryRequired+ ? `${failureHeadlineSentence}: ${failureReason}`+ : `${failureHeadlineSentence}: ${failureReason}. Restart recording`}><divclassName="rounded-full bg-red-500 animate-pulse shrink-0"@@ -523,19 +532,32 @@ export default function ShortcutReminderPage() {</button><div className="bg-white/15" style={{ height: "1px" }} /><div className="flex items-stretch justify-center flex-1 min-h-0">- <button- onClick={handleRestartRecording}- onMouseDown={(e) => e.stopPropagation()}- onPointerDown={(e) => e.stopPropagation()}- className="flex items-center justify-center hover:bg-white/10 transition-colors cursor-pointer text-white/90 flex-1"- style={{ gap: `${gap}px`, WebkitAppRegion: 'no-drag' } as React.CSSProperties}- title={`Restart recording — ${failureReason}`}- >- <RotateCw style={{ width: `${smIconPx}px`, height: `${smIconPx}px` }} className="shrink-0" />- <span className="font-mono font-bold" style={{ fontSize: `${fontPx}px` }}>- restart- </span>- </button>+ {manualRecoveryRequired ? (+ <div+ className="flex items-center justify-center text-white/90 flex-1"+ style={{ gap: `${gap}px` }}+ title={failureReason}+ >+ <Power style={{ width: `${smIconPx}px`, height: `${smIconPx}px` }} className="shrink-0" />+ <span className="font-mono font-bold" style={{ fontSize: `${fontPx}px` }}>+ quit & reopen+ </span>+ </div>+ ) : (+ <button+ onClick={handleRestartRecording}+ onMouseDown={(e) => e.stopPropagation()}+ onPointerDown={(e) => e.stopPropagation()}+ className="flex items-center justify-center hover:bg-white/10 transition-colors cursor-pointer text-white/90 flex-1"+ style={{ gap: `${gap}px`, WebkitAppRegion: 'no-drag' } as React.CSSProperties}+ title={`Restart recording — ${failureReason}`}+ >+ <RotateCw style={{ width: `${smIconPx}px`, height: `${smIconPx}px` }} className="shrink-0" />+ <span className="font-mono font-bold" style={{ fontSize: `${fontPx}px` }}>+ restart+ </span>+ </button>+ )}<div className="bg-white/15" style={{ width: "1px" }} /><buttononClick={handleDismissIncident}diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 25ec1eb3b..8f5a2dbe4 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -11083,7 +11083,7 @@ dependencies = [[[package]]name = "sck-rs"version = "0.1.0"-source = "git+https://github.com/screenpipe/sck-rs?rev=8f0c74ef35737463c9c05fcdff375633dc143788#8f0c74ef35737463c9c05fcdff375633dc143788"+source = "git+https://github.com/screenpipe/sck-rs?rev=b372bd25e9164b45331a290ce4f3f9801bf506f3#b372bd25e9164b45331a290ce4f3f9801bf506f3"dependencies = ["cidre 0.16.1 (git+https://github.com/yury/cidre.git?rev=9c20f5ee5abaad4598843a33e13d6e48822d1f30)","image 0.25.10",diff --git a/apps/screenpipe-app-tauri/src-tauri/src/health.rs b/apps/screenpipe-app-tauri/src-tauri/src/health.rsindex 87331d29b..75b5275c5 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/health.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/health.rs@@ -578,6 +578,10 @@ struct CaptureFailureSignals {audio: bool,vision: bool,persistence: bool,+ /// ScreenCaptureKit exhausted its process-wide native worker budget.+ /// Fallback frames may still arrive, but a recorder-only restart cannot+ /// release workers whose native callbacks remain blocked.+ vision_process_exhausted: bool,}fn capture_failure_signals(@@ -621,6 +625,7 @@ fn capture_failure_signals(persistence: health.write_queue_degraded&& (health.write_queue_consecutive_fatal >= WRITE_QUEUE_FAILURE_THRESHOLD|| health.write_queue_consecutive_contention >= WRITE_QUEUE_FAILURE_THRESHOLD),+ vision_process_exhausted: false,}}@@ -737,6 +742,9 @@ fn overlay_failure_detail(if simulated_break {return "simulated recording failure";}+ if failures.vision_process_exhausted {+ return crate::overlay_health::MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL;+ }match (failures.audio, failures.vision, failures.persistence) {(true, true, false) => "audio and screen capture are not updating",@@ -766,6 +774,8 @@ pub(crate) fn overlay_failure_subsystem(detail: &str) -> &'static str {match detail {"audio capture is not updating" => "audio","screen capture is not updating" => "screen",+ crate::overlay_health::MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL+ | crate::overlay_health::MANUAL_PERMISSION_RECOVERY_DETAIL => "screen",// "audio and screen capture are not updating", "multiple recording// errors detected", persistence, engine start/stop, simulated breaks,// and anything unrecognized stay generic on purpose.@@ -791,7 +801,10 @@ fn overlay_tick_decision(&& !recently_woke&& (status == RecordingStatus::Error|| (status == RecordingStatus::Stopped && ever_connected));- let confirmed_failure = failures.audio || failures.vision || failures.persistence;+ let confirmed_failure = failures.audio+ || failures.vision+ || failures.persistence+ || failures.vision_process_exhausted;let failure_suppressed = start_in_progress || recently_woke || intentionally_paused;let broken = simulated_break || (!failure_suppressed && (engine_down || confirmed_failure));let healthy = !intentionally_paused@@ -1754,13 +1767,17 @@ pub async fn start_health_check(app: tauri::AppHandle) -> Result<()> {let in_restart_grace = last_restart_triggered.map(|t| t.elapsed() < NOTIFICATION_COOLDOWN).unwrap_or(false);- let failure_signals = match &health_result {+ let mut failure_signals = match &health_result {Ok(health) => capture_failure_signals(health, &mut vision_progress),Err(_) => {vision_progress.observe(None);CaptureFailureSignals::default()}};+ // Native SCK process state is authoritative even when `/health`+ // is unavailable or a CoreGraphics fallback makes it look green.+ failure_signals.vision_process_exhausted =+ screenpipe_screen::screencapturekit_process_exhausted();let capture_health_confirmed = match &health_result {Ok(health) => health_confirms_recording(health),Err(_) => false,@@ -1989,6 +2006,7 @@ pub async fn start_health_check(app: tauri::AppHandle) -> Result<()> {audio: stall_confirmed(consecutive_audio_stall),vision: stall_confirmed(consecutive_vision_stall) || stale_tier.confirmed(),persistence: failure_signals.persistence,+ vision_process_exhausted: failure_signals.vision_process_exhausted,},sim_break,);@@ -2893,6 +2911,39 @@ mod tests {);}+ /// Escaped regression: the native SCK breaker hit its hard 32-worker+ /// ceiling, then CoreGraphics returned a fallback frame and `/health`+ /// looked green long enough for the overlay to claim recovery. Native+ /// process state must outrank fresh fallback data.+ #[test]+ fn terminal_sck_worker_leak_cannot_be_masked_by_green_health() {+ let decision = overlay_tick_decision(+ RecordingStatus::Recording,+ true,+ true,+ true,+ false,+ true,+ false,+ false,+ CaptureFailureSignals {+ vision_process_exhausted: true,+ ..CaptureFailureSignals::default()+ },+ false,+ );++ assert_eq!(+ decision,+ OverlayTickDecision {+ broken: true,+ healthy: false,+ failure_detail: crate::overlay_health::MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL,+ }+ );+ assert_eq!(overlay_failure_subsystem(decision.failure_detail), "screen");+ }+#[test]fn overlay_preserves_real_failure_and_transient_guards() {let failures = CaptureFailureSignals {@@ -2981,6 +3032,15 @@ mod tests {false,"screen capture is not updating",),+ (+ RecordingStatus::Recording,+ CaptureFailureSignals {+ vision_process_exhausted: true,+ ..CaptureFailureSignals::default()+ },+ false,+ crate::overlay_health::MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL,+ ),(RecordingStatus::Recording,CaptureFailureSignals {@@ -3098,6 +3158,7 @@ mod tests {audio,vision,persistence,+ vision_process_exhausted: false,},simulated,);@@ -3129,7 +3190,7 @@ mod tests {}#[test]- fn overlay_decision_exhaustively_checks_12288_state_combinations() {+ fn overlay_decision_exhaustively_checks_24576_state_combinations() {let statuses = [RecordingStatus::Starting,RecordingStatus::Recording,@@ -3140,11 +3201,11 @@ mod tests {];let mut checked = 0usize;- // Eleven independent booleans x six recording states. This covers- // 12,288 combinations of response quality, capture intent, lifecycle- // guards, three failure classes, and the QA simulation path.+ // Twelve independent booleans x six recording states. This covers+ // 24,576 combinations of response quality, capture intent, lifecycle+ // guards, four failure classes, and the QA simulation path.for status in statuses {- for bits in 0u16..(1 << 11) {+ for bits in 0u16..(1 << 12) {let health_response_received = bits & (1 << 0) != 0;let health_confirmed = bits & (1 << 1) != 0;let capture_intended = bits & (1 << 2) != 0;@@ -3157,8 +3218,9 @@ mod tests {audio: bits & (1 << 7) != 0,vision: bits & (1 << 8) != 0,persistence: bits & (1 << 9) != 0,+ vision_process_exhausted: bits & (1 << 10) != 0,};- let simulated_break = bits & (1 << 10) != 0;+ let simulated_break = bits & (1 << 11) != 0;let decision = overlay_tick_decision(status,@@ -3174,7 +3236,10 @@ mod tests {);let failure_suppressed = start_in_progress || recently_woke || intentionally_paused;- let confirmed_failure = failures.audio || failures.vision || failures.persistence;+ let confirmed_failure = failures.audio+ || failures.vision+ || failures.persistence+ || failures.vision_process_exhausted;let engine_down = capture_intended&& !start_in_progress&& !recently_woke@@ -3198,7 +3263,7 @@ mod tests {},};- assert_eq!(decision, expected, "status={status:?}, bits={bits:011b}");+ assert_eq!(decision, expected, "status={status:?}, bits={bits:012b}");assert!(!(decision.broken && decision.healthy),"failure and recovery must be mutually exclusive"@@ -3216,7 +3281,7 @@ mod tests {}}- assert_eq!(checked, 12_288);+ assert_eq!(checked, 24_576);}// Helper: call decide_status with thresholds exceeded (no debouncing active)diff --git a/apps/screenpipe-app-tauri/src-tauri/src/overlay_health.rs b/apps/screenpipe-app-tauri/src-tauri/src/overlay_health.rsindex d72f2e6ac..3c917e70f 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/overlay_health.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/overlay_health.rs@@ -37,10 +37,32 @@ const FIXING_CONFIRM_TICKS: u32 = 2;const PASSIVE_RECOVERY_CONFIRM_TICKS: u32 = 90;/// A user-triggered recovery must never remain in `fixing` forever while a/// checked-out SQLite connection prevents graceful pool close. Past this-/// bound, a process relaunch is the only safe way to prove every connection is-/// gone before recording resumes.+/// bound, keep the app running and ask the user to quit and reopen it manually.const USER_RESTART_TEARDOWN_TIMEOUT: Duration = Duration::from_secs(15);+pub(crate) const MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL: &str =+ "quit and reopen screenpipe to restore screen capture";+const MANUAL_RECORDING_RECOVERY_DETAIL: &str = "quit and reopen screenpipe to recover recording";+pub(crate) const MANUAL_PERMISSION_RECOVERY_DETAIL: &str =+ "quit and reopen screenpipe to finish screen recording access";+const MANUAL_RECOVERY_ACTION: &str = "manual-reopen";++fn manual_recovery_detail(detail: &str) -> Option<&'static str> {+ match detail {+ MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL => Some(MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL),+ MANUAL_RECORDING_RECOVERY_DETAIL => Some(MANUAL_RECORDING_RECOVERY_DETAIL),+ MANUAL_PERMISSION_RECOVERY_DETAIL => Some(MANUAL_PERMISSION_RECOVERY_DETAIL),+ _ => None,+ }+}++fn pending_manual_recovery_detail() -> Option<&'static str> {+ let inner = INNER.lock().ok()?;+ (inner.state == OverlayHealthState::Failure)+ .then(|| manual_recovery_detail(&inner.last_detail))+ .flatten()+}+fn passive_recovery_confirm_ticks() -> u32 {if crate::stale_tier::capture_loop_silent_e2e_started() {3@@ -489,20 +511,33 @@ fn mark_capture_recovery_e2e() {#[cfg(not(all(debug_assertions, feature = "e2e")))]fn mark_capture_recovery_e2e() {}-/// Wire format for both overlay surfaces: `state`, `state|detail`, or-/// `state|detail|subsystem`.+/// Wire format for both overlay surfaces: `state`, `state|detail`,+/// `state|detail|subsystem`, or `state|detail|subsystem|action`.////// The subsystem is appended rather than inlined so the pill can name what/// actually failed (#6126) while `detail` keeps its existing meaning and/// position. It is only present for a failure the engine could attribute to a/// single subsystem; both renderers fall back to the generic wording without-/// it. Neither field ever contains a `|`, so a fixed 3-way split is exact.+/// it. Manual recovery adds an explicit action field so neither renderer+/// infers behavior from user-facing English. No field contains a `|`.pub(crate) fn build_health_payload(state: OverlayHealthState, detail: Option<&str>) -> String {let detail = detail.unwrap_or("");if detail.is_empty() {return state.as_str().to_string();}- match crate::health::overlay_failure_subsystem(detail) {+ let subsystem = crate::health::overlay_failure_subsystem(detail);+ let manual_recovery =+ state == OverlayHealthState::Failure && manual_recovery_detail(detail).is_some();+ if manual_recovery {+ return format!(+ "{}|{}|{}|{}",+ state.as_str(),+ detail,+ subsystem,+ MANUAL_RECOVERY_ACTION+ );+ }+ match subsystem {"" => format!("{}|{}", state.as_str(), detail),subsystem => format!("{}|{}|{}", state.as_str(), detail, subsystem),}@@ -679,6 +714,28 @@ async fn reveal_overlay_if_hidden(app: &tauri::AppHandle) {/// platforms run the identical sequence, and the health loop — not this/// function — confirms the recovery.pub async fn restart_recording(app: tauri::AppHandle) {+ // A recorder-only restart cannot release leaked process-wide native+ // workers. More importantly, this health path must never terminate the app:+ // it may interrupt unrelated user work and its terminal classification is+ // deliberately conservative. Keep the current process alive and leave the+ // final quit/reopen decision to the user.+ let process_exhausted = screenpipe_screen::screencapturekit_process_exhausted();+ let pending_manual_detail = pending_manual_recovery_detail();+ if restart_preflight_action(process_exhausted, pending_manual_detail.is_some())+ == RestartPreflightAction::ShowManualRecovery+ {+ let detail = if process_exhausted {+ MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL+ } else {+ pending_manual_detail.unwrap_or(MANUAL_RECORDING_RECOVERY_DETAIL)+ };+ warn!(+ "overlay health: manual-only recovery is still active; refusing recorder restart and keeping app running"+ );+ show_manual_recovery_failure(&app, detail);+ return;+ }+{let Ok(mut inner) = INNER.lock() else { return };if !begin_fixing(&mut inner, Instant::now()) {@@ -697,25 +754,34 @@ pub async fn restart_recording(app: tauri::AppHandle) {crate::recording::stop_screenpipe(app.state(), app.clone()),).await;- if recording_restart_action(&teardown) == RecordingRestartAction::RelaunchApp {- match teardown {- crate::recording::TeardownOutcome::Failed(error) => warn!(- "overlay health: stop before restart failed ({error}); relaunching app"- ),+ if recording_restart_action(&teardown) == RecordingRestartAction::KeepAppRunningWithFailure {+ match &teardown {+ crate::recording::TeardownOutcome::Failed(error) => {+ warn!(+ "overlay health: stop before restart failed ({error}); keeping app running for manual recovery"+ )+ }crate::recording::TeardownOutcome::TimedOut => warn!(- "overlay health: stop before restart exceeded {:?}; relaunching app",+ "overlay health: stop before restart exceeded {:?}; keeping app running for manual recovery",USER_RESTART_TEARDOWN_TIMEOUT),crate::recording::TeardownOutcome::Completed => unreachable!(),}- crate::process_exit::request_app_relaunch(- app,- "recording recovery teardown did not complete",- Duration::from_millis(250),- );+ show_manual_recovery_failure(&app, MANUAL_RECORDING_RECOVERY_DETAIL);return;}tokio::time::sleep(Duration::from_secs(2)).await;+ // A bounded native call can finish after recorder teardown and change the+ // process-wide status while we wait for macOS resources to settle. Re-check+ // immediately before spawning so that late terminal evidence cannot race+ // us into an in-process restart that ScreenCaptureKit cannot recover from.+ if screenpipe_screen::screencapturekit_process_exhausted() {+ warn!(+ "overlay health: ScreenCaptureKit process worker ceiling reached during recorder restart; keeping app running for manual recovery"+ );+ show_manual_recovery_failure(&app, MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL);+ return;+ }if let Err(e) = crate::recording::spawn_screenpipe(app.state(), app.clone(), None).await {warn!("overlay health: spawn during restart failed: {}", e);let detail = restart_failure_detail(&e);@@ -727,10 +793,18 @@ pub async fn restart_recording(app: tauri::AppHandle) {}}+fn show_manual_recovery_failure(app: &tauri::AppHandle, detail: &'static str) {+ if let Ok(mut inner) = INNER.lock() {+ fixing_failed(&mut inner);+ inner.last_detail = detail.to_string();+ }+ push_state(app, OverlayHealthState::Failure, Some(detail));+}+fn restart_failure_detail(error: &str) -> &'static str {let error = error.to_ascii_lowercase();if error.contains("screen recording permission was granted") {- "restart screenpipe to finish screen recording access"+ MANUAL_PERMISSION_RECOVERY_DETAIL} else if error.contains("screen recording permission") {"screen recording permission is required"} else if error.contains("server not") {@@ -744,25 +818,40 @@ fn is_specific_permission_restart_detail(detail: &str) -> bool {matches!(detail,"screen recording permission is required"- | "restart screenpipe to finish screen recording access"+ | MANUAL_PERMISSION_RECOVERY_DETAIL)}+#[derive(Debug, PartialEq, Eq)]+enum RestartPreflightAction {+ RestartRecorder,+ ShowManualRecovery,+}++fn restart_preflight_action(+ process_exhausted: bool,+ manual_recovery_pending: bool,+) -> RestartPreflightAction {+ if process_exhausted || manual_recovery_pending {+ RestartPreflightAction::ShowManualRecovery+ } else {+ RestartPreflightAction::RestartRecorder+ }+}+#[derive(Debug, PartialEq, Eq)]enum RecordingRestartAction {SpawnInProcess,- RelaunchApp,+ KeepAppRunningWithFailure,}-fn recording_restart_action(- outcome: &crate::recording::TeardownOutcome,-) -> RecordingRestartAction {+fn recording_restart_action(outcome: &crate::recording::TeardownOutcome) -> RecordingRestartAction {match outcome {- crate::recording::TeardownOutcome::Completed => {- RecordingRestartAction::SpawnInProcess- }+ crate::recording::TeardownOutcome::Completed => RecordingRestartAction::SpawnInProcess,crate::recording::TeardownOutcome::Failed(_)- | crate::recording::TeardownOutcome::TimedOut => RecordingRestartAction::RelaunchApp,+ | crate::recording::TeardownOutcome::TimedOut => {+ RecordingRestartAction::KeepAppRunningWithFailure+ }}}@@ -835,6 +924,31 @@ mod tests {);}+ #[test]+ fn manual_recovery_is_an_explicit_wire_action() {+ assert_eq!(+ build_health_payload(+ OverlayHealthState::Failure,+ Some(MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL),+ ),+ "failure|quit and reopen screenpipe to restore screen capture|screen|manual-reopen",+ );+ assert_eq!(+ build_health_payload(+ OverlayHealthState::Failure,+ Some(MANUAL_RECORDING_RECOVERY_DETAIL),+ ),+ "failure|quit and reopen screenpipe to recover recording||manual-reopen",+ );+ assert_eq!(+ build_health_payload(+ OverlayHealthState::Failure,+ Some(MANUAL_PERMISSION_RECOVERY_DETAIL),+ ),+ "failure|quit and reopen screenpipe to finish screen recording access|screen|manual-reopen",+ );+ }+/// An unattributable failure keeps the two-field shape, so the renderers/// fall back to the generic wording rather than inventing a subsystem.#[test]@@ -868,13 +982,16 @@ mod tests {}}- /// The renderers split on `|` into at most three parts, so no field may- /// contain one — otherwise the subsystem would absorb part of the reason.+ /// The renderers split on `|` into at most four parts, so no field may+ /// contain one — otherwise a later field would absorb part of the reason.#[test]fn no_payload_field_contains_the_separator() {for detail in ["audio capture is not updating","screen capture is not updating",+ MANUAL_SCREEN_CAPTURE_RECOVERY_DETAIL,+ MANUAL_RECORDING_RECOVERY_DETAIL,+ MANUAL_PERMISSION_RECOVERY_DETAIL,"audio and screen capture are not updating","multiple recording errors detected","recording data cannot be saved",@@ -883,17 +1000,16 @@ mod tests {"recording engine stopped","recording stopped unexpectedly","recording did not restart",- "restart screenpipe to finish screen recording access","screen recording permission is required","simulated recording failure","updating database",] {let payload = build_health_payload(OverlayHealthState::Failure, Some(detail));assert!(- payload.matches('|').count() <= 2,- "{payload:?} would not parse into state/detail/subsystem",+ payload.matches('|').count() <= 3,+ "{payload:?} would not parse into state/detail/subsystem/action",);- let parts: Vec<&str> = payload.splitn(3, '|').collect();+ let parts: Vec<&str> = payload.splitn(4, '|').collect();assert_eq!(parts[1], detail, "detail must survive the round trip");}}@@ -913,18 +1029,33 @@ mod tests {}#[test]- fn user_restart_relaunches_when_teardown_cannot_prove_pools_closed() {+ fn user_restart_never_relaunches_the_app() {+ assert_eq!(+ restart_preflight_action(false, false),+ RestartPreflightAction::RestartRecorder+ );+ assert_eq!(+ restart_preflight_action(true, false),+ RestartPreflightAction::ShowManualRecovery,+ "terminal native evidence must remain advisory"+ );+ assert_eq!(+ restart_preflight_action(false, true),+ RestartPreflightAction::ShowManualRecovery,+ "a stale or malformed UI must not bypass a manual-only incident"+ );assert_eq!(recording_restart_action(&TeardownOutcome::Completed),RecordingRestartAction::SpawnInProcess);assert_eq!(recording_restart_action(&TeardownOutcome::TimedOut),- RecordingRestartAction::RelaunchApp+ RecordingRestartAction::KeepAppRunningWithFailure);+ let failed = TeardownOutcome::Failed("pool closed".to_string());assert_eq!(- recording_restart_action(&TeardownOutcome::Failed("pool closed".to_string())),- RecordingRestartAction::RelaunchApp+ recording_restart_action(&failed),+ RecordingRestartAction::KeepAppRunningWithFailure);}@@ -934,7 +1065,7 @@ mod tests {restart_failure_detail("Screen recording permission was granted, but Screenpipe must restart before it can be used."),- "restart screenpipe to finish screen recording access"+ MANUAL_PERMISSION_RECOVERY_DETAIL);assert_eq!(restart_failure_detail("Screen recording permission required"),diff --git a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swiftindex d02486f9f..c3bb8086a 100644--- a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift+++ b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift@@ -74,22 +74,22 @@ public func shortcutSetMeetingStopResult(_ succeeded: Int32) {/// Recording-health state pushed from the Rust health loop (issue #5127):/// "normal" | "failure" | "recovering" | "fixing" | "recovered", optionally-/// "state|detail" or "state|detail|subsystem" where detail is a concise-/// failure reason (or a boot-phase label while fixing) and subsystem is-/// "audio" or "screen" when the engine could attribute the failure to one-/// (#6126).+/// "state|detail", "state|detail|subsystem", or a fourth explicit action+/// field. Detail is a concise failure reason (or a boot-phase label while+/// fixing), and subsystem is "audio" or "screen" when attributable (#6126)./// Swift only renders it — all detection/debounce/recovery logic lives in Rust.@_cdecl("shortcut_set_health_state")public func shortcutSetHealthState(_ statePtr: UnsafePointer<CChar>?) -> Int32 {guard let statePtr = statePtr else { return -1 }let payload = String(cString: statePtr)- let parts = payload.split(separator: "|", maxSplits: 2).map(String.init)+ let parts = payload.split(separator: "|", maxSplits: 3, omittingEmptySubsequences: false).map(String.init)let state = parts.first ?? "normal"let detail = parts.count > 1 ? parts[1] : ""let subsystem = parts.count > 2 ? parts[2] : ""+ let action = parts.count > 3 ? parts[3] : ""if #available(macOS 13.0, *) {ShortcutReminderController.shared.setHealthState(- state, detail: detail, subsystem: subsystem)+ state, detail: detail, subsystem: subsystem, action: action)return 0}return -2@@ -118,6 +118,9 @@ final class OverlayMetrics: ObservableObject {/// "audio" | "screen" | "" — which subsystem failed, when the engine could/// attribute it to one. Empty keeps the pill's generic wording (#6126).@Published var healthSubsystem: String = ""+ /// Explicit behavior from Rust. Kept separate from user-facing copy so a+ /// wording change cannot turn a manual-only incident into a restart click.+ @Published var healthAction: String = ""/// Collapsed failure-pill label. Must stay in sync with the webview's/// `failureHeadline` in app/shortcut-reminder/page.tsx — both render the@@ -129,6 +132,12 @@ final class OverlayMetrics: ObservableObject {default: return "recording needs help"}}++ /// Terminal native failures are advisory only. The user must decide when+ /// to quit and reopen the app; the recording-health UI never exits it.+ var manualRecoveryRequired: Bool {+ healthAction == "manual-reopen"+ }/// True when the cursor is inside the panel area — drives expand/collapse/// since SwiftUI's .onHover tracking areas use .activeInActiveApp which/// does not fire when the app is not frontmost (the overlay stays visible@@ -944,16 +953,15 @@ struct ShortcutReminderView: View {private var failureView: some View {HStack(spacing: 0) {- // The message zone is itself a Button — and clicking it RESTARTS.- // Users click the thing that says "recording needs help" expecting- // the fix (observed repeatedly in testing); a separate restart- // button to the right of the text reads as "nothing happened".+ // The message zone is itself a Button for recoverable failures.+ // A terminal native failure is advisory only: never turn a health+ // signal into an app-exit action.// Hover has already expanded the row by the time a click is// possible, so expand-on-click would always be a no-op anyway.// (Plain Button, NOT .onTapGesture: tap recognizers delay/steal// mouse events in this nonactivating panel.)Button(action: {- if isExpanded {+ if isExpanded && !metrics.manualRecoveryRequired {metrics.healthState = "fixing"onAction("restart_recording")} else {@@ -980,7 +988,7 @@ struct ShortcutReminderView: View {if !isExpanded {// Repair affordance: hint that an action lives here.- Image(systemName: "arrow.clockwise")+ Image(systemName: metrics.manualRecoveryRequired ? "power" : "arrow.clockwise").font(.system(size: 6 * scale, weight: .bold)).foregroundColor(.white.opacity(0.45)).padding(.trailing, s(8))@@ -994,25 +1002,38 @@ struct ShortcutReminderView: View {if isExpanded {Rectangle().fill(.white.opacity(0.15)).frame(width: 0.5).frame(height: s(12))- Button(action: {- // Optimistic — Rust pushes the authoritative "fixing"- // right after it receives the action.- metrics.healthState = "fixing"- onAction("restart_recording")- }) {+ if metrics.manualRecoveryRequired {HStack(spacing: s(2)) {- Image(systemName: "arrow.clockwise")+ Image(systemName: "power").font(.system(size: 6 * scale, weight: .bold)).foregroundColor(.white.opacity(0.95))- Text("restart")+ Text("quit & reopen").font(Brand.swiftUIMonoFont(size: 8 * scale, weight: .bold)).foregroundColor(.white.opacity(0.95))}.padding(.horizontal, s(8)).frame(maxHeight: .infinity)- .contentShape(Rectangle())+ } else {+ Button(action: {+ // Optimistic — Rust pushes the authoritative "fixing"+ // right after it receives the action.+ metrics.healthState = "fixing"+ onAction("restart_recording")+ }) {+ HStack(spacing: s(2)) {+ Image(systemName: "arrow.clockwise")+ .font(.system(size: 6 * scale, weight: .bold))+ .foregroundColor(.white.opacity(0.95))+ Text("restart")+ .font(Brand.swiftUIMonoFont(size: 8 * scale, weight: .bold))+ .foregroundColor(.white.opacity(0.95))+ }+ .padding(.horizontal, s(8))+ .frame(maxHeight: .infinity)+ .contentShape(Rectangle())+ }+ .buttonStyle(.plain)}- .buttonStyle(.plain)Rectangle().fill(.white.opacity(0.15)).frame(width: 0.5).frame(height: s(12))@@ -2064,7 +2085,12 @@ class ShortcutReminderController: NSObject, NSWindowDelegate {/// frame is deliberately NOT resized — all health content is sized to fit/// the fixed expanded panel, because setFrame on this nonactivating panel/// breaks its mouse routing (dead-click pill).- func setHealthState(_ state: String, detail: String = "", subsystem: String = "") {+ func setHealthState(+ _ state: String,+ detail: String = "",+ subsystem: String = "",+ action: String = ""+ ) {DispatchQueue.main.async { [self] inif self.metrics.healthDetail != detail {self.metrics.healthDetail = detail@@ -2072,6 +2098,9 @@ class ShortcutReminderController: NSObject, NSWindowDelegate {if self.metrics.healthSubsystem != subsystem {self.metrics.healthSubsystem = subsystem}+ if self.metrics.healthAction != action {+ self.metrics.healthAction = action+ }if self.metrics.healthState != state {let normalityChanged = (self.metrics.healthState == "normal") != (state == "normal")self.metrics.healthState = statediff --git a/crates/screenpipe-screen/Cargo.toml b/crates/screenpipe-screen/Cargo.tomlindex 4c824e94f..eff515561 100644--- a/crates/screenpipe-screen/Cargo.toml+++ b/crates/screenpipe-screen/Cargo.toml@@ -78,7 +78,7 @@ harness = false# macOS: sck-rs for 12.3+ (ScreenCaptureKit), xcap as fallback for older versions[target.'cfg(target_os = "macos")'.dependencies]-sck-rs = { git = "https://github.com/screenpipe/sck-rs" , rev = "8f0c74ef35737463c9c05fcdff375633dc143788"}+sck-rs = { git = "https://github.com/screenpipe/sck-rs" , rev = "b372bd25e9164b45331a290ce4f3f9801bf506f3"}xcap = { workspace = true }libc = { workspace = true }cidre = { git = "https://github.com/yury/cidre.git", rev = "8481f3f0dc7dd39bb5be80d9424bfac0cad3801a", features = ["vn", "cv", "cg", "app"] }diff --git a/crates/screenpipe-screen/src/lib.rs b/crates/screenpipe-screen/src/lib.rsindex 58e3533c2..426c08206 100644--- a/crates/screenpipe-screen/src/lib.rs+++ b/crates/screenpipe-screen/src/lib.rs@@ -58,6 +58,25 @@ pub use tesseract::{perform_ocr_tesseract, tesseract_available};pub mod browser_utils;pub mod snapshot_writer;+/// True when the native ScreenCaptureKit sync-worker containment layer has+/// reached its hard parked-worker ceiling.+///+/// Read the typed state directly from `sck-rs`: error wording can change and a+/// CoreGraphics fallback frame can still look fresh while primary capture is+/// refusing new work. The app treats this as advisory and never exits itself.+#[cfg(target_os = "macos")]+pub fn screencapturekit_process_exhausted() -> bool {+ matches!(+ sck_rs::process_status(),+ sck_rs::ProcessStatus::Exhausted { .. }+ )+}++#[cfg(not(target_os = "macos"))]+pub fn screencapturekit_process_exhausted() -> bool {+ false+}+/// Flag to request invalidation of persistent SCStream handles after screen/// unlock or wake. Set by `sleep_monitor` (CFNotification callback thread),/// consumed by the event-driven capture loop (tokio thread) so that the actualdiff --git a/docs/coverage/CORE.md b/docs/coverage/CORE.mdindex 25e59a21c..3800a1999 100644--- a/docs/coverage/CORE.md+++ b/docs/coverage/CORE.md@@ -8,11 +8,11 @@ confidence, and criticality.- Manifest: `docs/coverage/core-engine-map.json`- Tracked crates: screenpipe-engine, screenpipe-db, screenpipe-sqlite-coordinator, screenpipe-audio, screenpipe-screen, screenpipe-a11y- Mapped suites: 32-- Mapped Rust files: 327-- Active test blocks: 3175+- Mapped Rust files: 330+- Active test blocks: 3186- Ignored/manual test blocks: 137-- Declared test blocks: 3312-- Weighted coverage points: 2606.2+- Declared test blocks: 3323+- Weighted coverage points: 2613.9Confidence 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,15 +23,15 @@ are explicitly enabled in a runtime lane.| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 29 | 3036 | 132 | 2542.8 | 21 | 11 | 100% |-| macos | 29 | 3094 | 112 | 2555.2 | 22 | 11 | 100% |-| linux | 25 | 2710 | 105 | 2246.1 | 20 | 11 | 100% |+| windows | 29 | 3047 | 132 | 2550.5 | 21 | 11 | 100% |+| macos | 29 | 3105 | 112 | 2562.9 | 22 | 11 | 100% |+| linux | 25 | 2721 | 105 | 2253.8 | 20 | 11 | 100% |## Crate Summary| Crate | Suites | Integration files | Source unit files | Active tests | Ignored tests | Weighted points | Flows || --- | --- | --- | --- | --- | --- | --- | --- |-| screenpipe-engine | 10 | 19 | 106 | 1522 | 42 | 1165.8 | 10 |+| screenpipe-engine | 10 | 19 | 109 | 1533 | 42 | 1173.5 | 10 || screenpipe-db | 5 | 52 | 15 | 451 | 16 | 428.2 | 9 || screenpipe-sqlite-coordinator | 1 | 0 | 2 | 16 | 0 | 16.0 | 2 || screenpipe-audio | 6 | 25 | 51 | 591 | 43 | 517.4 | 5 |@@ -69,19 +69,19 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| db-search | 2 suites / 111 active / 9 ignored / 111.0 pts | 2 suites / 111 active / 9 ignored / 111.0 pts | 2 suites / 111 active / 9 ignored / 111.0 pts || engine-lifecycle | 6 suites / 209 active / 1 ignored / 184.3 pts | 6 suites / 209 active / 1 ignored / 184.3 pts | 5 suites / 203 active / 1 ignored / 182.6 pts || local-api | 2 suites / 355 active / 9 ignored / 250.3 pts | 2 suites / 355 active / 9 ignored / 250.3 pts | 2 suites / 355 active / 9 ignored / 250.3 pts |-| meeting | 6 suites / 1456 active / 19 ignored / 1189.0 pts | 6 suites / 1456 active / 19 ignored / 1189.0 pts | 4 suites / 1163 active / 15 ignored / 918.5 pts |+| meeting | 6 suites / 1467 active / 19 ignored / 1196.7 pts | 6 suites / 1467 active / 19 ignored / 1196.7 pts | 4 suites / 1174 active / 15 ignored / 926.2 pts || ocr | 4 suites / 125 active / 7 ignored / 119.0 pts | 4 suites / 129 active / 7 ignored / 124.5 pts | 3 suites / 120 active / 6 ignored / 115.5 pts || os-integration | 1 suites / 6 active / 0 ignored / 1.7 pts | 1 suites / 6 active / 0 ignored / 1.7 pts | - || performance | 13 suites / 1416 active / 67 ignored / 1244.9 pts | 14 suites / 1519 active / 70 ignored / 1286.1 pts | 13 suites / 1416 active / 67 ignored / 1244.9 pts |-| pipes | 1 suites / 466 active / 3 ignored / 326.2 pts | 1 suites / 466 active / 3 ignored / 326.2 pts | 1 suites / 466 active / 3 ignored / 326.2 pts |-| privacy | 5 suites / 883 active / 36 ignored / 718.3 pts | 5 suites / 937 active / 16 ignored / 725.2 pts | 5 suites / 861 active / 14 ignored / 697.2 pts |+| pipes | 1 suites / 477 active / 3 ignored / 333.9 pts | 1 suites / 477 active / 3 ignored / 333.9 pts | 1 suites / 477 active / 3 ignored / 333.9 pts |+| privacy | 5 suites / 894 active / 36 ignored / 726.0 pts | 5 suites / 948 active / 16 ignored / 732.9 pts | 5 suites / 872 active / 14 ignored / 704.9 pts || real-app | - | 1 suites / 103 active / 3 ignored / 41.2 pts | - || speaker | 2 suites / 348 active / 8 ignored / 348.0 pts | 2 suites / 348 active / 8 ignored / 348.0 pts | 2 suites / 348 active / 8 ignored / 348.0 pts || storage | 3 suites / 507 active / 29 ignored / 408.6 pts | 3 suites / 507 active / 29 ignored / 408.6 pts | 3 suites / 507 active / 29 ignored / 408.6 pts |-| sync | 1 suites / 466 active / 3 ignored / 326.2 pts | 1 suites / 466 active / 3 ignored / 326.2 pts | 1 suites / 466 active / 3 ignored / 326.2 pts |+| sync | 1 suites / 477 active / 3 ignored / 333.9 pts | 1 suites / 477 active / 3 ignored / 333.9 pts | 1 suites / 477 active / 3 ignored / 333.9 pts || timeline | 4 suites / 1002 active / 33 ignored / 810.3 pts | 4 suites / 1002 active / 33 ignored / 810.3 pts | 4 suites / 1002 active / 33 ignored / 810.3 pts || transcription | 5 suites / 728 active / 40 ignored / 572.2 pts | 5 suites / 728 active / 40 ignored / 572.2 pts | 5 suites / 728 active / 40 ignored / 572.2 pts |-| ui-events | 4 suites / 706 active / 28 ignored / 537.7 pts | 3 suites / 657 active / 5 ignored / 503.4 pts | 3 suites / 657 active / 5 ignored / 503.4 pts |+| ui-events | 4 suites / 717 active / 28 ignored / 545.4 pts | 3 suites / 668 active / 5 ignored / 511.1 pts | 3 suites / 668 active / 5 ignored / 511.1 pts || vision-capture | 5 suites / 533 active / 32 ignored / 420.1 pts | 5 suites / 537 active / 32 ignored / 425.6 pts | 4 suites / 528 active / 31 ignored / 416.6 pts |## Critical Flow Matrix@@ -139,7 +139,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| engine-db-recovery-cli | screenpipe-engine | windows, macos, linux | database, engine-lifecycle | engine-health-lifecycle, performance-liveness | high | strong | unit | 1 | 8 | 0 | Exact DB/WAL/SHM working-copy preservation, rollback on archive failure, and restart repair for crashes during the multi-file generation swap. || 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. || engine-local-api-search-integration | screenpipe-engine | windows, macos, linux | local-api, db-search | local-api-search | high | strong | integration | 1 | 6 | 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 | 30 | 466 | 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 | 477 | 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 | 9 | 218 | 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 | 38 | 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 | 6 | 30 | 0 | PostHog capture gating, telemetry context shaping, piggyback telemetry forwarding, crash-log helpers, resource monitoring, and the recording-coverage reliability metric. |@@ -329,6 +329,8 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| db-audio-meetings-speakers | screenpipe-db | tests/untranscribed_chunks_test.rs | integration | 14 | 0 | 14 || db-runtime-reliability | screenpipe-db | tests/wal_chaos_e2e_test.rs | integration | 1 | 3 | 4 || engine-api-routes | screenpipe-engine | src/activity_ledger.rs | source | 6 | 0 | 6 |+| engine-meeting-privacy-sync | screenpipe-engine | src/agent_profile.rs | source | 4 | 0 | 4 |+| engine-meeting-privacy-sync | screenpipe-engine | src/agent_skills.rs | source | 4 | 0 | 4 || engine-telemetry-observability | screenpipe-engine | src/analytics.rs | source | 5 | 0 | 5 || engine-retention-storage | screenpipe-engine | src/archive.rs | source | 13 | 0 | 13 || engine-retention-storage | screenpipe-engine | src/atomic_file.rs | source | 4 | 0 | 4 |@@ -347,7 +349,8 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| engine-meeting-privacy-sync | screenpipe-engine | src/cli/service.rs | source | 3 | 0 | 3 || engine-meeting-privacy-sync | screenpipe-engine | src/cli/store_file.rs | source | 12 | 0 | 12 || engine-meeting-privacy-sync | screenpipe-engine | src/cli/team_pipes.rs | source | 5 | 0 | 5 |-| engine-meeting-privacy-sync | screenpipe-engine | src/cli/team.rs | source | 12 | 0 | 12 |+| engine-meeting-privacy-sync | screenpipe-engine | src/cli/team_skills.rs | source | 2 | 0 | 2 |+| engine-meeting-privacy-sync | screenpipe-engine | src/cli/team.rs | source | 13 | 0 | 13 || 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 |diff --git a/docs/coverage/core-engine-map.json b/docs/coverage/core-engine-map.jsonindex 3f0ac2ff2..37930a875 100644--- a/docs/coverage/core-engine-map.json+++ b/docs/coverage/core-engine-map.json@@ -433,6 +433,8 @@"label": "Engine meetings, privacy, pipes, and sync units","crate": "screenpipe-engine","files": [+ "src/agent_profile.rs",+ "src/agent_skills.rs","src/calendar_speaker_id.rs","src/capture_exclusions.rs","src/cli/agent.rs",@@ -446,6 +448,7 @@"src/cli/store_file.rs","src/cli/team.rs","src/cli/team_pipes.rs",+ "src/cli/team_skills.rs","src/cli/view.rs","src/cloud_search.rs","src/connections_api.rs",diff --git a/packages/sdk/Cargo.lock b/packages/sdk/Cargo.lockindex af8e67c9d..10444c23e 100644--- a/packages/sdk/Cargo.lock+++ b/packages/sdk/Cargo.lock@@ -6721,7 +6721,7 @@ dependencies = [[[package]]name = "sck-rs"version = "0.1.0"-source = "git+https://github.com/screenpipe/sck-rs?rev=8f0c74ef35737463c9c05fcdff375633dc143788#8f0c74ef35737463c9c05fcdff375633dc143788"+source = "git+https://github.com/screenpipe/sck-rs?rev=b372bd25e9164b45331a290ce4f3f9801bf506f3#b372bd25e9164b45331a290ce4f3f9801bf506f3"dependencies = ["cidre 0.16.1 (git+https://github.com/yury/cidre.git?rev=9c20f5ee5abaad4598843a33e13d6e48822d1f30)","image",diff --git a/packages/sdk/examples/tauri-app/src-tauri/Cargo.lock b/packages/sdk/examples/tauri-app/src-tauri/Cargo.lockindex cf49f3c2a..07e047a93 100644--- a/packages/sdk/examples/tauri-app/src-tauri/Cargo.lock+++ b/packages/sdk/examples/tauri-app/src-tauri/Cargo.lock@@ -6847,7 +6847,7 @@ dependencies = [[[package]]name = "sck-rs"version = "0.1.0"-source = "git+https://github.com/screenpipe/sck-rs?rev=8f0c74ef35737463c9c05fcdff375633dc143788#8f0c74ef35737463c9c05fcdff375633dc143788"+source = "git+https://github.com/screenpipe/sck-rs?rev=b372bd25e9164b45331a290ce4f3f9801bf506f3#b372bd25e9164b45331a290ce4f3f9801bf506f3"dependencies = ["cidre 0.16.1 (git+https://github.com/yury/cidre.git?rev=9c20f5ee5abaad4598843a33e13d6e48822d1f30)","image",