commit 347e7fc1d76a2914e484207945f956218607ce1e
parent 8f6ac97eb4822cabf862de63258340fa0123278a
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 16 Nov 2026 07:32:23 -0500
plans: the Orpheus re-tune plan, S1 in progress
The plan for re-tuning and re-running Orpheus reads from the post bench and
the character presets without an agent (four slices). S1, the engine taking
a tuning and a variant, is in progress on lane/orpheus-tuning.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
1 file changed, 173 insertions(+), 0 deletions(-)
diff --git a/plans/orpheus-retune.md b/plans/orpheus-retune.md
@@ -0,0 +1,173 @@
+# Orpheus re-tune and re-run, by the operator alone
+
+Status: **planned 15 Nov 2026; S1 in progress (16 Nov 2026, `lane/orpheus-tuning`).** Written to be
+picked up cold (after a usage reset). S2, S3 and S4 are not started.
+
+## The ask (operator, 15 Nov 2026)
+
+> Stick with Orpheus, but make it much easier to re-tune and re-run in different ways in either the
+> character or clip editor without having to ask an AI agent, letting me re-type a message (and maybe
+> find/replace over the whole video?) and re-run with a button to re-listen.
+
+Chatterbox was considered and set aside: Orpheus stays the synthetic engine. The work is UI and plumbing,
+not a new model.
+
+## What exists today (verified 15 Nov against main 976efc77e)
+
+- **Engine.** `scripts/tts_orpheus.py` renders chunks on llama-server (Vulkan) and SNAC; per chunk up to
+ `takes` seeded takes, the first that passes its checks is kept. Its `input.json` ALREADY carries
+ `sampler`, `seedBase`, `takes`, `tagCheck`. Stock voices only (`tara leah jess leo dan mia zac zoe`), no
+ reference-audio path, and there must never be one.
+- **The knobs are constants.** `common/lib/ttsApps.ts`: `ORPHEUS_SAMPLER` (temperature 0.55, top_p 0.85,
+ top_k 50, min_p 0, repeat_penalty 1.2, repeat_last_n 64; the operator's pick by ear on 12 Oct 2026) and
+ `ORPHEUS_SEED_BASE = 1234`. Settings carry only `tts.orpheus.takes` / `tagCheck` (and `speed`, which
+ Orpheus ignores). The cache key's `keyExtra` holds takes and tagCheck, not the sampler or the seed.
+- **Consequence:** the same text in the same voice comes back as the same cached file. Today a different
+ reading of a line can only be got by changing the words or by an agent changing code or settings. That
+ is the gap.
+- **The TTS op.** `editor/app/api/ops/tts/route.ts`: `POST { text | file, voice?, engine?, speed?, out? }`
+ → a `tts-file` job (`common/controller/ttsFile.ts`), cached, queued on the `tts` lane.
+- **Where Orpheus reads are made in umtool:**
+ - the post bench's narration panel (`umtool/components/projects/PostNarrationPanel.tsx`, route
+ `app/api/report/post-narration`): an editable script textarea + **Save script**, **Re-take with
+ direction** (`op: "take"` with note, voice, engine, speed, script), a take tree (synthesized, recorded,
+ derived), a pick;
+ - screen lines (`ScreenLineVoice.tsx`, "Make the read" = `umtool posts screen <p> <item> read`);
+ - card narration (`report-to-video/narration.mjs`, `narrate-via-editor.mjs`);
+ - thread reads (`lib/report/postThreadRead.mjs`);
+ - the Voices page (`VoicesPanel.tsx`): an audition of candidate voices side by side, **Use this voice**;
+ - character presets (`CharacterPresets.tsx`; CLI `umtool cast set`, `umtool cast project …`): the
+ SYNTHETIC preset is a stock voice and its speed only.
+- **Pronunciation** already exists: the lexicon `umtool posts say` and the voice map `umtool posts voices`
+ (`PronunciationPanel.tsx`), with "try it" and a list of picked reads that still say an entry the old way.
+
+"Character or clip editor" = the character presets / Voices page and **the post bench** (operator,
+15 Nov). The `/projects/<p>/clips` clip editor is out of scope.
+
+## Operator rulings (15 Nov 2026), binding on every slice
+
+1. **Scope:** the post bench (and the character presets). Not the `/clips` clip editor.
+2. **Tunings:** both the named starting points AND the bare numbers.
+3. **Every edit is for READING only.** Re-typing a line, find/replace, a pronunciation entry exist to
+ change what the voice says: an acronym spelled out, a delivery change (tags, punctuation), a typo
+ corrected in speech. **The original text is always what is shown on screen**: a post card, a screen
+ line, a thread tile, a caption. No slice may change displayed text, and a test in each lane pins it
+ (edit the read → the card's drawn text is byte-identical).
+ - Consequence to verify in S1's design note: every read needs a SPOKEN text kept apart from its SHOWN
+ text. A post's `narration.script` is already separate from the post's own text (check that the card
+ draws from the post, never from the script). A screen line's read is drawn from the screen's lines,
+ so a screen line needs its own "said as" override (e.g. `saidAs.<n>`), defaulting to the shown line.
+ A card's `narration.text` is already spoken-only. Thread reads: check.
+ - The "a read may not say what a screen masks" refusal still applies to the spoken text.
+4. **Re-reading only on a press.** A stale read is listed and offered, never re-made by itself.
+
+## What to build: four slices, each one lane
+
+### S1. The engine takes a tuning and a seed (`lane/orpheus-tuning`; plumbing, no UI)
+
+- A synthesis may carry `tuning: { temperature?, top_p?, repeat_penalty?, min_p?, takes? }` and
+ `variant?: integer` (the seed is `ORPHEUS_SEED_BASE + 9973 × variant`, or an explicit `seed`; implementer
+ proposes). Each value is range-checked and refused in words when out of range. A missing value falls back to
+ `ORPHEUS_SAMPLER` and the settings, so **an ask without them is byte-identical to today's, cache hit
+ included** (pin that in a test).
+- Tuning and seed go INTO the cache key: the same ask again is still free; "another reading" is a new key.
+- The result JSON (and so a take's record) says the tuning and seed it was made with, so a reading can be
+ made again exactly, and its numbers can be copied into a character.
+- Through every layer: `ttsApps.ts` → `ttsFile.ts` → `scripts/tts.mjs` → `tts_orpheus.py` (already reads
+ them from input.json), the ops route, `pnpm ops tts`, `narrate-via-editor.mjs`, the post-narration
+ `take` op. Kokoro and eSpeak NG ignore a tuning and say so (a note, not an error).
+- Docs: COMMANDS.md regenerated (`pnpm archilyzer docs cli`), SETTINGS.md if a settings default is added
+ (a site-wide `tts.orpheus.sampler` default is optional; the constant can stay the default).
+
+### S2. A character carries its tuning (`lane/character-tuning`; UI on the character preset + Voices page)
+
+- The SYNTHETIC preset gains an Orpheus tuning: temperature, top_p, repeat penalty, takes. It is shown as
+ three named starting points plus the numbers under "Adjust": **Steady** (cooler; the default's
+ neighbour), **Default** (`ORPHEUS_SAMPLER`), **Lively** (warmer). The names and values are the
+ implementer's proposal for the operator to judge by ear; the numbers are always visible and editable.
+- **Try it, in the preset:** a text box (prefilled with a line this character actually reads in the
+ project, or any line typed), **Read it** → a job → plays when done; **Another reading** = the same text
+ and tuning, the next variant; every audition stays in a short list (text, tuning, variant, Play), so
+ two readings can be compared at one loudness (reuse the Voices page's audition player and its
+ loudness match).
+- **Keep these settings** saves the tuning to the character (the cast's, or this video's own), through
+ the CLI's own command: `umtool cast set <character> --temperature … --top-p … --repeat-penalty …
+ --takes …` (and the `cast project` twin). A kept reading's variant may be kept too ("use this voice's
+ reading as the character's sample").
+- Changing a character's tuning makes its existing reads stale, not re-made: the bench lists "N reads by
+ this character were made with other settings · Re-read them" (one button, S4's queue).
+
+### S3. Re-type and re-run a line where it is read (`lane/line-rerun`; post bench, screen lines, card narration)
+
+- For every synthesized read (a post's script, a screen line, a card's narration, a thread read): the
+ text is editable in place; the buttons are
+ - **Read again**: the same text, the next variant (a new reading, not the cache);
+ - **Read edited text**: saves the text (the draft, as Save script does now) and reads it;
+ - **Tune ▾**: this line's own tuning, prefilled from the character; "use for this line only" or
+ "keep for the character" (→ S2's command).
+- When the job ends the new take **plays by itself** (a toggle, on by default) and joins the take list
+ with its text, tuning and variant; **Pick** makes it the one the cut plays. The previous pick stays one
+ press away (no reading is ever deleted by re-running).
+- **One sentence only (S3b, optional within the lane or a follow-up):** a take's `parts` already carry
+ each sentence's file, start and length. **Re-read this sentence** makes a new reading of one part and
+ joins it into a new take with the others unchanged (the same join and fades as `tts_orpheus.py`), so a
+ single flubbed sentence does not cost the good ones.
+- Recording is untouched: a recorded take, its enhance and convert chain, and the operator's
+ `*.recorded-operator.*` files are not changed by any of this.
+
+### S4. Find and replace over the whole video, and the re-read queue (`lane/reads-find`)
+
+- A **Reads** view per project (a tab of the workspace, or a section of the Voices page; implementer
+ proposes): every line a synthetic voice reads in the cut (posts, screen lines, cards, thread reads),
+ with its character, its picked take, and whether that take still matches its text and tuning
+ (`fresh` / `stale`).
+- **Find** (plain text, case on/off, whole word) highlights matches across all of them, with a count.
+ **Replace** never touches shown text (ruling 3). It offers two scopes and says which it does:
+ 1. **These reads**: rewrites the SPOKEN text of the matched lines (scripts, screen lines' "said as",
+ card narration), as one undoable draft step, shown as a preview list first;
+ 2. **Everywhere, from now on**: adds a pronunciation entry (the existing `umtool posts say`), so every
+ read, present and future, says it that way.
+- After either, the reads that changed are `stale`; **Re-read N changed lines** queues them (paced on the
+ editor's `tts` lane, one job each, or one batch job; GPU arbiter rules as now) and the view fills in
+ as each one lands.
+- **Listen through:** a player that plays the re-read lines one after another (each with its old take
+ one press away), and "play in the cut" (the Play-the-cut view at that item), so re-listening needs no
+ render.
+- CLI twin: `umtool reads <p> [--find <text>] [--stale]`, `umtool reads <p> replace <from> <to>
+ [--say-only] [--dry-run]`, `umtool reads <p> reread [--stale] [--wait]`, all `--json`.
+
+## Rules for this work (from AGENTS.md and the standing rulings)
+
+- Stock voices only; no reference audio; the disclosure line on every synthesized read stays.
+- **Works with no model:** every button is a form and a job; nothing asks an agent or an LLM.
+- Every write goes through a umtool command (the CLI twin) and lands in the working draft, as the
+ bench's writes do now; no hand-edited manifest, take json or notes.json.
+- Synthesis is the EDITOR's (`tts-file` jobs on the `tts` lane); umtool never runs Orpheus itself.
+ Render mode holds that lane, so a re-read waits during a render, and the view must say so.
+- Orpheus is heavy (llama-server, `heavyEstimateMB` 4000): a batch re-read is one queue, never a burst
+ of parallel servers.
+- Each lane: design note first → Opus implementer → gates (typecheck, touched unit suites, docs checks,
+ the lane's umtool e2e spec alone via `pnpm --filter umtool run e2e <spec>`) → independent read-only
+ review → fixes by the same implementer → merge → post-merge suites → **ask the operator before
+ restarting umtool** (he records narration in it) → ship → smoke.
+- No real people's or channels' names in code, fixtures or docs; fixtures only in tests.
+
+## Order
+
+S1 first (everything else needs a seed and a tuning to vary). Then S3 (the button he asked for most
+directly), then S2, then S4. S2 and S3 can run as two lanes side by side after S1 merges, since they touch
+different components. The machine allows two lanes at most.
+
+## Questions for the operator
+
+All four answered 15 Nov (see "Operator rulings" above). None is open.
+
+## Done means
+
+- From the post bench, a line can be re-typed, re-read with a new variant or a new tuning, heard on
+ arrival, and picked, with no agent.
+- A character's tuning can be auditioned and kept from its preset.
+- A word can be found across every read of a video, replaced (words or pronunciation), the changed lines
+ re-read in one press and listened through.
+- Asks with no tuning and no variant still produce byte-identical audio and cache hits.
+- No edit to a read ever changes what is shown on screen.