Archilyzer · Source

archilyzer

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

commit 36f8ddd5f4aeeced9b512212d1d15d7110eb8fd4
parent 5fbeec9acffbeb66be3d1032bbe2bd83c9338530
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu, 12 Nov 2026 08:53:42 -0500

umtool: the Voices page's proposed characters -- Propose characters runs the rule (cast assign; no model needed), each proposal with its voice, why and the items it would be named on, Accept / Change (a stock voice, the name, anonymous and its shown name) / Reject through the same writer, Accept all; nothing applied before a press and no picked read touched; the route's assign, proposal-accept|reject (one or all) and proposal-change ops are the CLI's own command; "Ask the model too (optional)" is the --model twin; voices.spec covers Propose -> Change -> Accept -> Reject

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

Diffstat:
Meditor/CHANGELOG.md | 1+
Mumtool/app/api/report/voices/route.ts | 26+++++++++++++++++++++++++-
Mumtool/components/projects/CharacterPresets.tsx | 2+-
Aumtool/components/projects/ProposedCharacters.tsx | 150+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/components/projects/VoicesPanel.tsx | 8++++++++
Mumtool/e2e/voices.spec.ts | 46++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 231 insertions(+), 2 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **umtool: the Voices page proposes characters and you accept, change or reject each.** A new "proposed" section: **Propose characters** runs the same rule as `umtool cast assign` (no model is needed or asked), each proposal shows its voice, why it was chosen and the items it would be named on, and **Accept**, **Change** (another stock voice, the name, anonymous) and **Reject** each go through the same writer as the CLI. Accepting never touches a picked read: one in another voice is listed as drift, as before. - **umtool: every post author gets a character by rule, as a proposal you accept.** Giving each author of a video a voice meant one `cast project … keep` or Voices-page click per author. `umtool cast assign <p>` now goes through every post item's author: one the item, this video, its voice map or the cast already answers for is left as it is; one with none gets a PROPOSED character of this video -- an id from the handle, their name and a stock Kokoro voice, the next in one fixed rotation (a male and a female voice in turn) that the project does not use yet. A gender hint comes only from pronouns the profile itself states; today's captures carry none, so the rotation is neutral. Proposals are kept apart in `narration/characters.json` (the same writer and undo) and change nothing until a person acts: `--accept <id>` / `--accept-all` makes the character and names it on that author's items that name none, without touching any take; `--change <id>` sets its voice (a stock one only), speed, name or anonymity; `--reject <id>` drops it. `--dry-run` writes nothing. - **umtool: a Model log shows what the model was asked, what it answered, and what the code did with it.** Until now a prompt was shown nowhere, and a local model's calls were in no ledger. Every model call of a run is now recorded, on every route (a local model, the Claude API, this session), and listed in a **Model log** panel on the run page (`/research/runs/<article>/<n>`), the article's Iterations tab and each media draft. Calls are grouped by phase (terms, reading, meaning check, grouping). A row has the first lines of what was asked, what came back, the seconds, and whether its answer was kept, dropped or rewritten, with the reason and each item's fate. A row opens to the whole prompt and answer (40,000 characters of each are kept). A log holds 20,000 calls or 32 MB; past that the panel says the log is full, and later calls are not recorded. The header counts the calls, the seconds and the models; a filter narrows to kept, dropped or rewritten; the list follows a run while it runs. `umtool model-log <article> <n>` (or `--job <jobId>`) prints the same, with `--phase`, `--outcome`, `--task`, `--run`, `--call <run.call>` for one call's whole text, and `--json`; a control sequence in a recorded text is printed as its escape (`\x1b`), never sent to the terminal. `/settings/generation` shows, per task, the route and the model it will run on, "no API key configured" when there is none, and the model of its last run. - **The job page has the Model log too, and a local model's calls are in the usage ledger.** A job that calls a model (a report draft, a refresh, triage, verdicts, a frame scan, clip suggestions, video assist) shows its calls on `/jobs/<id>`, as umtool does. Calls to a local model are appended to `.generation/usage.jsonl` with route `local` and cost 0, so `pnpm ops get generation-usage` lists every model a run called, and a run that was local only lists no other. `pnpm ops get iterations` gains each iteration's call count and seconds. The record keeps the text sent to the model and nothing else: no header and no model host; the editor's `WORKER_TOKEN`, an API key, every environment variable named like a credential, and host paths are taken out before a line is written, anything shaped like a credential (a URL's user and password, a token in a query string however its `&` and `=` are written — `\u0026`, `&amp;`, `%26`, `%3D` — an `Authorization` value of any scheme, a `Bearer` value, a cookie line, a key that says what it is) loses its value whoever's it is, while a date or a time after `secret:` or `token:` is left as it is, and a failed call's message has its URLs and addresses removed. Links are kept. diff --git a/umtool/app/api/report/voices/route.ts b/umtool/app/api/report/voices/route.ts @@ -41,6 +41,10 @@ export const dynamic = "force-dynamic"; // POST { project, op: "character-pool", id } "Add to the pool": cast project <p> pool <id> // POST { project, op: "character-keep", who, anonymous? } "Keep in this video only": cast project <p> keep <character|@handle> // POST { project, op: "item-character", item, character: <id> | null } umtool posts character <p> <item> <id> | --clear +// POST { project, op: "assign", model? } umtool cast assign <p> [--model]: PROPOSED characters (applied to nothing) +// POST { project, op: "proposal-accept", id | all: true } | { op: "proposal-reject", id | all: true } +// umtool cast assign <p> --accept <id> | --accept-all | --reject <id> | --reject-all +// POST { project, op: "proposal-change", id, voice?, speed?, name?, direction?, anonymous?, shown? } umtool cast assign <p> --change <id> … // POST multipart { project, op: "recording", item, as?, clean?, convert?, file } a JOB: posts narrate <p> <item> // --recording <file> (kept, cleaned, converted to a STOCK voice) const headers = { "cache-control": "no-store" }; @@ -261,6 +265,26 @@ export async function POST(request: Request) { if (id && !idOk(id)) return Response.json({ error: "which character?" }, { status: 400 }); return answer(await postsCli(["character", project.id, item, id || "--clear"])); } + // PROPOSED characters (umtool cast assign): by rule, the model only when asked; accept, change, reject. + if (op === "assign") return answer(await cli(["assign", project.id, ...(b.model === true ? ["--model"] : [])])); + if (op === "proposal-accept" || op === "proposal-reject") { + const verb = op === "proposal-accept" ? "--accept" : "--reject"; + if (b.all === true) return answer(await cli(["assign", project.id, `${verb}-all`])); + if (!idOk(s("id"))) return Response.json({ error: "which proposal?" }, { status: 400 }); + return answer(await cli(["assign", project.id, verb, s("id")])); + } + if (op === "proposal-change") { + if (!idOk(s("id"))) return Response.json({ error: "which proposal?" }, { status: 400 }); + const args = ["assign", project.id, "--change", s("id")]; + if (s("voice")) args.push("--voice", s("voice")); + if (typeof b.speed === "number" || s("speed")) args.push("--speed", String(b.speed ?? s("speed"))); + if (s("name")) args.push("--name", s("name")); + if (b.direction !== undefined) args.push("--direction", s("direction")); + if (b.anonymous === true) args.push("--anonymous"); + if (b.anonymous === false) args.push("--no-anonymous"); + if (s("shown")) args.push("--shown", s("shown")); + return answer(await cli(args)); + } if (op === "recording") { const file = form?.get("file"); const item = s("item"); @@ -278,7 +302,7 @@ export async function POST(request: Request) { const job = startJob(`cast-recording ${project.id}`, [{ label: `${item}: the recording kept, cleaned, converted`, argv, cwd: path.join(/* turbopackIgnore: true */ UMTOOL_DIR, ".."), env: {}, timeoutMs: 45 * 60 * 1000 }], { project: project.id }); return Response.json({ ok: true, job: jobView(job), file: path.relative(project.dir, abs) }, { headers }); } - return Response.json({ error: "op must be audition, use, reread, cast-rm, cast-undo, cast-set, character-set, character-add, character-rm, characters-undo, character-pool, character-keep, item-character or recording" }, { status: 400 }); + return Response.json({ error: "op must be audition, use, reread, cast-rm, cast-undo, cast-set, character-set, character-add, character-rm, characters-undo, character-pool, character-keep, item-character, assign, proposal-accept, proposal-reject, proposal-change or recording" }, { status: 400 }); } catch (e) { const status = (e as { status?: number }).status ?? 400; return Response.json({ error: e instanceof Error ? e.message : String(e) }, { status, headers }); diff --git a/umtool/components/projects/CharacterPresets.tsx b/umtool/components/projects/CharacterPresets.tsx @@ -52,7 +52,7 @@ export function recordedWords(c: PresetCharacter): string { } /** A stock voice picked as engine + voice; `none` (a label) offers "no voice of its own". */ -function VoicePick({ value, onChange, engines, none = null, name }: { value: string; onChange: (v: string) => void; engines: Engine[]; none?: string | null; name: string }) { +export function VoicePick({ value, onChange, engines, none = null, name }: { value: string; onChange: (v: string) => void; engines: Engine[]; none?: string | null; name: string }) { const at = value.indexOf(":"); const eng = at > 0 ? value.slice(0, at) : ""; const voice = at > 0 ? value.slice(at + 1) : ""; diff --git a/umtool/components/projects/ProposedCharacters.tsx b/umtool/components/projects/ProposedCharacters.tsx @@ -0,0 +1,150 @@ +"use client"; + +import { useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; +import { VoicePick, type Engine } from "./CharacterPresets"; + +// --------------------------------------------------------------------------- +// PROPOSED CHARACTERS (characters C3; components/projects/VoicesPanel.tsx; /api/report/voices; the CLI is `umtool +// cast assign`). Propose: a character for each post author with none, BY RULE -- a stock voice from a fixed rotation, +// no model. Each proposal is applied to NOTHING until a person acts: Accept (this video's character, named on that +// author's items that name none; no take touched), Change (its voice, name, anonymity), Reject. "Ask the model too" +// is optional and visibly so: the page works with no model configured. +// --------------------------------------------------------------------------- + +export type Proposal = { + id: string; name: string; handles: string[]; synthetic?: { voice?: string; speed?: number }; recorded?: { direction?: string }; + anonymous?: boolean; shown?: string; by: "rule" | "model"; why?: string; model?: string; items?: string[]; +}; +type PostFn = (body: Record<string, unknown>) => Promise<Record<string, unknown> | null>; + +const input = "rounded-[3px] border border-seam-2 bg-ground px-1.5 py-[3px] text-[11.5px] text-text outline-none focus:border-signal"; +const pretty = (spec: string) => spec.replace(":", " · "); +/** The engines a proposal may name a voice of (cast.mjs STOCK_VOICES: Kokoro and Orpheus). */ +const STOCK_ENGINES = new Set(["kokoro", "orpheus"]); + +function ProposalRow({ x, engines, busy, post, onChanged }: { x: Proposal; engines: Engine[]; busy: boolean; post: PostFn; onChanged: (what: string) => void }) { + const [edit, setEdit] = useState(false); + const [f, setF] = useState({ voice: x.synthetic?.voice ?? "", name: x.name, anonymous: !!x.anonymous, shown: x.shown ?? "" }); + const cell = "border-t border-seam px-2 py-1 align-top"; + const label = x.anonymous ? x.shown ?? x.name : x.name; + const send = async (body: Record<string, unknown>, what: string) => { + const j = await post(body); + if (j) onChanged(what); + return j; + }; + const save = async () => { + const body: Record<string, unknown> = { op: "proposal-change", id: x.id }; + if (f.voice && f.voice !== x.synthetic?.voice) body.voice = f.voice; + if (f.name.trim() && f.name.trim() !== x.name) body.name = f.name.trim(); + if (f.anonymous !== !!x.anonymous) body.anonymous = f.anonymous; + if (f.anonymous && f.shown.trim() && f.shown.trim() !== (x.shown ?? "")) body.shown = f.shown.trim(); + if (Object.keys(body).length === 2) { + setEdit(false); + return; + } + if (await send(body, `proposal ${x.id} changed`)) setEdit(false); + }; + return ( + <tr data-proposal={x.id} data-proposal-by={x.by}> + <td className={cell}> + <span className="font-medium">{label}</span> + {x.anonymous && <span className="ml-1.5 rounded-[3px] border border-seam-2 px-1 text-[10.5px] text-doubt-text">anonymous</span>} + <span className="ml-1.5 font-mono text-[11px] text-muted">{x.handles.map((h) => `@${h}`).join(" ")}</span> + <div className="text-[11px] text-muted" data-proposal-why=""> + {x.by === "model" ? `the model${x.model ? ` (${x.model})` : ""}` : "by rule"} + {x.why ? ` · ${x.why}` : ""} + </div> + </td> + <td className={cn(cell, "font-mono")} data-proposal-voice={x.synthetic?.voice ?? ""}> + {x.synthetic?.voice ? pretty(x.synthetic.voice) : "—"} + {typeof x.synthetic?.speed === "number" ? ` ×${x.synthetic.speed}` : ""} + {x.recorded?.direction && <div className="font-sans text-[11px] text-text-2">“{x.recorded.direction}”</div>} + </td> + <td className={cn(cell, "text-[11px] text-text-2")} data-proposal-items={(x.items ?? []).length}> + {(x.items ?? []).length ? `${x.items!.length} item${x.items!.length === 1 ? "" : "s"}: ${x.items!.join(", ")}` : "no item to name"} + </td> + <td className={cn(cell, "whitespace-nowrap text-right")}> + {edit ? ( + <span className="inline-flex flex-wrap items-center justify-end gap-1" data-proposal-form={x.id}> + <VoicePick name={`proposal ${x.id}`} value={f.voice} onChange={(v) => setF({ ...f, voice: v })} engines={engines} /> + <input data-proposal-name="" value={f.name} onChange={(e) => setF({ ...f, name: e.target.value })} className={cn(input, "w-36")} aria-label="its name" /> + <label className="inline-flex items-center gap-1 text-[11.5px]"> + <input type="checkbox" data-proposal-anonymous="" checked={f.anonymous} onChange={(e) => setF({ ...f, anonymous: e.target.checked })} /> anonymous + </label> + {f.anonymous && <input data-proposal-shown="" value={f.shown} onChange={(e) => setF({ ...f, shown: e.target.value })} placeholder="shown as (Anon n)" className={cn(input, "w-28")} aria-label="the name it is shown under" />} + <button type="button" data-proposal-save={x.id} disabled={busy} onClick={() => void save()} className={buttonVariants({ variant: "go", size: "sm" })}> + Save + </button> + <button type="button" onClick={() => setEdit(false)} className={buttonVariants({ variant: "quiet", size: "sm" })}> + Cancel + </button> + </span> + ) : ( + <> + <button type="button" data-proposal-accept={x.id} disabled={busy} onClick={() => void send({ op: "proposal-accept", id: x.id }, `${label} is this video's character now`)} className={buttonVariants({ variant: "go", size: "sm" })} title="this video's character, named on these items — no take is touched"> + Accept + </button>{" "} + <button type="button" data-proposal-change={x.id} disabled={busy} onClick={() => setEdit(true)} className={buttonVariants({ variant: "outline", size: "sm" })}> + Change + </button>{" "} + <button type="button" data-proposal-reject={x.id} disabled={busy} onClick={() => void send({ op: "proposal-reject", id: x.id }, `proposal ${x.id} rejected`)} className={buttonVariants({ variant: "quiet", size: "sm" })}> + Reject + </button> + </> + )} + </td> + </tr> + ); +} + +/** The proposed characters, and the buttons that make them (by rule; the model only when asked). */ +export function ProposedCharacters({ + proposed, engines, busy, post, onChanged, modelState = null, +}: { + proposed: Proposal[]; engines: Engine[]; busy: boolean; post: PostFn; onChanged: (what: string) => void; + modelState?: { route: string | null; model: string | null; why: string | null } | null; +}) { + const stock = engines.filter((e) => STOCK_ENGINES.has(e.id)); + const send = async (body: Record<string, unknown>, what: (j: Record<string, unknown>) => string) => { + const j = await post(body); + if (j) onChanged(what(j)); + }; + const count = (j: Record<string, unknown>) => (Array.isArray(j.proposed) ? j.proposed.length : 0); + return ( + <section data-proposed-characters={proposed.length}> + <h2 className="micro mb-1.5">proposed · {proposed.length}</h2> + {proposed.length > 0 && ( + <table className="w-full border-collapse"> + <tbody> + {proposed.map((x) => ( + <ProposalRow key={`${x.id}:${JSON.stringify([x.synthetic, x.name, x.anonymous, x.shown])}`} x={x} engines={stock} busy={busy} post={post} onChanged={onChanged} /> + ))} + </tbody> + </table> + )} + <div className="mt-1.5 flex flex-wrap items-center gap-1.5"> + <button type="button" data-proposals-make="" disabled={busy} onClick={() => void send({ op: "assign" }, (j) => (count(j) ? `${count(j)} character(s) proposed` : "nothing to propose: every author has a character or a proposal"))} className={buttonVariants({ variant: "outline", size: "sm" })} title="a stock voice for each author with no character, by rule — nothing is applied until you accept"> + Propose characters + </button> + {proposed.length > 1 && ( + <button type="button" data-proposals-accept-all="" disabled={busy} onClick={() => void send({ op: "proposal-accept", all: true }, () => "every proposal accepted")} className={buttonVariants({ variant: "outline", size: "sm" })}> + Accept all + </button> + )} + <button + type="button" + data-proposals-model="" + disabled={busy || (!!modelState && !modelState.route)} + onClick={() => void send({ op: "assign", model: true }, (j) => `the model: ${String((j.model as { summary?: string } | undefined)?.summary ?? `${count(j)} proposed`)}`)} + className={buttonVariants({ variant: "quiet", size: "sm" })} + title={modelState?.why ?? "optional: the cast-assign task (settings.generation) proposes a name, voice, speed and direction per author, checked and laid over the rule's"} + > + Ask the model too (optional) + </button> + {modelState?.route && <span className="text-[11px] text-muted" data-proposals-route={modelState.route}>{modelState.route}{modelState.model ? ` · ${modelState.model}` : ""}</span>} + </div> + </section> + ); +} diff --git a/umtool/components/projects/VoicesPanel.tsx b/umtool/components/projects/VoicesPanel.tsx @@ -5,6 +5,7 @@ import { buttonVariants } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { jobsHref, postBenchHref } from "@/lib/hrefs"; import { PresetEditor, ProjectCharacters, recordedWords, type ItemCharacter, type PresetCharacter } from "./CharacterPresets"; +import { ProposedCharacters, type Proposal } from "./ProposedCharacters"; // --------------------------------------------------------------------------- // THE VOICES PANEL (components/projects/VoicesPage.tsx; /api/report/voices; the CLI is `umtool cast`). Works with @@ -15,6 +16,8 @@ import { PresetEditor, ProjectCharacters, recordedWords, type ItemCharacter, typ // reads, its picked reads in another voice (drift), its real voice (speakers.json) -- Audition // opens the box below for it; Presets opens its two presets (CharacterPresets.tsx); an author // with no character: "Add to the pool" / "Keep in this video only" +// proposed a character for each author with none, BY RULE (ProposedCharacters.tsx; umtool cast assign): +// Accept / Change / Reject, nothing applied before; the model only on "Ask the model too" // this video's own the characters that live in this video only (anonymous ones under a shown name), and the items // read as a character of their own // the audition a line (its own words in this project, a stock line, or typed), 2-6 candidate stock voices @@ -57,6 +60,8 @@ type View = { cast: CastChar[]; engines: Engine[]; convertEngines: string[]; running: { id: string; state: string; kind: string } | null; // This video's own characters (narration/characters.json) and the items that name a character of their own. own?: PresetCharacter[]; itemCharacters?: ItemCharacter[]; charactersError?: string; + // PROPOSED characters (umtool cast assign), applied to nothing until accepted; where the model would run. + proposed?: Proposal[]; assignModel?: { route: string | null; model: string | null; why: string | null } | null; }; type Candidate = { spec: string; engine: string; voice: string; weight: string; key: string; rel: string; cached: boolean; seconds: number | null; lufs: number | null; score: number | null }; type Audition = { character: { id: string; name: string; handles: string[]; voice: string | null }; text: string; from: string; speaker: string | null; reference: string | null; candidates: Candidate[] }; @@ -393,6 +398,9 @@ export default function VoicesPanel({ project, posts, initialWho = null }: { pro )} </section> + {/* --- proposed characters (by rule; the model only when asked) ------------------- */} + <ProposedCharacters proposed={view.proposed ?? []} engines={view.engines} busy={busy} post={post} onChanged={changed} modelState={view.assignModel ?? null} /> + {/* --- one character's presets --------------------------------------------------- */} {preset && presetOf && ( <> diff --git a/umtool/e2e/voices.spec.ts b/umtool/e2e/voices.spec.ts @@ -22,6 +22,7 @@ import * as urls from "./urls"; // a character's presets (CharacterPresets.tsx): Keep in this video only -> its voice, speed, clean, direction saved; // an anonymous character of this video ("Anon 1"), never offered -- and refused -- the pool; an item read as a // character of its own, and cleared +// proposed characters (ProposedCharacters.tsx, umtool cast assign): Propose by rule -> Change -> Accept -> Reject // --------------------------------------------------------------------------- const HERE = path.dirname(fileURLToPath(import.meta.url)); @@ -277,6 +278,51 @@ test("a character's presets; this video's own characters -- an anonymous one is expect(own().map((c) => c.id)).toEqual(["hostman"]); }); +test("proposed characters by rule, no model: Propose, Change, Accept, Reject -- nothing applied before a press, no take touched", async ({ page }) => { + type Doc = { characters: { id: string; anonymous?: boolean; shown?: string; synthetic?: { voice?: string } }[]; proposed?: { id: string; by: string; anonymous?: boolean; synthetic?: { voice?: string } }[] }; + const doc = () => JSON.parse(readFileSync(CHARACTERS, "utf8")) as Doc; + const itemCharacter = (id: string) => (entry(id).narration as { character?: string } | undefined)?.character ?? null; + const before = readFileSync(MANIFEST, "utf8"); + const take1 = JSON.stringify(picked("p-1")); + await page.goto(urls.voicesHref(P)); + const box = page.locator("[data-proposed-characters]"); + await expect(box).toHaveAttribute("data-proposed-characters", "0", { timeout: 30_000 }); + await box.locator("[data-proposals-make]").click(); + await expect(page.locator("[data-voices-status]")).toContainText("2 character(s) proposed"); + await expect(box).toHaveAttribute("data-proposed-characters", "2"); + expect(doc().characters).toEqual([]); + expect((doc().proposed ?? []).map((x) => [x.id, x.by])).toEqual([["hostman", "rule"], ["guest", "rule"]]); + for (const x of doc().proposed ?? []) expect(x.synthetic?.voice).toMatch(/^kokoro:/); + expect(readFileSync(MANIFEST, "utf8")).toBe(before); + const guest = box.locator('[data-proposal="guest"]'); + await expect(guest.locator("[data-proposal-items]")).toContainText("p-3"); + // Change: another stock voice, anonymous. + await guest.locator('[data-proposal-change="guest"]').click(); + await guest.locator('[data-preset-engine="proposal guest"]').selectOption("kokoro"); + await guest.locator('[data-preset-voice="proposal guest"]').selectOption("bm_george"); + await guest.locator("[data-proposal-anonymous]").check(); + await guest.locator('[data-proposal-save="guest"]').click(); + await expect(page.locator("[data-voices-status]")).toContainText("proposal guest changed"); + await expect(box.locator('[data-proposal="guest"] [data-proposal-voice]')).toHaveAttribute("data-proposal-voice", "kokoro:bm_george"); + expect((doc().proposed ?? []).find((x) => x.id === "guest")).toMatchObject({ anonymous: true, synthetic: { voice: "kokoro:bm_george" } }); + expect(readFileSync(MANIFEST, "utf8")).toBe(before); + await shot(page, "9-proposed", box); + // Accept: this video's character, named on the guest's item -- no take touched. + await box.locator('[data-proposal-accept="guest"]').click(); + await expect(page.locator("[data-voices-status]")).toContainText("this video's character now"); + await expect(box).toHaveAttribute("data-proposed-characters", "1"); + expect(doc().characters.map((c) => [c.id, c.anonymous, c.shown, c.synthetic?.voice])).toEqual([["guest", true, "Anon 1", "kokoro:bm_george"]]); + expect(itemCharacter("p-3")).toBe("guest"); + expect(itemCharacter("p-1")).toBe(null); + expect(JSON.stringify(picked("p-1"))).toBe(take1); + await expect(page.locator('[data-voices-character="guest"]')).toContainText("Anon 1"); + // Reject: dropped, nothing else changes. + await box.locator('[data-proposal-reject="hostman"]').click(); + await expect(box).toHaveAttribute("data-proposed-characters", "0"); + expect(doc().proposed).toBeUndefined(); + expect(itemCharacter("p-1")).toBe(null); +}); + test("the Cut tab's Reads and voices reaches the Voices page", async ({ page }) => { await page.goto(urls.projectHref(P, { tab: "cut" })); const { openPanel } = await import("./panels");