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
evals: cover absolute file URL paths through media player
Louis Beaumont900407157a9e
diff --git a/evals/coding-agent/README.md b/evals/coding-agent/README.mdindex 5258f869c..3030f6869 100644--- a/evals/coding-agent/README.md+++ b/evals/coding-agent/README.md@@ -67,7 +67,7 @@ The hidden fixture appears only at grading and uses no dependency links.This does not establish native recording continuity, real authentication,account-switch race safety, browser integration, isolation or model performance.-The current app corpus contains 137 git-mined regressions. See+The current app corpus contains 138 git-mined regressions. See[DESIGN.md](./DESIGN.md) for the Anthropic guidance, source contract, andhistory-mining workflow. The companion website manifest uses this same harness.@@ -1742,3 +1742,16 @@ so changing the candidate package’s `test` script cannot skip hidden assertionTheir calibration suites reject broken source with a no-op test script and stillaccept correct source with the same script. This closes that command-dispatchbypass; it does not establish an execution sandbox or tamper-proof dependencies.++## Media file URL paths++`app-media-file-url-path` mounts the actual media player and media wrapper with+synthetic native commands, translation and class-name ports. Nine outcomes cover+Unix URL slash variants, outer quotes and whitespace, encoded spaces, Windows and+ordinary paths, malformed escapes, empty input, and audio/video presentation.+The parent loses four paths and preserves five outcomes; the historical fix and+current source pass nine. Run `bun test evals/coding-agent/calibrate-media-file-url.test.js`+for broken/correct/equivalent, unused-source, disconnected-caller, refusal,+preserved-behavior and missing-source controls. Fixtures and runtime links appear+only at grading. Native file access/decoding, playback, Markdown filtering,+cache policy, enforced execution isolation and model performance are unverified.diff --git a/evals/coding-agent/calibrate-media-file-url.test.js b/evals/coding-agent/calibrate-media-file-url.test.jsnew file mode 100644index 000000000..68f51fa38--- /dev/null+++ b/evals/coding-agent/calibrate-media-file-url.test.js@@ -0,0 +1,58 @@+// screenpipe — AI that knows everything you've seen, said, or heard+// https://screenpipe.com+import {afterAll,expect,test} from 'bun:test';+import {execFileSync,spawnSync} from 'node:child_process';+import {mkdirSync,mkdtempSync,readFileSync,writeFileSync,symlinkSync,rmSync} from 'node:fs';+import {dirname,join,resolve} from 'node:path';+import {tmpdir} from 'node:os';+const repo=resolve(import.meta.dir,'../..'),app='apps/screenpipe-app-tauri';+const item=JSON.parse(readFileSync(join(import.meta.dir,'cases.json'),'utf8')).cases.find(c=>c.id==='app-media-file-url-path');+const root=mkdtempSync(join(tmpdir(),'media-file-url-calibration-'));+const receipts=process.env.SCREENPIPE_EVAL_CALIBRATION_RECEIPTS;+const helper=`${app}/lib/utils/media-file-path.ts`,player=`${app}/components/rewind/media.tsx`;+const paths=[helper,player,`${app}/lib/actions/video-actions.ts`,`${app}/lib/utils.ts`,`${app}/lib/utils/tauri.ts`];+afterAll(()=>rmSync(root,{recursive:true,force:true}));+function replace(cwd,file,from,to){const p=join(cwd,file),s=readFileSync(p,'utf8');expect(s.split(from)).toHaveLength(2);writeFileSync(p,s.replace(from,to));}+function grade(name,ref=item.oracle_ref,mutate=()=>{}){+ const cwd=join(root,name);mkdirSync(cwd);+ // Exact historical sources only. External dependencies are linked at grading.+ for(const path of paths){const dest=join(cwd,path);mkdirSync(dirname(dest),{recursive:true});writeFileSync(dest,execFileSync('git',['show',`${ref}:${path}`],{cwd:repo}));}+ for(const f of item.grader.fixtures){const dest=join(cwd,f.destination_path);mkdirSync(dirname(dest),{recursive:true});writeFileSync(dest,readFileSync(join(import.meta.dir,f.local_path)));}+ for(const link of item.grader_dependency_links)symlinkSync(join(repo,link.source_path),join(cwd,link.destination_path),'dir');+ mutate(cwd);+ const r=spawnSync('/bin/bash',['-c',item.grader.command],{cwd,encoding:'utf8',timeout:60000,maxBuffer:4*1024*1024,env:{PATH:process.env.PATH,HOME:cwd,CI:'true',TZ:'UTC',NO_COLOR:'1'}});+ if(receipts){mkdirSync(receipts,{recursive:true});writeFileSync(join(receipts,name+'.stdout'),r.stdout||'');writeFileSync(join(receipts,name+'.stderr'),r.stderr||'');writeFileSync(join(receipts,name+'.json'),JSON.stringify({ref,command:item.grader.command,exit_code:r.status,signal:r.signal,error:r.error?.message},null,2));}+ expect(r.error).toBeUndefined();expect(r.signal).toBeNull();return r;+}+function passes(r){expect(r.status).toBe(0);expect(r.stdout).toContain('9 passed');expect(r.stdout+r.stderr).not.toMatch(/Unhandled|Uncaught|Failed to resolve import/);}+function fails(r){expect(r.status).toBe(1);expect(r.stderr).toMatch(/AssertionError|Error: expect\(/);expect(r.stdout+r.stderr).not.toMatch(/Unhandled|Uncaught|Failed to resolve import|Cannot find module/);}+test('parent loses four reader paths and preserves five outcomes',()=>{const r=grade('parent',item.base_ref);fails(r);expect(r.stdout).toContain('4 failed | 5 passed');},60000);+test('historical fix passes all outcomes',()=>passes(grade('reference')),60000);+test('current caller passes all outcomes',()=>passes(grade('current','HEAD')),60000);+test('equivalent helper name passes',()=>passes(grade('equivalent',item.oracle_ref,cwd=>{+ for(const path of [helper,player]){const p=join(cwd,path);writeFileSync(p,readFileSync(p,'utf8').replaceAll('normalizeMediaFilePath','preserveLocalPlayerPath'));}+})),60000);+test('unused correct helper cannot hide the broken active path',()=>fails(grade('unused',item.base_ref,cwd=>{+ writeFileSync(join(cwd,`${app}/unused-correct-media-path.ts`),execFileSync('git',['show',`${item.oracle_ref}:${helper}`],{cwd:repo}));+})),60000);+test('correct helper with a disconnected caller fails',()=>fails(grade('disconnected',item.oracle_ref,cwd=>{+ replace(cwd,player,'return normalizeMediaFilePath(path);','return path;');+})),60000);+test('blanket native-reading refusal fails preserved playback',()=>fails(grade('refusal',item.oracle_ref,cwd=>{+ replace(cwd,player,'const sanitizedPath = sanitizeFilePath(filePath);','return; const sanitizedPath = sanitizeFilePath(filePath);');+})),60000);+test('lost Windows drive fails preserved native identity',()=>fails(grade('windows',item.oracle_ref,cwd=>{+ replace(cwd,helper,'if (windowsMatch) return windowsMatch[0].trim();','if (windowsMatch) return "/" + windowsMatch[0].trim();');+})),60000);+test('audio-only presentation fails ordinary video',()=>fails(grade('audio-only',item.oracle_ref,cwd=>{+ replace(cwd,helper,'export function isAudioMediaPath(path: string): boolean {','export function isAudioMediaPath(path: string): boolean { return true;');+})),60000);+test('video-only presentation fails preserved audio',()=>fails(grade('video-only',item.oracle_ref,cwd=>{+ replace(cwd,helper,'export function isAudioMediaPath(path: string): boolean {','export function isAudioMediaPath(path: string): boolean { return false;');+})),60000);+test('empty input reading is rejected',()=>fails(grade('empty-read',item.oracle_ref,cwd=>{+ replace(cwd,player,'if (!sanitizedPath) {','if (!sanitizedPath) { await getMediaFile(sanitizedPath);');+})),60000);+test('missing player is setup failure, not baseline evidence',()=>{+ const r=grade('missing',item.oracle_ref,cwd=>rmSync(join(cwd,player)));expect(r.status).toBe(1);expect(r.stdout+r.stderr).toMatch(/Failed to resolve import|Failed to load url/);expect(r.stderr).not.toMatch(/AssertionError/);+},60000);diff --git a/evals/coding-agent/cases.json b/evals/coding-agent/cases.jsonindex e9ee56827..c813f1b94 100644--- a/evals/coding-agent/cases.json+++ b/evals/coding-agent/cases.json@@ -1,7 +1,7 @@{"schema_version": 1,"suite": "screenpipe-app-coding-agent-regressions",- "dataset_version": "2026-10-07-meeting-stop-save-refusal",+ "dataset_version": "2026-10-07-media-file-url","suite_type": "regression","owner": "screenpipe engineering","policy": {@@ -5693,6 +5693,57 @@],"command": "cd apps/screenpipe-app-tauri && node node_modules/vitest/vitest.mjs run --config keyboard-probe.config.ts"}+ },+ {+ "id": "app-media-file-url-path",+ "name": "Preserve absolute file URL paths through the media player",+ "source": {+ "kind": "git_regression",+ "fix_commit": "60d896613c64396e059c07ca03c5c8bb8ceade59"+ },+ "base_ref": "0d5a3e726a71f8c22c9162a0db1ea0a9bc86a806",+ "oracle_ref": "60d896613c64396e059c07ca03c5c8bb8ceade59",+ "oracle_paths": [+ "apps/screenpipe-app-tauri/lib/utils/media-file-path.ts"+ ],+ "trigger_paths": [+ "apps/screenpipe-app-tauri/lib/utils/media-file-path.ts",+ "apps/screenpipe-app-tauri/components/rewind/media.tsx",+ "apps/screenpipe-app-tauri/lib/actions/video-actions.ts"+ ],+ "gate": "advisory",+ "tags": [+ "regression",+ "escaped-failure",+ "media",+ "preserved-behavior"+ ],+ "prompt": "The media player loses the beginning of absolute Unix file paths when it receives a file URL, so local recordings cannot be read. Repair the actual MediaComponent-to-native-media-reader flow. Unix file URLs with one, three or four slashes after file: must retain the full absolute path, including its leading slash, and decode percent-encoded spaces. Outer whitespace and surrounding quotes must not corrupt the path. Preserve ordinary absolute paths containing spaces, Windows drive file URLs with encoded spaces, and paths containing malformed percent escapes without dropping text or throwing. Each successful read must request the intended local path through the existing native media command contract and display the returned bytes with audio controls for WAV files and video controls for ordinary MP4 video. An empty path must not invoke native file reading. Keep the public component and native command contracts compatible. No particular helper or implementation is required. Synthetic native commands and a DOM environment assess player behavior; actual filesystem permission, native decoding, browser playback, Markdown source filtering, cache policy and isolation are separate.",+ "agent_timeout_seconds": 900,+ "grader_dependency_links": [+ {+ "source_path": "apps/screenpipe-app-tauri/node_modules",+ "destination_path": "apps/screenpipe-app-tauri/node_modules"+ }+ ],+ "grader": {+ "timeout_seconds": 60,+ "fixtures": [+ {+ "local_path": "graders/media-file-url.fixture.tsx.txt",+ "destination_path": "apps/screenpipe-app-tauri/components/rewind/eval-media-file-url.test.tsx"+ },+ {+ "local_path": "graders/media-file-url.config.mjs",+ "destination_path": "apps/screenpipe-app-tauri/eval-media-file-url.config.mjs"+ },+ {+ "local_path": "graders/media-file-url-translation.fixture.ts.txt",+ "destination_path": "apps/screenpipe-app-tauri/eval-media-translation.ts"+ }+ ],+ "command": "cd apps/screenpipe-app-tauri && node node_modules/vitest/vitest.mjs run --config eval-media-file-url.config.mjs"+ }}]}diff --git a/evals/coding-agent/graders/media-file-url-translation.fixture.ts.txt b/evals/coding-agent/graders/media-file-url-translation.fixture.ts.txtnew file mode 100644index 000000000..06ffca612--- /dev/null+++ b/evals/coding-agent/graders/media-file-url-translation.fixture.ts.txt@@ -0,0 +1,3 @@+// screenpipe — AI that knows everything you've seen, said, or heard+// https://screenpipe.com+export const useGT = () => (text: string) => text;diff --git a/evals/coding-agent/graders/media-file-url.config.mjs b/evals/coding-agent/graders/media-file-url.config.mjsnew file mode 100644index 000000000..78c860708--- /dev/null+++ b/evals/coding-agent/graders/media-file-url.config.mjs@@ -0,0 +1,5 @@+// screenpipe — AI that knows everything you've seen, said, or heard+// https://screenpipe.com+import {defineConfig} from 'vitest/config';+import {fileURLToPath} from 'node:url';+export default defineConfig({resolve:{alias:{'@':fileURLToPath(new URL('./',import.meta.url)),'gt-react':fileURLToPath(new URL('./eval-media-translation.ts',import.meta.url))}},esbuild:{jsx:'automatic'},test:{environment:'jsdom',include:['components/rewind/eval-media-file-url.test.tsx'],maxWorkers:1,minWorkers:1}});diff --git a/evals/coding-agent/graders/media-file-url.fixture.tsx.txt b/evals/coding-agent/graders/media-file-url.fixture.tsx.txtnew file mode 100644index 000000000..81ae94dbd--- /dev/null+++ b/evals/coding-agent/graders/media-file-url.fixture.tsx.txt@@ -0,0 +1,42 @@+// screenpipe — AI that knows everything you've seen, said, or heard+// https://screenpipe.com+import React from 'react';+import {render,waitFor,cleanup} from '@testing-library/react';+import {beforeEach,afterEach,it,expect,vi} from 'vitest';+import {MediaComponent} from './media';+const {read}=vi.hoisted(()=>({read:vi.fn(async()=>({status:'ok',data:{data:'UklGRg==',mimeType:'audio/wav'}}))}));+vi.mock('@/lib/utils/tauri',()=>({commands:{getMediaFile:read}}));+vi.mock('@/lib/utils',()=>({cn:(...values)=>values.filter(Boolean).join(' ')}));+beforeEach(()=>{read.mockClear();URL.createObjectURL=vi.fn(()=>'blob:synthetic-media');URL.revokeObjectURL=vi.fn();});+afterEach(()=>cleanup());+const cases=[+ ['standard Unix URL','file:///Users/fixture/one%20clip.wav','/Users/fixture/one clip.wav'],+ ['one slash URL','file:/Users/fixture/two%20clip.wav','/Users/fixture/two clip.wav'],+ ['four slash URL','file:////Users/fixture/three%20clip.wav','/Users/fixture/three clip.wav'],+ ['whitespace and quote URL',' "file:///Users/fixture/four%20clip.wav" ','/Users/fixture/four clip.wav'],+ ['direct absolute','/Users/fixture/five clip.wav','/Users/fixture/five clip.wav'],+ ['Windows URL','file:///C:/Users/fixture/six%20clip.wav','C:/Users/fixture/six clip.wav'],+ ['malformed escape','/Users/fixture/seven%A.wav','/Users/fixture/seven%A.wav'],+];+it.each(cases)('%s reaches native reader and shows audio controls',async(_,input,path)=>{+ const {container}=render(<MediaComponent filePath={input}/>);+ await waitFor(()=>expect(container.querySelector('audio source')?.getAttribute('src')).toBe('blob:synthetic-media'));+ expect(container.querySelector('audio')?.hasAttribute('controls')).toBe(true);+ expect(read).toHaveBeenCalled(); expect(read.mock.calls.every(call=>call[0]===path)).toBe(true);+});+it('empty input cannot read native media',async()=>{+ render(<MediaComponent filePath=""/>);+ await new Promise(resolve=>setTimeout(resolve,0));+ expect(read).not.toHaveBeenCalled();+});++vi.mock('gt-react',()=>({useGT:()=>((text)=>text)}));++it('ordinary video remains video with native bytes and controls',async()=>{+ read.mockResolvedValueOnce({status:'ok',data:{data:'UklGRg==',mimeType:'video/mp4'}});+ const {container}=render(<MediaComponent filePath="/Users/fixture/video-nine.mp4"/>);+ await waitFor(()=>expect(container.querySelector('video source')?.getAttribute('src')).toBe('blob:synthetic-media'));+ expect(container.querySelector('video')?.hasAttribute('controls')).toBe(true);+ expect(container.querySelector('audio')).toBeNull();+ expect(read).toHaveBeenCalled(); expect(read.mock.calls.every(call=>call[0]==='/Users/fixture/video-nine.mp4')).toBe(true);+});