// What cut-integrity.spec.ts acts on (UI notes 2026-10-30, #3 #5 #6 #7 #8): // its own project, written by that spec alone. // // reports/cut-integrity-fixture/ // video.manifest.json four clips of vid1 (the fixture corpus's cues): // c01 1.0-5.0 cite 1 -- overlaps c02 (not next to it): window-overlap // c03 6.8-8.6 cite 0.5, citeUrl t=0 -- the clock and the QR 6 s early: clip-cite-off // c02 3.0-6.0 cite 3, confirmed, an editorial note in `correction` // c04 vid2 2.0-4.0 cite 2, citeUrl naming a record the site does not have // draft-1.patch.json deck markers after c04 and after `gone` (a clip // nobody has): patch-markers-stale; removing c04 // re-anchors the first // out/clips-raw/ vid1 0.00-9.00, which holds every clip // // The site the QRs link is the spec's own (a local HTTP server on a free // port): every clip's citeUrl names it, and the spec writes its origin into // them before it opens a page. provenance.siteOrigin stays public-looking. // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; export const CUT_INTEGRITY = "cut-integrity-fixture"; export const SITE_PLACEHOLDER = "http://127.0.0.1:9"; const write = (dir, name, doc) => { mkdirSync(dir, { recursive: true }); writeFileSync(path.join(dir, name), JSON.stringify(doc, null, 2) + "\n"); }; /** The fixture's manifest, its QRs on `site`. Exported so the spec writes the same thing with its server's origin. */ export function cutIntegrityManifest(manifest, site) { const link = (id, t) => `${site}/?v=${encodeURIComponent(`testchan/${id}`)}&t=${t}`; const clip = (id, start, end, extra = {}) => ({ type: "clip", id, video: "vid1", start, end, lock: true, section: 0, ...extra }); // The origin is a public-looking one (a private origin is a blocking // manifest-invalid row that projects.spec counts); every clip carries its // own citeUrl on `site`, so the link check walks the spec's server. const doc = manifest(CUT_INTEGRITY, "The Cut Integrity Fixture", { siteOrigin: "https://archive.example" }, [ clip("c01", 1.0, 5.0, { cite: 1, citeUrl: link("vid1", 1), quote: "This is a complete sentence." }), clip("c03", 6.8, 8.6, { cite: 0.5, citeUrl: link("vid1", 0), quote: "of that it finishes here." }), // Confirmed, with an editorial note in `correction` (the box there was): "move to walk note". clip("c02", 3.0, 6.0, { cite: 3, citeUrl: link("vid1", 3), quote: "And this one runs on", verdict: "confirmed", correction: "might want a bit of silence" }), clip("c04", 2.0, 4.0, { video: "vid2", cite: 2, citeUrl: link("nope", 2), quote: "a record the site does not have" }), ]); doc.render.fetchPad = 0; return doc; } /** * @param {{ reports: string, manifest: Function, cachedWindow: string }} o */ export function makeCutIntegrityFixture({ reports, manifest, cachedWindow }) { const dir = path.join(reports, CUT_INTEGRITY); write(dir, "video.manifest.json", cutIntegrityManifest(manifest, SITE_PLACEHOLDER)); write(dir, "draft-1.patch.json", { render: { chrome: { deck: { markers: [{ after: "c04", label: "After four" }, { after: "gone", label: "Hand-made" }] } } }, }); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", path.basename(cachedWindow))); return dir; }