Archilyzer · Source

archilyzer

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

commit 85f6938b536a19d6c47e7443c5560d3c9f25fe1a
parent 24d0acd624a51c1412ec947a50c882b4d8b29fc4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue,  3 Nov 2026 17:46:45 -0500

umtool: a take with no script of its own is checked for slurs against the post's script (an older take kept none) -- a censored build never misses one it says; takeSlurBleeps' tests (its source take's state, the refusal's words, off and uncensored)

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

Diffstat:
Mumtool/report-to-video/post-render.mjs | 3++-
Mumtool/report-to-video/post-slurs.test.mjs | 17+++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/umtool/report-to-video/post-render.mjs b/umtool/report-to-video/post-render.mjs @@ -455,7 +455,8 @@ export async function buildPostSegment(entry, { render, outDir, manifestDir, box export function takeSlurBleeps(entry, take, redaction) { const takes = Array.isArray(entry?.narration?.takes) ? entry.narration.takes : []; const root = rootTakeOf(takes, take); - const b = takeBleeps(take, redaction?.slurs, { state: take.slurs ?? root?.slurs ?? null }); + // The script it read: its own, else the post's (a take from before takes kept theirs). + const b = takeBleeps(take, redaction?.slurs, { state: take.slurs ?? root?.slurs ?? null, script: typeof take.script === "string" ? take.script : String(entry?.narration?.script ?? "") }); if (b?.error) { throw new Error( `${entry.id}: ${b.error} -- a published cut never plays a slur: time its words (umtool posts narrate <p> ${entry.id} --words), ` + diff --git a/umtool/report-to-video/post-slurs.test.mjs b/umtool/report-to-video/post-slurs.test.mjs @@ -182,3 +182,20 @@ test("barsHtml draws placeholders and gaps with the redaction's bars", () => { const html = barsHtml(`${REDACT_MARK.repeat(3)} ${encodePlaceholder("k***")}${SLUR_GAP}`); assert.equal(html, `<span class="rbar" data-post-blanked="" style="width:1.56em"></span> <span class="slur" data-post-slur="">k***</span>`); }); + +test("takeSlurBleeps (post-render.mjs): a take's state is its own or its source's; no script of its own reads the post's; refused in the build's words", async () => { + const { takeSlurBleeps } = await import("./post-render.mjs"); + const script = `you ${F} there`; + const words = scriptTokens(script).map((t, i) => ({ w: t.w, start: i, end: i + 0.5 })); + const red = { terms: [], slurs: resolveSlurs({ voice: "beep" }, LIST) }; + const entry = (takes) => ({ id: "p1", type: "post", narration: { script, takes } }); + const tts = { file: "narration/posts/1/take-1.orpheus-zac.wav", seconds: 3, words }; + assert.deepEqual(takeSlurBleeps(entry([tts]), tts, red), { mode: "beep", spans: [[0.96, 1.56]], seconds: 3 }); + // Skipped at synthesis: nothing to cover -- and a take derived from it reads the same. + const skipped = { ...tts, slurs: "skip", words: undefined }; + const derived = { file: "narration/posts/1/take-2.enhance-x.wav", seconds: 3, source: { kind: "take", from: "take-1.orpheus-zac" } }; + assert.equal(takeSlurBleeps(entry([skipped, derived]), derived, red), null); + assert.throws(() => takeSlurBleeps(entry([{ ...tts, words: undefined }]), { ...tts, words: undefined }, red), /p1: .*no word timings to beep.*posts narrate <p> p1 --words.*--uncensored/); + assert.equal(takeSlurBleeps(entry([tts]), tts, { terms: [], slurs: resolveSlurs({}, LIST, { uncensored: true }) }), null); + assert.equal(takeSlurBleeps(entry([tts]), tts, null), null); +});