// What ui-ops.spec.ts acts on (UI notes 2026-10-30, #9 #10 #15 #18): its own // project and its own two channels, written by that spec alone. // // channels/uiopschan/ u1 (uploaded 2025-01-01, transcribed here long ago) // u2 (uploaded 2026-10-20: newer than the site's deploy) // channels/uiopsdirect/ d1, a YouTube upload (webpageUrl) -- the channel the // link policy links direct // reports/ui-ops-fixture/ // video.manifest.json o01 u1, o02 u2, o03 d1; every QR on the spec's own // site (a local server; SITE_PLACEHOLDER is replaced // with its origin before a page opens) // takes/draft-0..2 three past renders of the whole cut (take.json // seconds + renderSeconds), and draft-2 made `from` // draft-1: the ETA's records // draft-0.log an older render's log line ("take draft-0: done (…)"), // the ETA's other source // out/clips-raw/ u1 0.00-9.00, so the speaker check has a window // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, utimesSync, writeFileSync } from "node:fs"; import path from "node:path"; export const UI_OPS = "ui-ops-fixture"; export const UI_OPS_SITE_PLACEHOLDER = "http://127.0.0.1:9"; export const UI_OPS_SPEAKER = "ui-ops-speaker-fixture"; const write = (dir, name, doc) => { mkdirSync(dir, { recursive: true }); writeFileSync(path.join(dir, name), typeof doc === "string" ? doc : JSON.stringify(doc, null, 2) + "\n"); }; const LONG_AGO = new Date("2025-01-02T00:00:00Z"); function source(channels, slug, id, { uploadDate, webpageUrl, old = true }) { const dir = path.join(channels, slug, "data", id); const cues = Array.from({ length: 30 }, (_, i) => ({ start: i * 2, end: i * 2 + 2, text: `Line ${i} of ${id}.` })); write(dir, "transcript.cues.json", { title: `UI ops source ${id}`, uploadDate, channel: "UI Ops", webpageUrl, duration: 60, cues }); if (old) utimesSync(path.join(dir, "transcript.cues.json"), LONG_AGO, LONG_AGO); } /** The fixture's manifest, its QRs on `site`. Exported so the spec writes the same thing with its server's origin. */ export function uiOpsManifest(manifest, site) { const link = (chan, id, t) => `${site}/?v=${encodeURIComponent(`${chan}/${id}`)}&t=${t}`; const clip = (id, channel, video, start, end) => ({ type: "clip", id, channel, video, start, end, cite: start, citeUrl: link(channel, video, start), lock: true, section: 0, quote: `Line of ${video}.`, }); const doc = manifest(UI_OPS, "The UI Ops Fixture", { siteOrigin: "https://archive.example", channelSlug: "uiopschan" }, [ clip("o01", "uiopschan", "u1", 2, 6), clip("o02", "uiopschan", "u2", 4, 8), clip("o03", "uiopsdirect", "d1", 10, 14), ]); doc.render.fetchPad = 0; return doc; } /** * @param {{ reports: string, channels: string, manifest: Function, cachedWindow: string, ff: (args: string[]) => void }} o */ export function makeUiOpsFixture({ reports, channels, manifest, cachedWindow, ff }) { source(channels, "uiopschan", "u1", { uploadDate: "20250101", webpageUrl: "https://example.invalid/watch?v=u1" }); source(channels, "uiopschan", "u2", { uploadDate: "20261020", webpageUrl: "https://example.invalid/watch?v=u2" }); source(channels, "uiopsdirect", "d1", { uploadDate: "20250301", webpageUrl: "https://www.youtube.com/watch?v=d1" }); write(path.join(channels, "uiopsdirect"), "config.json", { name: "UI Ops Direct", url: "https://www.youtube.com/@uiopsdirect", platform: "youtube" }); const dir = path.join(reports, UI_OPS); write(dir, "video.manifest.json", uiOpsManifest(manifest, UI_OPS_SITE_PLACEHOLDER)); // Three past renders of the whole cut (30 s of video each): draft-0 known only // by its files (its manifest 11 min before builtAt) and its log's 1 min wait // at the slot -- 600 s; draft-1 recorded 600 s; draft-2, made from draft-1, 240 s. const take = (id, order, extra) => ({ id, group: "takes", order, label: id.replace("-", " "), kind: "reference", preview: "preview.mp4", seconds: 30, window: "full", ...extra }); write(path.join(dir, "takes", "draft-0"), "take.json", take("draft-0", 0, { builtAt: "2026-10-29T10:11:00.000Z" })); write(path.join(dir, "takes", "draft-0"), "video.manifest.json", "{}\n"); const at0 = new Date("2026-10-29T10:00:00.000Z"); utimesSync(path.join(dir, "takes", "draft-0", "video.manifest.json"), at0, at0); write(dir, "draft-0.log", "heavy: waiting for memory — 2917 MB available, the floor is 6000 MB\nheavy: 8879 MB available after 1m00s — admitted\ntake draft-0: done (30 s)\n"); write(path.join(dir, "takes", "draft-1"), "take.json", take("draft-1", 1, { builtAt: "2026-10-30T10:10:00.000Z", renderSeconds: 600 })); write(path.join(dir, "takes", "draft-2"), "take.json", take("draft-2", 2, { builtAt: "2026-10-31T10:04:00.000Z", renderSeconds: 240, from: "draft-1" })); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "u1_0.00-9.00.mp4")); makeSpeakerProject({ reports, channels, manifest, ff }); return dir; } // THE SPEAKER CHECK'S PROJECT (#15): four clips, each window already in the // corpus under its own channel -- three of one "voice" (a 150 Hz tone and its // octave), one of another (1.1 kHz) -- and speakers.json naming Host (k01, k02) // and Guest (k03). k04 is the clip the walk checks. The app's job runs the test // kit's fake embedder (VOICE_MATCH_* in playwright.config.ts). function makeSpeakerProject({ reports, channels, manifest, ff }) { const chan = "uiopsvoice"; const voices = { host: "0.3*sin(2*PI*150*t)+0.15*sin(2*PI*300*t)", guest: "0.3*sin(2*PI*1100*t)+0.1*sin(2*PI*2300*t)" }; const timeline = []; for (const [id, who] of [["k01", "host"], ["k02", "host"], ["k03", "guest"], ["k04", "host"]]) { const vid = `voice-${id}`; const vdir = path.join(channels, chan, "data", vid); mkdirSync(path.join(vdir, "clips"), { recursive: true }); write(vdir, "transcript.cues.json", { title: `Voice ${vid}`, uploadDate: "20250101", channel: "UI Ops Voices", webpageUrl: `https://example.invalid/watch?v=${vid}`, duration: 20, cues: [{ start: 2, end: 4.5, text: "slow news day." }] }); ff([ "-f", "lavfi", "-i", "color=c=gray:size=160x90:rate=15:duration=6", "-f", "lavfi", "-i", `aevalsrc=${voices[who]}:s=48000:d=6`, "-map", "0:v", "-map", "1:a", "-t", "6", "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "aac", "-ar", "48000", "-ac", "2", path.join(vdir, "clips", "0.00-6.00.mp4"), ]); timeline.push({ type: "clip", id, channel: chan, video: vid, start: 0.5, end: 5.5, cutStart: 2, cutEnd: 4.5, cite: 2, section: 0, lock: true, quote: "slow news day." }); } const dir = path.join(reports, UI_OPS_SPEAKER); write(dir, "video.manifest.json", manifest(UI_OPS_SPEAKER, "The Speaker Check Fixture", { siteOrigin: "https://archive.example", channelSlug: chan }, timeline)); write(dir, "speakers.json", { speakers: [{ name: "Host", clips: ["k01", "k02"] }, { name: "Guest", clips: ["k03"] }] }); }