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: require consistent evidence for speaker identity backfill (#7422)
Louis Beaumont6a33d28f81e1
diff --git a/crates/screenpipe-audio-eval/evals/README.md b/crates/screenpipe-audio-eval/evals/README.mdindex 279e10959..fc57cc933 100644--- a/crates/screenpipe-audio-eval/evals/README.md+++ b/crates/screenpipe-audio-eval/evals/README.md@@ -11,6 +11,24 @@ clustering) on a wav fixture and scores predictions against an RTTM groundtruth. Lives in its own crate (`screenpipe-audio-eval`) so its deps andhelpers don't bleed into prod paths.+## Database attribution evals++Voice clustering and DER do not establish that the database assigns the right+person to a transcript. The downstream attribution suite calls the production+DB methods against migrated, in-memory databases with synthetic evidence:++```bash+cargo test -p screenpipe-db --test speaker_identity_eval -- --nocapture+```++It checks exact live-mirror attribution, microphone owner-name bootstrapping,+and chunk-level speaker backfill. Cases include remote audio leaking into input,+competing identities, mixed turns, stream reconnects, overlap, conflicting model+evidence, and preservation of existing assignments. Positive controls require+clean matches to resolve. Each case emits JSON, followed by per-path totals.+These results measure identity propagation and abstention, not acoustic accuracy+or real-world diarization error rate. The suite needs no recordings or credentials.+## Why this existsPR [#3107](https://github.com/screenpipe/screenpipe/pull/3107) shipped adiff --git a/crates/screenpipe-db/src/db/meetings.rs b/crates/screenpipe-db/src/db/meetings.rsindex 48be8a585..7d9403b73 100644--- a/crates/screenpipe-db/src/db/meetings.rs+++ b/crates/screenpipe-db/src/db/meetings.rs@@ -1080,79 +1080,62 @@ impl DatabaseManager {Ok(inserted)}- /// Give live meeting-transcript segments the SAME global `speaker_id` that the- /// engine-agnostic backfill (`backfill_missing_speakers`) resolved on- /// `audio_transcriptions` — so the Meeting view shows the cross-meeting, nameable- /// identity instead of Deepgram's per-stream "speaker N" label.- ///- /// For each segment still missing a speaker (and `captured_at >= since`), take the- /// `speaker_id` of the nearest already-identified `audio_transcriptions` row within- /// `coverage_window_secs`. The mirrored live row shares the segment's exact- /// timestamp, so once the chunk backfill stamps it, it matches first. Idempotent —- /// only fills NULLs, and the `EXISTS` guard avoids no-op NULL writes. Returns rows- /// updated. Cheap: runs on the reconciliation sweep, never the hot path.+ /// Copy an identity only from this turn's identified live mirror. A nearby+ /// same-direction row may be a different participant, device, or stream.+ /// Exact time, text and device are required, and conflicting mirror identities+ /// leave the provider-local label unresolved. Existing assignments survive.pub async fn backfill_meeting_segment_speakers(&self,since: DateTime<Utc>,- coverage_window_secs: f64,+ _coverage_window_secs: f64,) -> Result<u64, SqlxError> {- // One statement instead of fetch-candidates → per-row nearest-lookup →- // update-by-id (up to 501 round-trips per pass). The scalar lookup is- // correlated to each of the capped candidates, but — critically — its- // timestamp predicates leave `at.timestamp` bare. SQLite can therefore- // range-scan `idx_audio_transcriptions_timestamp` instead of materializing- // candidate × the entire audio history under a BEGIN IMMEDIATE lock.- //- // Device match preserved: a mic segment (device_type = 'input') only- // pulls an input-device speaker, everything else an output-device one;- // COALESCE(is_input_device, 1) keeps the old NULL-defaults-to-input- // behaviour. Resolved segments drop out of the candidate set, so- // steady-state work is just newly-mirrored segments.- //- // Calculate proximity from rounded epoch milliseconds rather than a- // julianday delta. Equal offsets around a timestamp can differ by one- // floating-point ULP in julianday(), which would bypass the documented- // timestamp/id tie breakers.+ // Keep each mirror lookup bounded by the timestamp index. Limit eligible+ // updates, not unresolved candidates: newer unknown turns must not starve+ // older turns whose exact mirrors have since acquired an identity.+ // The old proximity window is retained in the API for callers but cannot+ // widen identity evidence beyond an exact timestamp match.const PER_PASS_LIMIT: i64 = 500;let mut tx = self.begin_immediate_with_retry().await?;let r = sqlx::query(- "WITH cand AS ( \- SELECT id, device_type, captured_at \- FROM meeting_transcript_segments \- WHERE speaker_id IS NULL AND julianday(captured_at) >= julianday(?1) \- ORDER BY captured_at DESC LIMIT ?3 \- ), \- nearest AS ( \- SELECT c.id AS seg_id, at.speaker_id AS sid, \- ROW_NUMBER() OVER ( \- PARTITION BY c.id \- ORDER BY ABS( \- CAST(ROUND(unixepoch(at.timestamp, 'subsec') * 1000.0) AS INTEGER) - \- CAST(ROUND(unixepoch(c.captured_at, 'subsec') * 1000.0) AS INTEGER) \- ), \- at.timestamp, at.id \- ) AS rn \- FROM cand c \- JOIN audio_transcriptions at INDEXED BY idx_audio_transcriptions_timestamp \- ON at.timestamp >= strftime( \- '%Y-%m-%dT%H:%M:%f+00:00', c.captured_at, printf('-%f seconds', ?2) \- ) \- AND at.timestamp <= strftime( \- '%Y-%m-%dT%H:%M:%f+00:00', c.captured_at, printf('+%f seconds', ?2) \- ) \- AND at.speaker_id IS NOT NULL \- AND COALESCE(at.is_input_device, 1) = \- (CASE WHEN c.device_type = 'input' THEN 1 ELSE 0 END) \- ) \- UPDATE meeting_transcript_segments SET speaker_id = ( \- SELECT sid FROM nearest \- WHERE nearest.seg_id = meeting_transcript_segments.id AND nearest.rn = 1 \- ) \- WHERE speaker_id IS NULL \- AND id IN (SELECT seg_id FROM nearest WHERE rn = 1)",+ r#"+ WITH cand AS (+ SELECT id, device_name, device_type, captured_at, transcript+ FROM meeting_transcript_segments+ WHERE speaker_id IS NULL AND julianday(captured_at) >= julianday(?1)+ AND TRIM(transcript) != ''+ ), matches AS (+ SELECT c.id AS seg_id, MIN(a.speaker_id) AS sid+ FROM cand c+ JOIN audio_transcriptions a INDEXED BY idx_audio_transcriptions_timestamp+ ON a.timestamp >= strftime('%Y-%m-%dT%H:%M:%f+00:00', c.captured_at, printf('-%f seconds', ?2))+ AND a.timestamp <= strftime('%Y-%m-%dT%H:%M:%f+00:00', c.captured_at, printf('+%f seconds', ?2))+ AND julianday(a.timestamp) = julianday(c.captured_at)+ AND a.transcription_engine = 'live'+ AND a.transcription = c.transcript+ AND a.device = c.device_name+ AND a.is_input_device = CASE WHEN c.device_type = 'input' THEN 1 ELSE 0 END+ AND a.speaker_id IS NOT NULL+ WHERE c.device_type IN ('input', 'output')+ AND NOT EXISTS (+ SELECT 1 FROM meeting_transcript_segments other+ WHERE other.id != c.id+ AND julianday(other.captured_at) = julianday(c.captured_at)+ AND other.device_name = c.device_name AND other.device_type = c.device_type+ AND other.transcript = c.transcript+ )+ GROUP BY c.id HAVING COUNT(DISTINCT a.speaker_id) = 1+ ORDER BY c.captured_at DESC, c.id DESC LIMIT ?3+ )+ UPDATE meeting_transcript_segments SET speaker_id = (+ SELECT sid FROM matches WHERE matches.seg_id = meeting_transcript_segments.id+ )+ WHERE speaker_id IS NULL AND id IN (SELECT seg_id FROM matches)+ "#,).bind(since)- .bind(coverage_window_secs.max(0.0))+ // SQLite timestamps are millisecond-rounded; the index envelope must+ // include the original microsecond value on either side of that rounding.+ .bind(0.001_f64).bind(PER_PASS_LIMIT).execute(&mut **tx.conn()).await?;diff --git a/crates/screenpipe-db/src/db/speakers.rs b/crates/screenpipe-db/src/db/speakers.rsindex 06ec1ae03..022e2c8b3 100644--- a/crates/screenpipe-db/src/db/speakers.rs+++ b/crates/screenpipe-db/src/db/speakers.rs@@ -482,29 +482,48 @@ impl DatabaseManager {Ok(rows)}- /// Get the dominant unnamed speaker on input devices.- /// Returns the speaker_id with the most transcriptions on input that has no name set.- /// Requires at least `min_count` transcriptions to be considered reliable.+ /// Bootstrap a user name only from one recent, input-only voice outside meetings.+ /// Count independent chunks with useful speech, not repeated live transcript rows.+ /// Other input identities (including named ones) and any output observation make+ /// ownership ambiguous. Abstain instead of repeatedly naming each new cluster.pub async fn get_dominant_unnamed_input_speaker(&self,min_count: i32,) -> Result<Option<i64>, SqlxError> {+ let since = chrono::Utc::now() - chrono::Duration::days(7);let result = sqlx::query_scalar::<_, i64>(r#"+ WITH recent_input AS (+ SELECT speaker_id, audio_chunk_id, timestamp, transcription_engine,+ start_time, end_time+ FROM audio_transcriptions+ WHERE is_input_device = 1 AND speaker_id IS NOT NULL+ AND timestamp >= ?2+ )SELECT at.speaker_id- FROM audio_transcriptions at+ FROM recent_input atINNER JOIN speakers s ON at.speaker_id = s.id- WHERE at.is_input_device = 1- AND at.speaker_id IS NOT NULL- AND (s.name IS NULL OR s.name = '')- AND (s.hallucination IS NULL OR s.hallucination = 0)+ WHERE (s.name IS NULL OR s.name = '')+ AND COALESCE(s.hallucination, 0) = 0+ AND (SELECT COUNT(DISTINCT speaker_id) FROM recent_input) = 1+ AND at.transcription_engine != 'live'+ AND at.end_time - at.start_time >= 2.0+ AND NOT EXISTS (+ SELECT 1 FROM audio_transcriptions remote+ WHERE remote.speaker_id = at.speaker_id AND remote.is_input_device = 0+ )+ AND NOT EXISTS (+ SELECT 1 FROM meetings m+ WHERE julianday(at.timestamp) >= julianday(m.meeting_start)+ AND julianday(at.timestamp) <= julianday(COALESCE(m.meeting_end, 'now'))+ )GROUP BY at.speaker_id- HAVING COUNT(*) >= ?1- ORDER BY COUNT(*) DESC+ HAVING COUNT(DISTINCT at.audio_chunk_id) >= ?1LIMIT 1"#,)- .bind(min_count)+ .bind(min_count.max(1))+ .bind(since).fetch_optional(&self.pool).await?;@@ -986,19 +1005,73 @@ impl DatabaseManager {Ok(())}- /// Update the speaker_id for all transcriptions in an audio chunk+ /// Apply a single-voice backfill without replacing existing turn identities.+ /// A chunk can contain several live speakers or provider reconnects. Their+ /// scoped labels are negative evidence against stamping the whole chunk with+ /// one voice, even when the audio model finds a dominant speaker.pub async fn update_transcriptions_speaker(&self,audio_chunk_id: i64,new_speaker_id: i64,) -> Result<u64, sqlx::Error> {let mut tx = self.begin_immediate_with_retry().await?;- let result =- sqlx::query("UPDATE audio_transcriptions SET speaker_id = ? WHERE audio_chunk_id = ?")- .bind(new_speaker_id)- .bind(audio_chunk_id)- .execute(&mut **tx.conn())- .await?;+ let result = sqlx::query(+ r#"+ WITH chunk_rows AS (+ SELECT * FROM audio_transcriptions WHERE audio_chunk_id = ?1+ ), live_evidence AS (+ SELECT m.meeting_id, m.stream_id, m.device_name, m.device_type, m.speaker_id,+ COALESCE(m.session_speaker_id, m.speaker_name) AS identity+ FROM chunk_rows a+ JOIN meeting_transcript_segments m+ ON julianday(m.captured_at) = julianday(a.timestamp)+ AND m.device_name = a.device+ AND m.device_type = CASE WHEN a.is_input_device = 1 THEN 'input' ELSE 'output' END+ AND m.transcript = a.transcription+ WHERE a.transcription_engine = 'live'+ ), live_identities AS (+ SELECT DISTINCT meeting_id, stream_id, device_name, device_type, identity+ FROM live_evidence+ )+ UPDATE audio_transcriptions SET speaker_id = ?2+ WHERE audio_chunk_id = ?1 AND speaker_id IS NULL+ AND NOT EXISTS (+ SELECT 1 FROM chunk_rows WHERE speaker_id IS NOT NULL AND speaker_id != ?2+ )+ AND NOT EXISTS (+ SELECT 1 FROM diarization_segments+ WHERE audio_chunk_id = ?1 AND (overlap = 1 OR speaker_id != ?2)+ )+ AND NOT EXISTS (+ SELECT 1 FROM diarization_segments WHERE audio_chunk_id = ?1+ GROUP BY diarization_run_id HAVING COUNT(DISTINCT provider_speaker_label) > 1+ )+ AND (+ NOT EXISTS (SELECT 1 FROM chunk_rows WHERE transcription_engine = 'live')+ OR (+ (SELECT COUNT(*) FROM live_identities) = 1+ AND NOT EXISTS (+ SELECT 1 FROM live_evidence+ WHERE identity IS NULL OR TRIM(identity) = '' OR speaker_id != ?2+ )+ AND NOT EXISTS (+ SELECT 1 FROM chunk_rows a WHERE a.transcription_engine = 'live'+ AND NOT EXISTS (+ SELECT 1 FROM meeting_transcript_segments m+ WHERE julianday(m.captured_at) = julianday(a.timestamp)+ AND m.device_name = a.device+ AND m.device_type = CASE WHEN a.is_input_device = 1 THEN 'input' ELSE 'output' END+ AND m.transcript = a.transcription+ )+ )+ )+ )+ "#,+ )+ .bind(audio_chunk_id)+ .bind(new_speaker_id)+ .execute(&mut **tx.conn())+ .await?;let rows_affected = result.rows_affected();tx.commit().await?;Ok(rows_affected)diff --git a/crates/screenpipe-db/tests/speaker_identity_eval.rs b/crates/screenpipe-db/tests/speaker_identity_eval.rsnew file mode 100644index 000000000..4db49ca60--- /dev/null+++ b/crates/screenpipe-db/tests/speaker_identity_eval.rs@@ -0,0 +1,597 @@+// screenpipe — AI that knows everything you've seen, said, or heard+// https://screenpipe.com++//! Attribution evals at the production DB boundary. Fixtures are synthetic:+//! no private recordings, customer identities, or provider credentials.+//! Run with --nocapture for per-case outcomes and a machine-readable summary.+use chrono::{DateTime, Duration, Utc};+use screenpipe_db::DatabaseManager;+use serde_json::json;++async fn db() -> DatabaseManager {+ DatabaseManager::new("sqlite::memory:", Default::default())+ .await+ .unwrap()+}++async fn audio(+ db: &DatabaseManager,+ speaker: i64,+ at: DateTime<Utc>,+ text: &str,+ device: &str,+ input: bool,+ engine: &str,+ chunk: Option<i64>,+ duration: f64,+) -> i64 {+ let chunk = match chunk {+ Some(id) => id,+ None => db+ .insert_audio_chunk(&format!("{device}_{}.mp4", at.timestamp_micros()), Some(at))+ .await+ .unwrap(),+ };+ sqlx::query("INSERT INTO audio_transcriptions (audio_chunk_id, offset_index, timestamp, transcription, device, is_input_device, speaker_id, transcription_engine, start_time, end_time) VALUES (?1, 0, ?2, ?3, ?4, ?5, ?6, ?7, 0, ?8)")+ .bind(chunk).bind(at).bind(text).bind(device).bind(input).bind(speaker).bind(engine).bind(duration)+ .execute(&db.pool).await.unwrap();+ chunk+}++#[tokio::test]+async fn speaker_identity_backfill_eval() {+ let cases = [+ ("exact_mirror", true),+ ("microsecond_mirror", true),+ ("ambiguous_stream_mirror", false),+ ("adjacent_other_turn", false),+ ("other_output_device", false),+ ("other_direction", false),+ ("same_text_after_reconnect", false),+ ("conflicting_exact_mirrors", false),+ ("agreeing_exact_mirrors", true),+ ("background_text_is_not_live_provenance", false),+ ("empty_transcript", false),+ ("human_assignment_survives", true),+ ];+ let mut failures = Vec::new();+ let mut false_assignments = 0;+ let mut missed_assignments = 0;+ for (case, should_assign) in cases {+ let db = db().await;+ // Stable millisecond timestamp exercises UTC storage and exact matching.+ let base: DateTime<Utc> = if case == "microsecond_mirror" {+ "2026-08-01T12:00:00.123789Z"+ } else {+ "2026-08-01T12:00:00.123Z"+ }+ .parse()+ .unwrap();+ let correct = db.create_speaker_with_name("Guest").await.unwrap().id;+ let wrong = db.create_speaker_with_name("Local user").await.unwrap().id;+ let meeting = db.insert_meeting("Meet", "test", None, None).await.unwrap();+ let text = if case == "empty_transcript" {+ ""+ } else {+ "A distinct guest turn."+ };+ db.insert_meeting_transcript_segment_with_identity(+ meeting,+ "test",+ None,+ "turn",+ "Meeting Tap",+ "output",+ "stream-new",+ Some("stream-new:1"),+ Some("speaker 1"),+ "A distinct guest turn.",+ base,+ )+ .await+ .unwrap();+ if case == "ambiguous_stream_mirror" {+ db.insert_meeting_transcript_segment_with_identity(+ meeting,+ "test",+ None,+ "other-turn",+ "Meeting Tap",+ "output",+ "other-stream",+ Some("other-stream:1"),+ Some("speaker 1"),+ text,+ base,+ )+ .await+ .unwrap();+ }+ if case == "empty_transcript" {+ sqlx::query(+ "UPDATE meeting_transcript_segments SET transcript = '' WHERE meeting_id = ?1",+ )+ .bind(meeting)+ .execute(&db.pool)+ .await+ .unwrap();+ }+ let time = if case == "same_text_after_reconnect" {+ base - Duration::seconds(5)+ } else {+ base+ };+ let candidate_text = if case == "adjacent_other_turn" {+ "A different person's preceding turn."+ } else {+ text+ };+ let device = if case == "other_output_device" {+ "Media player"+ } else {+ "Meeting Tap"+ };+ let input = case == "other_direction";+ let engine = if case == "background_text_is_not_live_provenance" {+ "Parakeet"+ } else {+ "live"+ };+ audio(+ &db,+ correct,+ time,+ candidate_text,+ device,+ input,+ engine,+ None,+ 3.0,+ )+ .await;+ if matches!(case, "conflicting_exact_mirrors" | "agreeing_exact_mirrors") {+ let other = if case == "conflicting_exact_mirrors" {+ wrong+ } else {+ correct+ };+ audio(+ &db,+ other,+ base,+ text,+ "Meeting Tap",+ false,+ "live",+ None,+ 3.0,+ )+ .await;+ }+ if case == "human_assignment_survives" {+ sqlx::query(+ "UPDATE meeting_transcript_segments SET speaker_id = ?1 WHERE meeting_id = ?2",+ )+ .bind(wrong)+ .bind(meeting)+ .execute(&db.pool)+ .await+ .unwrap();+ }+ let updated = db+ .backfill_meeting_segment_speakers(base - Duration::hours(1), 15.0)+ .await+ .unwrap();+ let actual: Option<i64> = sqlx::query_scalar("SELECT speaker_id FROM meeting_transcript_segments WHERE meeting_id = ?1 AND item_id = 'turn'")+ .bind(meeting).fetch_one(&db.pool).await.unwrap();+ let expected = should_assign.then_some(if case == "human_assignment_survives" {+ wrong+ } else {+ correct+ });+ let passed = actual == expected;+ if !passed {+ failures.push(case);+ }+ if actual.is_some() && actual != expected {+ false_assignments += 1;+ }+ if expected.is_some() && actual.is_none() {+ missed_assignments += 1;+ }+ let again = db+ .backfill_meeting_segment_speakers(base - Duration::hours(1), 15.0)+ .await+ .unwrap();+ assert_eq!(again, 0, "{case}: backfill must be idempotent");+ assert_eq!(+ db.count_meeting_transcript_segments(meeting).await.unwrap(),+ if case == "ambiguous_stream_mirror" {+ 2+ } else {+ 1+ },+ "{case}: preserve captured evidence"+ );+ println!(+ "{}",+ json!({"eval":"speaker_backfill","case":case,"passed":passed,"updated":updated,"expected":expected,"actual":actual})+ );+ }+ println!(+ "{}",+ json!({"eval":"speaker_backfill_summary","cases":cases.len(),"passed":cases.len()-failures.len(),"false_assignments":false_assignments,"missed_assignments":missed_assignments})+ );+ assert!(+ failures.is_empty(),+ "speaker backfill failures: {failures:?}"+ );+}++#[tokio::test]+async fn speaker_identity_autoname_eval() {+ let cases = [+ ("single_clean_input", true),+ ("live_input_only", false),+ ("remote_voice_on_microphone", false),+ ("two_input_people", false),+ ("already_named_owner_and_new_voice", false),+ ("old_input_only", false),+ ("meeting_input_only", false),+ ("many_rows_one_chunk", false),+ ("short_backchannels_only", false),+ ];+ let mut failures = Vec::new();+ let mut false_assignments = 0;+ let mut missed_assignments = 0;+ for (case, should_assign) in cases {+ let db = db().await;+ let base = if case == "old_input_only" {+ Utc::now() - Duration::days(10)+ } else {+ Utc::now() - Duration::minutes(5)+ };+ let candidate = db.insert_speaker(&[1.0f32; 512]).await.unwrap().id;+ let mut shared_chunk = None;+ for i in 0..10 {+ let chunk = audio(+ &db,+ candidate,+ base + Duration::seconds(i * 10),+ &format!("Clean phrase {i}"),+ "Microphone",+ true,+ if case == "live_input_only" {+ "live"+ } else {+ "Parakeet"+ },+ shared_chunk,+ if case == "short_backchannels_only" {+ 0.2+ } else {+ 3.0+ },+ )+ .await;+ if case == "many_rows_one_chunk" {+ shared_chunk = Some(chunk);+ }+ }+ if case == "remote_voice_on_microphone" {+ audio(+ &db,+ candidate,+ base,+ "Remote voice",+ "System Audio",+ false,+ "Parakeet",+ None,+ 3.0,+ )+ .await;+ }+ if matches!(+ case,+ "two_input_people" | "already_named_owner_and_new_voice"+ ) {+ let other = db.insert_speaker(&[0.5f32; 512]).await.unwrap().id;+ if case == "already_named_owner_and_new_voice" {+ db.update_speaker_name(other, "Local user").await.unwrap();+ }+ audio(+ &db,+ other,+ base,+ "Another person",+ "Microphone",+ true,+ "Parakeet",+ None,+ 3.0,+ )+ .await;+ }+ if case == "meeting_input_only" {+ let mid = db.insert_meeting("Zoom", "test", None, None).await.unwrap();+ sqlx::query("UPDATE meetings SET meeting_start = ?1, meeting_end = ?2 WHERE id = ?3")+ .bind(base - Duration::seconds(1))+ .bind(base + Duration::minutes(5))+ .bind(mid)+ .execute(&db.pool)+ .await+ .unwrap();+ }+ let actual = db.get_dominant_unnamed_input_speaker(10).await.unwrap();+ let expected = should_assign.then_some(candidate);+ let passed = actual == expected;+ if !passed {+ failures.push(case);+ }+ if actual.is_some() && actual != expected {+ false_assignments += 1;+ }+ if expected.is_some() && actual.is_none() {+ missed_assignments += 1;+ }+ println!(+ "{}",+ json!({"eval":"speaker_autoname","case":case,"passed":passed,"expected":expected,"actual":actual})+ );+ }+ println!(+ "{}",+ json!({"eval":"speaker_autoname_summary","cases":cases.len(),"passed":cases.len()-failures.len(),"false_assignments":false_assignments,"missed_assignments":missed_assignments})+ );+ assert!(+ failures.is_empty(),+ "speaker autoname failures: {failures:?}"+ );+}++#[tokio::test]+async fn speaker_identity_chunk_backfill_eval() {+ let cases = [+ "single_unassigned",+ "existing_assignment",+ "mixed_live_speakers",+ "single_live_speaker",+ "reconnected_streams",+ "unmirrored_live",+ "unknown_live_label",+ "confirmed_meeting_identity",+ "partly_confirmed_same_identity",+ "overlapping_diarization",+ "conflicting_diarization",+ "multiple_provider_labels",+ "agreeing_diarization",+ ];+ let mut failures = Vec::new();+ for case in cases {+ let db = db().await;+ let base = Utc::now();+ let inferred = db.create_speaker_with_name("Inferred").await.unwrap().id;+ let confirmed = db.create_speaker_with_name("Confirmed").await.unwrap().id;+ let chunk = audio(+ &db,+ confirmed,+ base,+ "First turn",+ "Meeting Tap",+ false,+ "live",+ None,+ 3.0,+ )+ .await;+ if case != "existing_assignment" {+ sqlx::query(+ "UPDATE audio_transcriptions SET speaker_id = NULL WHERE audio_chunk_id = ?1",+ )+ .bind(chunk)+ .execute(&db.pool)+ .await+ .unwrap();+ }+ if case == "single_unassigned" {+ sqlx::query("UPDATE audio_transcriptions SET transcription_engine = 'Parakeet' WHERE audio_chunk_id = ?1")+ .bind(chunk).execute(&db.pool).await.unwrap();+ } else {+ let meeting = db.insert_meeting("Meet", "test", None, None).await.unwrap();+ for i in 0..2 {+ let text = if i == 0 { "First turn" } else { "Second turn" };+ let t = base + Duration::seconds(i * 5);+ if i == 1 {+ audio(+ &db,+ confirmed,+ t,+ text,+ "Meeting Tap",+ false,+ "live",+ Some(chunk),+ 3.0,+ )+ .await;+ sqlx::query("UPDATE audio_transcriptions SET speaker_id = NULL WHERE audio_chunk_id = ?1 AND transcription = 'Second turn'")+ .bind(chunk).execute(&db.pool).await.unwrap();+ }+ let different = i == 1 && case == "mixed_live_speakers";+ let stream = if i == 1 && case == "reconnected_streams" {+ "new-stream"+ } else {+ "first-stream"+ };+ let identity = if different { "speaker-b" } else { "speaker-a" };+ db.insert_meeting_transcript_segment_with_identity(+ meeting,+ "test",+ None,+ &format!("turn-{i}"),+ "Meeting Tap",+ "output",+ stream,+ Some(identity),+ Some(identity),+ text,+ t,+ )+ .await+ .unwrap();+ }+ }+ if case == "unmirrored_live" {+ sqlx::query("DELETE FROM meeting_transcript_segments")+ .execute(&db.pool)+ .await+ .unwrap();+ }+ if case == "partly_confirmed_same_identity" {+ sqlx::query(+ "UPDATE meeting_transcript_segments SET speaker_id = ?1 WHERE item_id = 'turn-0'",+ )+ .bind(inferred)+ .execute(&db.pool)+ .await+ .unwrap();+ }+ if case == "confirmed_meeting_identity" {+ sqlx::query("UPDATE meeting_transcript_segments SET speaker_id = ?1")+ .bind(confirmed)+ .execute(&db.pool)+ .await+ .unwrap();+ }+ if case == "unknown_live_label" {+ sqlx::query("UPDATE meeting_transcript_segments SET session_speaker_id = NULL, speaker_name = NULL").execute(&db.pool).await.unwrap();+ }+ if matches!(+ case,+ "overlapping_diarization"+ | "conflicting_diarization"+ | "multiple_provider_labels"+ | "agreeing_diarization"+ ) {+ let run = sqlx::query("INSERT INTO diarization_runs(audio_chunk_id, mode, provider) VALUES (?1, 'background', 'eval')")+ .bind(chunk).execute(&db.pool).await.unwrap().last_insert_rowid();+ for i in 0..2 {+ sqlx::query("INSERT INTO diarization_segments(diarization_run_id, audio_chunk_id, provider_speaker_label, speaker_id, start_time, end_time, overlap) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)")+ .bind(run).bind(chunk)+ .bind(if case == "multiple_provider_labels" && i == 1 { "b" } else { "a" })+ .bind(if case == "conflicting_diarization" { confirmed } else { inferred })+ .bind(i as f64 * 5.0).bind(i as f64 * 5.0 + 3.0)+ .bind(case == "overlapping_diarization").execute(&db.pool).await.unwrap();+ }+ }+ db.update_transcriptions_speaker(chunk, inferred)+ .await+ .unwrap();+ let actual: Vec<Option<i64>> = sqlx::query_scalar(+ "SELECT speaker_id FROM audio_transcriptions WHERE audio_chunk_id = ?1 ORDER BY id",+ )+ .bind(chunk)+ .fetch_all(&db.pool)+ .await+ .unwrap();+ let expected = match case {+ "single_unassigned" => vec![Some(inferred)],+ "single_live_speaker" | "agreeing_diarization" | "partly_confirmed_same_identity" => {+ vec![Some(inferred), Some(inferred)]+ }+ "existing_assignment" => vec![Some(confirmed), None],+ _ => vec![None, None],+ };+ let passed = actual == expected;+ if !passed {+ failures.push(case);+ }+ println!(+ "{}",+ json!({"eval":"speaker_chunk_backfill","case":case,"passed":passed,"expected":expected,"actual":actual})+ );+ }+ println!(+ "{}",+ json!({"eval":"speaker_chunk_backfill_summary","cases":cases.len(),"passed":cases.len()-failures.len()})+ );+ assert!(+ failures.is_empty(),+ "speaker chunk backfill failures: {failures:?}"+ );+}++/// Unknown recent turns must not permanently hide older, resolvable turns.+/// Exercise a backlog and a concurrent capture write at the production boundary.+#[tokio::test]+async fn speaker_identity_backfill_progress_eval() {+ let db = db().await;+ let base = Utc::now() - Duration::days(1);+ let speaker = db.create_speaker_with_name("Known voice").await.unwrap().id;+ let meeting = db.insert_meeting("Meet", "test", None, None).await.unwrap();+ let chunk = db+ .insert_audio_chunk("Meeting Tap (output)_backlog.mp4", Some(base))+ .await+ .unwrap();+ sqlx::query(+ "WITH RECURSIVE seq(x) AS (SELECT 1 UNION ALL SELECT x + 1 FROM seq WHERE x < 20600)+ INSERT INTO meeting_transcript_segments+ (meeting_id, provider, item_id, device_name, device_type, transcript, captured_at, speaker_name)+ SELECT ?1, 'test', printf('backlog-%d', x), 'Meeting Tap', 'output', printf('turn %d', x),+ strftime('%Y-%m-%dT%H:%M:%f+00:00', ?2, printf('+%d seconds', x)), 'speaker 1'+ FROM seq",+ ).bind(meeting).bind(base).execute(&db.pool).await.unwrap();+ sqlx::query(+ "INSERT INTO audio_transcriptions+ (audio_chunk_id, offset_index, timestamp, transcription, device, is_input_device, speaker_id, transcription_engine)+ SELECT ?1, id, captured_at, transcript, device_name, 0, ?2, 'live'+ FROM meeting_transcript_segments WHERE meeting_id = ?3 ORDER BY captured_at LIMIT 600",+ ).bind(chunk).bind(speaker).bind(meeting).execute(&db.pool).await.unwrap();++ let started = std::time::Instant::now();+ let (mapped, captured) = tokio::time::timeout(std::time::Duration::from_secs(3), async {+ tokio::join!(+ db.backfill_meeting_segment_speakers(base, 15.0),+ db.insert_audio_chunk("continued_capture.mp4", Some(Utc::now())),+ )+ })+ .await+ .expect("identity backlog must not stall capture writes for seconds");+ let mapped = mapped.unwrap();+ let captured = captured.unwrap();+ println!(+ "{}",+ json!({"eval":"speaker_backfill_progress","first_pass":mapped,"expected":500,"seconds":started.elapsed().as_secs_f64()})+ );+ assert_eq!(+ mapped, 500,+ "skip unresolved recent turns and fill eligible older turns"+ );+ assert_eq!(+ db.backfill_meeting_segment_speakers(base, 15.0)+ .await+ .unwrap(),+ 100+ );+ assert_eq!(+ db.backfill_meeting_segment_speakers(base, 15.0)+ .await+ .unwrap(),+ 0+ );+ let unknown: i64 = sqlx::query_scalar("SELECT COUNT(*) FROM meeting_transcript_segments WHERE meeting_id = ?1 AND speaker_id IS NULL")+ .bind(meeting).fetch_one(&db.pool).await.unwrap();+ assert_eq!(+ unknown, 20000,+ "preserve uncertainty and captured transcripts"+ );+ let durable: i64 = sqlx::query_scalar(+ "SELECT COUNT(*) FROM audio_chunks WHERE id = ?1 AND file_path = 'continued_capture.mp4'",+ )+ .bind(captured)+ .fetch_one(&db.pool)+ .await+ .unwrap();+ assert_eq!(durable, 1);+}diff --git a/crates/screenpipe-db/tests/speaker_reassignment_test.rs b/crates/screenpipe-db/tests/speaker_reassignment_test.rsindex 76f30ae40..9692bd909 100644--- a/crates/screenpipe-db/tests/speaker_reassignment_test.rs+++ b/crates/screenpipe-db/tests/speaker_reassignment_test.rs@@ -147,7 +147,7 @@ mod speaker_reassignment_tests {// =========================================================================#[tokio::test]- async fn test_update_transcriptions_speaker() {+ async fn test_background_backfill_preserves_existing_speaker() {let db = setup_test_db().await;// Create speaker and audio@@ -165,7 +165,15 @@ mod speaker_reassignment_tests {.await.unwrap();- assert!(rows_updated > 0);+ assert_eq!(rows_updated, 0);+ let actual: Option<i64> = sqlx::query_scalar(+ "SELECT speaker_id FROM audio_transcriptions WHERE audio_chunk_id = ?1",+ )+ .bind(audio_chunk_id)+ .fetch_one(&db.pool)+ .await+ .unwrap();+ assert_eq!(actual, Some(speaker_id));}// =========================================================================diff --git a/crates/screenpipe-db/tests/timeline_live_meeting_test.rs b/crates/screenpipe-db/tests/timeline_live_meeting_test.rsindex 61ba1d132..e3de29820 100644--- a/crates/screenpipe-db/tests/timeline_live_meeting_test.rs+++ b/crates/screenpipe-db/tests/timeline_live_meeting_test.rs@@ -503,16 +503,16 @@ mod timeline_live_meeting_tests {// A named global speaker (as the embedding backfill would have created/named).let speaker = db.create_speaker_with_name("Chris Ng").await.unwrap();- // The meeting's covering audio, already identified with that speaker.+ // The exact mirrored live turn, already identified with that speaker.let chunk_id = db.insert_audio_chunk("System Audio (output)_meeting.mp4", Some(base)).await.unwrap();db.insert_audio_transcription(chunk_id,- "identified background line",+ "audience question",0,- "",+ "live",&AudioDevice {name: "System Audio".to_string(),device_type: DeviceType::Output,@@ -539,7 +539,7 @@ mod timeline_live_meeting_tests {"output",Some("speaker 1"),"audience question",- base + Duration::seconds(1),+ base,).await.unwrap();@@ -679,7 +679,7 @@ mod timeline_live_meeting_tests {}#[tokio::test]- async fn test_speaker_backfill_matches_reference_and_breaks_ties_deterministically() {+ async fn test_speaker_backfill_abstains_on_nearby_turns() {let db = setup_test_db().await;// This millisecond phase makes julianday() represent +2s as one ULP// nearer than -2s, reproducing the old incorrect tie resolution.@@ -697,8 +697,8 @@ mod timeline_live_meeting_tests {let earlier = db.create_speaker_with_name("Earlier").await.unwrap();let later = db.create_speaker_with_name("Later").await.unwrap();- // Equal distance from the segment. The documented tie order picks the- // earlier timestamp, then the lower row id when timestamps also match.+ // Nearby turns are not evidence of who spoke the unresolved turn.+ // Timestamp or row-id tie breakers cannot establish identity.for (text, timestamp, speaker_id) in [("later", base + Duration::seconds(2), later.id),("earlier", base - Duration::seconds(2), earlier.id),@@ -733,40 +733,19 @@ mod timeline_live_meeting_tests {.await.unwrap();- // Reference implementation: the old nearest-row lookup plus explicit- // timestamp/id tie breakers. Use integer epoch milliseconds so equal- // offsets remain exactly equal before applying those tie breakers.- let expected: i64 = sqlx::query_scalar(- "SELECT speaker_id FROM audio_transcriptions \- WHERE speaker_id IS NOT NULL AND COALESCE(is_input_device, 1) = 0 \- AND ABS( \- CAST(ROUND(unixepoch(timestamp, 'subsec') * 1000.0) AS INTEGER) - \- CAST(ROUND(unixepoch(?1, 'subsec') * 1000.0) AS INTEGER) \- ) <= 10000 \- ORDER BY ABS( \- CAST(ROUND(unixepoch(timestamp, 'subsec') * 1000.0) AS INTEGER) - \- CAST(ROUND(unixepoch(?1, 'subsec') * 1000.0) AS INTEGER) \- ), timestamp, id LIMIT 1",- )- .bind(base)- .fetch_one(&db.pool)- .await- .unwrap();-- assert_eq!(expected, earlier.id);assert_eq!(db.backfill_meeting_segment_speakers(base - Duration::hours(1), 10.0).await.unwrap(),- 1+ 0);- let actual: i64 = sqlx::query_scalar(+ let actual: Option<i64> = sqlx::query_scalar("SELECT speaker_id FROM meeting_transcript_segments WHERE item_id = 'tie-segment'",).fetch_one(&db.pool).await.unwrap();- assert_eq!(actual, expected);+ assert_eq!(actual, None);}#[tokio::test]diff --git a/docs/COVERAGE.md b/docs/COVERAGE.mdindex 8408eccd6..f4462e0bc 100644--- a/docs/COVERAGE.md+++ b/docs/COVERAGE.md@@ -37,16 +37,16 @@ results and `cargo llvm-cov` data on top when judging release confidence.### Core Engine- Mapped suites: 36-- Mapped Rust files: 377-- Active test blocks: 3720+- Mapped Rust files: 378+- Active test blocks: 3724- Ignored/manual test blocks: 168-- Weighted coverage points: 3068.5+- Weighted coverage points: 3072.5| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 32 | 3574 | 154 | 3002.3 | 21 | 11 | 100% |-| macos | 31 | 3602 | 129 | 2992.2 | 22 | 11 | 100% |-| linux | 28 | 3159 | 129 | 2627.0 | 20 | 11 | 100% |+| windows | 32 | 3578 | 154 | 3006.3 | 21 | 11 | 100% |+| macos | 31 | 3606 | 129 | 2996.2 | 22 | 11 | 100% |+| linux | 28 | 3163 | 129 | 2631.0 | 20 | 11 | 100% |## Refreshdiff --git a/docs/coverage/CORE.md b/docs/coverage/CORE.mdindex c18164cd7..d41fffe72 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, screenpipe-fs- Mapped suites: 36-- Mapped Rust files: 377-- Active test blocks: 3720+- Mapped Rust files: 378+- Active test blocks: 3724- Ignored/manual test blocks: 168-- Declared test blocks: 3888-- Weighted coverage points: 3068.5+- Declared test blocks: 3892+- Weighted coverage points: 3072.5Confidence 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,16 +23,16 @@ are explicitly enabled in a runtime lane.| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 32 | 3574 | 154 | 3002.3 | 21 | 11 | 100% |-| macos | 31 | 3602 | 129 | 2992.2 | 22 | 11 | 100% |-| linux | 28 | 3159 | 129 | 2627.0 | 20 | 11 | 100% |+| windows | 32 | 3578 | 154 | 3006.3 | 21 | 11 | 100% |+| macos | 31 | 3606 | 129 | 2996.2 | 22 | 11 | 100% |+| linux | 28 | 3163 | 129 | 2631.0 | 20 | 11 | 100% |## Crate Summary| Crate | Suites | Integration files | Source unit files | Active tests | Ignored tests | Weighted points | Flows || --- | --- | --- | --- | --- | --- | --- | --- || screenpipe-engine | 12 | 21 | 125 | 1786 | 52 | 1374.0 | 10 |-| screenpipe-db | 5 | 63 | 25 | 584 | 25 | 556.1 | 9 |+| screenpipe-db | 5 | 64 | 25 | 588 | 25 | 560.1 | 9 || screenpipe-sqlite-coordinator | 1 | 0 | 3 | 27 | 0 | 27.0 | 2 || screenpipe-audio | 7 | 25 | 53 | 672 | 48 | 588.8 | 5 || screenpipe-screen | 6 | 9 | 19 | 272 | 9 | 242.3 | 4 |@@ -63,21 +63,21 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| Layer | windows | macos | linux || --- | --- | --- | --- || accessibility | 4 suites / 373 active / 35 ignored / 339.1 pts | 4 suites / 414 active / 10 ignored / 335.4 pts | 4 suites / 333 active / 7 ignored / 305.5 pts |-| audio | 9 suites / 790 active / 49 ignored / 706.8 pts | 8 suites / 784 active / 49 ignored / 702.6 pts | 7 suites / 705 active / 48 ignored / 647.3 pts |+| audio | 9 suites / 794 active / 49 ignored / 710.8 pts | 8 suites / 788 active / 49 ignored / 706.6 pts | 7 suites / 709 active / 48 ignored / 651.3 pts || audio-device | 2 suites / 234 active / 7 ignored / 210.3 pts | 2 suites / 234 active / 7 ignored / 210.3 pts | 1 suites / 155 active / 6 ignored / 155.0 pts || configuration | 2 suites / 143 active / 3 ignored / 129.2 pts | 2 suites / 143 active / 3 ignored / 129.2 pts | 2 suites / 143 active / 3 ignored / 129.2 pts |-| database | 7 suites / 538 active / 21 ignored / 510.1 pts | 7 suites / 538 active / 21 ignored / 510.1 pts | 7 suites / 538 active / 21 ignored / 510.1 pts |+| database | 7 suites / 542 active / 21 ignored / 514.1 pts | 7 suites / 542 active / 21 ignored / 514.1 pts | 7 suites / 542 active / 21 ignored / 514.1 pts || db-search | 2 suites / 113 active / 9 ignored / 113.0 pts | 2 suites / 113 active / 9 ignored / 113.0 pts | 2 suites / 113 active / 9 ignored / 113.0 pts || engine-lifecycle | 6 suites / 247 active / 1 ignored / 222.0 pts | 6 suites / 247 active / 1 ignored / 222.0 pts | 6 suites / 243 active / 9 ignored / 221.1 pts || local-api | 3 suites / 470 active / 11 ignored / 331.4 pts | 3 suites / 470 active / 11 ignored / 331.4 pts | 3 suites / 470 active / 11 ignored / 331.4 pts |-| meeting | 6 suites / 1683 active / 24 ignored / 1374.3 pts | 6 suites / 1683 active / 24 ignored / 1374.3 pts | 4 suites / 1334 active / 20 ignored / 1049.0 pts |+| meeting | 6 suites / 1687 active / 24 ignored / 1378.3 pts | 6 suites / 1687 active / 24 ignored / 1378.3 pts | 4 suites / 1338 active / 20 ignored / 1053.0 pts || ocr | 4 suites / 136 active / 7 ignored / 126.7 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 / 1620 active / 78 ignored / 1433.3 pts | 14 suites / 1728 active / 82 ignored / 1476.5 pts | 13 suites / 1620 active / 78 ignored / 1433.3 pts || pipes | 1 suites / 522 active / 3 ignored / 365.4 pts | 1 suites / 522 active / 3 ignored / 365.4 pts | 1 suites / 522 active / 3 ignored / 365.4 pts || privacy | 5 suites / 975 active / 42 ignored / 788.1 pts | 5 suites / 1016 active / 17 ignored / 784.4 pts | 5 suites / 935 active / 14 ignored / 754.4 pts || real-app | - | 1 suites / 108 active / 4 ignored / 43.2 pts | - |-| speaker | 2 suites / 384 active / 11 ignored / 384.0 pts | 2 suites / 384 active / 11 ignored / 384.0 pts | 2 suites / 384 active / 11 ignored / 384.0 pts |+| speaker | 2 suites / 388 active / 11 ignored / 388.0 pts | 2 suites / 388 active / 11 ignored / 388.0 pts | 2 suites / 388 active / 11 ignored / 388.0 pts || storage | 4 suites / 665 active / 38 ignored / 552.5 pts | 4 suites / 665 active / 38 ignored / 552.5 pts | 4 suites / 665 active / 38 ignored / 552.5 pts || sync | 1 suites / 522 active / 3 ignored / 365.4 pts | 1 suites / 522 active / 3 ignored / 365.4 pts | 1 suites / 522 active / 3 ignored / 365.4 pts || timeline | 4 suites / 1212 active / 44 ignored / 993.0 pts | 4 suites / 1212 active / 44 ignored / 993.0 pts | 4 suites / 1212 active / 44 ignored / 993.0 pts |@@ -131,7 +131,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| audio-transcription-pipeline | screenpipe-audio | windows, macos, linux | audio, transcription, performance | audio-record-transcribe, meeting-live-notes, performance-liveness | high | partial | mixed | 16 | 121 | 9 | Batch deferral, cleanup, language detection, result normalization, and real recording/transcription tests. Hardware/model-heavy tests are ignored by default. Also covers ffmpeg encode child reaping on error paths. || audio-windows-parakeet-provider | screenpipe-audio | windows | audio, transcription | audio-record-transcribe | high | partial | unit | 1 | 6 | 0 | Registers existing CPU override, eligible adapter selection, DXGI ordinal, error fallback and adapter determinism tests. Windows-only; manifest registration does not verify execution on physical GPU hardware. || db-accessibility-ui-events | screenpipe-db | windows, macos, linux | database, configuration, accessibility, ui-events, performance | settings-to-engine-config, accessibility-ui-events, performance-liveness | medium | partial | integration | 7 | 27 | 2 | Elements bulk insert, on-screen filtering, UI event batching, DB tier config, and ignored heavy-read real-DB probes. |-| db-audio-meetings-speakers | screenpipe-db | windows, macos, linux | database, audio, meeting, speaker | audio-record-transcribe, audio-device-health, meeting-live-notes | high | strong | integration | 16 | 115 | 1 | Audio transcript dedupe, live meeting mirroring, end-generation and open-meeting invariants, liveness, and speaker reassignment coverage. |+| db-audio-meetings-speakers | screenpipe-db | windows, macos, linux | database, audio, meeting, speaker | audio-record-transcribe, audio-device-health, meeting-live-notes | high | strong | integration | 17 | 119 | 1 | Audio transcript dedupe, live meeting mirroring, end-generation and open-meeting invariants, liveness, and speaker reassignment coverage. || db-runtime-reliability | screenpipe-db | windows, macos, linux | database, performance | performance-liveness | high | partial | mixed | 16 | 47 | 6 | SQLite hard-fault classification, failpoint VFS injection, fresh-identity recovery verification with integrity/FK/write canaries, query cancellation, close-severs-connections regressions, multi-pool WAL parity, runtime version pinning, and WAL chaos plus memory-pressure probes, plus read-only quarantine self-heal verification for transient IOERR faults. || db-search-indexing | screenpipe-db | windows, macos, linux | db-search, ocr, accessibility, performance | local-api-search, capture-ocr-pipeline, accessibility-ui-events, performance-liveness | high | strong | mixed | 13 | 105 | 4 | FTS, tokenizer, OCR snapshot search, query planning, ordering, accessibility search, and contention coverage. || db-timeline-frames | screenpipe-db | windows, macos, linux | database, timeline, storage, performance | timeline-streaming, performance-liveness | high | strong | mixed | 36 | 290 | 12 | Frame/audio joins, timeline query shape, suggestions frames, write queue, DB primitives (src/db.rs split into src/db/ modules), feedback record upserts, media eviction anti-join regressions, SAF output registry, semantic storage, and timeline performance. |@@ -343,6 +343,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| db-audio-meetings-speakers | screenpipe-db | tests/single_open_meeting_invariant_test.rs | integration | 3 | 0 | 3 || db-audio-meetings-speakers | screenpipe-db | tests/speaker_benchmark.rs | integration | 0 | 1 | 1 || db-audio-meetings-speakers | screenpipe-db | tests/speaker_delete_test.rs | integration | 3 | 0 | 3 |+| db-audio-meetings-speakers | screenpipe-db | tests/speaker_identity_eval.rs | integration | 4 | 0 | 4 || db-audio-meetings-speakers | screenpipe-db | tests/speaker_reassignment_test.rs | integration | 29 | 0 | 29 || db-runtime-reliability | screenpipe-db | tests/sqlite_architecture_invariants_test.rs | integration | 2 | 0 | 2 || db-runtime-reliability | screenpipe-db | tests/sqlite_runtime_version.rs | integration | 1 | 0 | 1 |diff --git a/docs/coverage/core-engine-map.json b/docs/coverage/core-engine-map.jsonindex 0f914c6d7..2c2eccf9c 100644--- a/docs/coverage/core-engine-map.json+++ b/docs/coverage/core-engine-map.json@@ -786,6 +786,7 @@"tests/speaker_benchmark.rs","tests/speaker_delete_test.rs","tests/speaker_reassignment_test.rs",+ "tests/speaker_identity_eval.rs","tests/timeline_live_meeting_index_test.rs","tests/timeline_live_meeting_test.rs","tests/untranscribed_chunks_test.rs"