Skip to content

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

test: cover local api OCR search route

Louis Beaumonte3330324ab65
diff --git a/COVERAGE.md b/COVERAGE.md
index c4c9b9e55..5f49b592b 100644
--- a/COVERAGE.md
+++ b/COVERAGE.md
@@ -30,17 +30,17 @@ results and `cargo llvm-cov` data on top when judging release confidence.
### Core Engine
-- Mapped suites: 22
+- Mapped suites: 23
- Mapped Rust files: 190
-- Active test blocks: 1639
+- Active test blocks: 1640
- Ignored/manual test blocks: 108
-- Weighted coverage points: 1365.1
+- Weighted coverage points: 1366.1
| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| windows | 19 | 1542 | 105 | 1319.3 | 21 | 11 | 95% |
-| macos | 19 | 1594 | 85 | 1337.4 | 22 | 11 | 95% |
-| linux | 17 | 1531 | 82 | 1308.7 | 20 | 11 | 91% |
+| windows | 20 | 1543 | 105 | 1320.3 | 21 | 11 | 100% |
+| macos | 20 | 1595 | 85 | 1338.4 | 22 | 11 | 100% |
+| linux | 18 | 1532 | 82 | 1309.7 | 20 | 11 | 95% |
## Refresh
diff --git a/Cargo.lock b/Cargo.lock
index 067d08f76..cae7b1f0f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8070,7 +8070,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"audiopipe",
@@ -8132,7 +8132,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio-eval"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"audiopipe",
@@ -8170,7 +8170,7 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -8183,7 +8183,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"async-trait",
@@ -8221,7 +8221,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -8273,7 +8273,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"chrono",
@@ -8299,7 +8299,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"arc-swap",
@@ -8375,7 +8375,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"chrono",
@@ -8393,7 +8393,7 @@ dependencies = [
[[package]]
name = "screenpipe-meeting-eval"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"clap",
@@ -8405,7 +8405,7 @@ dependencies = [
[[package]]
name = "screenpipe-redact"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"anyhow",
"async-trait",
@@ -8435,7 +8435,7 @@ dependencies = [
[[package]]
name = "screenpipe-rfdetr-mlx"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"image",
"mlx-rs",
@@ -8446,7 +8446,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -8504,7 +8504,7 @@ dependencies = [
[[package]]
name = "screenpipe-sync"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"async-trait",
"base64 0.22.1",
@@ -8526,7 +8526,7 @@ dependencies = [
[[package]]
name = "screenpipe-team-memory"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"serde",
"serde_yaml",
@@ -8535,7 +8535,7 @@ dependencies = [
[[package]]
name = "screenpipe-vault"
-version = "0.3.351"
+version = "0.4.0"
dependencies = [
"argon2",
"chacha20poly1305",
diff --git a/coverage/CORE.md b/coverage/CORE.md
index 0e0ec57c1..d7215d532 100644
--- a/coverage/CORE.md
+++ b/coverage/CORE.md
@@ -7,12 +7,12 @@ confidence, and criticality.
- Manifest: `coverage/core-engine-map.json`
- Tracked crates: screenpipe-engine, screenpipe-db, screenpipe-audio, screenpipe-screen, screenpipe-a11y
-- Mapped suites: 22
+- Mapped suites: 23
- Mapped Rust files: 190
-- Active test blocks: 1639
+- Active test blocks: 1640
- Ignored/manual test blocks: 108
-- Declared test blocks: 1747
-- Weighted coverage points: 1365.1
+- Declared test blocks: 1748
+- Weighted coverage points: 1366.1
Confidence weights: strong=1.0, partial=0.7, conditional=0.4, smoke=0.3.
Criticality weights: high=1.0, medium=0.7, low=0.4.
@@ -23,15 +23,15 @@ are explicitly enabled in a runtime lane.
| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| windows | 19 | 1542 | 105 | 1319.3 | 21 | 11 | 95% |
-| macos | 19 | 1594 | 85 | 1337.4 | 22 | 11 | 95% |
-| linux | 17 | 1531 | 82 | 1308.7 | 20 | 11 | 91% |
+| windows | 20 | 1543 | 105 | 1320.3 | 21 | 11 | 100% |
+| macos | 20 | 1595 | 85 | 1338.4 | 22 | 11 | 100% |
+| linux | 18 | 1532 | 82 | 1309.7 | 20 | 11 | 95% |
## Crate Summary
| Crate | Suites | Integration files | Source unit files | Active tests | Ignored tests | Weighted points | Flows |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| screenpipe-engine | 5 | 14 | 49 | 658 | 40 | 488.9 | 10 |
+| screenpipe-engine | 6 | 14 | 49 | 659 | 40 | 489.9 | 10 |
| screenpipe-db | 4 | 27 | 5 | 289 | 4 | 280.3 | 9 |
| screenpipe-audio | 5 | 23 | 28 | 282 | 35 | 245.2 | 5 |
| screenpipe-screen | 4 | 9 | 8 | 167 | 4 | 166.7 | 4 |
@@ -65,10 +65,10 @@ bun run coverage:core -- --llvm-cov-summary ../../coverage/core-llvm-cov-summary
| audio-device | 1 suites / 76 active / 4 ignored / 76.0 pts | 1 suites / 76 active / 4 ignored / 76.0 pts | 1 suites / 76 active / 4 ignored / 76.0 pts |
| configuration | 2 suites / 114 active / 3 ignored / 105.3 pts | 2 suites / 114 active / 3 ignored / 105.3 pts | 2 suites / 114 active / 3 ignored / 105.3 pts |
| database | 3 suites / 210 active / 4 ignored / 201.3 pts | 3 suites / 210 active / 4 ignored / 201.3 pts | 3 suites / 210 active / 4 ignored / 201.3 pts |
-| db-search | 1 suites / 79 active / 0 ignored / 79.0 pts | 1 suites / 79 active / 0 ignored / 79.0 pts | 1 suites / 79 active / 0 ignored / 79.0 pts |
+| db-search | 2 suites / 80 active / 5 ignored / 80.0 pts | 2 suites / 80 active / 5 ignored / 80.0 pts | 2 suites / 80 active / 5 ignored / 80.0 pts |
| engine-lifecycle | 2 suites / 99 active / 1 ignored / 97.6 pts | 2 suites / 99 active / 1 ignored / 97.6 pts | 1 suites / 97 active / 1 ignored / 97.0 pts |
-| local-api | 1 suites / 103 active / 7 ignored / 72.1 pts | 1 suites / 103 active / 7 ignored / 72.1 pts | 1 suites / 103 active / 7 ignored / 72.1 pts |
-| meeting | 4 suites / 622 active / 16 ignored / 493.3 pts | 4 suites / 622 active / 16 ignored / 493.3 pts | 4 suites / 622 active / 16 ignored / 493.3 pts |
+| local-api | 2 suites / 104 active / 7 ignored / 73.1 pts | 2 suites / 104 active / 7 ignored / 73.1 pts | 2 suites / 104 active / 7 ignored / 73.1 pts |
+| meeting | 4 suites / 622 active / 11 ignored / 493.3 pts | 4 suites / 622 active / 11 ignored / 493.3 pts | 4 suites / 622 active / 11 ignored / 493.3 pts |
| ocr | 3 suites / 80 active / 3 ignored / 79.7 pts | 3 suites / 88 active / 2 ignored / 88.0 pts | 2 suites / 79 active / 2 ignored / 79.0 pts |
| os-integration | 1 suites / 2 active / 0 ignored / 0.6 pts | 1 suites / 2 active / 0 ignored / 0.6 pts | - |
| performance | 10 suites / 875 active / 54 ignored / 798.7 pts | 11 suites / 945 active / 57 ignored / 826.7 pts | 10 suites / 875 active / 54 ignored / 798.7 pts |
@@ -78,8 +78,8 @@ bun run coverage:core -- --llvm-cov-summary ../../coverage/core-llvm-cov-summary
| speaker | 2 suites / 193 active / 3 ignored / 193.0 pts | 2 suites / 193 active / 3 ignored / 193.0 pts | 2 suites / 193 active / 3 ignored / 193.0 pts |
| storage | 2 suites / 240 active / 27 ignored / 201.0 pts | 2 suites / 240 active / 27 ignored / 201.0 pts | 2 suites / 240 active / 27 ignored / 201.0 pts |
| sync | 1 suites / 326 active / 6 ignored / 228.2 pts | 1 suites / 326 active / 6 ignored / 228.2 pts | 1 suites / 326 active / 6 ignored / 228.2 pts |
-| timeline | 4 suites / 500 active / 35 ignored / 430.1 pts | 4 suites / 500 active / 35 ignored / 430.1 pts | 4 suites / 500 active / 35 ignored / 430.1 pts |
-| transcription | 5 suites / 309 active / 38 ignored / 241.3 pts | 5 suites / 309 active / 38 ignored / 241.3 pts | 5 suites / 309 active / 38 ignored / 241.3 pts |
+| timeline | 4 suites / 500 active / 30 ignored / 430.1 pts | 4 suites / 500 active / 30 ignored / 430.1 pts | 4 suites / 500 active / 30 ignored / 430.1 pts |
+| transcription | 5 suites / 309 active / 33 ignored / 241.3 pts | 5 suites / 309 active / 33 ignored / 241.3 pts | 5 suites / 309 active / 33 ignored / 241.3 pts |
| ui-events | 4 suites / 498 active / 30 ignored / 383.7 pts | 3 suites / 472 active / 8 ignored / 365.5 pts | 3 suites / 472 active / 8 ignored / 365.5 pts |
| vision-capture | 3 suites / 288 active / 28 ignored / 248.7 pts | 3 suites / 296 active / 27 ignored / 257.0 pts | 2 suites / 287 active / 27 ignored / 248.0 pts |
@@ -91,7 +91,7 @@ bun run coverage:core -- --llvm-cov-summary ../../coverage/core-llvm-cov-summary
| Engine health, sleep, and lifecycle | engine-lifecycle | covered (strong; engine-config-lifecycle, engine-focus-os) | covered (strong; engine-config-lifecycle, engine-focus-os) | covered (strong; engine-config-lifecycle) |
| Capture, OCR, and frame persistence | vision-capture, ocr | covered (partial; screen-windows-ocr) | covered (strong; screen-macos-ocr) | weak (strong; screen-capture-windowing, engine-capture-timeline) |
| Timeline frame and stream delivery | timeline | covered (strong; screen-capture-windowing, db-timeline-frames) | covered (strong; screen-capture-windowing, db-timeline-frames) | covered (strong; screen-capture-windowing, db-timeline-frames) |
-| Local API search and indexing | local-api, db-search | weak (strong; db-search-indexing, engine-api-routes) | weak (strong; db-search-indexing, engine-api-routes) | weak (strong; db-search-indexing, engine-api-routes) |
+| Local API search and indexing | local-api, db-search | covered (strong; engine-local-api-search-integration) | covered (strong; engine-local-api-search-integration) | covered (strong; engine-local-api-search-integration) |
| Audio record, transcribe, and reconcile | audio, transcription | covered (strong; audio-meetings-speakers-dedup, audio-transcription-pipeline) | covered (strong; audio-meetings-speakers-dedup, audio-transcription-pipeline) | covered (strong; audio-meetings-speakers-dedup, audio-transcription-pipeline) |
| Audio device and stream health | audio-device | covered (strong; audio-device-stream-health) | covered (strong; audio-device-stream-health) | covered (strong; audio-device-stream-health) |
| Meeting detection and live transcript merge | meeting | covered (strong; engine-meeting-privacy-sync, audio-meetings-speakers-dedup) | covered (strong; engine-meeting-privacy-sync, audio-meetings-speakers-dedup) | covered (strong; engine-meeting-privacy-sync, audio-meetings-speakers-dedup) |
@@ -101,9 +101,9 @@ bun run coverage:core -- --llvm-cov-summary ../../coverage/core-llvm-cov-summary
## Critical Gaps
-- windows: Local API search and indexing (weak).
-- macos: Local API search and indexing (weak).
-- linux: Capture, OCR, and frame persistence (weak); Local API search and indexing (weak).
+- windows: no critical gaps in the current manifest.
+- macos: no critical gaps in the current manifest.
+- linux: Capture, OCR, and frame persistence (weak).
## Execution Integrity
@@ -130,10 +130,11 @@ bun run coverage:core -- --llvm-cov-summary ../../coverage/core-llvm-cov-summary
| 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 | 11 | 83 | 1 | Audio transcript dedupe, live meeting mirroring, open meeting invariants, liveness, and speaker reassignment coverage. |
| 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 | 8 | 79 | 0 | 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 | 8 | 110 | 1 | Frame/audio joins, timeline query shape, suggestions frames, write queue, DB primitives, and timeline performance. |
-| engine-api-routes | screenpipe-engine | windows, macos, linux | local-api, timeline, meeting, transcription | local-api-search, timeline-streaming, meeting-live-notes, audio-record-transcribe | high | partial | mixed | 13 | 103 | 7 | Route/unit coverage for search, health, streaming, meetings, time/timezone, and transcription. Legacy endpoint/websocket tests require local data and remain ignored. |
+| engine-api-routes | screenpipe-engine | windows, macos, linux | local-api, timeline, meeting, transcription | local-api-search, timeline-streaming, meeting-live-notes, audio-record-transcribe | high | partial | mixed | 12 | 103 | 2 | Route/unit coverage for search, health, streaming, meetings, time/timezone, and transcription. Legacy endpoint/websocket tests require local data and remain ignored. |
| engine-capture-timeline | screenpipe-engine | windows, macos, linux | vision-capture, timeline, storage, performance | capture-ocr-pipeline, timeline-streaming, performance-liveness | high | partial | mixed | 18 | 130 | 26 | Covers capture trigger logic, frame/audio linking, hot cache, timeline refresh regressions, fragmented MP4 extraction, and HD-mode control. Several real-data tests are intentionally ignored by default. |
| engine-config-lifecycle | screenpipe-engine | windows, macos, linux | configuration, engine-lifecycle, performance | settings-to-engine-config, engine-health-lifecycle, performance-liveness | high | strong | mixed | 9 | 97 | 1 | Fast logic coverage for the config bridge, tray health debounce, sleep/power policies, and queue backpressure. |
| engine-focus-os | screenpipe-engine | windows, macos | engine-lifecycle, os-integration | engine-health-lifecycle, performance-liveness | medium | conditional | unit | 2 | 2 | 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 | 1 | 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 | 21 | 326 | 6 | Unit-heavy coverage for meeting heuristics, privacy filter policy, UI recorder safety, pipes, sync helpers, and CLI parsing. |
| screen-capture-windowing | screenpipe-screen | windows, macos, linux | vision-capture, timeline, performance, privacy | capture-ocr-pipeline, timeline-streaming, privacy-and-redaction, performance-liveness | high | strong | mixed | 13 | 157 | 1 | Window filtering, empty-window regressions, retry policy, URL timing, monitor cache, OCR cache, snapshots, and image comparison. |
| screen-custom-ocr | screenpipe-screen | windows, macos, linux | ocr | capture-ocr-pipeline | medium | conditional | manual | 1 | 0 | 2 | Custom OCR tests are ignored by default and only contribute when explicitly run. |
@@ -305,7 +306,7 @@ bun run coverage:core -- --llvm-cov-summary ../../coverage/core-llvm-cov-summary
| engine-meeting-privacy-sync | screenpipe-engine | src/workflow_classifier.rs | source | 2 | 0 | 2 |
| engine-capture-timeline | screenpipe-engine | tests/audio_vision_integration_test.rs | integration | 0 | 1 | 1 |
| engine-config-lifecycle | screenpipe-engine | tests/consumer_sleep_test.rs | integration | 5 | 0 | 5 |
-| engine-api-routes | screenpipe-engine | tests/endpoint_test.rs | integration | 0 | 5 | 5 |
+| engine-local-api-search-integration | screenpipe-engine | tests/endpoint_test.rs | integration | 1 | 5 | 6 |
| engine-capture-timeline | screenpipe-engine | tests/first_frames_test.rs | integration | 0 | 4 | 4 |
| engine-capture-timeline | screenpipe-engine | tests/frame_extraction_test.rs | integration | 1 | 5 | 6 |
| engine-capture-timeline | screenpipe-engine | tests/frame_linker_actor_integration.rs | integration | 7 | 0 | 7 |
diff --git a/coverage/core-engine-map.json b/coverage/core-engine-map.json
index 3d7b3a81c..c9c49980f 100644
--- a/coverage/core-engine-map.json
+++ b/coverage/core-engine-map.json
@@ -168,7 +168,6 @@
"src/routes/streaming.rs",
"src/routes/time.rs",
"src/routes/timezone.rs",
- "tests/endpoint_test.rs",
"tests/tags_test.rs",
"tests/transcribe_test.rs",
"tests/websockets_test.rs"
@@ -181,6 +180,21 @@
"kind": "mixed",
"notes": "Route/unit coverage for search, health, streaming, meetings, time/timezone, and transcription. Legacy endpoint/websocket tests require local data and remain ignored."
},
+ {
+ "id": "engine-local-api-search-integration",
+ "label": "Engine local API search route over indexed DB data",
+ "crate": "screenpipe-engine",
+ "files": [
+ "tests/endpoint_test.rs"
+ ],
+ "platforms": ["windows", "macos", "linux"],
+ "layers": ["local-api", "db-search"],
+ "flows": ["local-api-search"],
+ "criticality": "high",
+ "confidence": "strong",
+ "kind": "integration",
+ "notes": "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."
+ },
{
"id": "engine-focus-os",
"label": "Engine focus and OS integration helpers",
diff --git a/crates/screenpipe-engine/tests/endpoint_test.rs b/crates/screenpipe-engine/tests/endpoint_test.rs
index 1a796f10b..3728b7698 100644
--- a/crates/screenpipe-engine/tests/endpoint_test.rs
+++ b/crates/screenpipe-engine/tests/endpoint_test.rs
@@ -12,12 +12,12 @@ mod tests {
use chrono::{Duration, Utc};
use screenpipe_audio::audio_manager::AudioManagerBuilder;
use screenpipe_db::{ContentType, DatabaseManager, SearchResult};
+ use screenpipe_engine::routes::search::SearchResponse;
use screenpipe_engine::SCServer;
use screenpipe_engine::{ContentItem, PaginatedResponse};
use screenpipe_screen::OcrEngine; // Adjust this import based on your actual module structure
use serde::Deserialize;
use std::net::SocketAddr;
- use std::path::PathBuf;
use std::sync::Arc;
use tower::ServiceExt; // for `oneshot` and `ready`
@@ -32,6 +32,15 @@ mod tests {
}
async fn setup_test_app() -> (Router, Arc<DatabaseManager>) {
+ let unique_suffix = std::time::SystemTime::now()
+ .duration_since(std::time::UNIX_EPOCH)
+ .map(|duration| duration.as_nanos())
+ .unwrap_or_default();
+ let screenpipe_dir = std::env::temp_dir().join(format!(
+ "screenpipe-endpoint-test-{}-{unique_suffix}",
+ std::process::id()
+ ));
+
let db = Arc::new(
DatabaseManager::new("sqlite::memory:", Default::default())
.await
@@ -40,7 +49,8 @@ mod tests {
let audio_manager = Arc::new(
AudioManagerBuilder::new()
- .output_path("/tmp/screenpipe".into())
+ .is_disabled(true)
+ .output_path(screenpipe_dir.join("audio"))
.build(db.clone())
.await
.unwrap(),
@@ -49,7 +59,7 @@ mod tests {
let app = SCServer::new(
db.clone(),
SocketAddr::from(([127, 0, 0, 1], 23948)),
- PathBuf::from(""),
+ screenpipe_dir,
false,
false,
audio_manager,
@@ -62,6 +72,72 @@ mod tests {
(router, db)
}
+ #[tokio::test]
+ async fn test_search_route_returns_indexed_ocr_result() {
+ let (app, db) = setup_test_app().await;
+
+ let device_name = "endpoint-test-device";
+ db.insert_video_chunk("endpoint-local-api-search.mp4", device_name)
+ .await
+ .unwrap();
+
+ let frame_id = db
+ .insert_frame(
+ device_name,
+ Some(Utc::now()),
+ Some("https://docs.example/search"),
+ Some("SearchFixtureApp"),
+ Some("Search Fixture Window"),
+ true,
+ Some(0),
+ )
+ .await
+ .unwrap();
+ assert_ne!(frame_id, 0, "test frame should attach to the video chunk");
+
+ db.insert_ocr_text(
+ frame_id,
+ "A user can find the local api sentinel exactmatch from visible OCR text",
+ "[]",
+ Arc::new(OcrEngine::Tesseract.into()),
+ )
+ .await
+ .unwrap();
+
+ let response = app
+ .oneshot(
+ Request::builder()
+ .uri("/search?q=local%20api%20sentinel%20exactmatch&content_type=ocr&limit=5")
+ .body(Body::empty())
+ .unwrap(),
+ )
+ .await
+ .unwrap();
+
+ assert_eq!(response.status(), StatusCode::OK);
+ let body = to_bytes(response.into_body(), usize::MAX).await.unwrap();
+ let search_response: SearchResponse = serde_json::from_slice(&body).unwrap();
+
+ assert_eq!(search_response.pagination.total, 1);
+ assert_eq!(search_response.data.len(), 1);
+
+ match &search_response.data[0] {
+ ContentItem::OCR(ocr) => {
+ assert_eq!(ocr.frame_id, frame_id);
+ assert!(ocr.text.contains("local api sentinel exactmatch"));
+ assert_eq!(ocr.app_name, "SearchFixtureApp");
+ assert_eq!(ocr.window_name, "Search Fixture Window");
+ assert_eq!(
+ ocr.browser_url.as_deref(),
+ Some("https://docs.example/search")
+ );
+ assert_eq!(ocr.device_name, device_name);
+ assert_eq!(ocr.focused, Some(true));
+ }
+ other => panic!("expected OCR search result, got {other:?}"),
+ }
+ }
+
#[tokio::test]
#[ignore = "requires Silero VAD ONNX models, run locally with --ignored"]
async fn test_search_audio_with_length_constraints() {