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(ci): unbreak main — rustfmt drift + date-deterministic compact-markdown test
Louis Beaumontc2004ee2ad4a
diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/compact-markdown.test.tsx b/apps/screenpipe-app-tauri/components/settings/__tests__/compact-markdown.test.tsxindex 631bd3baf..a44572714 100644--- a/apps/screenpipe-app-tauri/components/settings/__tests__/compact-markdown.test.tsx+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/compact-markdown.test.tsx@@ -43,18 +43,27 @@ describe("CompactMarkdown", () => {});it("renders generated window summaries as human memory copy", () => {- render(- <CompactMarkdown data-testid="preview">- {- "_Window checked: 2026-06-20 17:11–18:11 IST (11:41–12:41 UTC)_\n\nNo activity."- }- </CompactMarkdown>,- );+ // The "last hour" label only renders when the window's date is today+ // (formatDateForMemoryCopy compares against `new Date()`), so freeze the+ // clock to the fixture's date — otherwise this fails on any later day.+ vi.useFakeTimers({ toFake: ["Date"] });+ vi.setSystemTime(new Date(2026, 5, 20, 18, 30, 0));+ try {+ render(+ <CompactMarkdown data-testid="preview">+ {+ "_Window checked: 2026-06-20 17:11–18:11 IST (11:41–12:41 UTC)_\n\nNo activity."+ }+ </CompactMarkdown>,+ );- const preview = screen.getByTestId("preview");- expect(preview.textContent).toContain("Checked last hour (5:11 PM-6:11 PM)");- expect(preview.textContent).not.toContain("Window checked");- expect(preview.textContent).not.toContain("2026-06-20");- expect(preview.textContent).not.toContain("UTC");+ const preview = screen.getByTestId("preview");+ expect(preview.textContent).toContain("Checked last hour (5:11 PM-6:11 PM)");+ expect(preview.textContent).not.toContain("Window checked");+ expect(preview.textContent).not.toContain("2026-06-20");+ expect(preview.textContent).not.toContain("UTC");+ } finally {+ vi.useRealTimers();+ }});});diff --git a/crates/screenpipe-db/tests/db.rs b/crates/screenpipe-db/tests/db.rsindex a23159b3d..1183aec67 100644--- a/crates/screenpipe-db/tests/db.rs+++ b/crates/screenpipe-db/tests/db.rs@@ -565,10 +565,8 @@ mod tests {.related_tags(&["person:ada".to_string()], 50).await.unwrap();- let counts: std::collections::HashMap<&str, i64> = related- .iter()- .map(|(n, c)| (n.as_str(), *c))- .collect();+ let counts: std::collections::HashMap<&str, i64> =+ related.iter().map(|(n, c)| (n.as_str(), *c)).collect();assert_eq!(related.len(), 4, "got {related:?}");assert_eq!(related[0], ("project:atlas".to_string(), 3));assert_eq!(counts.get("project:atlas"), Some(&3));@@ -579,17 +577,17 @@ mod tests {assert!(!counts.contains_key("person:bob"), "unrelated tag leaked");// The `limit` truncates to the top-N by count.- let top1 = db.related_tags(&["person:ada".to_string()], 1).await.unwrap();+ let top1 = db+ .related_tags(&["person:ada".to_string()], 1)+ .await+ .unwrap();assert_eq!(top1, vec![("project:atlas".to_string(), 3)]);// Multiple inputs → AND: only items carrying BOTH person:ada AND// project:atlas (f_a, f_b, ac — not the memory, which lacks the// project). Co-occurring extras: workflow:planning and person:connor.let both = db- .related_tags(- &["person:ada".to_string(), "project:atlas".to_string()],- 50,- )+ .related_tags(&["person:ada".to_string(), "project:atlas".to_string()], 50).await.unwrap();let both_names: std::collections::HashSet<&str> =@@ -681,10 +679,7 @@ mod tests {// Duplicate input tags must behave like a single input (the DISTINCT in// the input CTE), NOT silently match nothing.let deduped = db- .related_tags(- &["person:ada".to_string(), "person:ada".to_string()],- 50,- )+ .related_tags(&["person:ada".to_string(), "person:ada".to_string()], 50).await.unwrap();let deduped_names: std::collections::HashSet<&str> =diff --git a/crates/screenpipe-db/tests/tag_filter_bench.rs b/crates/screenpipe-db/tests/tag_filter_bench.rsindex 77e3b3540..d2bf26743 100644--- a/crates/screenpipe-db/tests/tag_filter_bench.rs+++ b/crates/screenpipe-db/tests/tag_filter_bench.rs@@ -530,12 +530,24 @@ async fn bench_related_tags_scaling() {};println!("\n--- timings ---");- bench("person:hot (50k items, wide fan-out)", vec!["person:hot".to_string()]).await;- bench("person:cold (200 items, realistic)", vec!["person:cold".to_string()]).await;+ bench(+ "person:hot (50k items, wide fan-out)",+ vec!["person:hot".to_string()],+ )+ .await;+ bench(+ "person:cold (200 items, realistic)",+ vec!["person:cold".to_string()],+ )+ .await;bench("person:hot+co:0 (AND, two inputs)",vec!["person:hot".to_string(), "co:0".to_string()],).await;- bench("nonexistent:tag (no matches)", vec!["nonexistent:tag".to_string()]).await;+ bench(+ "nonexistent:tag (no matches)",+ vec!["nonexistent:tag".to_string()],+ )+ .await;}diff --git a/crates/screenpipe-engine/src/routes/search.rs b/crates/screenpipe-engine/src/routes/search.rsindex a4840e947..6dcb998e5 100644--- a/crates/screenpipe-engine/src/routes/search.rs+++ b/crates/screenpipe-engine/src/routes/search.rs@@ -267,9 +267,7 @@ fn related_namespace_key(ns: &str) -> String {/// `{"people": ["louis"]}`; a namespace-less tag lands under `"tags"` with its/// full value. Values keep the most-frequent-first order from the query and/// are de-duplicated within each bucket.-fn group_related_tags(- rows: Vec<(String, i64)>,-) -> std::collections::HashMap<String, Vec<String>> {+fn group_related_tags(rows: Vec<(String, i64)>) -> std::collections::HashMap<String, Vec<String>> {let mut grouped: std::collections::HashMap<String, Vec<String>> =std::collections::HashMap::new();for (name, _count) in rows {@@ -1292,10 +1290,7 @@ mod tests {#[test]fn test_group_related_tags_dedupes_within_bucket() {- let rows = vec![- ("person:ada".to_string(), 3),- ("person:ada".to_string(), 1),- ];+ let rows = vec![("person:ada".to_string(), 3), ("person:ada".to_string(), 1)];let grouped = group_related_tags(rows);assert_eq!(grouped.get("people").unwrap(), &vec!["ada"]);}