Archilyzer · Source

archilyzer

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

commit 989776f7e1e4485dcdc4d7e210b9a88070960caa
parent fb84586bf8a7d387a6a5c2a6ecfbf4d911254d4b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 17 Nov 2026 09:28:44 -0500

umtool: the reading pin, recorded on main before S3 (ruling 3: an edit to a read never changes what the card draws)

A single read and a thread read (an excerpt parent tile hiding its unread paragraph, a quoted post, a
screen) whose reads say their shown text as drafted: plain card, followed card, blocks, tile modes and
drawn screens hashed as main draws them.

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

Diffstat:
Aumtool/report-to-video/post-reading-pin.test.mjs | 119+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 119 insertions(+), 0 deletions(-)

diff --git a/umtool/report-to-video/post-reading-pin.test.mjs b/umtool/report-to-video/post-reading-pin.test.mjs @@ -0,0 +1,119 @@ +// THE READING PIN (lane/line-rerun, S3 of the Orpheus re-tune plan; operator ruling 3, 15 Nov 2026: "every edit is for +// READING only -- the original text is always what is shown on screen"). An item whose read says its shown text as +// drafted draws BYTE-IDENTICALLY to main (19fb842b5) before a line of S3 was written: its plain card, its followed +// card (the blocks the read lights, the paragraphs an excerpt tile hides), its thread tiles' modes and the screens it +// draws. A change that moves one of these hashes changes what a card made before S3 draws. +// +// Recorded on main: PIN_RECORD=1 node --test report-to-video/post-reading-pin.test.mjs +import assert from "node:assert/strict"; +import { createHash } from "node:crypto"; +import { test } from "node:test"; +import { postCardHtml, postItemPlan } from "./post-item.mjs"; +import { drawnScreens, threadLayout } from "./post-thread.mjs"; +import { followBlocks } from "./read-follow.mjs"; +import { screenLineSaid } from "./post-screens.mjs"; +import { draftScript } from "./post-narration.mjs"; + +const sha = (v) => createHash("sha1").update(typeof v === "string" ? v : JSON.stringify(v)).digest("hex"); + +const POST = "The council met on Tuesday about the new bridge.\n\nNobody from the ministry came to explain the delay."; +const QUOTED = { id: "7002", handle: "harbourwatch", author: "Harbour Watch", text: "Bridge works paused again, the notice says.", date: "2026-10-01T09:00:00.000Z" }; +const PARENT = { + id: "7001", handle: "rivertalk", author: "River Talk", date: "2026-10-01T08:00:00.000Z", + text: "Does anyone know why the tolls on the old crossing keep rising?\n\nA second paragraph nobody reads aloud in this cut.", +}; +const IMG = { src: "posts-media/bridge-x/7003/7003_1.png", kind: "image", width: 900, height: 1400 }; +const DM = { + id: "s1", media: 0, kind: "dm", read: "all", lines: [ + { who: "rivertalk", text: "Are the tolls going up again?" }, + { who: "bridgefan", text: "Not this year, they said." }, + ], +}; +const base = (o = {}) => ({ + type: "post", id: "p-7003", post: "bridge-x/7003", platform: "x", author: "Bridge Fan", handle: "bridgefan", date: "2026-10-02T10:00:00.000Z", + text: POST, subjects: ["bridgefan"], ...o, +}); +const drafted = draftScript(POST).script; + +/** A single read of his words: one file, its script his words as drafted. */ +export function singleItem(o = {}) { + return base({ + quoted: QUOTED, ...o, + narration: { script: drafted, pick: 0, takes: [{ file: "narration/posts/7003/take-1.orpheus-zac.wav", engine: "orpheus", voice: "zac", seconds: 6.2, script: drafted }] }, + }); +} + +/** A thread read: the parent's first paragraph only (its tile an excerpt), the quoted post, his words, the screen's lines. */ +export function threadItem(o = {}) { + const e = base({ parents: [PARENT], quoted: QUOTED, thread: { parent: "excerpt" }, media: [IMG], screens: [DM], ...o }); + const parts = []; + let t = 0; + const add = (text, role, piece, gap, more = {}) => { + t += parts.length ? gap : 0; + const sec = Math.round((text.split(/\s+/).length / 3) * 100) / 100; + parts.push({ n: parts.length + 1, para: piece * 100 + (more.para ?? 0), text, voice: role === "post" ? "zac" : "leo", role, start: Math.round(t * 1000) / 1000, seconds: sec, ...(more.line ? { line: more.line, speaker: more.speaker } : {}) }); + t += sec; + }; + add(draftScript(PARENT.text.split("\n\n")[0]).script, "parent:0", 0, 0); + add(draftScript(QUOTED.text).script, "quoted", 1, 0.8); + const [p1, p2] = drafted.split("\n\n"); + add(p1, "post", 2, 0.8); + add(p2, "post", 2, 0.6, { para: 1 }); + DM.lines.forEach((l, n) => { + const said = screenLineSaid(DM, n); + add(draftScript(said).script, `screen:s1:${n}`, 3 + n, n ? 0.35 : 0.8, { line: draftScript(said).script, speaker: l.who }); + }); + return { + ...e, + narration: { + script: drafted, pick: 0, + takes: [{ file: "narration/posts/7003/take-1.orpheus-thread.wav", engine: "orpheus", voice: "zac+leo", seconds: Math.round(t * 1000) / 1000, script: parts.map((p) => p.text).join("\n\n"), parts, read: { kind: "thread", parents: "0" } }], + }, + }; +} + +/** What the card DRAWS of an item: never what its read sounds like (no timing). */ +export function drawn(e) { + const render = { postNarration: { lead: 0.4 } }; + const plan = postItemPlan(e, render); + const box = { width: 1600, height: 900 }; + const fb = followBlocks(e); + return { + plain: sha(postCardHtml(e, { ...box })), + follow: sha(postCardHtml(e, { ...box, follow: true, thread: plan.follow?.thread ?? null })), + // The blocks: their words, their scope, the screen line they are -- and whether a part reads them at all (an + // excerpt tile hides the ones none does). + blocks: sha(fb.blocks.map((b) => [b.k, b.scope, b.from, b.to, b.line ?? null, b.part === null])), + tiles: sha(Array.isArray(e.parents) || e.quoted ? (threadLayout(e, render).tiles ?? []).map((x) => [x.scope, x.mode, x.above ?? null, x.inside ?? null]) : []), + screens: sha(drawnScreens(e).map((s) => s.id)), + }; +} + +export const FIXTURES = { single: singleItem(), thread: threadItem() }; + +// Recorded on main (19fb842b5), before the S3 code. +const PINNED = { + single: { + plain: "b2d58c132a00371da7ae824538067737551a4e3f", + follow: "80b1456aff9178519d0def976396c9a4e5d61047", + blocks: "6dd74f6c9ca620ed3d2ec690fd229fc848dc5a59", + tiles: "b22e780f2eed98b5f9cefe21828d3600bd5af3c0", + screens: "97d170e1550eee4afc0af065b78cda302a97674c", + }, + thread: { + plain: "2bbb8717d3cad9f607463c969f5f7df622133cdf", + follow: "b0574d9a6149c221f3ed675ce748c98b48f6316b", + blocks: "3d085f775b916acd294b454fafde7bc770e72b85", + tiles: "68c08a31d2d1eaaac527741a5e83eaf5093d1b51", + screens: "2d021c30467f8a663cbd09eb672c85a6c484355a", + }, +}; + +test("THE READING PIN: an item whose read says its shown text as drafted draws as it did on main", () => { + const got = Object.fromEntries(Object.entries(FIXTURES).map(([k, e]) => [k, drawn(e)])); + if (process.env.PIN_RECORD) { + console.log(JSON.stringify(got, null, 2)); + return; + } + assert.deepEqual(got, PINNED); +});