// What the cut-editing specs act on (UI notes 2026-10-30, items 1, 2, 11, 19), // each its own project, written by its spec alone: // // cut-sections-fixture the deck on, six clips c01–c06 on vid1 in three // sections -- §0 c01 c02 | §1 "Two" c03 c04 | §2 // "Three" c05 c06 -- and draft-1.patch.json carrying // the same markers (in step), so a section edit syncs // it (cut-sections.spec.ts) // cut-flash-fixture the clip editor's three clips (clip-editor-fixture.mjs, // its own copy) with the deck on, a marker after r001 // and citeUrls -- Flash-forward selection…, Add to // trailer, a split that keeps its section (cut-flash.spec.ts) // trailer-fixture the deck's six clips with promo/trailer-beats.json: // c01 inside its clip, c03 starting 0.5 s before its // window, c02 after it (out of the cut's order); c04 // and c06 starred on the walk (trailer-beats.spec.ts) // take-housekeeping-fixture four takes: draft-9, draft-10 (labelled "draft 9: // …", the Ember mistake), draft-11, and draft-12 whose // build lock names a live pid -- RENDERING // (take-housekeeping.spec.ts) // cut-groups-fixture claim groups (lane L4): the deck on, eight clips on // vid1 -- §0 c01 c02 c03 | §1 "Two" c04 … c08 -- and // three groups: g1 c01 c02 (opens the cut), g2 c04 // c05 (opens §1), g3 c06 c07; c03 and c08 in none // (cut-groups.spec.ts) // group-proposals-fixture cut-sections-fixture's cut, no groups: the // propose-groups review (group-proposals.spec.ts) // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import os from "node:os"; import path from "node:path"; import { makeClipEditorFixture } from "./clip-editor-fixture.mjs"; const json = (doc, indent = 2) => JSON.stringify(doc, null, indent) + "\n"; const write = (dir, name, text) => { mkdirSync(path.dirname(path.join(dir, name)), { recursive: true }); writeFileSync(path.join(dir, name), text); }; const MARKERS = [ { after: "c02", label: "Two", color: "#ff5a5a" }, { after: "c04", label: "Three", color: "#4fbf6a" }, ]; const sixClips = (ids = ["c01", "c02", "c03", "c04", "c05", "c06"]) => ids.map((id, i) => ({ type: "clip", id, video: "vid1", start: 1 + i * 2, end: 2.5 + i * 2, cite: 1 + i * 2, citeUrl: `https://archive.example/?v=testchan%2Fvid1&t=${1 + i * 2}`, lock: true, title: "The Fixture Stream", date: "2026-10-27", quote: `the words of ${id}`, })); /** * @param {{ reports: string, manifest: Function, deckManifest: Function, cachedWindow: string, cues: Array<[number, number, string]> }} o */ export function makeCutEditingFixture({ reports, manifest, deckManifest, cachedWindow, cues }) { // ---- sections -------------------------------------------------------------- const sections = path.join(reports, "cut-sections-fixture"); const sm = deckManifest("cut-sections-fixture", "The Cut Sections Fixture", sixClips()); sm.render.chrome.deck.markers = MARKERS.map((m) => ({ ...m })); write(sections, "video.manifest.json", json(sm)); write(sections, "draft-1.patch.json", json({ render: { chrome: { deck: { markers: MARKERS } } }, title: "The Cut Sections Fixture (draft)" })); mkdirSync(path.join(sections, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(sections, "out", "clips-raw", "vid1_0.00-9.00.mp4")); // ---- flash-forward, Add to trailer, split ---------------------------------- const { dir: flash } = makeClipEditorFixture({ reports, manifest, cachedWindow, cues, name: "cut-flash-fixture", title: "The Cut Flash Fixture" }); const ff = path.join(flash, "video.manifest.json"); const fm = JSON.parse(readFileSync(ff, "utf8")); fm.render = { ...fm.render, width: 1920, height: 1080, chrome: { engine: "hyperframes", layout: "deck", deck: { markers: [{ after: "r001", label: "Two", color: "#ff5a5a" }] } } }; delete fm.render.headerHeight; for (const e of fm.timeline) { e.cite = e.cutStart; e.citeUrl = `https://archive.example/?v=testchan%2Fvid1&t=${Math.floor(e.cutStart)}`; e.title = "The Fixture Stream"; e.date = "2026-10-27"; e.speakers = ["Subject"]; } fm.timeline[1].lockEnd = true; writeFileSync(ff, json(fm)); write(flash, "draft-1.patch.json", json({ render: { chrome: { deck: { markers: [{ after: "r001", label: "Two", color: "#ff5a5a" }] } } } })); // ---- trailer beats ----------------------------------------------------------- const trailer = path.join(reports, "trailer-fixture"); const tm = deckManifest("trailer-fixture", "The Trailer Fixture", sixClips()); tm.render.chrome.deck.markers = MARKERS.map((m) => ({ ...m })); for (const e of tm.timeline) if (e.id === "c04" || e.id === "c06") Object.assign(e, { star: true, walkNote: e.id === "c04" ? "this is gold" : "the ending" }); write(trailer, "video.manifest.json", json(tm)); // 1-space, as the Ember file was written by hand: a write keeps it. write(trailer, path.join("promo", "trailer-beats.json"), json([ { id: "c01", start: 1, end: 2.5 }, { id: "c03", start: 4.5, end: 6.5 }, { id: "c02", start: 3, end: 4.5 }, ], 1)); // ---- take housekeeping ------------------------------------------------------- const takes = path.join(reports, "take-housekeeping-fixture"); write(takes, "video.manifest.json", json(deckManifest("take-housekeeping-fixture", "The Take Housekeeping Fixture", sixClips().slice(0, 2)))); const take = (id, order, label) => ({ id, group: "takes", order, label, kind: "different", summary: "", changes: ["timeline: 2 items"], preview: "preview.mp4", seconds: 4.5, builtAt: `2026-10-${20 + order}T12:00:00.000Z`, style: null, patch: null, window: "full", }); for (const [id, order, label] of [ ["draft-9", 1, "draft 9: the first walk"], ["draft-10", 2, "draft 9: re-walked (wrong label)"], ["draft-11", 3, "draft 11: tightened"], ["draft-12", 4, "draft 12: rendering"], ]) write(path.join(takes, "takes", id), "take.json", json(take(id, order, label))); // pid 1 is always alive; this host, so the lock reads as a render running now. write(path.join(takes, "takes", "draft-12"), ".building.json", JSON.stringify({ pid: 1, host: os.hostname(), startedAt: "2026-10-31T23:00:00.000Z", take: "draft-12", from: "draft-11" }) + "\n"); // ---- claim groups (lane L4) ---------------------------------------------------- const groups = path.join(reports, "cut-groups-fixture"); const gm = deckManifest("cut-groups-fixture", "The Cut Groups Fixture", sixClips(["c01", "c02", "c03", "c04", "c05", "c06", "c07", "c08"]).map((e) => ({ ...e, start: e.start / 2, end: e.start / 2 + 0.9, cite: e.start / 2 }))); gm.render.chrome.deck.markers = [{ after: "c03", label: "Two", color: "#ff5a5a" }]; gm.groups = [ { id: "g1", section: 0, claim: "The opening claim", ids: ["c01", "c02"] }, { id: "g2", section: 1, claim: "The second claim, said twice", ids: ["c04", "c05"] }, { id: "g3", section: 1, claim: "A third", ids: ["c06", "c07"] }, ]; write(groups, "video.manifest.json", json(gm)); mkdirSync(path.join(groups, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(groups, "out", "clips-raw", "vid1_0.00-9.00.mp4")); const proposals = path.join(reports, "group-proposals-fixture"); const pm = deckManifest("group-proposals-fixture", "The Group Proposals Fixture", sixClips()); pm.render.chrome.deck.markers = MARKERS.map((m) => ({ ...m })); write(proposals, "video.manifest.json", json(pm)); mkdirSync(path.join(proposals, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(proposals, "out", "clips-raw", "vid1_0.00-9.00.mp4")); return { sections, flash, trailer, takes, groups, proposals }; }