Archilyzer · Source

archilyzer

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

commit 4f51b6c3db574e992d210691b4b9a0d3a9f68109
parent d1fd7a1cc9302219e4b47c6d4439939437dc05d7
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed,  4 Nov 2026 22:43:31 -0500

umtool docs: pronunciation and voices, the thread read as a command

knobs.md gains "Pronunciation and voices (the lexicon, the voice map, a
thread read)", written for a cheaper model: what each command does, its
exit codes, and recipes to copy instead of a script. cli.md gets the
rows for `posts narrate --take --thread`, `posts say` and `posts
voices`; report-video.md points at them. A thread read's parts are
measured with ffprobe alone; `--all --take --thread` is refused (one
item's).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/docs/cli.md | 3+++
Mumtool/docs/knobs.md | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/docs/report-video.md | 5+++++
Mumtool/lib/report/postNarrationCli.mjs | 1+
Mumtool/lib/report/postThreadRead.mjs | 8++++----
Mumtool/report-to-video/post-redact.mjs | 1+
6 files changed, 73 insertions(+), 4 deletions(-)

diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md @@ -92,6 +92,9 @@ Inbox cannot disagree about what is wrong with one. | `timeline <project> threads [--json]` · `timeline <project> threads --write [--conversation <id>]` | **the cut's conversations** ([report-video.md](report-video.md#thread-reads), `post-conversation.mjs`): each tree of two post items or more — its root, its items' places, whether they play as one run (one scene) or are split by other entries, a reply placed before the post it answers, an item re-reading a post its run already read (with `posts set-item <p> <item> thread.parent.<i>=context`). `--write` gathers each (or the one holding `<id>`: its root, a post, an item, a `thread.group` name) at its first item's place in TREE order (a manual thread: in DATE order) — a post after what it answers, sibling branches by date, each depth first — in ONE write (one undo point); never across a section boundary (gathered within each section, and said) | | `posts roles <project> [<item> …] [--write] [--set <n>=<role>,…] [--json]` | a narrated read **piece by piece** ([knobs.md](knobs.md#thread-reads-every-part-of-a-read-on-screen-while-it-is-said), [report-video.md](report-video.md#thread-reads)): the text each part of the picked take reads -- `parent:<i>`, `quoted`, `post`, `media:<i>` -- stored or inferred, what the card shows for each, and the build's guard (a part read off a post the card hides is refused). `--write` stores the inferred roles on the picked takes' parts (one write; the import stores them for every new take); `<item> --set n=role,…` sets parts' roles by hand (`off`: inferred again); a part out of range or an unknown role is refused (**exit 1**) | | `posts narrate <project> --import [--dry-run] [--json]` · `--list` · `<item> [--script "…"] [--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= pace=fast\|normal]` · `<item> --take [--note "…"] [--voice v] [--engine e] [--speed s] [--script "…"]` · `<item> --derive <n> --op enhance\|convert [--engine e] [--voice v]` · `<item> --delete <n>` · `--all --draft-scripts [--force]` · `--all --take [--limit N]` · `--cut <k=v>…` | a **narrated post item** ([report-video.md](report-video.md#narrated-post-items), [knobs.md](knobs.md#a-narrated-post-item)): `--import` reads `narration/posts/index.json` (`[{id, entry, script, takes: [{file, engine, voice, seconds}], pick}]`, and a take's `take-<n>.parts.json`) into the cut in ONE write, measuring each take (length, loudness); a re-run adds only takes not there. `--take` asks the EDITOR for a new take (`POST /api/ops/tts`, its `out` the next `narration/posts/<postId>/take-<n>.<engine>-<voice>.wav`; a job, waited for; `ARCHILYZER_EDITOR_URL`, `WORKER_TOKEN`) and picks it, its `--note` kept with it; `--pick <n>` is the take's number as `--list` shows it. `--derive <n>` makes a NEW take from take n through the editor's `voice-enhance` / `voice-convert` op (a stock synthetic voice; "not installed" until the editor has the engine), the original kept; `--delete <n>` moves a take's file to the post's `.trash/`. A new script or pick takes the approval away. `--all --draft-scripts` writes every post's words as its script, VERBATIM (cleaned only to be spoken: @handles, links, emoji dropped; `plan(s)` → plans, `w/` → with, `&` → and; paragraphs kept). `--cut` sets `render.postNarration` (and its read-follow: `follow=on\|off`, `follow.dim=`, `follow.ease=`; its thread reads: `thread.parent=`, `thread.quoted=`, `thread.carry=`, `thread.reveal=`, `thread.shrink=`, `thread.dim=`, `thread.seconds=`, `thread.pan=`). Refused in the build's words (**exit 1**) | +| `posts narrate <project> <item> --take --thread [--parents 0\|all\|none\|<n>] [--skip-parent <id\|parent:i>]… [--no-quoted] [--no-linked] [--read-seen] [--voice-for <handle>=<voice>]… [--voice v] [--engine e] [--note "…"] [--force] [--no-hold] [--dry-run] [--json]` | a **THREAD READ** as one command ([knobs.md](knobs.md#pronunciation-and-voices-the-lexicon-the-voice-map-a-thread-read), `lib/report/postThreadRead.mjs`): the post it answers (`--parents all`: every ancestor; `<n>`: parents 0..n; `none`), the post it quotes and the posts it links to, then his words, in DATE order, each in its author's voice (`--voice-for`, then the project's voice map, `posts voices`; his own: the narrator's), the redaction, the slur filter (a beep is skipped: a joined read is not word-timed) and the lexicon (`posts say`) applied. A parent or quoted post the item before already shows is not read again (`--read-seen`: it is). Each part is synthesized ONCE by the editor's tts op into `narration/parts-cache/<sha1(voice\|text)>.wav` (the transcription lane held meanwhile, only if it was not; `--no-hold`: left alone), joined (0.8 s between pieces, 0.6 between paragraphs, 0.25 inside one) into `take-<n>.<engine>-thread.wav` with `take-<n>.parts.json`, saved with its parts' roles, its lexicon and how it was asked (`read`) and PICKED — one write (one undo point). `--dry-run`: the pieces, voices and parts (cached or not), nothing asked. Already up to date (same words and voices): nothing done, **exit 0** (`--force`: again). A part not synthesized: **exit 1** (the parts made stay cached; run it again); `--json` prints `{ok: false, error}` too. A usage error: **exit 2** | +| `posts say <project> [ls] [--item <id>]` · `add <word\|phrase> "<spoken>" [--case] [--item <id>] [--note "…"]` · `remove <word\|n> [--item <id>]` · `try "<text>" [--item <id>]` · `stale` `[--json]` | **THE PRONUNCIATION LEXICON** ([knobs.md](knobs.md#pronunciation-and-voices-the-lexicon-the-voice-map-a-thread-read)): `narration/lexicon.json` in the project, a word or phrase said differently in EVERY synthesized read (a script's `--take`, each piece of a thread read, the bench's re-take); the scripts and cards keep their words. Whole words, without case unless `--case`, a phrase across any spaces, regex characters literal; `--item` for one item's reads (it wins over the project's). A masked slur and a redacted word are never replaced. `add` of a word already listed changes what is said. `try` prints what a voice would be asked to say. `stale` lists every picked read that still says an entry the old way, with the command that re-reads it. A bad entry or an unknown item: **exit 2** | +| `posts voices <project> [ls] \| set <handle\|*> <voice> \| remove <handle\|*> [--json]` | **THE VOICE MAP** (`narration/voices.json`): the stock voice a thread read gives each author (`*`: everyone it does not name; default `leo` on Orpheus); `ls` lists the map and every author the cut's items carry with the voice each would get. A bad handle or voice: **exit 2** | | `posts fx <project> <item> add caption --match "…" --text "…" [--target post\|quoted\|parent:<i>] [--occurrence n] [--at s] [--lead s] [--hold s] [--place below\|above\|side]` · `add clock [--rewind auto\|on\|off] [--off]` · `set <n> [--text …] [--place …] [--rewind …]` | a post item's **caption** ([report-video.md](report-video.md#a-caption), [knobs.md](knobs.md#a-caption-a-chip-explaining-a-phrase-as-it-is-read)): a chip explaining a phrase (any script: CJK drawn), up as it is read -- `--at`, else the take's word timings, else the reading estimate -- held `--hold` s, by the phrase and never over a word read while it is up; it waits for a word zoom. Its **clock** ([knobs.md](knobs.md#the-clock-each-posts-own-time-on-its-card-run-between-items)): the post's own time on the card, run from the clock item before it (forward; a REWIND when earlier: `--rewind`), `--off` not on this item. Through `updatePostFx`, refused in the build's words (**exit 1**); a zoom's knob on a caption, or a caption's on a zoom (**exit 1**) | | `posts clock <project> [on\|off\|default] [--zone <IANA zone>] [--json]` | the cut's **clock** default (`render.posts.clock`, `updatePostClock`); bare, which items show it and their times | | `posts fx <project> <item> add slam --text "不動心" [--match "…" \| --at s] [--whole \| --per-glyph] [--gap s] [--hold s] [--from-scale x] [--color #rrggbb] [--outline #rrggbb] [--outline-width px] [--place over-match\|center] [--size px] [--face jp\|sc\|tc\|kr] [--sfx trailer-hit\|off] [--volume x] [--swell \| --no-swell] [--bar "…" [--bar-style dark\|gold\|plain]]` · `set <n> [those flags; --bar off clears it]` | a post item's **slam** ([report-video.md](report-video.md#a-slam), [knobs.md](knobs.md#a-slam-a-trailer-style-title-slam-over-a-word-as-it-is-read)): a corny trailer title slam -- each glyph huge, shrinking onto the card just above the matched words' line and HITTING (a flash, dust, the frame's punch, a trailer hit's boom: the teaser's generator, `trailer-hits.mjs`), gold with a black outline; the hits spread evenly over the words' spoken span (`--gap` spaces them, `--at` moves the first), held `--hold` s; `--bar` lands the glyphs on a translation bar (rising in at the first hit, faded with them); a caption up with it waits for it. Through `updatePostFx`, refused in the build's words (**exit 1**); a slam's knob on another effect, or another's on a slam (**exit 2**) | diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -678,6 +678,7 @@ the shape, the mix, recordings, parts, the best part). One writer for a post's n | **the recording session** — the cut's posts read aloud in order, part by part, each part on disk as soon as it is kept (a reload resumes), the post's recorded take made and picked when its last part is in | `/projects/<p>/narration/record` (the Cut tab's **Record the narration**): the jump list (recorded / placeholder, n of N), the post's card and attachment, the teleprompter in its parts (the placeholder's `parts.json`, else the script split), the mic, the level, count-in; **Space** record / stop, **r** redo the part, **Enter** the next part (the post done: the next post), **n** / **p** posts; **Play it back**, **Play the placeholder** | — | `GET /api/report/post-narration/record?project&id[&n]` · `POST` multipart `{project, id, n, count, text, para, part}` · `POST {op: "discard", id, n}` · `POST {op: "finish", id}` | | a recorded take — your own read, part by part, kept as `take-<n>.recorded-<label>.wav`, picked | post bench, **record your read**: the mic, the level, **Record** (R) / **Stop** (S) / **Redo part** / **Next part**, **Keep** / **Discard**, **voice** (the label, default `operator`) | — | `POST` multipart `{project, id, label, script?, part[], text[], para[]}` | | a synthesized take — the editor's tts op, with direction | post bench, **Re-take with direction** (a note, a voice) | `umtool posts narrate <p> <item> --take [--note "…"] [--voice v] [--engine e] [--speed s]` · every missing one: `--all --take` | `op: "take"` → `{jobId, file}` · `GET ?project&id&job&file` keeps it when done | +| a THREAD READ — the post it answers (or every ancestor), the post it quotes, the linked posts and his words, each in its author's voice, parts cached, one take picked ([below](#pronunciation-and-voices-the-lexicon-the-voice-map-a-thread-read)) | — | `umtool posts narrate <p> <item> --take --thread [--parents 0\|all] [--skip-parent <id>]… [--voice-for <handle>=<voice>]… [--dry-run] [--json]` | — | | a derived take — a take run through the editor's `enhance` or `convert` (a stock synthetic voice: `zac`, `leah`, `orpheus:zac`, never a recording) into a NEW take, the original kept; enhance engines `deepfilternet` · `rnnoise`, convert `openvoice` · `seed-vc` (unnamed: the editor's settings.voice, recorded on the take); "not installed" until `archilyzer voice setup --engine <id>` | post bench, **run AI on take #n** (the op, an engine, a stock voice) → **Run → a new take**; a derived take's **Re-run**; a recording's **Re-record** with **then re-run the chain** | `umtool posts narrate <p> <item> --derive <n> --op enhance\|convert [--engine e] [--voice v]` | `op: "derive", from, op2, engine?, voice?` → `{jobId, file}` (or `{installed: false}`) · `GET ?project&id&job&file&derive=<from>&op=…` keeps it | | delete a take (soft: its file to the post's `.trash/`) | post bench, the take's **Delete** | `--delete <n>` | `op: "delete", take` (an index) | | `narration.pick` — the take that plays | post bench, the take's **Pick** | `--pick <n>` (1 = the first, as `--list` shows) | `patch: {pick}` (an index) | @@ -762,6 +763,64 @@ snapshot and every script keep their words. | `render.posts.slurs.add` — the project's own words (always masked; a word, or `{word, forms?, mask?, say?}`) · `.except` — never masked here (a form, a slur's word or its id) | — | `umtool posts slurs <p> add <word>` · `except <word>` · `remove <word>` (one writer, `updatePostSlurs`) | — | | what the cut masks | — | `umtool posts slurs <p> ls [--json]`: per slur (its mask, never the word) and per post, and each read that needs word timings | — | +## Pronunciation and voices (the lexicon, the voice map, a thread read) + +Three plain commands do what hand-made scripts used to (operator, 4 Nov 2026: "we want the plain apps to do as much +heavy lifting as possible so cheaper models can more easily do these tasks without having to improvise shell scripts +and instead call real tools"). Run them; do not write a script that calls `pnpm ops tts`, ffmpeg or a regex file. + +**The lexicon** (`report-to-video/post-say.mjs`; the project's `narration/lexicon.json`, one writer, `lib/report/postSay.mjs` +`updateLexicon`): a word or phrase the VOICE says differently -- "tbh" said "T-B-H", "@grok" said "At grok", "atm" +said "A-T-M". It is applied where the words become what a voice is asked to say (`post-redact.mjs` `spokenRead`), so +EVERY synthesized read gets it: a script's take (`posts narrate --take`, `--all --take`), each piece of a thread read, +the bench's **Re-take with direction**. The script, the card and the archive keep their words. A match is a whole word +(no letter, digit or `_` either side; "can" is not the "can" of "can't"), without case unless `--case`, the words of a +phrase across any spaces; regex characters are literal (`C++`, `(sic)`, `$5`). `--item <id>`: that item's reads only, +winning over the project's entry for the same word; a longer match wins over a shorter one inside it; a replacement +is never matched again. **The slur filter and the redaction win**: a slur (whatever the filter's voice, on or off) and a +redacted word are never replaced, and a spoken form that says a slur or a blanked name is masked or dropped too. A take +records what it applied (`takes[i].lexicon: [{word, say, item?}]`), so `stale` knows a read SAID THE OLD WAY: an +entry its words hold that it did not apply with the same spoken form (a recording never is). It lives in the project, +not the manifest: changing it never re-renders a card, it makes new takes. Beep slurs: a take with a lexicon entry is +still word-timed against its script as written (the replaced words are placed between the words heard). + +**The voice map** (`narration/voices.json`, `updateVoiceMap`): `{"<handle>": "<voice>", "*": "<voice>"}` -- the stock +voice a thread read gives each author (handles without `@`, any case; `*` everyone it does not name, default `leo` on +Orpheus). The item's own author reads in the item's narrator voice (`narration.voice`, else the cut's) unless the map +names them; `--voice-for <handle>=<voice>` overrides it for one read, `--voice` sets his post's. + +**A thread read** (`lib/report/postThreadRead.mjs`): `posts narrate <p> <item> --take --thread` reads the post it +answers, the post it quotes, the posts its words link to and his words, in DATE order (`post-thread.mjs` +`chronoPieces`), each piece cleaned to be spoken (a context post's paraphrase when it has one), each in its author's +voice. Each part (a paragraph; a long one split at a sentence end) is synthesized ONCE through the editor's tts op (a +job on its queue, paced; the GPU and the heavy slot are the editor's) into `narration/parts-cache/<sha1(voice|text)>.wav` +and reused by every read after -- a re-read after one word changed asks for that part alone. The transcription lane is +held while parts are asked (only if it was not held; released after, on a failure, on Ctrl-C). The parts are joined +(0.8 s between pieces, 0.6 between paragraphs, 0.25 inside one) into `take-<n>.<engine>-thread.wav` with +`take-<n>.parts.json`, kept with each part's ROLE stored, and PICKED -- one write, one undo point +(`umtool timeline <p> undo`). Its exit code is the answer: 0 made or already up to date (`"upToDate": true`), 1 a part +was not synthesized (the parts made stay cached: run it again), 2 a usage error; `--json` for a queue step. + +| Knob | In umtool | From a terminal | Route | +|---|---|---|---| +| the lexicon -- `[{word, say, case?, item?, note?}]` (at most 500) | the bench's re-take applies it | `umtool posts say <p> add tbh "T-B-H"` · `add atm "at the moment" --item p-…` · `add US "U.S." --case` · `ls [--item <id>]` · `remove tbh [--item <id>]` (or its number) | — (`POST /api/report/post-narration {op: "take"}` applies it) | +| what a voice would be asked to say (the lexicon, the redaction, the slur filter) | — | `umtool posts say <p> try "tbh @grok atm" [--item <id>]` | — | +| the picked reads that say an entry the old way, each with the command that re-reads it | — | `umtool posts say <p> stale [--json]` | — | +| the voice map | — | `umtool posts voices <p> set kirscheverstahl tara` · `set '*' leo` · `remove <handle>` · `ls` (each author the cut carries, and the voice each gets) | — | +| a thread read -- `takes[i].read: {kind: "thread", parents, skip?, quoted?, linked?, seen?, voiceFor?, voice?}` | the post bench plays and picks it like any take | `umtool posts narrate <p> <item> --take --thread` (parent 0) · `--parents all` (every ancestor) · `--parents none` · `--skip-parent <id>` (repeat) · `--no-quoted` · `--no-linked` · `--read-seen` · `--voice-for Movail2=leah` · `--voice leo` · `--force` · `--dry-run` · `--json` | — | + +Recipes (copy them; `<p>` is the project, `<item>` the post item's id or its post's id): + +```sh +umtool posts say <p> add tbh "T-B-H" # every read says it so from now on +umtool posts say <p> stale # the reads that still say "tbh" -- and the line that fixes each +umtool posts voices <p> set kirscheverstahl tara # her words, in tara's voice +umtool posts narrate <p> <item> --take --thread --dry-run # what it will read, in which voices, what is cached +umtool posts narrate <p> <item> --take --thread --json # make it; exit 0 / 1 / 2 +umtool posts narrate <p> <item> --take --thread --parents all --skip-parent 2117733256955367748 # the whole chain but one +umtool posts roles <p> <item> # the guard: every part on screen while it is said +``` + ## A caption (a chip explaining a phrase as it is read) `fx: [{kind: "caption", match, text, …}]` on a post item ([report-video.md](report-video.md#a-caption): the shape, diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -552,6 +552,11 @@ the hand-made batch's list — `umtool posts narrate <p> --import` reads it into manifest in one undoable write. umtool never synthesizes: `posts narrate <p> <item> --take [--note "…"]` and the bench's **Re-take with direction** ask the editor's tts op (a job on its queue) to write the next take there, then measure it, append it and pick it. +What the voice is asked to say is the script with the redaction left out, the slur filter's +voice and the project's **pronunciation lexicon** applied (`umtool posts say`: "tbh" said +"T-B-H"); a **thread read** -- the post it answers, the quoted and linked posts and his words, +each in its author's voice, part by part from a cache -- is `posts narrate <p> <item> --take +--thread` ([knobs.md](knobs.md#pronunciation-and-voices-the-lexicon-the-voice-map-a-thread-read)). **The mix, inside the build's audio graph** (`postNarrationFilters`, frame-accurate, the item's true length — so the deck's rail and date run on with it, never frozen): diff --git a/umtool/lib/report/postNarrationCli.mjs b/umtool/lib/report/postNarrationCli.mjs @@ -438,6 +438,7 @@ export async function narrateCommand(project, words, flags, { json = false, dryR return 0; } if (flags.has("--take")) { + if (flags.has("--thread")) throw new NarrateError("--take --thread reads one item: name it (umtool posts narrate <p> <item> --take --thread)"); const limitRaw = str("--limit"); const limit = limitRaw === null ? Infinity : Number(limitRaw); const todo = tl.filter((e) => e.narration?.script && !(e.narration.takes ?? []).length); diff --git a/umtool/lib/report/postThreadRead.mjs b/umtool/lib/report/postThreadRead.mjs @@ -246,10 +246,10 @@ const fileThere = async (f) => !!(await stat(f).catch(() => null))?.isFile(); /** A file's length, seconds (ffprobe). */ async function durationOf(file) { - const { measureTake } = await import("./postNarrationCli.mjs"); - const m = await measureTake(file); - if (!(m.seconds > 0)) throw new ThreadReadError(`${file} has no length (not a sound file?)`); - return m.seconds; + const { stdout } = await execFileP(process.env.FFPROBE_BIN ?? "ffprobe", ["-v", "error", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", file]).catch(() => ({ stdout: "" })); + const s = Number(String(stdout).trim()); + if (!(s > 0)) throw new ThreadReadError(`${file} has no length (not a sound file?) -- delete it from ${PARTS_CACHE}/ and run it again`); + return s; } /** diff --git a/umtool/report-to-video/post-redact.mjs b/umtool/report-to-video/post-redact.mjs @@ -361,6 +361,7 @@ export function slurEntry(entry, slurs) { * @param {Record<string, any>} entry * @param {Redaction|null|undefined} red * @param {{ voice?: "skip"|"beep"|"placeholder" }} [o] the voice to use (default the filter's) + * @returns {{ text: string, slurs: "said" | "skip" | "placeholder" | null, lexicon?: Array<{ word: string, say: string, item?: string }> }} */ export function spokenRead(text, entry, red, { voice = undefined } = {}) { const s = red?.slurs;