// THE TTS SEAM OF THE READ COMMANDS (lane reads-find, a finding of 17 Nov 2026): `postsCommand`'s `tts` (askEditorTts's // shape) reaches EVERY read the posts commands make -- `narrate --take`, `--take --thread`, and `screen // read` -- and with it the editor's lanes are never held. Before, the screen read (and the narrate paths) ignored the // caller's stub and asked the editor at its address. Temp dirs, a stub tts, invented people; noLiveEditor first. import "./noLiveEditor.mjs"; import assert from "node:assert/strict"; import { mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; import { after, test } from "node:test"; import { postsCommand } from "./postsCli.mjs"; import { readManifestOf, readsProject, wavOf } from "./reads.fixtures.mjs"; const ROOT = await mkdtemp(path.join(tmpdir(), "umtool-tts-seam-")); after(() => rm(ROOT, { recursive: true, force: true })); delete process.env.UMTOOL_CAST_FILE; const stubAsk = (asked) => async (body) => { asked.push(body); await wavOf(body.out); return { jobId: `job-${asked.length}`, result: { wav: body.out, engine: body.engine, voice: body.voice, tuning: { temperature: 0.55, top_p: 0.85, top_k: 50, min_p: 0, repeat_penalty: 1.2, takes: 3 }, reading: body.reading ?? 0 } }; }; const run = (p, args, asked) => postsCommand(args, { root: p.root, tts: stubAsk(asked), out: () => {}, err: () => {} }); test("screen … read takes the injected tts: every piece it synthesizes is asked of the stub, none of an editor", async () => { const p = await readsProject(ROOT, "screen"); const asked = []; assert.equal(await run(p, ["screen", "p", "p-2", "read", "--for", "screen:s1:1", "--reading", "next", "--no-pick"], asked), 0); assert.ok(asked.length >= 1); assert.ok(asked.some((b) => /Not this year/.test(b.text))); const e = (await readManifestOf(p)).timeline[1]; assert.equal(e.narration.takes.length, 2, "a new take, unpicked"); assert.equal(e.narration.pick, 0); }); test("narrate --take and --take --thread take it too", async () => { const p = await readsProject(ROOT, "narrate"); const asked = []; assert.equal(await run(p, ["narrate", "p", "p-1", "--take", "--reading", "next", "--no-pick", "--bench-slurs"], asked), 0); assert.equal(asked.length, 1); assert.equal((await readManifestOf(p)).timeline[0].narration.takes.length, 2); const before = asked.length; assert.equal(await run(p, ["narrate", "p", "p-2", "--take", "--thread", "--no-screens", "--tuned", "post=reading:next", "--no-pick"], asked), 0); assert.ok(asked.length > before); });