commit 75d8678f40f2bf861ce8892739ecf6d974ca0849
parent 5a3c2576230edcb57848fdf2b155c8a5e178f4b4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 13 Nov 2026 01:00:17 -0500
umtool: pin what an item with round-1 screens draws, plans, keys and is told (lane/screens-2)
post-screens-pin2.test.mjs records, on main (5a3c2576) before any round-2 code, the sha1 of the
plan, the plain and following card pages, the segment key and the checks (validation, the
thread-read guard, the screens lint, the disclosure) over six items with round-1 screens: DMs in
a video and an image email, lines left out and drawn dim, a screenshot of a post with typed lines
and a ref, a picture-only post with a screen on its own picture, screens not narrated, and a read
with a line take. Any change that moves one changes what a screen made before round 2 does.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
1 file changed, 140 insertions(+), 0 deletions(-)
diff --git a/umtool/report-to-video/post-screens-pin2.test.mjs b/umtool/report-to-video/post-screens-pin2.test.mjs
@@ -0,0 +1,140 @@
+// THE SECOND PIN (lane/screens-2, 13 Nov 2026): an item with ROUND-1 SCREENS and none of the round-2 keys draws,
+// plans, keys, validates, guards and lints BYTE-IDENTICALLY to main (7b8f5268) before a line of round 2 was written. A
+// change that moves any of these hashes changes what a screen made before round 2 draws, plays or is told.
+//
+// Covered over a spread of screens: DMs in a video read whole, an image email read in excerpts, a screen with lines
+// left out (omit) and drawn dim, a screenshot of a post with typed lines and a `ref`, a picture-only post with a screen
+// on its own picture, an item whose screens are not narrated, and a take with line takes (`read.lineTakes`).
+import assert from "node:assert/strict";
+import { createHash } from "node:crypto";
+import { test } from "node:test";
+import { postCardHtml, postItemPlan, validatePostItem } from "./post-item.mjs";
+import { postSegmentKeyOf } from "./post-render.mjs";
+import { partRoles, threadReadErrors } from "./post-thread.mjs";
+import { screenLineSaid, screenWarnings } from "./post-screens.mjs";
+import { draftScript, postNarrationDisclosure } from "./post-narration.mjs";
+
+const sha = (v) => createHash("sha1").update(typeof v === "string" ? v : JSON.stringify(v)).digest("hex");
+const VID = { src: "posts-media/savvy-x/2117/2117_1.mp4", kind: "video", width: 1920, height: 1080, seconds: 61.742, audio: true, start: 3.3, end: 8 };
+const IMG = { src: "posts-media/savvy-x/2117/2117_2.jpg", kind: "image", width: 900, height: 1400 };
+const DM = {
+ id: "s1", media: 0, at: [3.5, 8], kind: "dm", read: "all", lines: [
+ { who: "TheQuartering", text: "what's your email so I can refund your order", time: "11:32 AM" },
+ { who: "MadamSavvy", text: "where is my scale video", time: "11:53 AM" },
+ { who: "TheQuartering", text: "you HONESTLY believe that I have lied about weight loss?" },
+ { who: "TheQuartering", text: "You can't be this dumb", time: "11:58 AM" },
+ ],
+};
+const MAIL = {
+ id: "s2", media: 1, kind: "email", title: "Refund email", checked: { by: "operator", at: "2026-11-12T10:00:00.000Z" }, read: [{ line: 0 }, { line: 1, text: "Total amount refunded: $99.95" }], lines: [
+ { who: "coffee brand coffee", text: "Some items in your order have been refunded" },
+ { text: "Total amount refunded: $99.95 USD. It may take up to 10 days for this refund to appear in your account." },
+ { text: "Order number 4419283 ยท reply to support@coffeebrand.com" },
+ ],
+};
+const POST = "Hey, @thequartering You told me your video was ready to go.\n\nYour turn.";
+const base = (o = {}) => ({ type: "post", id: "p-2117", post: "savvy-x/2117", platform: "x", author: "Savvy", handle: "MadamSavvy", date: "2026-11-02T01:40:36.000Z", text: POST, subjects: ["MadamSavvy"], media: [VID, IMG], screens: [DM, MAIL], ...o });
+/** A thread read's take: her words, then each screen line (stored roles, lines and speakers), timed by words. */
+function narrated(e, lines, extra = {}) {
+ 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, text, voice: role === "post" ? "tara" : "leo", ...more, role, start: Math.round(t * 1000) / 1000, seconds: sec });
+ t += sec;
+ };
+ add("Hey, at thequartering You told me your video was ready to go.", "post", 0, 0);
+ add("Your turn.", "post", 0, 0.6);
+ lines.forEach(([id, n], i) => {
+ const sc = e.screens.find((s) => s.id === id);
+ const said = screenLineSaid(sc, n);
+ add(said, `screen:${id}:${n}`, 1 + i, i && lines[i - 1][0] === id ? 0.35 : 0.8, { line: draftScript(said).script, speaker: String(sc.lines[n].who ?? "") });
+ });
+ return { ...e, narration: { script: POST, pick: 0, takes: [{ file: "narration/posts/2117/take-1.orpheus-thread.wav", engine: "orpheus", voice: "tara+leo", seconds: Math.round(t * 1000) / 1000, script: "x", parts, ...extra }] } };
+}
+const ALL = [["s1", 0], ["s1", 1], ["s1", 2], ["s1", 3], ["s2", 0], ["s2", 1]];
+
+const FIXTURES = {
+ dmAndMail: narrated(base(), ALL),
+ omitDim: narrated(base({ screens: [{ ...DM, read: [{ line: 0 }, { line: 3, text: "this dumb" }] }, { ...MAIL, unread: "dim" }] }), [["s1", 0], ["s1", 3], ["s2", 0], ["s2", 1]]),
+ postShot: narrated(base({ media: [IMG], screens: [{ id: "s1", media: 0, kind: "post", ref: "other-x/9001", read: "all", lines: [{ who: "other", text: "The roof repairs start on Monday." }, { who: "other", text: "Bring gloves." }] }] }), [["s1", 0], ["s1", 1]]),
+ pictureOnly: narrated(base({ text: "@thequartering", media: [IMG], screens: [{ ...MAIL, media: 0 }] }), [["s2", 0], ["s2", 1]]),
+ notNarrated: base(),
+ lineTakes: (() => {
+ const e = narrated(base(), ALL, { read: { kind: "thread", parents: "0", lineTakes: { "screen:s1:1": { n: 2, file: "narration/posts/2117/take-2.recorded-operator.wav", line: draftScript("where is my scale video").script } } } });
+ e.narration.takes.push({ file: "narration/posts/2117/take-2.recorded-operator.wav", engine: "recorded", voice: "operator", label: "operator", seconds: 1.4, source: { kind: "recorded", voice: "operator" }, script: "where is my scale video" });
+ e.narration.takes[0].parts[3] = { ...e.narration.takes[0].parts[3], voice: "operator", take: "take-2.recorded-operator", file: "narration/posts/2117/take-2.recorded-operator.wav" };
+ return e;
+ })(),
+};
+
+/** Every output an item with screens has: its plan, its card pages, its segment key, its validation, guard and lint. */
+function outputs(e) {
+ const render = { postNarration: { lead: 0.4 } };
+ const plan = postItemPlan(e, render);
+ const box = { width: 1600, height: 900 };
+ const narratedNow = Array.isArray(e.narration?.takes);
+ return {
+ plan: sha(plan),
+ plain: sha(postCardHtml(e, { ...box })),
+ follow: sha(postCardHtml(e, { ...box, follow: true, thread: plan.follow?.thread ?? null })),
+ key: sha(postSegmentKeyOf({ entry: e, box, render: { fps: 30, palette: null }, plan, take: plan.narration ? {} : null })),
+ checks: sha([validatePostItem(e), threadReadErrors(e, render), screenWarnings(e, { narrated: narratedNow, takeRoles: narratedNow ? partRoles(e).map((r) => r.role) : [] }), postNarrationDisclosure(e)]),
+ };
+}
+
+// Recorded on main (7b8f5268), before the round-2 code: PIN_RECORD=1 node --test this file.
+const PINNED = {
+ "dmAndMail": {
+ "plan": "25466c15390c7c605b05754660ba297f6bac9699",
+ "plain": "968fe3cbdf8cc0982f91ea82266277afbdaf627b",
+ "follow": "7a303b53afbf33f4bf674b147ed5f8229473f438",
+ "key": "FAKE-TEST-VALUE",
+ "checks": "58f994d43961a1f976b5fab4778d7b039d45aab6"
+ },
+ "omitDim": {
+ "plan": "d553ce26ea25e3286010c39bdb4767604a4dcaa9",
+ "plain": "968fe3cbdf8cc0982f91ea82266277afbdaf627b",
+ "follow": "66590ec6a12b6017b319b64165951345b4c37c43",
+ "key": "FAKE-TEST-VALUE",
+ "checks": "58f994d43961a1f976b5fab4778d7b039d45aab6"
+ },
+ "postShot": {
+ "plan": "4bed2e5bfe6fb0798c353795d926fad46f480eb2",
+ "plain": "968fe3cbdf8cc0982f91ea82266277afbdaf627b",
+ "follow": "c92594bc9a582206416df016c56643e92a75b812",
+ "key": "FAKE-TEST-VALUE",
+ "checks": "0b6e6bf545ef5f0a2066a6df455aff903e1a37c1"
+ },
+ "pictureOnly": {
+ "plan": "6be3de8f69aad67365657a31c73d6b35ec1d8213",
+ "plain": "ce72a862e6f5d607a150a085ab60f6c9de002d7d",
+ "follow": "6efbb3bf18f8eae5e3020fcddb0f0543a58a6b1b",
+ "key": "FAKE-TEST-VALUE",
+ "checks": "5c8d877bdcee8cbf71658c9ad75d8430757c0a4a"
+ },
+ "notNarrated": {
+ "plan": "335251e03af67c0374492e8c3530b0b8518b81e7",
+ "plain": "968fe3cbdf8cc0982f91ea82266277afbdaf627b",
+ "follow": "0d68eae2fb41c1ab32ef3ff1d702fd0b17eef034",
+ "key": "FAKE-TEST-VALUE",
+ "checks": "4615ef4e7c3e3669aebe789aad56c5c25554aaf3"
+ },
+ "lineTakes": {
+ "plan": "25466c15390c7c605b05754660ba297f6bac9699",
+ "plain": "968fe3cbdf8cc0982f91ea82266277afbdaf627b",
+ "follow": "7a303b53afbf33f4bf674b147ed5f8229473f438",
+ "key": "FAKE-TEST-VALUE",
+ "checks": "c301b5157774d42623aa191b3416d79e39b89857"
+ }
+};
+
+test("an item with round-1 screens and none of the round-2 keys draws, plans, keys and is checked BYTE-IDENTICALLY to main", () => {
+ const now = Object.fromEntries(Object.entries(FIXTURES).map(([k, e]) => [k, outputs(e)]));
+ if (process.env.PIN_RECORD === "1") {
+ console.log(JSON.stringify(now, null, 1));
+ return;
+ }
+ assert.deepEqual(now, PINNED);
+});