// WHAT NEEDS YOU (needs-you.spec.ts, umtool redesign L4): one fixture per new Inbox call -- // // reports/needs-you-fixture the Play cut (play-cut-fixture.mjs) with // c01 walked (confirmed), c02–c04 not -> clips-unwalked // v1, a RENDERED saved version (its base frozen, a preview), no verdict; // `short`, a rendered legacy take, no verdict -> version-unjudged (Play ?take=v1) // quote-check.json: c02's row for a cut it no longer plays; c01, c03, c04 never // checked -> quote-check-stale, its one press Run quote-check // reports/needs-you-links one clip of a RUMBLE recording cited by its URL-slug folder (v6nyslug) whose // archive record is its embed id (v6nyembd, its metadata.info.json), and a // recorded link check calling it dead with that fix -> link-dead, Use embed ids (1) // .umtool/research/needs-you-case a case with a pipeline (scope nychan), its candidate scan done on // 1 Nov, and nychan/nyfresh transcribed since -> case-new-cues // // X's jar is the stub editor's (editor-stub-services.mjs), put up by the spec. The spec WRITES (a verdict, the // links fix, a queued quote check): this fixture is its own. Synthetic, like every fixture. import { copyFileSync, mkdirSync, readFileSync, utimesSync, writeFileSync } from "node:fs"; import { createHash } from "node:crypto"; import path from "node:path"; import { linksOf, withArchiveId } from "../../lib/report/linkCheck.mjs"; export const NY_PROJECT = "needs-you-fixture"; export const NY_TITLE = "The Needs You Fixture"; export const NY_LINKS = "needs-you-links"; export const NY_LINKS_TITLE = "The Needs You Links"; export const NY_CASE = "needs-you-case"; export const NY_RUMBLE = "nyrumble"; export const NY_FOLDER = "v6nyslug"; export const NY_EMBED = "v6nyembd"; /** * A public-shaped site that never resolves (`.invalid`, RFC 6761: no resolver answers it): the re-check after * the fix cannot verify, and says so. Not a loopback address -- that is a blocking siteOrigin of its own. */ export const NY_SITE = "https://ny-archive.invalid"; const write = (dir, name, doc) => { mkdirSync(dir, { recursive: true }); writeFileSync(path.join(dir, name), typeof doc === "string" ? doc : JSON.stringify(doc, null, 2) + "\n"); }; /** * @param {{ reports: string, reportsRoot: string, channels: string, deckManifest: Function, manifest: Function, cachedWindow: string, makePlayCutFixture: Function, * names?: { project: string, title: string, links: string, linksTitle: string, withCase: boolean } }} o * `names`: a second copy under its own names (readiness.spec.ts, umtool redesign L7b: the workspace's readiness bar * reads the same calls, and needs-you.spec writes its own), with no case. */ export function makeNeedsYouFixture({ reports, reportsRoot, channels, deckManifest, manifest, cachedWindow, makePlayCutFixture, names = { project: NY_PROJECT, title: NY_TITLE, links: NY_LINKS, linksTitle: NY_LINKS_TITLE, withCase: true } }) { // ---- the cut: versions to judge, clips not walked, quote checks out of date ---- const { dir } = makePlayCutFixture({ reports, deckManifest, cachedWindow, name: names.project, title: names.title }); const file = path.join(dir, "video.manifest.json"); const m = JSON.parse(readFileSync(file, "utf8")); m.timeline = m.timeline.map((e) => (e.id === "c01" ? { ...e, verdict: "confirmed" } : e)); const text = JSON.stringify(m, null, 2) + "\n"; writeFileSync(file, text); const v1 = path.join(dir, "takes", "v1"); write(v1, "base.manifest.json", text); write(v1, "take.json", { id: "v1", group: "takes", order: 3, label: "Saved draft", kind: "reference", summary: "", changes: [], preview: "preview.mp4", // Rendered a day before the fixture is made: a call (a render older than two weeks is Quiet, versions.mjs RECENT_DAYS). seconds: 9, builtAt: new Date(Date.now() - 864e5).toISOString(), style: null, patch: null, window: "full", version: true, savedAt: new Date(Date.now() - 2 * 864e5).toISOString(), baseHash: createHash("sha256").update(text).digest("hex"), }); copyFileSync(cachedWindow, path.join(v1, "preview.mp4")); write(dir, "quote-check.json", { version: 1, checkedAt: "2026-11-08T11:00:00.000Z", clips: { c02: { status: "ok", cut: { from: 3, to: 5 }, quote: "And this one runs on", checkedAt: "2026-11-08T11:00:00.000Z" } } }); // ---- the Rumble QR that names the folder, not the record ---- const rch = path.join(channels, NY_RUMBLE); write(rch, "config.json", { name: "NY Rumble", platform: "rumble" }); const rv = path.join(rch, "data", NY_FOLDER); write(rv, "metadata.info.json", { id: NY_EMBED, title: "The NY Rumble Recording", webpage_url: `https://rumble.com/${NY_FOLDER}-the-ny-rumble-recording.html` }); write(rv, "transcript.cues.json", { title: "The NY Rumble Recording", duration: 60, cues: [{ start: 0, end: 60, text: "a rumble." }] }); const lm = manifest(names.links, names.linksTitle, { siteOrigin: NY_SITE, channelSlug: NY_RUMBLE }, [{ type: "clip", id: "n01", video: NY_FOLDER, start: 10, end: 14, cite: 10, section: 0, quote: "a rumble." }]); const ldir = path.join(reports, names.links); write(ldir, "video.manifest.json", lm); const [qr] = linksOf(lm); if (!qr) throw new Error("needs-you-fixture: the Rumble clip draws no QR"); write(path.join(ldir, "out"), "links.json", { version: 1, checkedAt: "2026-11-08T12:00:00.000Z", fetched: 3, origins: { [NY_SITE]: { state: "ok", generatedAt: "2026-11-01T00:00:00.000Z" } }, links: [ { clip: "n01", url: qr.url, state: "dead", origin: NY_SITE, why: `"${NY_FOLDER}" is the recording's folder (its Rumble URL slug), not a record on ${new URL(NY_SITE).host}; the site's record is its embed id "${NY_EMBED}"`, fix: withArchiveId(qr.url, NY_FOLDER, NY_EMBED), fixSiteVideo: NY_EMBED, }, ], }); if (!names.withCase) return { dir, ldir, cdir: null }; // ---- a live case, scanned on 1 Nov, its channel transcribed since ---- const now = "2026-11-01T00:00:00.000Z"; const cdir = path.join(reportsRoot, ".umtool", "research", NY_CASE); write(cdir, "case.json", { format: "umtool-research-case", version: 1, id: NY_CASE, title: "The Needs You Case", scope: { source: "local" }, search: null, sessions: [], sections: [], quotes: [], notes: "", handoffs: [], counters: { quote: 0, section: 0 }, createdAt: now, updatedAt: now }); write(cdir, "pipeline.json", { format: "archilyzer-case-pipeline", version: 1, case: NY_CASE, subjects: [], scope: { channels: ["nychan"], groups: [], sites: [] }, eras: [], groups: [], privateNames: { sha256: [], note: "" }, readerPrompts: { common: "" }, status: "reading", createdAt: now, updatedAt: now }); write(cdir, "stages.json", { candidates: { state: "done", startedAt: now, endedAt: "2026-11-01T00:05:00.000Z", by: "cli", pid: 1, log: [], counts: { windows: 0 } } }); write(path.join(channels, "nychan"), "config.json", { name: "NY Chan", platform: "youtube" }); const old = path.join(channels, "nychan", "data", "nyold"); write(old, "transcript.cues.json", { title: "Before the scan", duration: 10, cues: [{ start: 0, end: 10, text: "old." }] }); utimesSync(path.join(old, "transcript.cues.json"), new Date("2026-10-20T00:00:00Z"), new Date("2026-10-20T00:00:00Z")); write(path.join(channels, "nychan", "data", "nyfresh"), "transcript.cues.json", { title: "After the scan", duration: 10, cues: [{ start: 0, end: 10, text: "new." }] }); return { dir, ldir, cdir }; }