Archilyzer · Source

archilyzer

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

commit c037a972fdde1b263d70ee1968cfe3ef67381577
parent a45d216408adfe6d4c10abe314a5845ba0f31699
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed,  4 Nov 2026 00:52:20 -0500

umtool: a take read in one go (no parts) has roles too -- its script's paragraphs, as read-follow times them, so the post it answers is shown in full while a one-shot read says it

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

Diffstat:
Mumtool/report-to-video/post-thread.mjs | 9+++++++--
Mumtool/report-to-video/post-thread.test.mjs | 9+++++++++
Mumtool/report-to-video/read-follow.mjs | 3++-
3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/umtool/report-to-video/post-thread.mjs b/umtool/report-to-video/post-thread.mjs @@ -49,7 +49,7 @@ // bench, the writers and the lint all read the same rules from here. import { cardText, contextText, parentsOf } from "./post-item.mjs"; -import { draftScript, isNarrated, pickedTake } from "./post-narration.mjs"; +import { draftScript, isNarrated, pickedTake, scriptParts } from "./post-narration.mjs"; import { normWord, scriptWordsOf } from "./word-zoom.mjs"; import { followKnobs } from "./read-follow.mjs"; @@ -169,7 +169,12 @@ const orderOf = (role) => (role.startsWith("parent:") ? 2 - Number(role.slice(7) */ export function partRoles(entry, take = undefined) { const t = take === undefined ? pickedTake(entry) : take; - const parts = Array.isArray(t?.parts) ? t.parts : []; + let parts = Array.isArray(t?.parts) ? t.parts : []; + // A take read in one go (no parts): its script's parts, as read-follow times them -- each paragraph a piece. + if (!parts.length && t) { + const script = str(t.script).trim() ? t.script : str(entry?.narration?.script); + parts = scriptParts(script).map((p) => ({ text: p.text, para: p.para * 100 })); + } if (!parts.length) return []; const texts = readTexts(entry); const images = (Array.isArray(entry?.media) ? entry.media : []).map((m, i) => ({ m, i })).filter((x) => x.m?.kind === "image"); diff --git a/umtool/report-to-video/post-thread.test.mjs b/umtool/report-to-video/post-thread.test.mjs @@ -211,3 +211,12 @@ test("the card page: a threaded read draws the conversation as tiles in one flow // Not narrated: the card as it was (no tiles). assert.ok(!postCardHtml(base({ parents: [parentRef()] }), { width: 1600, height: 900, follow: true, thread: null }).includes("data-thread-slot")); }); + +test("a take read in one go (no parts): its script's paragraphs carry the roles -- the parent it reads is shown in full while the words share the read", () => { + const e = base({ parents: [parentRef()], narration: { script: REPLY, takes: [{ file: "narration/posts/1001/take-1.orpheus-zac.wav", seconds: 20, script: `${PARENT}\n\n${REPLY}` }], pick: 0 } }); + assert.deepEqual(partRoles(e).map((r) => r.role), ["parent:0", "parent:0", "parent:0", "post", "post"]); + const plan = postItemPlan(e, {}); + assert.equal(plan.follow.source, "script"); + assert.deepEqual(plan.follow.thread.tiles.map((t) => [t.scope, t.mode]), [["parent:0", "full"], ["post", "full"]]); + assert.deepEqual(threadReadErrors(e), []); +}); diff --git a/umtool/report-to-video/read-follow.mjs b/umtool/report-to-video/read-follow.mjs @@ -201,7 +201,8 @@ export function followParts(entry) { return { source: "take", parts: t.parts.map((p, k) => ({ text: str(p.text), start: fin(p.start) ? p.start : null, ...(roles[k]?.role ? { scope: roles[k].role } : {}) })) }; } const script = str(t?.script).trim() ? t.script : str(entry?.narration?.script); - return { source: "script", parts: scriptParts(script).map((p) => ({ text: p.text })) }; + const roles = partRoles(entry); + return { source: "script", parts: scriptParts(script).map((p, k) => ({ text: p.text, ...(roles[k]?.role ? { scope: roles[k].role } : {}) })) }; } const parts = []; for (const sc of cardScopes(entry)) for (const p of scriptParts(sc.text)) parts.push({ text: p.text, scope: sc.scope });