// What bench-shell.spec.ts and piece.spec.ts's Media test act on (P4b): their // own projects, so the other specs' writes never move what they assert. // // reports/bench-shell-fixture/ READ-ONLY (bench-extend-fixture, the same, is // written by the Extend-and-Reset test). vid1's run-on cue (3-6 s) and the // sentence that closes at 9 s: // s01 3.00-6.00 ends mid-sentence: the verdict bar asks to extend it // to 0:09.00, which would cover all of s02 // s02 6.00-9.00 locked // reports/media-tab-fixture/ writable by piece.spec's Media test: three // reports/media-review-fixture/ fields to review, and the same for the // review bench (bench-shell.spec), each with the draft files that say // where they came from: // m01 on-screen text drafted by qwen3:8b on its SECOND attempt; the // first broke "title over 60 characters" (onscreen-draft.json) // m02 on-screen text drafted on its first attempt // k01 a card's narration from release 25's narrate (narration-draft.json, // its units at the top level, no mark in the manifest): attempt 1 // broke "text in quotation marks", attempt 2 was kept // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; const AT = "2026-10-13T10:00:00.000Z"; const P = (task, attempt) => ({ task, model: "qwen3:8b", at: AT, iteration: 1, attempt }); const write = (dir, name, doc) => { mkdirSync(dir, { recursive: true }); writeFileSync(path.join(dir, name), JSON.stringify(doc, null, 2) + "\n"); }; /** * @param {{ reports: string, manifest: Function, cachedWindow: string }} o * `manifest` is make-fixture's manifest(slug, title, provenance, timeline); * `cachedWindow` the vid1 0-9 s window the build fixtures share. */ export function makeBenchShellFixture({ reports, manifest, cachedWindow }) { // bench-shell-fixture is read-only; bench-extend-fixture, the same two clips, // is written by the Extend-and-Reset test alone. let bench = null; for (const slug of ["bench-shell-fixture", "bench-extend-fixture"]) { const dir = path.join(reports, slug); write( dir, "video.manifest.json", manifest(slug, "The Bench Shell Fixture", { siteOrigin: "https://archive.example" }, [ { type: "clip", id: "s01", video: "vid1", start: 3.0, end: 6.0, cite: 3, section: 0, quote: "and because" }, { type: "clip", id: "s02", video: "vid1", start: 6.0, end: 9.0, cite: 6, section: 0, lock: true, quote: "the rest of it" }, ]), ); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", path.basename(cachedWindow))); bench ??= dir; } const made = []; for (const slug of ["media-tab-fixture", "media-review-fixture"]) { const dir = path.join(reports, slug); write( dir, "video.manifest.json", manifest(slug, "The Media Tab Fixture", { siteOrigin: "https://archive.example" }, [ { type: "clip", id: "m01", video: "vid1", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "and because", onscreen: { title: "She will not sell" }, drafted: { onscreen: P("onscreen", 2) }, }, { type: "clip", id: "m02", video: "vid1", start: 9.0, end: 12.0, cite: 9, section: 0, lock: true, quote: "another whole sentence", onscreen: { title: "The county voted" }, drafted: { onscreen: P("onscreen", 1) }, }, { type: "card", id: "k01", style: "chapter", seconds: "auto", heading: "The county", narration: { text: "Half a year on, the county said yes." } }, ]), ); write(dir, "onscreen-draft.json", { task: "onscreen", model: "qwen3:8b", at: AT, article: "media-tab", iteration: 1, units: { m01: { target: { entry: "m01", field: "onscreen" }, label: "m01", attempts: [ { value: { title: "She says she would never, ever sell the family bakery to any chain" }, hard: ["title over 60 characters"], soft: [] }, { value: { title: "She will not sell" }, hard: [], soft: [] }, ], chosen: { value: { title: "She will not sell" }, hard: [], soft: [] }, applied: "applied", }, m02: { target: { entry: "m02", field: "onscreen" }, label: "m02", attempts: [{ value: { title: "The county voted" }, hard: [], soft: [] }], chosen: { value: { title: "The county voted" }, hard: [], soft: [] }, applied: "applied", }, }, checks: [{ name: "onscreen", ok: true, detail: "2 field(s) drafted" }], alternatives: [], }); write(dir, "narration-draft.json", { k01: { heading: "The county", attempts: [ { text: "\"Yes,\" said the county.", hard: ["text in quotation marks: no quotes in narration"], soft: [] }, { text: "Half a year on, the county said yes.", hard: [], soft: [] }, ], chosen: { text: "Half a year on, the county said yes.", hard: [], soft: [] }, }, }); made.push(dir); } return { bench, media: made }; }