// What review-player.spec.ts walks (release 32 R1): the drafts review's // audition deck over a cut whose first cited window is on disk and whose // second is not. Its own project and its own TWO sources (vid9, vid8): a // window in the corpus is keyed by video and shared by every project, so a // card on vid1 played whichever wider window another spec had fetched there // first (clip-bench's after-only fetch leaves vid1's 0.00-14.00), and a fetch // here must never make another spec's window "already cached". // // reports/review-player-fixture/ // p01 on-screen text DRAFTED over vid9 3-6 s: the project's cached window // (out/clips-raw/vid9_0.00-9.00.mp4, a copy of vid1's) plays it // p02 on-screen text DRAFTED over vid8 3-6 s: nothing on disk until Fetch // clip asks the editor stub, which writes the window into the corpus // k01 a chapter card whose narration was DRAFTED: no clip, edited on the card // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; const AT = "2026-10-16T10:00:00.000Z"; const P = (task, model = "qwen3:8b") => ({ task, model, at: AT, iteration: 1, attempt: 1 }); const write = (dir, name, doc) => { mkdirSync(dir, { recursive: true }); writeFileSync(path.join(dir, name), JSON.stringify(doc, null, 2) + "\n"); }; /** * @param {{ reports: string, channels: string, manifest: Function, cachedWindow: string }} o */ export function makeReviewPlayerFixture({ reports, channels, manifest, cachedWindow }) { // vid9: the first card's source, nobody else's. Its cues are vid1's first // three, so the run-on quote at 3-6 s is the same seven words. write(path.join(channels, "testchan", "data", "vid9"), "transcript.cues.json", { title: "Fixture source vid9", uploadDate: "20250101", channel: "Fixture Channel", webpageUrl: "https://example.invalid/watch?v=vid9", duration: 9, cues: [ { start: 0, end: 3, text: "This is a complete sentence." }, { start: 3, end: 6, text: "And this one runs on and because" }, { start: 6, end: 9, text: "of that it finishes here." }, ], }); const rows = [ [0, 3, "The review fixture opens."], [3, 6, "This is the sentence the second card cites."], [6, 9, "And nothing else on the disk holds it."], ]; write(path.join(channels, "testchan", "data", "vid8"), "transcript.cues.json", { title: "Fixture source vid8", uploadDate: "20250101", channel: "Fixture Channel", webpageUrl: "https://example.invalid/watch?v=vid8", duration: 9, cues: rows.map(([start, end, text]) => ({ start, end, text })), }); const dir = path.join(reports, "review-player-fixture"); write( dir, "video.manifest.json", manifest("review-player-fixture", "The Review Player Fixture", { siteOrigin: "https://archive.example" }, [ { type: "clip", id: "p01", video: "vid9", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "And this one runs on and because", onscreen: { title: "On disk title" }, drafted: { onscreen: P("onscreen") }, }, { type: "clip", id: "p02", video: "vid8", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "This is the sentence the second card cites.", onscreen: { title: "Fetched title" }, drafted: { onscreen: P("onscreen", "claude-sonnet-5-5") }, }, { type: "card", id: "k01", style: "chapter", seconds: "auto", heading: "Later", narration: { text: "A drafted narration line." }, drafted: { narration: P("narrate") }, }, ]), ); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "vid9_0.00-9.00.mp4")); return { dir }; }