// A VIDEO's READS (reads-find.spec.ts; components/projects/ReadsPanel.tsx, lib/report/readsCli.mjs): two post items read // by this video's own "ferry" character (orpheus · tara), one recorded read, and a narrated card whose reading is kept // beside the build -- the words "north pier" in three of them, so Find counts, Replace rewrites what is SAID, and the // re-read queue re-reads through the suite's editor stub (no real synthesis). // // reports/reads-fixture/ // p-1 @invented_ferry_reads picked take orpheus · tara (made with the defaults): "… the north pier …" twice // p-2 @invented_ferry_reads picked take orpheus · tara: no match // p-3 @invented_pier_reads picked take RECORDED: "… north pier …" -- found, never replaced // c-1 a card, its narration "… the north pier reopened." (orpheus · leo), its reading kept in out/narration/ // p-4 @invented_ferry_reads a THREAD read: its parent (said as shown: "… north pier …"), his words, a DM screen of // two lines ("Is the north pier open?" -- a said-as made by a replace), each part a file of the parts cache // // Invented people, like every fixture. import { mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; import { narrationsOf } from "../../report-to-video/narration.mjs"; import { draftScript } from "../../report-to-video/post-narration.mjs"; import { screenLineSaid } from "../../report-to-video/post-screens.mjs"; export const READS = "reads-fixture"; export const READS_P1 = "The ferry leaves the north pier at noon.\n\nBring a coat for the north pier wind."; 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, manifest: Function, ff: (args: string[]) => void }} o */ export function makeReadsFixture({ reports, manifest, ff }) { const dir = path.join(reports, READS); const made = { temperature: 0.55, top_p: 0.85, top_k: 50, min_p: 0, repeat_penalty: 1.2, takes: 3 }; const post = (id, handle, text, take) => ({ type: "post", id: `p-${id}`, post: `readsx/${id}`, platform: "x", author: handle === "invented_ferry_reads" ? "Ferry Teller" : "Pier Watch", handle, date: `2026-10-30T1${id}:00:00.000Z`, text, url: `https://x.com/${handle}/status/${id}`, engagement: { likes: 1 }, section: 0, narration: { script: text, takes: [{ seconds: 2, script: text, at: "2026-11-02T00:00:00.000Z", ...take }], pick: 0 }, }); const tone = (abs) => { mkdirSync(path.dirname(abs), { recursive: true }); ff(["-f", "lavfi", "-i", "sine=frequency=262:sample_rate=48000:duration=2", "-ac", "1", "-c:a", "pcm_s16le", abs]); }; const timeline = [ post("1", "invented_ferry_reads", READS_P1, { file: "narration/posts/1/take-1.orpheus-tara.wav", engine: "orpheus", voice: "tara", tuning: made, reading: 0 }), post("2", "invented_ferry_reads", "The ferry fares go up in the spring.", { file: "narration/posts/2/take-1.orpheus-tara.wav", engine: "orpheus", voice: "tara", tuning: made, reading: 0 }), post("3", "invented_pier_reads", "The north pier is closed today.", { file: "narration/posts/3/take-1.recorded.wav", engine: "recorded", voice: "operator" }), { type: "card", id: "c-1", seconds: "auto", heading: "Later", narration: { text: "Six months later, the north pier reopened.", engine: "orpheus", voice: "leo" } }, threadPost(), ]; for (const e of timeline) for (const t of e.narration?.takes ?? []) { tone(path.join(dir, ...t.file.split("/"))); for (const x of t.parts ?? []) tone(path.join(dir, ...x.file.split("/"))); } // p-4's picture (its screen is in it). mkdirSync(path.join(dir, "posts-media", "readsx", "4"), { recursive: true }); ff(["-f", "lavfi", "-i", "color=c=gray:s=90x140", "-frames:v", "1", path.join(dir, "posts-media", "readsx", "4", "4_1.png")]); const m = manifest(READS, "The Reads Fixture", {}, timeline); write(dir, "video.manifest.json", m); // The card's reading, kept beside the build as narrate-via-editor keeps it (out/narration/.{wav,json}). for (const n of narrationsOf(m)) { const store = path.join(dir, "out", "narration"); tone(path.join(store, `${n.key}.wav`)); write(store, `${n.key}.json`, { id: n.id, key: n.key, text: n.text, engine: n.engine, voice: n.voice, speed: 1, seconds: 2, createdAt: "2026-11-02T00:00:00.000Z" }); } write(path.join(dir, "narration"), "characters.json", { format: "umtool-project-characters", version: 1, characters: [{ id: "ferry", name: "Ferry Teller", handles: ["invented_ferry_reads"], synthetic: { voice: "orpheus:tara" } }], }); return dir; } /** p-4: a thread read -- its parent, his words, a DM screen of two lines -- each part a file of the parts cache. */ export function threadPost() { const text = "The ferry timetable changes next week."; const parent = { id: "41", handle: "invented_pier_reads", author: "Pier Watch", date: "2026-10-30T13:00:00.000Z", text: "They say the north pier will stay shut." }; const dm = { id: "s1", media: 0, kind: "dm", read: "all", lines: [{ who: "invented_pier_reads", text: "Is the north pier open?" }, { who: "invented_ferry_reads", text: "Not until spring." }] }; const parts = []; let t = 0; const add = (words, role, piece, more = {}) => { t += parts.length ? 0.8 : 0; parts.push({ n: parts.length + 1, para: piece * 100, text: words, voice: role === "post" || more.speaker === "invented_ferry_reads" ? "tara" : "leo", role, start: Math.round(t * 1000) / 1000, seconds: 2, file: `narration/parts-cache/reads-fixture-${parts.length + 1}.wav`, ...more }); t += 2; }; add(draftScript(parent.text).script, "parent:0", 0); add(draftScript(text).script, "post", 1); dm.lines.forEach((l, n) => { const said = draftScript(screenLineSaid(dm, n)).script; add(said, `screen:s1:${n}`, 2 + n, { line: said, speaker: l.who }); }); return { type: "post", id: "p-4", post: "readsx/4", platform: "x", author: "Ferry Teller", handle: "invented_ferry_reads", date: "2026-10-30T14:00:00.000Z", text, url: "https://x.com/invented_ferry_reads/status/4", engagement: { likes: 1 }, section: 0, parents: [parent], media: [{ src: "posts-media/readsx/4/4_1.png", kind: "image", width: 900, height: 1400 }], screens: [dm], narration: { script: draftScript(text).script, pick: 0, takes: [{ file: "narration/posts/4/take-1.orpheus-thread.wav", engine: "orpheus", voice: "tara+leo", seconds: Math.round(t * 1000) / 1000, script: parts.map((p) => p.text).join("\n\n"), parts, read: { kind: "thread", parents: "0" }, at: "2026-11-02T00:00:00.000Z" }] }, }; }