Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit e5c5c0873da10597842fe7543dfd3ea3b5ff2e8a
parent fa3641ad8ab694a025c46d4bac46280335b5ff7c
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 17 Nov 2026 15:48:15 -0500

the read commands take an injected tts; no test reaches a live editor (noLiveEditor.mjs)

A finding of 17 Nov 2026 (an incident in this lane: a unit run's thread read fell through to the
operator's running editor, asked it for Orpheus parts and held its transcription lane). postsCommand's
`ask` is the voice ops' seam; the READ paths -- `posts narrate <item> --take`, `--take --thread`,
`posts screen <item> read` -- ignored any stub and asked the editor at its address. postsCommand now
takes `tts` (askEditorTts's shape) and hands it to every read it makes, the editor's lanes then never
held (threadTake lanes: null; makeTake's beep timing never waits on a lane).

noLiveEditor.mjs, imported FIRST by this lane's tests and scratch scripts: the editor's address set
to the discard port on loopback and the token to none (editor/.env is never read), then checked --
it throws if anything would still resolve to a real editor. postsTtsSeam.test.mjs pins the seam;
an unstubbed read under the guard fails on the missing token, before any connection.
Also: `posts narrate <item> --take --bench-slurs` (the bench's slur rule, for the re-read queue).

Co-Authored-By: Claude <noreply@anthropic.com>

Diffstat:
Mumtool/lib/report/benchQueueParity.test.mjs | 1+
Aumtool/lib/report/noLiveEditor.mjs | 19+++++++++++++++++++
Mumtool/lib/report/plainPressFresh.test.mjs | 1+
Mumtool/lib/report/postNarrationCli.mjs | 13++++++++++---
Mumtool/lib/report/postNarrationsForReading.test.mjs | 1+
Mumtool/lib/report/postScreensCli.mjs | 4+++-
Mumtool/lib/report/postsCli.mjs | 10++++++----
Aumtool/lib/report/postsTtsSeam.test.mjs | 44++++++++++++++++++++++++++++++++++++++++++++
Mumtool/lib/report/reads.test.mjs | 1+
Mumtool/lib/report/readsReplace.test.mjs | 1+
10 files changed, 87 insertions(+), 8 deletions(-)

diff --git a/umtool/lib/report/benchQueueParity.test.mjs b/umtool/lib/report/benchQueueParity.test.mjs @@ -2,6 +2,7 @@ // queue (makeTake with the bench's slur rule) asks the editor EXACTLY what the bench's take op asks // (postTakeAsk.mjs: the one module both build from) -- the slur case included: a cut that beeps a slur has it left // out of a bench read, and out of the queue's. Temp dirs, a stub tts, invented people. +import "./noLiveEditor.mjs"; import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; diff --git a/umtool/lib/report/noLiveEditor.mjs b/umtool/lib/report/noLiveEditor.mjs @@ -0,0 +1,19 @@ +// NO TEST REACHES A LIVE EDITOR (lane reads-find, 17 Nov 2026: a unit run's read fell through to the operator's running +// editor). Imported FIRST by a test (or a scratch script), before any module that could ask the editor: the editor's +// address is set to one that cannot answer (the discard port on loopback) and the token to none -- so no tts, no lane +// hold, no job can be asked of a real editor, and editor/.env's token is never read (agentToken takes the empty one +// set here). Then it CHECKS what the modules that ask the editor would resolve, and throws when either still points +// anywhere real: a test that needs an editor brings a stub of its own (an injected ask), never a port. +// +// Plain ESM, side effects only. +import { editorConfig } from "./fetchWindows.mjs"; +import { editorLanes } from "./renderMode.mjs"; + +export const DEAD_EDITOR = "http://127.0.0.1:9"; +process.env.ARCHILYZER_EDITOR_URL = DEAD_EDITOR; +process.env.WORKER_TOKEN = ""; +process.env.UMTOOL_URL = "http://127.0.0.1:9"; + +const cfg = editorConfig(process.env); +if (cfg.url !== DEAD_EDITOR || cfg.token !== "") throw new Error(`noLiveEditor: the editor resolves to ${cfg.url}${cfg.token ? " with a token" : ""} -- a test must never reach a real editor`); +if (editorLanes(cfg) !== null) throw new Error("noLiveEditor: the editor's lanes would be held -- a test must never reach a real editor"); diff --git a/umtool/lib/report/plainPressFresh.test.mjs b/umtool/lib/report/plainPressFresh.test.mjs @@ -2,6 +2,7 @@ // the LINE owned (`tuningOwn`); the character's and the settings' -- takes included -- are resolved now. The character's // takes change -> its read is stale -> a plain press re-reads it -> picked -> fresh. A line that owned its takes keeps // them. No editor (a stub tts); temp dirs; invented people. +import "./noLiveEditor.mjs"; import assert from "node:assert/strict"; import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; diff --git a/umtool/lib/report/postNarrationCli.mjs b/umtool/lib/report/postNarrationCli.mjs @@ -48,7 +48,7 @@ export const NARRATE_USAGE = [ "usage: umtool posts narrate <project> --import [--dry-run] [--json]", " umtool posts narrate <project> --list [--json]", " umtool posts narrate <project> <item> [--script \"…\"] [--take [--note \"…\"] [--voice v] [--engine e] [--speed s]]", - " [--reading N|next] [--temperature t] [--top-p p] [--top-k k] [--min-p m] [--repeat-penalty r] [--chunk-takes n] [--no-pick]", + " [--reading N|next] [--temperature t] [--top-p p] [--top-k k] [--min-p m] [--repeat-penalty r] [--chunk-takes n] [--no-pick] [--bench-slurs]", " [--pick <n>] [--approve|--unapprove] [--off|--on] [lead=… tail=… ramp=… linger=… clip=read|full", " wet=… lowpass=… duck=on|off short=hold|loop attach=under|after lufs=… rate=… pace=fast|normal] [--json]", " umtool posts narrate <project> <item> --recording <file> [--as <character>] [--no-clean|--clean] [--no-trim|--trim] [--no-convert]", @@ -102,7 +102,8 @@ export const NARRATE_USAGE = [ " Orpheus's TUNING for this read, any of them, the rest its defaults. The take records the tuning (every value) and", " the reading it was made with. Kokoro and eSpeak NG ignore both (the editor says so). One item's --take only, not", " --all. --reading next: one past the highest reading these words were read at (0 for new words). --no-pick: the", - " new take joins the list unpicked (--pick <n> makes it the one; the bench's Read again does this).", + " new take joins the list unpicked (--pick <n> makes it the one; the bench's Read again does this). --bench-slurs:", + " the bench's slur rule (a cut that beeps has the slur left out, not word-timed): what `umtool reads … reread` asks.", " With --thread: the whole read's, every synthesized piece read anew (next: each one past its own highest); --for", " <role> (post, quoted, parent:<i>, linked:<i>, screen:<id>:<line>) one piece's only, the others from the cache;", " --tuned <role|*>=reading:N,temperature:t,… (repeatable) each piece's exactly (what a read's `read.tuned` says).", @@ -583,7 +584,7 @@ async function timeTakeWords(project, rel, script, { askOp = null, emit = () => } /** `umtool posts narrate …` (postsCli.mjs routes it here). */ -export async function narrateCommand(project, words, flags, { json = false, dryRun = false, out = (s) => console.log(s), str, multi = () => [], ask = null }) { +export async function narrateCommand(project, words, flags, { json = false, dryRun = false, out = (s) => console.log(s), str, multi = () => [], ask = null, tts = null }) { const manifest = await readManifest(project.dir); if (!manifest) throw new NarrateError(`${project.id} has no manifest`); const render = manifest.render ?? {}; @@ -843,6 +844,8 @@ export async function narrateCommand(project, words, flags, { json = false, dryR screens: !flags.has("--no-screens"), lineTakes: lineTakesOf(multi("--line-take")), // Its readings and tunings (lane line-rerun): the whole read's, one piece's (--for), each piece's (--tuned). tuned: threadTunedOf(tuned, { str, multi }), keepPick: flags.has("--no-pick"), events: flags.has("--events"), + // The editor's tts op as the caller hands it (postsCommand's `tts`: a test's stub) -- the lanes then never held. + ...(tts ? { ask: tts, lanes: null } : {}), }); } if (str("--post-take") !== null) throw new NarrateError("--post-take is a thread read's (umtool posts narrate <p> <item> --take --thread --post-take <n>)"); @@ -856,6 +859,10 @@ export async function narrateCommand(project, words, flags, { json = false, dryR const r = await makeTake(project, e, { script: str("--script"), note: str("--note"), engine: str("--engine"), voice: str("--voice"), speed: speedFlag(str), ...(asked ? { tuning: asked.tuning, reading: asked.reading } : {}), keepPick, render, emit: (_ev, f) => !json && f?.message && out(f.message), + // --bench-slurs (the re-read queue's): the bench's slur rule -- a beep left out, as a bench press leaves it. + benchSlurs: flags.has("--bench-slurs"), + // The editor's tts op as the caller hands it (postsCommand's `tts`: a test's stub). + ...(tts ? { ask: tts, laneHeld: async () => false } : {}), }); if (json) out(JSON.stringify({ ok: true, id: e.id, take: r.take, picked: !keepPick, narration: r.result.narration, token: r.result.token }, null, 2)); else out(`${e.id}: take ${r.take.file} (${r.take.seconds} s), ${keepPick ? "not picked (--pick to play it)" : "picked"}${r.take.note ? ` — note: ${r.take.note}` : ""}${tunedLabel(asked)}`); diff --git a/umtool/lib/report/postNarrationsForReading.test.mjs b/umtool/lib/report/postNarrationsForReading.test.mjs @@ -2,6 +2,7 @@ // import (`posts narrate --import`, narration/posts/index.json) sets a script through updatePostNarrations, and a script // that is not the post's words as drafted must leave the card on the shown text -- as the single writer does // (postNarrationIn's forReading). Pinned with the reading pin's hashes: the card draws what it drew before. +import "./noLiveEditor.mjs"; import assert from "node:assert/strict"; import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; diff --git a/umtool/lib/report/postScreensCli.mjs b/umtool/lib/report/postScreensCli.mjs @@ -254,7 +254,7 @@ export function screenListing(e, sc) { * `umtool posts screen <p> <item> <verb> …`. `project` is resolved; `rest` the words after the project * (`<item> <verb> [<id>] [pairs…]`); `opt` the posts command's flags and helpers. */ -export async function screenCommand(project, rest, { flags, str: flag, multi, json = false, out = (s) => console.log(s), dryRun = false }) { +export async function screenCommand(project, rest, { flags, str: flag, multi, json = false, out = (s) => console.log(s), dryRun = false, tts = null }) { const [ref, verb, ...words] = rest; if (!ref || !verb || flags.has("--help")) { out(SCREEN_USAGE); @@ -406,6 +406,8 @@ export async function screenCommand(project, rest, { flags, str: flag, multi, js // Its readings and tunings (lane line-rerun): the flags' (--reading, the tuning flags, --for, --tuned), over the // playing read's -- each piece's kept while it says the same words. tuned: threadTunedOf(tuningFlags(flag), { str: flag, multi }), inherit: playingTuned(e), keepPick: flags.has("--no-pick"), events: flags.has("--events"), + // The editor's tts op as the caller hands it (postsCommand's `tts`: a test's stub) -- the lanes then never held. + ...(tts ? { ask: tts, lanes: null } : {}), }); } if (verb === "record") { diff --git a/umtool/lib/report/postsCli.mjs b/umtool/lib/report/postsCli.mjs @@ -448,10 +448,12 @@ export async function addPostFromArchive(project, { slug, postId, attach = null, /** * @param {string[]} args the words after `posts` - * @param {{ root?: string, out?: (s: string) => void, err?: (s: string) => void }} [opts] + * @param {{ root?: string, out?: (s: string) => void, err?: (s: string) => void, ask?: Function | null, tts?: Function | null }} [opts] + * `ask` the editor's voice ops (a recording's chain); `tts` the editor's tts op for every READ made here (`narrate + * --take`, `--take --thread`, `screen … read`; askEditorTts's shape) -- a test's stub, the editor's lanes then never held * @returns {Promise<number>} the exit code */ -export async function postsCommand(args, { root = REPORTS_ROOT, out = (s) => console.log(s), err = (s) => console.error(s), ask = null } = {}) { +export async function postsCommand(args, { root = REPORTS_ROOT, out = (s) => console.log(s), err = (s) => console.error(s), ask = null, tts = null } = {}) { // A TAKE-SCOPED EDIT (`--in-take <take>`, takeScope.mjs): the same command over the take's manifest, written into its patch. let scoped; try { @@ -500,7 +502,7 @@ export async function postsCommand(args, { root = REPORTS_ROOT, out = (s) => con err(SCREEN_USAGE); return 2; } - return await screenCommand(await projectOf(projectArg, root), words.slice(2), { flags, str, multi, json, out, dryRun }); + return await screenCommand(await projectOf(projectArg, root), words.slice(2), { flags, str, multi, json, out, dryRun, tts }); } if (verb === "set-item" && projectArg && ref && !flags.has("--help")) return await setItemCommand(projectArg, ref, words.slice(3), { root, json, out, reread: !flags.has("--no-reread") }); if (verb === "reread") { @@ -559,7 +561,7 @@ export async function postsCommand(args, { root = REPORTS_ROOT, out = (s) => con const named = words.slice(3).find((w) => takes.has(w)); if (named) throw new CliError(`posts narrate: --take makes a NEW READ (TTS); "${named}" is a take of ${project.id} -- to edit take ${named}, say --in-take ${named}`); } - return await narrateCommand(project, words.slice(2), flags, { json, dryRun, out, str, multi, ask }); + return await narrateCommand(project, words.slice(2), flags, { json, dryRun, out, str, multi, ask, tts }); } if (verb === "fx") { const { FX_USAGE, fxCommand } = await import("./postFxCli.mjs"); diff --git a/umtool/lib/report/postsTtsSeam.test.mjs b/umtool/lib/report/postsTtsSeam.test.mjs @@ -0,0 +1,44 @@ +// 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 <item> --take`, `--take --thread`, and `screen <item> +// 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); +}); diff --git a/umtool/lib/report/reads.test.mjs b/umtool/lib/report/reads.test.mjs @@ -1,6 +1,7 @@ // THE READ MODEL (lane reads-find, reads.mjs): every read of a video -- a post's script, a thread read's pieces, its // screen lines, a card's narration -- with what it SAYS, where that is kept, the take that plays, and its state; and // FIND over the spoken text only. Temp dirs, invented people. +import "./noLiveEditor.mjs"; import assert from "node:assert/strict"; import { mkdtemp, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; diff --git a/umtool/lib/report/readsReplace.test.mjs b/umtool/lib/report/readsReplace.test.mjs @@ -3,6 +3,7 @@ // when it has none, a card's narration; a context piece and a recorded read listed, never changed); undo restores // every line; Everywhere adds a pronunciation entry, previews what it makes stale, never reaches a card, and is whole // words only. Neither synthesizes. Temp dirs, invented people. +import "./noLiveEditor.mjs"; import assert from "node:assert/strict"; import { mkdtemp, readdir, rm } from "node:fs/promises"; import { tmpdir } from "node:os";