commit f6c3dfa231a9d2d48577219d5a5bff1ba0353d66
parent 017352a48b512eae8796b4c3b1c73d80a1c19f9c
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 13 Nov 2026 02:11:05 -0500
umtool screens, review 1 (M1, M2, i): no preview plays a read the build refuses; a picture's words never read twice
M1. post-thread.mjs playableEntry (itemReadRefusals, the enforced lint's own judgement on the item
as written): a read older than its screen -- a line's words or speaker edited, a shape or a handle
added, a line removed, redacted or no longer read -- is in NO preview: Play's view (playView),
Present's payload (operator and public), the card page (/api/report/post-item), the post bench's
player and its plan (postBenchData, PostBench) play the item silent, as an item not narrated, with
`readRefused: {reason}`; PostItemPlayer says why (data-post-read-refused) and judges an entry
handed to it as written too; the inspector lists the refusals. The relaxed writer stays.
M2. (a) A screen made with --from-read records `source: "read"`: it IS the post's read -- the thread
read leaves his own piece out (no take of it reused by default; --post-take refused). (b) The
enforced lint (validateScreenReads = itemReadRefusals over the cut) refuses any part of a read --
his words, a context post, a screen line, a take with no parts -- that says a number or an e-mail
one of the item's screens masks (its digits however joined) or a redacted line's words; it names
the part and the line, never the value. (c) `add --from-read` says the item still plays its read
as it was until the read is made again, and the refusal is printed with the write.
i. Present's public payload carries the screens as the card draws them (publicScreens): shapes
masked in words, speakers, times and titles (an excerpt masked in place), a redacted line
wordless, a blurred speaker nameless; never a raw line.
Tests made failing first: lib/report/postScreensReview3.test.mjs (5).
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
13 files changed, 361 insertions(+), 18 deletions(-)
diff --git a/umtool/app/api/report/post-item/inspector/route.ts b/umtool/app/api/report/post-item/inspector/route.ts
@@ -2,6 +2,7 @@ import { readdir, stat } from "node:fs/promises";
import path from "node:path";
import { cardText, excerptErrors, excerptRanges, excerptSpansOf } from "umtool-report-to-video/post-item";
import { pickedTake } from "umtool-report-to-video/post-narration";
+import { itemReadRefusals } from "umtool-report-to-video/post-thread";
import { withEditNotes } from "@/lib/report/guard";
import { StaleToken, StructureRefused, manifestToken, updatePostItem } from "@/lib/report/manifest.mjs";
import { attachmentOf } from "@/lib/report/postsCli.mjs";
@@ -74,6 +75,8 @@ export async function GET(request: Request) {
takes: takes.map((t, i) => ({ i, file: String(t.file ?? ""), engine: typeof t.engine === "string" ? t.engine : null, voice: typeof t.voice === "string" ? t.voice : null, seconds: typeof t.seconds === "number" ? t.seconds : null })),
picked: picked ? picked.index : null,
off: e.narration?.off === true,
+ // A read the build refuses (post-thread.mjs itemReadRefusals): not played anywhere until it is made again.
+ refused: itemReadRefusals(e) as string[],
},
token: await manifestToken(r.project.dir),
},
diff --git a/umtool/app/api/report/post-item/route.ts b/umtool/app/api/report/post-item/route.ts
@@ -7,6 +7,7 @@ import { jobState, startJob } from "@/lib/research/case-editor";
import { withEditNotes } from "@/lib/report/guard";
import { StaleToken, StructureRefused, manifestToken, updatePostFx, updatePostItem, updatePostNarration } from "@/lib/report/manifest.mjs";
import { isNarrated, pickedTake } from "umtool-report-to-video/post-narration";
+import { playableEntry } from "umtool-report-to-video/post-thread";
import { scriptWordTimes } from "umtool-report-to-video/word-zoom";
import { followKnobs } from "umtool-report-to-video/read-follow";
import { threadLayout } from "umtool-report-to-video/post-thread";
@@ -273,6 +274,8 @@ export async function GET(request: Request) {
const w = Math.round(Number(q.get("w")) || 0);
const h = Math.round(Number(q.get("h")) || 0);
if (!(w >= 160 && w <= 3840 && h >= 90 && h <= 2160)) return new Response("w and h are the footage box, in px", { status: 400 });
+ // NEVER A READ THE BUILD REFUSES (post-thread.mjs playableEntry): a read older than its screen draws as no read at all.
+ found.item = playableEntry(found.item) as Entry;
const base = `/api/report/post-item?project=${encodeURIComponent(r.project.id)}`;
const parentShot = typeof found.item.parentShot === "string" ? `${base}&file=${encodeURIComponent(found.item.parentShot)}` : null;
// The authors' pictures (post-avatars.mjs), served as the project's files.
diff --git a/umtool/components/projects/PostBench.tsx b/umtool/components/projects/PostBench.tsx
@@ -12,6 +12,7 @@ import PostItemPlayer, { type PostPlan } from "./review/PostItemPlayer";
import PostFollowPanel from "./PostFollowPanel";
import PostThreadPanel from "./PostThreadPanel";
import PostScreensPanel from "./PostScreensPanel";
+import { playableEntry } from "umtool-report-to-video/post-thread";
import BlurBoxPad, { type Band } from "./BlurBoxPad";
import PostNarrationPanel from "./PostNarrationPanel";
import PostComboPanel from "./PostComboPanel";
@@ -142,7 +143,8 @@ export default function PostBench({
: savedScene,
[entry, savedScene],
);
- const shown = useMemo(() => panelEntry(sceneEntry(entry, scene), render) as Entry, [entry, scene, render]);
+ // What plays: never a read the build refuses (post-thread.mjs playableEntry) -- the item silent, the reason said.
+ const shown = useMemo(() => playableEntry(panelEntry(sceneEntry(entry, scene), render)) as Entry, [entry, scene, render]);
const plan = useMemo(() => (entry === initial ? initialPlan : (postItemPlan(shown, render, { prev: before, scene: conversation, mediaScene: conversation ? null : scene }) as PostPlan)), [entry, shown, initial, initialPlan, render, before, scene, conversation]);
// Its progress bar (post-progress.mjs): the read's span and its parts' ticks.
const progressP = useMemo(() => progressPlan(shown, render, plan as never), [shown, render, plan]);
diff --git a/umtool/components/projects/review/PostItemPlayer.tsx b/umtool/components/projects/review/PostItemPlayer.tsx
@@ -6,6 +6,7 @@ import { applyJoinState, endMediaOf, joinClockOf, joinEase, joinFrameAt } from "
import { applyVisitState } from "umtool-report-to-video/post-link-visit";
import { applyMapState, mapHtml, mapPlace, mapSize } from "umtool-report-to-video/post-branch-map";
import { dryGainAt, mixPhaseAt, pickedTake, wetGainAt } from "umtool-report-to-video/post-narration";
+import { READ_REFUSED_REASON, itemReadRefusals } from "umtool-report-to-video/post-thread";
import { applyFollowState, followPath, followStateAt, measureFollow } from "umtool-report-to-video/read-follow";
import { scrollAt, showOpacityAt } from "umtool-report-to-video/post-thread";
import { blurCqw, blurOf, labelBoxOf, pixelGrid } from "umtool-report-to-video/post-censor";
@@ -629,8 +630,15 @@ export default function PostItemPlayer({
}) {
const wrap = useRef<HTMLDivElement | null>(null);
const [scale, setScale] = useState(0);
+ // NEVER A READ THE BUILD REFUSES (post-thread.mjs playableEntry; itemReadRefusals for an entry handed in as written):
+ // the item plays silent and says why.
+ const readRefused = useMemo(() => {
+ const own = (entry as { readRefused?: { reason: string } }).readRefused;
+ if (own) return own;
+ return (itemReadRefusals(entry) as string[]).length ? { reason: READ_REFUSED_REASON as string } : null;
+ }, [entry]);
// Narrated (post-narration.mjs): the picked take on the item's clock, from `at`.
- const mix = plan.narration ?? null;
+ const mix = readRefused ? null : plan.narration ?? null;
const voiceTake = useMemo(() => (mix ? pickedTake(entry) : null), [mix, entry]);
const voice = useRef<HTMLAudioElement | null>(null);
const local = mix ? s - mix.at : -1;
@@ -1199,8 +1207,14 @@ export default function PostItemPlayer({
data-post-scene={scene ? scene.key : undefined}
data-post-scene-n={scene ? `${scene.n + 1}/${scene.of}` : undefined}
data-post-thread-tiles={followNow?.tiles ? Object.entries(followNow.tiles).map(([sc, v]) => `${sc}=${v[0]}/${v[1]}`).join(" ") : undefined}
+ data-post-read-refused={readRefused ? "1" : undefined}
className="pointer-events-none absolute inset-0 overflow-hidden"
>
+ {readRefused && (
+ <div className="absolute left-2 top-2 z-20 max-w-[70%] rounded bg-black/80 px-2 py-1 text-[11px] text-[var(--color-bad,#e5484d)]" data-post-read-refused-reason="">
+ {readRefused.reason}
+ </div>
+ )}
{mix && voiceTake && (
// eslint-disable-next-line jsx-a11y/media-has-caption
<audio ref={voice} src={fileOf(takeFileUrl(project, voiceTake.file))} preload="auto" muted={!voiceOn} data-post-narration-audio={voiceTake.file} data-post-narration-rate={String(speed * readRate)} />
diff --git a/umtool/lib/report/playView.mjs b/umtool/lib/report/playView.mjs
@@ -17,6 +17,7 @@ import { rejectionOf } from "./rejectReasons.mjs";
import { dateKeyLabel } from "./playCut.mjs";
import { panelEntry, postDay, postItemPlan } from "umtool-report-to-video/post-item";
import { planContext } from "umtool-report-to-video/post-conversation";
+import { playableEntry } from "umtool-report-to-video/post-thread";
import { clockPlan } from "umtool-report-to-video/post-clock";
import { progressPlan } from "umtool-report-to-video/post-progress";
import { pickWindow, projectCache, windowVersion, windowsFor } from "./serve.mjs";
@@ -67,6 +68,8 @@ export function postPlayEntry(e, render = undefined, ctx = null, mediaScene = nu
date: day || null,
quote: words || null,
post: panelEntry(sceneEntry(e, mediaScene), render),
+ // Its read, NOT played (post-thread.mjs playableEntry): why -- Play and Present say so.
+ ...(e.readRefused ? { readRefused: e.readRefused } : {}),
// `prev`: the item before it in the cut (post-thread.mjs: a parent that is that item is carried in); `scene`: the
// posts its run left on screen (post-conversation.mjs: one conversation played as one scene) -- it wins the card.
postPlan: plan,
@@ -199,7 +202,11 @@ export async function playViewWith(project, { take = null, bare = false, postFor
: { combos: {}, groups: [] };
const entries = await Promise.all(
timeline.map(async (e, i) => {
- if (e.type === "post") return postPlayEntry(post ? post(e) : e, render, planContext(timeline, i, render), mediaSceneOf(timeline, i, repeatGroups, render));
+ // Never a read the build refuses (post-thread.mjs playableEntry, judged on the item as written): it plays silent.
+ if (e.type === "post") {
+ const pe = playableEntry(e);
+ return postPlayEntry(post ? post(pe) : pe, render, planContext(timeline, i, render), mediaSceneOf(timeline, i, repeatGroups, render));
+ }
if (e.type === "video") return videoPlayEntry(e, D);
if (e.type !== "clip" || !fin(e.start) || !fin(e.end)) return { id: e.id, type: String(e.type ?? "entry"), heading: headingOf(e), section: e.section ?? null };
const win = pickWindow(await windowsFor(project, e, cache), null);
diff --git a/umtool/lib/report/postBenchData.ts b/umtool/lib/report/postBenchData.ts
@@ -2,6 +2,7 @@ import { channelsDirFor, readManifest } from "@/lib/projects/report.mjs";
import { manifestToken } from "@/lib/report/manifest.mjs";
import { deckGeometry, deckOn, feedGeometry, feedOn } from "umtool-report-to-video/deck";
import { postItemPlan, panelEntry } from "umtool-report-to-video/post-item";
+import { playableEntry } from "umtool-report-to-video/post-thread";
import { planContext } from "umtool-report-to-video/post-conversation";
import { projectCombos } from "umtool-report-to-video/post-combo-prints";
import { mediaSceneOf, sceneEntry } from "umtool-report-to-video/post-media-scene";
@@ -71,7 +72,8 @@ export async function postBenchData(dir: string, id: string): Promise<PostBenchD
entry,
token,
box: { width: box.width, height: box.height },
- plan: postItemPlan(panelEntry(sceneEntry(entry, scene), render), render, { ...ctx, mediaScene: ctx.scene ? null : scene }) as unknown as PostPlan,
+ // Never a read the build refuses (post-thread.mjs playableEntry): planned as the bench's player plays it.
+ plan: postItemPlan(playableEntry(panelEntry(sceneEntry(entry, scene), render)), render, { ...ctx, mediaScene: ctx.scene ? null : scene }) as unknown as PostPlan,
scene,
render,
before: ctx.prev,
diff --git a/umtool/lib/report/postScreensCli.mjs b/umtool/lib/report/postScreensCli.mjs
@@ -255,7 +255,8 @@ export async function screenCommand(project, rest, { flags, str: flag, multi, js
const m2 = await readManifest(project.dir);
const i = (m2?.timeline ?? []).findIndex((x) => x?.id === e.id);
const at = i >= 0 ? m2.timeline[i] : null;
- const refused = at && isNarrated(at) ? threadReadErrors(at, m2.render ?? {}, { ...planContext(m2.timeline, i, m2.render ?? {}), followOn: followKnobs(at, m2.render ?? {}).on }) : [];
+ const { readSaysHiddenErrors } = await import("umtool-report-to-video/post-thread");
+ const refused = at && isNarrated(at) ? [...threadReadErrors(at, m2.render ?? {}, { ...planContext(m2.timeline, i, m2.render ?? {}), followOn: followKnobs(at, m2.render ?? {}).on }), ...readSaysHiddenErrors(at)] : [];
if (json) {
out(JSON.stringify({ ok: true, id: e.id, what, screens: entry.screens ?? [], warnings, refusedUntilRead: refused, token: result.token, editNotes }, null, 2));
return 0;
@@ -298,7 +299,8 @@ export async function screenCommand(project, rest, { flags, str: flag, multi, js
out(json ? JSON.stringify({ ok: !errs.length, dryRun: true, screen: sc, errors: errs }, null, 2) : [`would add ${sc.id} from its read:`, ...screenListing(e, sc).map((l) => ` ${l}`), ...errs.map((x) => ` refused: ${x}`)].join("\n"));
return errs.length ? 1 : 0;
}
- return write([...screens, sc], `added screen ${sc.id} from its read (${sc.lines.length} line(s), not checked)`);
+ // What is true now: the screen is not drawn and its read is the old one until the read is made again.
+ return write([...screens, sc], `added screen ${sc.id} from its read (${sc.lines.length} line(s), not checked) -- not drawn, and the item still plays its read as it was (its script, every word of it), until the read is made again: umtool posts screen ${project.id} ${e.id} read (its lines are then the read, the masked parts never said)`);
}
if (verb === "add") {
const from = flag("--from") ? await readFrom(path.resolve(String(flag("--from")))) : {};
@@ -426,6 +428,8 @@ export async function screenCommand(project, rest, { flags, str: flag, multi, js
* from the parts cache when it was before).
*/
export function defaultPostTake(e) {
+ // A screen made from its read IS his read (postThreadRead.mjs): no take of his words stands in for it.
+ if (screensOf(e).some((sc) => sc.source === "read")) return null;
const takes = Array.isArray(e?.narration?.takes) ? e.narration.takes : [];
const k = Number.isInteger(e?.narration?.pick) && e.narration.pick >= 0 && e.narration.pick < takes.length ? e.narration.pick : 0;
const t = takes[k];
diff --git a/umtool/lib/report/postScreensReview3.test.mjs b/umtool/lib/report/postScreensReview3.test.mjs
@@ -0,0 +1,163 @@
+// lane/screens-2, review round 1: what the review found, each pinned by a test made failing first.
+// M1 a read the build refuses is never played by a preview: playableEntry, Play's view, Present (operator and public)
+// M2 a screen made from its read IS the post's read (the post part not read twice); no part of a read says what the
+// item's screens hide (the enforced lint); `add --from-read` says only what is true
+// i the public payload carries the screens as the card draws them, never raw
+// Temp dirs only; no audio is made (the takes are placeholders the payloads only name).
+import assert from "node:assert/strict";
+import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import path from "node:path";
+import { after, test } from "node:test";
+import { draftScript } from "umtool-report-to-video/post-narration";
+import { screenLineSaid, withoutLines } from "umtool-report-to-video/post-screens";
+import { itemReadRefusals, playableEntry, readSaysHiddenErrors, validateScreenReads } from "umtool-report-to-video/post-thread";
+import { presentPayload } from "./present.mjs";
+import { playViewWith } from "./playView.mjs";
+import { postsCommand } from "./postsCli.mjs";
+import { threadReadPlan } from "./postThreadRead.mjs";
+
+const ROOT = await mkdtemp(path.join(tmpdir(), "umtool-screens-review3-"));
+after(() => rm(ROOT, { recursive: true, force: true }));
+const IMG = { src: "posts-media/savvy-x/2117/2117_2.jpg", kind: "image", width: 900, height: 1400 };
+const DM = { id: "s1", media: 0, kind: "dm", read: "all", checked: { by: "op", at: "2026-11-12T10:00:00.000Z" }, lines: [
+ { who: "TheQuartering", text: "what is your address so I can send it" },
+ { who: "MadamSavvy", text: "it is 12 Elm Street Springfield" },
+ { who: "TheQuartering", text: "You can't be this dumb" },
+] };
+const THREAD = "narration/posts/2117/take-1.orpheus-thread.wav";
+function narrated(e) {
+ const parts = [{ n: 1, para: 0, text: "Hey, you told me.", voice: "tara", role: "post", start: 0, seconds: 1 }];
+ let t = 1.5;
+ e.screens[0].lines.forEach((l, n) => {
+ const said = screenLineSaid(e.screens[0], n);
+ parts.push({ n: parts.length + 1, para: 100 * (n + 1), text: said, voice: "leo", role: `screen:s1:${n}`, start: t, seconds: 1, line: draftScript(said).script, speaker: l.who });
+ t += 1.5;
+ });
+ return { ...e, narration: { script: "Hey, you told me.", pick: 0, takes: [{ file: THREAD, engine: "orpheus", voice: "tara+leo", seconds: t, script: "x", parts, read: { kind: "thread", parents: "0" } }] } };
+}
+const ITEM = narrated({ type: "post", id: "p-2117", post: "savvy-x/2117", platform: "x", author: "Savvy", handle: "MadamSavvy", date: "2026-11-02T01:40:36.000Z", text: "Hey, you told me.", subjects: ["MadamSavvy"], media: [IMG], screens: [structuredClone(DM)] });
+// The g1 probe's edits: each made UNDER the read (the writer takes them; the build refuses the old read).
+const EDITS = {
+ "words of line 1 edited": (sc) => ({ ...sc, lines: sc.lines.map((l, i) => (i === 1 ? { ...l, text: "it is somewhere in town" } : l)) }),
+ "line 0 gets a phone number": (sc) => ({ ...sc, lines: sc.lines.map((l, i) => (i === 0 ? { ...l, text: "what is your address call 555 201 4477" } : l)) }),
+ "line 2 gets an anonymous handle": (sc) => ({ ...sc, lines: sc.lines.map((l, i) => (i === 2 ? { ...l, text: "ask @secretkid about it" } : l)) }),
+ "line 1 given to someone else": (sc) => ({ ...sc, lines: sc.lines.map((l, i) => (i === 1 ? { ...l, who: "Stranger" } : l)) }),
+ "line 0 removed": (sc) => withoutLines(sc, [0]),
+ "line 1 redacted": (sc) => ({ ...sc, lines: sc.lines.map((l, i) => (i === 1 ? { ...l, redact: true } : l)) }),
+ "line 1 no longer read": (sc) => ({ ...sc, read: [{ line: 0 }, { line: 2 }] }),
+};
+const edited = (f) => ({ ...ITEM, screens: [f(structuredClone(ITEM.screens[0]))] });
+
+async function project(name, item) {
+ const dir = path.join(ROOT, name);
+ await mkdir(path.join(dir, "narration"), { recursive: true });
+ await writeFile(path.join(dir, "video.manifest.json"), JSON.stringify({ schemaVersion: 1, slug: name, title: name, provenance: { channelsDir: "../channels", channelSlug: "chan" }, render: { width: 1920, height: 1080, fps: 30 }, timeline: [item] }, null, 2));
+ return { id: name, dir };
+}
+
+test("M1 playableEntry: the read as made plays; after each g1 edit the item plays WITHOUT its read (no narration, no take), the reason said", () => {
+ assert.equal(playableEntry(ITEM), ITEM, "a read the build plays: the item itself");
+ for (const [name, f] of Object.entries(EDITS)) {
+ const e = edited(f);
+ assert.ok(itemReadRefusals(e).length > 0, name);
+ const p = playableEntry(e);
+ assert.equal(p.narration, undefined, name);
+ assert.ok(!JSON.stringify(p).includes(THREAD), `${name}: no reference to the old take`);
+ assert.match(p.readRefused.reason, /make the read again/);
+ }
+});
+
+test("M1 Play and Present: a refused read is in no view and no payload -- operator or public -- and Present's public data carries no raw line (i)", async () => {
+ for (const [name, f] of Object.entries(EDITS)) {
+ const p = await project(`m1-${Object.keys(EDITS).indexOf(name)}`, edited(f));
+ const view = await playViewWith(p, {});
+ assert.ok(!view.error, String(view.error));
+ const pe = view.view.entries.find((x) => x.id === "p-2117");
+ assert.equal(pe.post.narration, undefined, `${name}: Play`);
+ assert.equal(pe.postPlan.narration ?? null, null, `${name}: Play's plan`);
+ assert.ok(pe.readRefused, `${name}: Play says why`);
+ for (const canUncensor of [true, false]) {
+ const pay = await presentPayload(p, { canUncensor });
+ assert.ok(!pay.error, String(pay.error));
+ const s = pay.slides.find((x) => x.kind === "post");
+ assert.equal(s.narration, null, `${name}: Present ${canUncensor ? "operator" : "public"}`);
+ assert.ok(!JSON.stringify(pay).includes(THREAD), `${name}: no stale audio in the payload`);
+ if (!canUncensor) {
+ const raw = JSON.stringify(s.post.screens);
+ assert.ok(!/555|4477/.test(raw), `${name}: a phone number never in the public data`);
+ }
+ }
+ }
+ // The read as made: played, in both.
+ const ok = await project("m1-ok", ITEM);
+ const pay = await presentPayload(ok, { canUncensor: false });
+ assert.equal(pay.slides.find((x) => x.kind === "post").narration.file, THREAD);
+});
+
+test("i: the public payload's screens are what the card draws -- shapes masked in words, speaker, time and title; a redacted line wordless; a blurred speaker nameless; an excerpt masked in place", async () => {
+ const sc = { id: "s1", media: 0, kind: "dm", title: "Mail to savvy@gmail.com", read: [{ line: 0 }, { line: 1, text: "call 555 201 4477 tonight" }, { line: 3 }], lines: [
+ { who: "Stranger", text: "my email is jane.doe@example.com", time: "555-201-4477" },
+ { who: "MadamSavvy", text: "please call 555 201 4477 tonight after work" },
+ { who: "Stranger", text: "Order number 4419283", redact: true },
+ { who: "Other", text: "fine" },
+ ] };
+ const e = { ...ITEM, narration: undefined, screens: [sc] };
+ const p = await project("i-pub", e);
+ const pay = await presentPayload(p, { canUncensor: false });
+ const shown = pay.slides.find((x) => x.kind === "post").post.screens[0];
+ const raw = JSON.stringify(shown);
+ for (const v of ["jane.doe", "example.com", "555", "4477", "savvy@gmail", "4419283", "Stranger", "Other"]) assert.ok(!raw.includes(v), `${v} not in the public data`);
+ assert.deepEqual(shown.lines[2], { text: "", redact: true });
+ assert.equal(shown.lines[1].who, "MadamSavvy", "her own line: her name (a subject)");
+ assert.notEqual(shown.lines[0].who, shown.lines[3].who, "two blurred speakers still told apart");
+ assert.ok(shown.lines[1].text.includes(shown.read[1].text), "the excerpt is masked in place: still a run of its line");
+ // The operator's payload keeps the lines as written (the operator's own screen).
+ const op = await presentPayload(p, { canUncensor: true });
+ assert.ok(JSON.stringify(op.slides.find((x) => x.kind === "post").post.screens).includes("jane.doe@example.com"));
+});
+
+test("M2 the enforced lint: no part of an item's read says a number or an e-mail its screens mask, nor a redacted line's words -- whoever's part it is", () => {
+ const sc = { id: "s1", media: 0, kind: "text", source: "read", read: "all", lines: [{ text: "I never said that." }, { text: "Order number: 4419283 was refunded." }, { text: "my secret plan for the house", redact: true }] };
+ const plain = (script) => ({ type: "post", id: "p-7", post: "kir-x/7", platform: "x", author: "K", handle: "kirsche", date: "2026-11-02T01:40:36.000Z", text: "@thequartering", media: [IMG], screens: [sc], narration: { script, takes: [{ file: "narration/posts/7/take-1.kokoro-af_heart.wav", engine: "kokoro", voice: "af_heart", seconds: 3, script }], pick: 0 } });
+ assert.ok(readSaysHiddenErrors(plain("I never said that. Order number: 4419283 was refunded.")).some((x) => /its picked take says a number that line 1 of screen s1 masks/.test(x)));
+ assert.ok(readSaysHiddenErrors(plain("the order was 4419 283")).length > 0, "its digits however they are joined");
+ assert.ok(readSaysHiddenErrors(plain("here is my secret plan for the house")).some((x) => /line 2 of screen s1, which is redacted/.test(x)));
+ assert.deepEqual(readSaysHiddenErrors(plain("I never said that.")), []);
+ assert.deepEqual(readSaysHiddenErrors(plain("I paid $99.95 on 11/02/2026")), [], "amounts and dates are never shapes");
+ // Through the cut: the build's enforced lint (validateScreenReads) refuses it; a cut without screens is untouched.
+ assert.ok(validateScreenReads({ timeline: [plain("Order number: 4419283 was refunded.")] }).length > 0);
+ const { screens: _s, ...noScreens } = plain("Order number: 4419283 was refunded.");
+ assert.deepEqual(validateScreenReads({ timeline: [noScreens] }), []);
+ // A message names the part and the line, never the value.
+ assert.ok(readSaysHiddenErrors(plain("Order number: 4419283")).every((x) => !x.includes("4419283")));
+});
+
+test("M2 --from-read: its screen IS the post's read -- the post part is not read again, no take of it reused, a --post-take refused; `add` says only what is true (probe f2)", async () => {
+ const take = { file: "narration/posts/7/take-1.kokoro-af_heart.wav", engine: "kokoro", voice: "af_heart", seconds: 3, script: "I never said that.\nOrder number: 4419283 was refunded." };
+ const item = { type: "post", id: "p-7", post: "kir-x/7", platform: "x", author: "Kirsche", handle: "kirsche", date: "2026-11-02T01:40:36.000Z", text: "@thequartering", media: [IMG], narration: { script: take.script, takes: [take], pick: 0 } };
+ await project("fr", item);
+ const lines = [];
+ const posts = async (args) => {
+ lines.length = 0;
+ const code = await postsCommand(args, { root: ROOT, out: (s) => lines.push(s), err: (s) => lines.push(s) });
+ return { code, text: lines.join("\n") };
+ };
+ let r = await posts(["screen", "fr", "p-7", "add", "--from-read"]);
+ assert.equal(r.code, 0, r.text);
+ assert.match(r.text, /the item still plays its read as it was/);
+ assert.match(r.text, /the build REFUSES the read as it is .*says a number that line 1 of screen s1 masks/);
+ r = await posts(["screen", "fr", "p-7", "read", "--dry-run", "--json"]);
+ assert.equal(r.code, 0, r.text);
+ const j = JSON.parse(r.text);
+ assert.deepEqual(j.parts.map((p) => p.role), ["screen:s1:0", "screen:s1:1"], "the post part is not read: the screen's lines are its read");
+ assert.ok(j.parts.every((p) => !p.take), "no take reused");
+ assert.ok(j.parts.every((p) => !/4419283/.test(p.text)), "the masked number never said");
+ assert.ok(j.skipped.some((s) => s.role === "post" && /screen s1's lines/.test(s.why)));
+ r = await posts(["screen", "fr", "p-7", "read", "--dry-run", "--post-take", "1"]);
+ assert.notEqual(r.code, 0);
+ assert.match(r.text, /own words are its screen s1's lines/);
+ // A typed screen (not from its read) reads his words as before.
+ const typed = { ...item, screens: [{ id: "s1", media: 0, kind: "text", source: "transcribed", read: "all", lines: [{ text: "hello" }] }] };
+ assert.deepEqual(threadReadPlan({ render: {}, timeline: [typed] }, typed, {}).pieces.map((p) => p.role), ["post", "screen:s1:0"]);
+});
diff --git a/umtool/lib/report/postScreensRound2.test.mjs b/umtool/lib/report/postScreensRound2.test.mjs
@@ -65,7 +65,7 @@ test("linesOfRead: a line per line of the script, blank lines and emotion tags d
test("screenFromRead: a picture-only post's script made a screen on its picture, read whole, NOT checked; refused for any other post", () => {
const made = screenFromRead(PIC, { pictureOnly: ownPictureOnly(PIC), id: "s1" });
- assert.deepEqual(made.screen, { id: "s1", media: 0, kind: "text", source: "transcribed", lines: [{ text: "I never said that." }, { text: "Order number: 4419283 was refunded on 11/02/2026." }], read: "all" });
+ assert.deepEqual(made.screen, { id: "s1", media: 0, kind: "text", source: "read", lines: [{ text: "I never said that." }, { text: "Order number: 4419283 was refunded on 11/02/2026." }], read: "all" });
assert.deepEqual(validatePostItem({ ...PIC, screens: [made.screen] }), []);
// Its shapes are masked like any line's (the order number drawn as a bar, never said); its date stays.
assert.ok(!maskShapes(made.screen.lines[1].text).text.includes("4419283"));
diff --git a/umtool/lib/report/postThreadRead.mjs b/umtool/lib/report/postThreadRead.mjs
@@ -63,7 +63,7 @@ import { cardText, parentsOf } from "umtool-report-to-video/post-item";
import { planContext } from "umtool-report-to-video/post-conversation";
import { spokenRead, termsFor } from "umtool-report-to-video/post-redact";
import { readSpeedOf, resolvePieceVoice } from "umtool-report-to-video/post-say";
-import { SCREEN_LINE_GAP, parseScreenRole, screenWho, shapeSpans } from "umtool-report-to-video/post-screens";
+import { SCREEN_LINE_GAP, parseScreenRole, screenWho, screensOf, shapeSpans } from "umtool-report-to-video/post-screens";
import { readManifest } from "../projects/report.mjs";
import { withEditNotes } from "./edit-guard.mjs";
import { manifestToken, updatePostNarration } from "./manifest.mjs";
@@ -181,7 +181,16 @@ export function threadReadPlan(manifest, e, { red = null, map = {}, cast = {}, i
const script = own ? null : draftScript(cardText(e)).script || null;
const pieces = [];
const skipped = [];
+ // A SCREEN MADE FROM ITS READ (`posts screen … add --from-read`: `source: "read"`) IS that read: its lines are what
+ // the picture says, so his own piece is not read as well (it would say the picture's words twice, and what the card
+ // masks once) -- and no take of his words stands in for it.
+ const fromRead = screensOf(e).find((sc) => sc.source === "read" && screens) ?? null;
+ if (fromRead && postTake) throw new ThreadReadError(`--post-take: ${e.id}'s own words are its screen ${fromRead.id}'s lines (made from its read): no take reads them as well -- leave --post-take out`);
for (const p of chronoPieces(e)) {
+ if (p.role === "post" && fromRead) {
+ skipped.push({ role: "post", why: `its read is screen ${fromRead.id}'s lines (made from its read)` });
+ continue;
+ }
const m = /^parent:(\d)$/.exec(p.role);
if (m) {
const at = Number(m[1]);
@@ -270,7 +279,8 @@ export function threadReadPlan(manifest, e, { red = null, map = {}, cast = {}, i
const spd = readSpeedOf({ flag: speed, preset: v.speed ?? null, own: p.role === "post" ? e.narration?.speed ?? null : null, engine: v.engine });
pieces.push({ role: p.role, handle: p.handle, date: p.date, voice: v.voice, engine: v.engine, from: v.from, ...(spd !== null ? { speed: spd } : {}), ...(v.character ? { character: v.character } : {}), written, text: said.text.trim(), lexicon: said.lexicon ?? [], slurs: said.slurs, ...(said.anonymised ? { anonymised: said.anonymised } : {}) });
}
- if (!pieces.some((p) => p.role === "post")) throw new ThreadReadError(`${e.id} has no words of his own to read (--script "…" first)`);
+ if (!fromRead && !pieces.some((p) => p.role === "post")) throw new ThreadReadError(`${e.id} has no words of his own to read (--script "…" first)`);
+ if (!pieces.length) throw new ThreadReadError(`${e.id} has nothing to read (its screen ${fromRead?.id ?? ""} reads no line)`);
// HIS LINE FROM A TAKE (--post-take): the take's file is the post's piece, its script its words; nothing synthesized.
if (postTake) {
const at = pieces.findIndex((p) => p.role === "post");
diff --git a/umtool/lib/report/present.mjs b/umtool/lib/report/present.mjs
@@ -25,7 +25,8 @@
// `canUncensor: false` (a public export, step 4) carries the CENSORED posts only -- every redacted span already
// marked, every masked slur masked, every blurred author's name and handle gone from the data -- and no reveal
// data at all. A public page can add censoring, never remove it.
-import { cardAuthors, cardText, excerptRanges, excerptSpansOf, postDay } from "umtool-report-to-video/post-item";
+import { cardAuthors, cardText, excerptRanges, excerptSpansOf, postDay, subjectsOf } from "umtool-report-to-video/post-item";
+import { excerptRun, maskShapes, maskedField, screenWho } from "umtool-report-to-video/post-screens";
import { REDACT_MARK, redactEntry, redactionOn } from "umtool-report-to-video/post-redact";
import { maskFor, slurMatches, slursOn } from "umtool-report-to-video/post-slurs";
import { blurOf, censorEntry } from "umtool-report-to-video/post-censor";
@@ -229,9 +230,62 @@ export function publicPostEntry(entry, red) {
const take = pickedTake(entry);
if (isObj(out.narration)) out.narration = take ? { takes: [{ file: take.file, seconds: take.seconds, ...(fin(take.rate) ? { rate: take.rate } : {}) }], pick: 0 } : { off: true };
delete out.notes;
+ // ITS SCREENS AS THE CARD DRAWS THEM (review round 1, i): never a raw line in the data.
+ if (Array.isArray(out.screens)) out.screens = publicScreens(out, { authorHidden: cardAuthors(entry).some((a) => a.where === "author" && a.redact) });
+ // A read not played: why, without the build's words (they name commands, not what was said).
+ if (isObj(out.readRefused)) out.readRefused = { reason: String(out.readRefused.reason ?? "") };
return out;
}
+/**
+ * A post's SCREENS AS ITS CARD DRAWS THEM, for a payload that cannot uncensor (post-screens.mjs, post-item.mjs
+ * postCardHtml's screenShown): each line's words, its time and the screen's title with their shapes MASKED (the
+ * redaction's marks, the same length: an excerpt is masked in place, so it is still a run of its line); a line marked
+ * redact carries no words, no speaker, no time; a speaker the card blurs carries no name (`xxxxxxxx`, one a speaker so
+ * the card still tells them apart) -- her own lines under the author's rule, an anonymous one (the pass's) as shown.
+ *
+ * @param {Record<string, any>} entry the post item (its redaction marked, its anonymous authors under their names)
+ * @param {{ authorHidden?: boolean }} [o]
+ */
+export function publicScreens(entry, { authorHidden = false } = {}) {
+ const subjects = new Set(subjectsOf(entry).map((h) => String(h).replace(/^@/, "").toLowerCase()));
+ const hidden = new Map();
+ const shown = (l) => {
+ const sw = screenWho(l?.who, entry);
+ if (sw.self) return !authorHidden;
+ if (l?.anonymous === true) return true;
+ if (entry.redact === true) return false;
+ if (entry.redact === false) return true;
+ return !!sw.handle && subjects.has(String(sw.handle).toLowerCase());
+ };
+ const nobody = (who) => {
+ const k = String(who).trim().toLowerCase();
+ if (!hidden.has(k)) hidden.set(k, hidden.size ? `${NOBODY}${hidden.size + 1}` : NOBODY);
+ return hidden.get(k);
+ };
+ return entry.screens.map((sc) => {
+ if (!isObj(sc) || !Array.isArray(sc.lines)) return sc;
+ const lines = sc.lines.map((l) => {
+ if (!isObj(l)) return l;
+ if (l.redact === true) return { text: "", redact: true };
+ const out = { ...l, text: maskShapes(str(l.text)).text };
+ if (typeof l.who === "string" && l.who.trim()) out.who = shown(l) ? maskedField(l.who) : nobody(l.who);
+ if (typeof l.time === "string") out.time = maskedField(l.time);
+ return out;
+ });
+ const read = Array.isArray(sc.read)
+ ? sc.read.map((x) => {
+ if (!isObj(x) || typeof x.text !== "string" || !isObj(sc.lines[x.line])) return x;
+ const raw = str(sc.lines[x.line].text);
+ const run = excerptRun(raw, x.text);
+ // An excerpt not in its line is never drawn whole: left out (the card leaves the line out too).
+ return run ? { ...x, text: maskShapes(raw).text.slice(run.start, run.end) } : null;
+ }).filter(Boolean)
+ : sc.read;
+ return { ...sc, lines, read, ...(typeof sc.title === "string" ? { title: maskedField(sc.title) } : {}) };
+ });
+}
+
// ---------------------------------------------------------------------------
// THE SLIDES.
// ---------------------------------------------------------------------------
diff --git a/umtool/report-to-video/post-screens.mjs b/umtool/report-to-video/post-screens.mjs
@@ -477,7 +477,7 @@ export function screenFromRead(e, { pictureOnly, id, media = null, kind = null }
const m = list[at];
const timed = m.kind === "video" || m.kind === "gif";
if (timed && !(fin(m.seconds) && m.seconds >= SCREEN_MIN_SPAN)) return { error: `attachment ${at} is a ${m.kind} of no known length: add the screen with --at <from>,<to>` };
- return { screen: { id, media: at, ...(timed ? { at: [0, r3(m.seconds)] } : {}), kind: k, source: "transcribed", lines, read: "all" } };
+ return { screen: { id, media: at, ...(timed ? { at: [0, r3(m.seconds)] } : {}), kind: k, source: "read", lines, read: "all" } };
}
// ---------------------------------------------------------------------------
@@ -516,7 +516,8 @@ export function validateScreens(e) {
} else if (timed) errors.push(`${at}.at must be [from, to]: the seconds of the ${m.kind} it is visible in`);
if (!SCREEN_KINDS.includes(sc.kind)) errors.push(`${at}.kind must be one of ${SCREEN_KINDS.join(", ")}`);
if (sc.title !== undefined && !(typeof sc.title === "string" && sc.title.trim() && sc.title.length <= SCREEN_TITLE_MAX)) errors.push(`${at}.title must be words (at most ${SCREEN_TITLE_MAX} characters)`);
- if (sc.source !== undefined && sc.source !== "transcribed") errors.push(`${at}.source must be "transcribed"`);
+ // "read": made from a picture-only post's read (--from-read) -- its lines ARE the post's read (postThreadRead.mjs).
+ if (sc.source !== undefined && sc.source !== "transcribed" && sc.source !== "read") errors.push(`${at}.source must be "transcribed" or "read" (made from its read)`);
if (sc.checked !== undefined && !(isObj(sc.checked) && typeof sc.checked.by === "string" && sc.checked.by.trim() && sc.checked.by.length <= 40 && typeof sc.checked.at === "string" && !Number.isNaN(Date.parse(sc.checked.at)))) {
errors.push(`${at}.checked must be { by, at }: who checked the transcription and when (ISO)`);
}
diff --git a/umtool/report-to-video/post-thread.mjs b/umtool/report-to-video/post-thread.mjs
@@ -581,18 +581,98 @@ export function screenPartErrors(entry, k, roles = partRoles(entry), changed = n
*/
export function validateScreenReads(manifest) {
const tl = Array.isArray(manifest?.timeline) ? manifest.timeline : [];
+ return tl.flatMap((e) => itemReadRefusals(e));
+}
+
+/**
+ * ONE POST ITEM's READ, REFUSED, pure -- what the build's enforced lint refuses about it (validateScreenReads is this
+ * over a cut), judged on the item AS WRITTEN: every screen part's errors (screenPartErrors: a line changed since the
+ * read, not read, gone, a shape said) and every part that SAYS WHAT ITS SCREENS HIDE (readSaysHiddenErrors). Empty
+ * for an item with no screens, or not narrated.
+ */
+export function itemReadRefusals(e) {
+ if (e?.type !== "post" || !Array.isArray(e.screens) || !isNarrated(e)) return [];
const out = [];
- for (const e of tl) {
- if (e?.type !== "post" || !Array.isArray(e.screens) || !isNarrated(e)) continue;
- const roles = partRoles(e);
- const changed = new Set();
- roles.forEach((r, k) => {
- if (r?.role && parseScreenRole(r.role)) out.push(...screenPartErrors(e, k, roles, changed));
+ const roles = partRoles(e);
+ const changed = new Set();
+ roles.forEach((r, k) => {
+ if (r?.role && parseScreenRole(r.role)) out.push(...screenPartErrors(e, k, roles, changed));
+ });
+ out.push(...readSaysHiddenErrors(e));
+ return out;
+}
+
+/** A shape's KEY, to know it said elsewhere: an e-mail lower case; a number its digits (fullwidth ones too). */
+const digitsOf = (t) => str(t).replace(/\p{Nd}/gu, (d) => String(Number.parseInt(d.normalize("NFKC"), 10))).replace(/[^0-9]/g, "");
+const shapeKey = (text, sp) => (sp.kind === "email" ? text.slice(sp.start, sp.end).toLowerCase() : digitsOf(text.slice(sp.start, sp.end)));
+/** Every run of digits a text says (its separators between them dropped): `["4419283", "5552014477"]`. */
+const digitRunsOf = (t) => [...str(t).matchAll(/\p{Nd}(?:[\s\-‐‑–—·./()]{0,3}\p{Nd})*/gu)].map((m) => digitsOf(m[0]));
+
+/**
+ * WHAT ITS SCREENS HIDE, SAID ANYWHERE IN ITS READ, pure (review round 1, M2: a picture's words read by the post's own
+ * part and again by its screen): every part of the picked take -- his words, a context post, a screen line, a take with
+ * no parts as its words -- that says a SHAPE one of the item's screens masks (an e-mail, a number of four digits or
+ * more: post-screens.mjs shapeSpans, its digits however they are joined) or the words of a line marked `redact` (three
+ * or more of them in a row). Names the part and the screen's line, never the value. None without screens.
+ */
+export function readSaysHiddenErrors(e) {
+ const screens = screensOfEntry(e);
+ const t = pickedTake(e);
+ if (!screens.length || !t) return [];
+ const id = e?.id ?? "<item>";
+ const masked = [];
+ const redacted = [];
+ for (const sc of screens) {
+ sc.lines.forEach((l, n) => {
+ if (!l || typeof l !== "object") return;
+ const text = str(l.text);
+ if (l.redact === true) {
+ const w = sayKeys(text);
+ if (w.length >= 3) redacted.push({ screen: sc.id, n, w });
+ return;
+ }
+ for (const sp of shapeSpans(text)) {
+ const key = shapeKey(text, sp);
+ if (sp.kind === "email" ? key.length >= 3 : key.length >= 4) masked.push({ screen: sc.id, n, kind: sp.kind, key });
+ }
});
}
+ if (!masked.length && !redacted.length) return [];
+ const parts = Array.isArray(t.parts) && t.parts.length ? t.parts.map((p) => str(p?.text)) : [str(t.said) || str(t.script)];
+ const out = [];
+ parts.forEach((said, k) => {
+ const where = Array.isArray(t.parts) && t.parts.length ? `its take's part ${k + 1}` : "its picked take";
+ const runs = new Set(digitRunsOf(said));
+ const low = said.toLowerCase();
+ const hit = masked.find((m) => (m.kind === "email" ? low.includes(m.key) : runs.has(m.key) || [...runs].some((r) => r.length >= m.key.length && r.includes(m.key))));
+ if (hit) out.push(`timeline ${e?.id ?? "?"}: ${where} says ${hit.kind === "email" ? "an e-mail address" : "a number"} that line ${hit.n} of screen ${hit.screen} masks -- the card never shows it and no read may say it: make the read again (umtool posts screen <p> ${id} read)`);
+ const w = sayKeys(said);
+ const red = redacted.find((r) => w.some((_, i) => r.w.every((x, j) => w[i + j] === x)));
+ if (red) out.push(`timeline ${e?.id ?? "?"}: ${where} says the words of line ${red.n} of screen ${red.screen}, which is redacted -- make the read again (umtool posts screen <p> ${id} read)`);
+ });
return out;
}
+// ---------------------------------------------------------------------------
+// WHAT A PREVIEW PLAYS (Play, Present, the post bench's player, the card page): never a read the build refuses.
+// ---------------------------------------------------------------------------
+
+/** What a preview says of a read it does not play. */
+export const READ_REFUSED_REASON = "the read is older than its screen, or says what the screen hides -- it is not played: make the read again (umtool posts screen <p> <item> read)";
+
+/**
+ * THE ITEM AS A PREVIEW MAY PLAY IT, pure (review round 1, M1): the item itself when the build would play its read;
+ * else the item WITHOUT its read -- no narration, no take, no part in it (it plays silent, as an item not narrated) --
+ * with `readRefused: { reason, errors }` saying why. Judged on the item as written (itemReadRefusals); every player and
+ * payload goes through it: playView (Play, Present -- the public payload too), the card page, the post bench's player.
+ */
+export function playableEntry(e) {
+ const errors = itemReadRefusals(e);
+ if (!errors.length) return e;
+ const { narration: _n, ...rest } = e;
+ return { ...rest, readRefused: { reason: READ_REFUSED_REASON, errors } };
+}
+
const sayKeys = (t) => str(t).toLowerCase().split(/\s+/).map((x) => x.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")).filter(Boolean);
const normText = (t) => str(t).replace(/\s+/g, " ").trim();