// What the intake specs act on (UI notes 2026-10-30, items 13, 14, 16), each // its own project, written by its spec alone: // // candidates-fixture the deck on: §0 c01 c02 | §1 "As a streamer" c03 c04 | // §2 "Looks" c05 c06, group g1 c03 c04; sweep.md beside // it in the /sweep bullet shape (anonymised), imported by // the spec through `umtool candidates … import`; a // cached window of vid2 (0–9 s), so a candidate on it // plays here (candidates.spec.ts) // source-backlog-fixture a deck cut citing two channels: testchan (the editor // stub answers it with a backlog: 1,454/2,798 transcribed) // and backlog-done (the stub's: nothing left), and a third // the stub does not archive (source-backlog.spec.ts) // add-post-fixture play-cut-fixture's cut (play-cut-fixture.mjs) with no posts; // the social channel testchan-x beside it in the corpus: // posts/2026-10.jsonl -- 1910000000000000001 plain words, // captured; ...002 QUOTING another account, not captured // (the stub's capture-posts takes it); ...003 with a picture, // captured -- each captured shot a tall 500x900 png // (add-post.spec.ts) // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import path from "node:path"; import { deflateSync } from "node:zlib"; import { makePlayCutFixture } from "./play-cut-fixture.mjs"; const CRC = (() => { const t = new Uint32Array(256); for (let n = 0; n < 256; n += 1) { let c = n; for (let k = 0; k < 8; k += 1) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; t[n] = c >>> 0; } return t; })(); const crc32 = (buf) => { let c = 0xffffffff; for (const b of buf) c = CRC[(c ^ b) & 0xff] ^ (c >>> 8); return (c ^ 0xffffffff) >>> 0; }; const chunk = (type, data) => { const len = Buffer.alloc(4); len.writeUInt32BE(data.length); const td = Buffer.concat([Buffer.from(type, "ascii"), data]); const crc = Buffer.alloc(4); crc.writeUInt32BE(crc32(td)); return Buffer.concat([len, td, crc]); }; /** * A post's screenshot, drawn: a light card -- the post's own words as dark bars * in its top 300 px -- and, below, a grey box standing for a quoted post or a * media thumbnail (what a crop keeps off the screen). */ export function postShotPng(w = 500, h = 900) { const raw = Buffer.alloc((w * 3 + 1) * h); for (let y = 0; y < h; y += 1) { const row = y * (w * 3 + 1); raw[row] = 0; for (let x = 0; x < w; x += 1) { let v = 245; if (y < 300 && y % 40 > 24 && x > 24 && x < w - 24 - (y % 80 > 40 ? 120 : 0)) v = 40; // the words if (y >= 340 && y < h - 30 && x > 24 && x < w - 24) v = y % 60 < 4 || x < 30 || x > w - 30 ? 120 : 190; // the quoted box const i = row + 1 + x * 3; raw[i] = v; raw[i + 1] = v; raw[i + 2] = v + (y >= 340 ? 10 : 0) > 255 ? 255 : v + (y >= 340 ? 10 : 0); } } const ihdr = Buffer.alloc(13); ihdr.writeUInt32BE(w, 0); ihdr.writeUInt32BE(h, 4); ihdr[8] = 8; ihdr[9] = 2; return Buffer.concat([Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]), chunk("IHDR", ihdr), chunk("IDAT", deflateSync(raw)), chunk("IEND", Buffer.alloc(0))]); } export const POST_IDS = { plain: "1910000000000000001", quoting: "1910000000000000002", media: "1910000000000000003" }; const json = (doc) => JSON.stringify(doc, null, 2) + "\n"; const write = (dir, name, text) => { mkdirSync(path.dirname(path.join(dir, name)), { recursive: true }); writeFileSync(path.join(dir, name), text); }; const clips = (ids) => ids.map((id, i) => ({ type: "clip", id, channel: "testchan", video: "vid1", start: 0.5 + i, end: 1.4 + i, cite: 0.5 + i, lock: true, title: "The Fixture Stream", date: "2026-10-27", quote: `the words of ${id}`, })); export const CANDIDATES_SWEEP = `# Re-sweep: newer transcripts against the cut - Format of each bullet: \`[verdict] [title @ time](link) (upload date) "quote" — why\`. ## 1. As a streamer - [strengthens c04] [An older stream || Some react @ 0:03](https://archive.example/?v=testchan%2Fvid2&t=3) (2025-07-18) "I'm a streamer who reacts to stuff a lot." — the same self-introduction c04 gives, a year before; a stock phrase - [new claim] [Working my way back to "normal" @ 1:02:46](https://archive.example/?v=testchan-twitch%2Fv1234567&t=3766) (2026-10-29) "I didn't want my voice on stream." — a new window, in no clip ## 2. Looks - [new claim] [The not-so-fabulous history || Liquid react @ 4:44](https://archive.example/?v=testchan%2FW4pgGUq5ygQ&t=284) (2025-08-03) "I respect that looks sell." — she accepts the trade outright - [could replace c06] [It's pretty clear by now... @ 30:45](https://archive.example/?v=testchan%2FXCERAAfIePY&t=1845) (2025-08-27) "It is one of the big reasons." — earlier than c06 by 13 months ## Top 5 across all sections 1. [new claim] [Working my way back to "normal" @ 1:02:46](https://archive.example/?v=testchan-twitch%2Fv1234567&t=3766) (2026-10-29) "I didn't want my voice on stream." ## Read and set aside (not hers) - \`zISdc4EwxJ4\` @ 15:29 ("I'm a host"): someone else. `; /** * @param {{ reports: string, deckManifest: Function, cachedWindow: string }} o */ export function makeIntakeFixture({ reports, channels, deckManifest, cachedWindow }) { const cands = path.join(reports, "candidates-fixture"); const m = deckManifest("candidates-fixture", "The Candidates Fixture", clips(["c01", "c02", "c03", "c04", "c05", "c06"])); m.render.chrome.deck.markers = [ { after: "c02", label: "As a streamer", color: "#ff5a5a" }, { after: "c04", label: "Looks", color: "#4fbf6a" }, ]; m.groups = [{ id: "g1", section: 1, claim: "Says she streams", ids: ["c03", "c04"] }]; write(cands, "video.manifest.json", json(m)); write(cands, "sweep.md", CANDIDATES_SWEEP); mkdirSync(path.join(cands, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(cands, "out", "clips-raw", "vid1_0.00-9.00.mp4")); copyFileSync(cachedWindow, path.join(cands, "out", "clips-raw", "vid2_0.00-9.00.mp4")); // ---- the source backlog (item 16) ---------------------------------------------- const backlog = path.join(reports, "source-backlog-fixture"); const bm = deckManifest("source-backlog-fixture", "The Source Backlog Fixture", [ ...clips(["c01", "c02", "c03"]), { ...clips(["c04"])[0], channel: "backlog-done" }, { ...clips(["c05"])[0], channel: "not-archived" }, ]); write(backlog, "video.manifest.json", json(bm)); // ---- Add post (item 13) ----------------------------------------------------------- makePlayCutFixture({ reports, deckManifest, cachedWindow, name: "add-post-fixture", title: "The Add Post Fixture" }); // With a post drawn the tally's cell is narrower: a word that fits it (the build refuses "Seizures" there). const apFile = path.join(reports, "add-post-fixture", "video.manifest.json"); const ap = JSON.parse(readFileSync(apFile, "utf8")); ap.render.chrome.factcheck.verdicts.CORROBORATED.tallyLabel = "Fits"; writeFileSync(apFile, json(ap)); const x = path.join(channels, "testchan-x"); const row = (id, date, text, extra = {}) => JSON.stringify({ id, slug: "testchan-x", channelSlug: "testchan-x", author: "teststreamer", authorName: "Test Streamer", createdAt: `${date}T15:00:00.000Z`, uploadDate: date.replace(/-/g, ""), text, url: `https://x.com/teststreamer/status/${id}`, platform: "twitter", isReply: false, isRepost: false, links: [], ...extra }); write(x, "config.json", json({ name: "Test Streamer (X)", kind: "social", platform: "x" })); write( x, "posts/2026-10.jsonl", [ row(POST_IDS.plain, "2026-10-20", "The voice is a setting, nothing more."), row(POST_IDS.quoting, "2026-10-21", "About that voice clip going round:", { quoted: { platform: "twitter", id: "1900000000000000009", author: "someoneelse", url: "https://x.com/someoneelse/status/1900000000000000009" } }), row(POST_IDS.media, "2026-10-22", "The voice setup, pictured.", { mediaCount: 1 }), ].join("\n") + "\n", ); write(x, "posts-archive", Object.values(POST_IDS).map((id) => `twitter ${id}`).join("\n") + "\n"); for (const id of [POST_IDS.plain, POST_IDS.media]) { const d = path.join(x, "posts-media", id); mkdirSync(d, { recursive: true }); writeFileSync(path.join(d, "shot.png"), postShotPng()); writeFileSync(path.join(d, "capture.json"), json({ version: 1, id, url: `https://x.com/teststreamer/status/${id}`, capturedAt: "2026-10-30T00:00:00.000Z", state: "captured", mediaState: "skipped", media: [] })); } return { cands, backlog }; }