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(gateway): seed the stale-window sentinel the fixture already carries

Louis Beaumontbe6fcaa60cf6
diff --git a/crates/screenpipe-gateway/src/bin/seed.rs b/crates/screenpipe-gateway/src/bin/seed.rs
index 875ed5f43..462798d04 100644
--- a/crates/screenpipe-gateway/src/bin/seed.rs
+++ b/crates/screenpipe-gateway/src/bin/seed.rs
@@ -27,6 +27,8 @@ struct Device {
label: &'static str,
marker: &'static str,
hour: u32,
+ /// Emit the out-of-window "stale batch member" frame (see [`STALE_FRAME_ID`]).
+ stale_sentinel: bool,
}
const DEVICES: &[Device] = &[
@@ -35,19 +37,38 @@ const DEVICES: &[Device] = &[
label: "alice-mbp",
marker: "alpha",
hour: 9,
+ stale_sentinel: true,
},
Device {
id: "dev-bob",
label: "bob-thinkpad",
marker: "bravo",
hour: 10,
+ stale_sentinel: false,
},
];
+/// The stale-window regression sentinel: a July-12 frame inside a batch object
+/// whose LastModified is inside the seeded July-22 window.
+///
+/// The hosted target filters `/search` and `/records` by object LastModified;
+/// the gateway filters by RECORD timestamp. This row is the only thing that
+/// tells those two apart, so both targets must exclude it from a
+/// `?since=2026-07-22&until=2026-07-23` query. Without it, an implementation
+/// that filtered by object time only would pass the whole conformance suite.
+///
+/// Alice only, and appended AFTER the memory row rather than sorted in with the
+/// other frames: the fixture is vendored from the website repo (see
+/// `e2e/conformance/VENDORED_FROM`) and the parity test compares bytes, so the
+/// line order here has to match the canonical copy. Folding this into the
+/// `frames` slice below would move it to line 3 and break the vendored fixture.
+const STALE_FRAME_ID: i64 = 999;
+const STALE_DAY: &str = "2026-07-12";
+
fn batch_for(device: &Device) -> Vec<u8> {
let ts = |m: u32| format!("2026-07-22T{:02}:{:02}:00Z", device.hour, m);
let parsed_text = format!("Ada: quarterly roadmap {} structured update", device.marker);
- build_jsonl_with_parsed(
+ let mut body = build_jsonl_with_parsed(
device.id,
device.label,
&[
@@ -130,7 +151,28 @@ fn batch_for(device: &Device) -> Vec<u8> {
importance: 0.8,
frame_id: Some(1),
}],
- )
+ );
+ if device.stale_sentinel {
+ // Same wire builder, so a frame-format change still propagates here.
+ body.extend_from_slice(&build_jsonl_with_parsed(
+ device.id,
+ device.label,
+ &[FrameRow {
+ frame_id: STALE_FRAME_ID,
+ timestamp: format!("{STALE_DAY}T{:02}:00:00Z", device.hour),
+ app_name: Some("Arc".to_string()),
+ window_name: Some("stale batch member".to_string()),
+ browser_url: None,
+ text: Some("roadmap stale-window regression sentinel".to_string()),
+ }],
+ &[],
+ &[],
+ &[],
+ &[],
+ &[],
+ ));
+ }
+ body
}
/// One org-wide daily rollup, byte-identical to the conformance fixture.
@@ -159,7 +201,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
for device in DEVICES {
let body = batch_for(device);
let counts = DirectUploadRecordCounts {
- frames: 2,
+ // The sentinel is a real frame in the body; the declared counts feed
+ // compute_batch_id, so they have to match what was actually written.
+ frames: 2 + usize::from(device.stale_sentinel),
parsed: 1,
audio: 1,
ui: 1,