// THE CASE PIPELINE fixture (plans/release-38/research-cases-and-assist.md, lane A): two channels in the // fixture's CHANNELS_DIR with words on disk -- a subject's own and a talk show that covers her -- and an empty // board, `lantern-case`, that the pipeline sits beside. case-pipeline.spec.ts defines it, counts its coverage, // finds its candidates, batches them, writes finding rows by hand, watches the privacy gate block a planted // private name, and exports. // // INVENTED, every word: no channel, recording, person or line here is real. PLANTED is the private name the gate // must catch; it is in one talk-show line and never in a definition. import { mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; export const PIPELINE_CASE = "lantern-case"; export const PLANTED = "Ottoline Brackenridge"; export const SUBJECT_CHANNEL = "lantern-wren"; export const TALK_CHANNEL = "harbor-talk"; const ts = (s) => { const h = Math.floor(s / 3600); const m = Math.floor((s % 3600) / 60); return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:${String(s % 60).padStart(2, "0")}.000`; }; const vtt = (cues) => "WEBVTT\n\n" + cues.map(([a, t]) => `${ts(a)} --> ${ts(a + 3)}\n${t}\n`).join("\n"); const write = (p, body) => { mkdirSync(path.dirname(p), { recursive: true }); writeFileSync(p, body); }; // Filler around each said line, every 6 s, so a window has words either side. function lines(say, duration = 600) { const fill = ["okay where were we", "the tide is out", "we got letters about the ferry", "let me read the next one", "the fog came in early", "thanks for calling in"]; const at = new Map(say); const out = []; for (let t = 0, i = 0; t < duration; t += 6) out.push([t, at.get(t) ?? fill[i++ % fill.length]]); return out; } export function makeCaseFixture({ channels, reportsRoot }) { const video = (slug, id, date, title, files) => { const dir = path.join(channels, slug, "data", id); write(path.join(dir, "metadata.info.json"), JSON.stringify({ id, title, upload_date: date, duration: 600, webpage_url: `https://www.youtube.com/watch?v=${id}` })); for (const [n, b] of Object.entries(files)) write(path.join(dir, n), b); }; const channel = (slug, name, playlist) => { write(path.join(channels, slug, "config.json"), JSON.stringify({ handling: "youtube", name })); write(path.join(channels, slug, "playlist"), playlist.map((id) => `https://www.youtube.com/watch?v=${id}`).join("\n") + "\n"); }; // The subject's own: two transcribed (en-orig beside a served en that rewrites a line), one held as audio only, // one listed and never fetched. channel(SUBJECT_CHANNEL, "Lantern Wren", ["lw-2015a", "lw-2015b", "lw-2015c", "lw-2016x", "lw-2021a"]); video(SUBJECT_CHANNEL, "lw-2015a", "20150310", "Opening the lantern shop", { "transcript.en-orig.vtt": vtt(lines([[120, "welcome to the lantern shop"], [126, "I built every lantern here myself"]])), "transcript.en.vtt": vtt([[120, "welcome to the candle store"]]), }); video(SUBJECT_CHANNEL, "lw-2015b", "20150601", "A quiet week", { "audio.opus": "fixture audio" }); video(SUBJECT_CHANNEL, "lw-2021a", "20210305", "Closing the shop", { "transcript.en-orig.vtt": vtt(lines([[240, "the lantern shop is closing for good"], [300, "wren here with an update"]])) }); // The talk show: one recording names her and the shop; one mentions the shop only (coverage noise). channel(TALK_CHANNEL, "Harbor Talk", ["ht-2015a", "ht-2015b"]); video(TALK_CHANNEL, "ht-2015a", "20150320", "Harbor Talk 12", { "transcript.en.vtt": vtt(lines([[180, "Wren Halloway stopped by the lantern shop"], [186, `she was with ${PLANTED} that day`]])), }); video(TALK_CHANNEL, "ht-2015b", "20150402", "Harbor Talk 13", { "transcript.en.vtt": vtt(lines([[60, "the lantern shop downtown had a sale"]])) }); // The board, empty: the pipeline is defined on the page. const at = "2026-11-01T12:00:00.000Z"; write( path.join(reportsRoot, ".umtool", "research", PIPELINE_CASE, "case.json"), `${JSON.stringify({ format: "umtool-research-case", version: 1, id: PIPELINE_CASE, title: "Wren and the lantern shop", scope: { source: "" }, search: null, sessions: [], sections: [], quotes: [], notes: "", handoffs: [], counters: { quote: 0, section: 0 }, createdAt: at, updatedAt: at }, null, 2)}\n`, ); } /** The definition the spec types (no private name in it). */ export const PIPELINE_DEFINITION = { subjects: [{ name: "Wren Halloway", aliases: ["Wren"], channels: [SUBJECT_CHANNEL] }], scope: { channels: [TALK_CHANNEL], groups: [], sites: [] }, eras: [ { id: "shop", from: "2015-01-01", to: "2016-12-31", families: { shop: "lantern shop", name: "\\bwren\\b" } }, { id: "closing", from: "2021-01-01", to: "2021-12-31", families: { shop: "lantern shop", name: "\\bwren\\b" }, strictFamilies: ["shop"] }, ], groups: [ { id: "own", label: "Her own words", channels: "subject" }, { id: "talk", label: "What others said", channels: "coverage" }, ], readerPrompts: { common: "Quote verbatim, at most 45 words.", own: "She is the speaker unless said otherwise." }, keyDates: [{ date: "2021-03-01", label: "the shop closes" }], status: "gathering", privateNames: { note: "a private person named on the talk show" }, };