Skip to content

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

fix: enable enterprise parsed sync by default (#7668)

Louis Beaumonta8aaee2d6348
diff --git a/apps/screenpipe-app-tauri/lib/hooks/__tests__/use-enterprise-policy.test.tsx b/apps/screenpipe-app-tauri/lib/hooks/__tests__/use-enterprise-policy.test.tsx
index 28087fca0..3ef682143 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/__tests__/use-enterprise-policy.test.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/__tests__/use-enterprise-policy.test.tsx
@@ -248,6 +248,23 @@ describe("enterprise policy runtime manual activation", () => {
vi.useRealTimers();
});
+ it.each([
+ [undefined, true],
+ [{}, true],
+ [{ parsed: true }, true],
+ [{ parsed: false }, false],
+ ])("pushes the parsed-data default to native sync while preserving %j", async (streams, expected) => {
+ mocks.commands.getEnterpriseLicenseKey.mockResolvedValue(KEY);
+ mockEnterpriseApi({ policy: { syncStreams: streams } });
+ const hook = await renderEnterprisePolicy();
+ await waitFor(() => {
+ expect(mocks.commands.setSyncStreams).toHaveBeenCalledWith(
+ true, expected, true, true, true, true, "off", "off",
+ );
+ });
+ hook.unmount();
+ });
+
it("shares one policy runtime across multiple consumers", async () => {
mocks.commands.getEnterpriseLicenseKey.mockResolvedValue(KEY);
mockEnterpriseApi({});
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts b/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts
index 8bdb0b23b..dd8afb6e8 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts
@@ -917,9 +917,8 @@ export function useEnterprisePolicyRuntime() {
}
// Push per-stream sync toggles to Rust so the enterprise sync task
- // gates each upload kind. Existing text/event streams default on.
- // Parsed app data is a new, richer data class and fails closed when an
- // older server does not return the flag.
+ // gates each upload kind. Text/event streams and parsed app data default
+ // on, including when an older server omits the flag. Preserve opt-outs.
try {
const streams = (data.syncStreams ?? {}) as Record<string, unknown>;
const pickBool = (key: string): boolean =>
@@ -944,7 +943,7 @@ export function useEnterprisePolicyRuntime() {
"enterprise setSyncStreams",
commands.setSyncStreams(
pickBool("frames"),
- streams.parsed === true,
+ pickBool("parsed"),
pickBool("audio"),
pickBool("ui_events"),
pickBool("memories"),
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/enterprise/policy.rs b/apps/screenpipe-app-tauri/src-tauri/src/enterprise/policy.rs
index 17e392b3f..e4f0dbc21 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/enterprise/policy.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/enterprise/policy.rs
@@ -120,8 +120,8 @@ impl AiToolPolicy {
}
static POLICY_UPDATE_LOCK: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
-/// Per-stream sync policy. Established streams preserve their historical
-/// defaults, while richer semantic streams require an explicit opt-in. The
+/// Per-stream sync policy. Text/event streams and parsed app data default on;
+/// Activities, feedback, and screenshot pixels require explicit opt-in. The
/// frontend pulls the admin's choices from `GET /api/enterprise/policy`
/// (`syncStreams` field) on
/// the 5-min poll and pushes them in via `set_sync_streams`. The sync state
@@ -211,7 +211,7 @@ impl Default for SyncStreams {
fn default() -> Self {
Self {
frames: true,
- parsed: false,
+ parsed: true,
activities: false,
audio: true,
ui_events: true,
@@ -1019,12 +1019,10 @@ mod tests {
}
#[test]
- fn sync_streams_default_keeps_parsed_data_off() {
- // Existing streams preserve deployed behavior; the new structured
- // data class requires an explicit admin choice.
+ fn sync_streams_default_enables_parsed_data() {
let s = SyncStreams::default();
assert!(s.frames);
- assert!(!s.parsed);
+ assert!(s.parsed);
assert!(!s.activities);
assert!(s.audio);
assert!(s.ui_events);
@@ -1066,6 +1064,8 @@ mod tests {
"off".to_string(),
"off".to_string(),
);
+ assert!(!current_sync_streams().parsed);
+ *SYNC_STREAMS.write().unwrap() = SyncStreams::default();
}
}
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/enterprise/sync.rs b/apps/screenpipe-app-tauri/src-tauri/src/enterprise/sync.rs
index 6dad6cec2..333cee27c 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/enterprise/sync.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/enterprise/sync.rs
@@ -3771,7 +3771,7 @@ pub(crate) mod tests {
fn drop(&mut self) {
crate::enterprise_policy::set_sync_streams(
true,
- false,
+ true,
true,
true,
true,
@@ -5450,15 +5450,17 @@ pub(crate) mod tests {
}
#[tokio::test]
- async fn parsed_rows_upload_as_a_separate_gated_stream_end_to_end() {
+ async fn parsed_rows_upload_by_default_and_respect_explicit_opt_out() {
let _guard = crate::enterprise_policy::sync_streams_test_lock();
+ let _restore = RestoreDefaultSyncStreams;
+ let defaults = crate::enterprise_policy::SyncStreams::default();
crate::enterprise_policy::set_sync_streams(
- false,
- true,
- false,
- false,
- false,
- false,
+ defaults.frames,
+ defaults.parsed,
+ defaults.audio,
+ defaults.ui_events,
+ defaults.memories,
+ defaults.snapshots,
"off".to_string(),
"off".to_string(),
);
@@ -5527,6 +5529,19 @@ pub(crate) mod tests {
"off".to_string(),
"off".to_string(),
);
+ let before_opt_out = cursor.last_parsed_ts.clone();
+ let disabled_local = MockLocal::new(vec![], vec![]).with_parsed(vec![vec![parsed(
+ 43,
+ "2026-05-07T11:00:00Z",
+ "This opted-out record must stay local",
+ )]]);
+ let report = run_one_sync(&cfg, &mut cursor, &disabled_local, &reqwest::Client::new())
+ .await
+ .unwrap();
+ assert_eq!(report.parsed, 0);
+ assert_eq!(cursor.last_parsed_ts, before_opt_out);
+ assert!(disabled_local.last_parsed_since.lock().unwrap().is_none());
+ assert_eq!(server.received_requests().await.unwrap().len(), 1);
}
#[tokio::test]
diff --git a/docs/COVERAGE.md b/docs/COVERAGE.md
index 845b9dda1..09837cfd0 100644
--- a/docs/COVERAGE.md
+++ b/docs/COVERAGE.md
@@ -38,15 +38,15 @@ results and `cargo llvm-cov` data on top when judging release confidence.
- Mapped suites: 37
- Mapped Rust files: 392
-- Active test blocks: 3862
+- Active test blocks: 3864
- Ignored/manual test blocks: 181
-- Weighted coverage points: 3188.9
+- Weighted coverage points: 3190.9
| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| windows | 33 | 3714 | 166 | 3121.9 | 21 | 11 | 100% |
-| macos | 32 | 3742 | 142 | 3111.2 | 22 | 11 | 100% |
-| linux | 29 | 3292 | 141 | 2740.2 | 20 | 11 | 100% |
+| windows | 33 | 3716 | 166 | 3123.9 | 21 | 11 | 100% |
+| macos | 32 | 3744 | 142 | 3113.2 | 22 | 11 | 100% |
+| linux | 29 | 3294 | 141 | 2742.2 | 20 | 11 | 100% |
## Refresh
diff --git a/docs/coverage/CORE.md b/docs/coverage/CORE.md
index 4be59f055..af52b51d6 100644
--- a/docs/coverage/CORE.md
+++ b/docs/coverage/CORE.md
@@ -9,10 +9,10 @@ confidence, and criticality.
- Tracked crates: screenpipe-engine, screenpipe-db, screenpipe-sqlite-coordinator, screenpipe-audio, screenpipe-screen, screenpipe-a11y, screenpipe-fs
- Mapped suites: 37
- Mapped Rust files: 392
-- Active test blocks: 3862
+- Active test blocks: 3864
- Ignored/manual test blocks: 181
-- Declared test blocks: 4043
-- Weighted coverage points: 3188.9
+- Declared test blocks: 4045
+- Weighted coverage points: 3190.9
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,16 +23,16 @@ are explicitly enabled in a runtime lane.
| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score |
| --- | --- | --- | --- | --- | --- | --- | --- |
-| windows | 33 | 3714 | 166 | 3121.9 | 21 | 11 | 100% |
-| macos | 32 | 3742 | 142 | 3111.2 | 22 | 11 | 100% |
-| linux | 29 | 3292 | 141 | 2740.2 | 20 | 11 | 100% |
+| windows | 33 | 3716 | 166 | 3123.9 | 21 | 11 | 100% |
+| macos | 32 | 3744 | 142 | 3113.2 | 22 | 11 | 100% |
+| linux | 29 | 3294 | 141 | 2742.2 | 20 | 11 | 100% |
## Crate Summary
| Crate | Suites | Integration files | Source unit files | Active tests | Ignored tests | Weighted points | Flows |
| --- | --- | --- | --- | --- | --- | --- | --- |
| screenpipe-engine | 12 | 22 | 128 | 1851 | 53 | 1426.4 | 10 |
-| screenpipe-db | 5 | 68 | 27 | 624 | 31 | 594.7 | 9 |
+| screenpipe-db | 5 | 68 | 27 | 626 | 31 | 596.7 | 9 |
| screenpipe-sqlite-coordinator | 1 | 0 | 3 | 27 | 0 | 27.0 | 2 |
| screenpipe-audio | 8 | 29 | 53 | 695 | 53 | 606.9 | 5 |
| screenpipe-screen | 6 | 9 | 19 | 276 | 9 | 245.4 | 4 |
@@ -66,21 +66,21 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| audio | 10 suites / 833 active / 57 ignored / 744.9 pts | 9 suites / 827 active / 57 ignored / 740.7 pts | 8 suites / 748 active / 56 ignored / 685.4 pts |
| audio-device | 2 suites / 235 active / 7 ignored / 211.3 pts | 2 suites / 235 active / 7 ignored / 211.3 pts | 1 suites / 156 active / 6 ignored / 156.0 pts |
| configuration | 2 suites / 153 active / 3 ignored / 138.7 pts | 2 suites / 153 active / 3 ignored / 138.7 pts | 2 suites / 153 active / 3 ignored / 138.7 pts |
-| database | 7 suites / 581 active / 27 ignored / 551.7 pts | 7 suites / 581 active / 27 ignored / 551.7 pts | 7 suites / 581 active / 27 ignored / 551.7 pts |
+| database | 7 suites / 583 active / 27 ignored / 553.7 pts | 7 suites / 583 active / 27 ignored / 553.7 pts | 7 suites / 583 active / 27 ignored / 553.7 pts |
| db-search | 2 suites / 119 active / 9 ignored / 119.0 pts | 2 suites / 119 active / 9 ignored / 119.0 pts | 2 suites / 119 active / 9 ignored / 119.0 pts |
| engine-lifecycle | 6 suites / 265 active / 1 ignored / 238.5 pts | 6 suites / 265 active / 1 ignored / 238.5 pts | 6 suites / 261 active / 9 ignored / 237.6 pts |
| local-api | 3 suites / 479 active / 12 ignored / 339.2 pts | 3 suites / 479 active / 12 ignored / 339.2 pts | 3 suites / 479 active / 12 ignored / 339.2 pts |
| meeting | 6 suites / 1751 active / 32 ignored / 1433.0 pts | 6 suites / 1751 active / 32 ignored / 1433.0 pts | 4 suites / 1397 active / 28 ignored / 1102.7 pts |
| ocr | 4 suites / 140 active / 7 ignored / 129.8 pts | 4 suites / 133 active / 7 ignored / 127.6 pts | 3 suites / 124 active / 6 ignored / 118.6 pts |
| os-integration | 1 suites / 6 active / 0 ignored / 1.7 pts | 1 suites / 6 active / 0 ignored / 1.7 pts | - |
-| performance | 13 suites / 1675 active / 82 ignored / 1479.6 pts | 14 suites / 1785 active / 87 ignored / 1523.6 pts | 13 suites / 1675 active / 82 ignored / 1479.6 pts |
+| performance | 13 suites / 1677 active / 82 ignored / 1481.6 pts | 14 suites / 1787 active / 87 ignored / 1525.6 pts | 13 suites / 1677 active / 82 ignored / 1481.6 pts |
| pipes | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts |
| privacy | 5 suites / 1013 active / 42 ignored / 816.8 pts | 5 suites / 1054 active / 18 ignored / 812.5 pts | 5 suites / 971 active / 14 ignored / 781.7 pts |
| real-app | - | 1 suites / 110 active / 5 ignored / 44.0 pts | - |
| speaker | 2 suites / 416 active / 18 ignored / 416.0 pts | 2 suites / 416 active / 18 ignored / 416.0 pts | 2 suites / 416 active / 18 ignored / 416.0 pts |
-| storage | 4 suites / 686 active / 41 ignored / 571.7 pts | 4 suites / 686 active / 41 ignored / 571.7 pts | 4 suites / 686 active / 41 ignored / 571.7 pts |
+| storage | 4 suites / 688 active / 41 ignored / 573.7 pts | 4 suites / 688 active / 41 ignored / 573.7 pts | 4 suites / 688 active / 41 ignored / 573.7 pts |
| sync | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts | 1 suites / 551 active / 3 ignored / 385.7 pts |
-| timeline | 4 suites / 1234 active / 48 ignored / 1013.2 pts | 4 suites / 1234 active / 48 ignored / 1013.2 pts | 4 suites / 1234 active / 48 ignored / 1013.2 pts |
+| timeline | 4 suites / 1236 active / 48 ignored / 1015.2 pts | 4 suites / 1236 active / 48 ignored / 1015.2 pts | 4 suites / 1236 active / 48 ignored / 1015.2 pts |
| transcription | 7 suites / 890 active / 53 ignored / 696.6 pts | 6 suites / 884 active / 53 ignored / 692.4 pts | 6 suites / 884 active / 53 ignored / 692.4 pts |
| ui-events | 4 suites / 828 active / 34 ignored / 627.7 pts | 3 suites / 759 active / 5 ignored / 579.4 pts | 3 suites / 759 active / 5 ignored / 579.4 pts |
| vision-capture | 6 suites / 576 active / 32 ignored / 453.6 pts | 6 suites / 569 active / 32 ignored / 451.4 pts | 5 suites / 560 active / 31 ignored / 442.4 pts |
@@ -135,7 +135,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| 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 | 19 | 135 | 4 | 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 | 50 | 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 | 14 | 106 | 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 | 39 | 305 | 15 | 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. |
+| db-timeline-frames | screenpipe-db | windows, macos, linux | database, timeline, storage, performance | timeline-streaming, performance-liveness | high | strong | mixed | 39 | 307 | 15 | 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. |
| 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 | 45 | 430 | 7 | 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 | 25 | 306 | 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 | 13 | 125 | 1 | Fast logic coverage for the config bridge, health-endpoint identity, tray health debounce, sleep/power policies, and queue backpressure. |
@@ -291,7 +291,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su
| db-runtime-reliability | screenpipe-db | src/recovery.rs | source | 5 | 0 | 5 |
| db-runtime-reliability | screenpipe-db | src/sqlite_error.rs | source | 5 | 0 | 5 |
| db-timeline-frames | screenpipe-db | src/storage/bulk/elements/lifecycle.rs | source | 2 | 0 | 2 |
-| db-timeline-frames | screenpipe-db | src/storage/bulk/tests.rs | source | 9 | 0 | 9 |
+| db-timeline-frames | screenpipe-db | src/storage/bulk/tests.rs | source | 11 | 0 | 11 |
| db-timeline-frames | screenpipe-db | src/storage/diagnostics.rs | source | 7 | 0 | 7 |
| db-timeline-frames | screenpipe-db | src/storage/lifecycle.rs | source | 3 | 1 | 4 |
| db-timeline-frames | screenpipe-db | src/storage/parity.rs | source | 2 | 0 | 2 |