// What media-draft-e.spec.ts reads (release 28, M6): a cut whose // publish.youtube was drafted, three cards long enough to make YouTube // chapters, and two clips over the cached window the build fixtures share — // so the project page previews the YouTube text, and a fast build writes // out/youtube.txt with its chapters and sources. Its own, so the other specs' // projects are never touched. Synthetic, like every fixture. import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; const P = (task, model = "qwen3:8b") => ({ task, model, at: "2026-10-13T10:00:00.000Z", iteration: 1, attempt: 1 }); /** * @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 makeYoutubeFixture({ reports, manifest, cachedWindow }) { const dir = path.join(reports, "youtube-fixture"); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); const m = manifest("youtube-fixture", "The YouTube Fixture", { siteOrigin: "https://archive.example" }, [ { type: "card", id: "title", style: "title", seconds: 10, heading: "The YouTube Fixture" }, { type: "clip", id: "c01", video: "vid1", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "and because" }, { type: "card", id: "k01", style: "chapter", seconds: 10, heading: "The county" }, { type: "clip", id: "c02", video: "vid1", start: 9.0, end: 12.0, cite: 9, section: 0, lock: true, quote: "another whole sentence" }, { type: "card", id: "k02", style: "chapter", seconds: 10, heading: "Then" }, ]); m.publish = { youtube: { title: "The county said yes", description: "Half a year on, the county said yes, and the fixture says so." } }; m.drafted = { "publish.youtube": P("youtube") }; writeFileSync(path.join(dir, "video.manifest.json"), JSON.stringify(m, null, 2) + "\n"); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", path.basename(cachedWindow))); return { dir }; }