Archilyzer · Source

archilyzer

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

commit d02d6265f873d3bdf497e33b291fda6a5e6dd1a0
parent 8e0e468207aca51a9569ad93695fdceadabbf0de
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed,  4 Nov 2026 13:49:08 -0500

umtool: a caption, the clock and the pace in the post segment's key, appended (postFxKeyFields) -- an item with none of them keeps its old key, so a take --from an earlier one reuses its segment (operator, 4 Nov: "make sure you handle caching well, we may have a couple rerenders before shipping")

The entry (in the key already) carries each caption's text and knobs, the clock fx, the pace and the item's
id (a repeated item is its own segment). Appended for what it does not carry: captionV / clockV (the chip's and
the clock's drawing, bumped when their look changes), clock (clockPlan: this post's time, the time it runs from
-- the item before's, when that one is a clock item -- the mode, a forced rewind, the zone) and pace (the gap
knobs it resolved to: a cut-level pace changes them without touching the entry). A plain item adds nothing.

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

Diffstat:
Mumtool/report-to-video/post-clock.test.mjs | 24++++++++++++++++++++++++
Mumtool/report-to-video/post-render.mjs | 31+++++++++++++++++++++++++++++--
2 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/umtool/report-to-video/post-clock.test.mjs b/umtool/report-to-video/post-clock.test.mjs @@ -101,3 +101,27 @@ test("THE PACE: fast plays a post back to back -- its gap knobs, unless it sets assert.equal(postNarrationKnobs(normal, cut).linger, 1.8); assert.match(validatePostNarration(post("a", "2026-11-02T22:15:00Z", { narration: { script: "x", pace: "slow" } })).join(), /pace must be fast or normal/); }); + +test("THE SEGMENT KEY (post-render.mjs postFxKeyFields): nothing for a plain item (its old key, its segment reused); the caption, the clock (the time it runs from, the rewind, the zone) and the pace each change it", async () => { + const { postFxKeyFields } = await import("./post-render.mjs"); + const take = { file: "n/t.wav", engine: "orpheus", voice: "zac", seconds: 5, script: "x" }; + const plain = post("a", "2026-11-02T22:15:00Z", { narration: { script: "x", takes: [take] } }); + assert.deepEqual(postFxKeyFields(plain, {}, post("z", "2026-11-02T22:00:00Z")), {}); + assert.deepEqual(postFxKeyFields(plain, { postNarration: { rate: 1.08 } }, null), {}); + // A caption: its drawing's version (the entry, in the key, carries its text and knobs). + assert.deepEqual(postFxKeyFields({ ...plain, fx: [{ kind: "caption", match: "x", text: "y" }] }, {}), { captionV: 1 }); + // The clock: from the item before -- its time, its being a clock item, the zone, the rewind. + const clk = { ...plain, fx: [{ kind: "clock" }] }; + const before = post("z", "2026-11-02T22:00:00Z", CLK); + const k1 = JSON.stringify(postFxKeyFields(clk, {}, before)); + assert.match(k1, /"clockV":1/); + assert.notEqual(JSON.stringify(postFxKeyFields(clk, {}, { ...before, date: "2026-11-02T21:00:00Z" })), k1); + assert.notEqual(JSON.stringify(postFxKeyFields(clk, {}, { ...before, fx: [] })), k1); + assert.notEqual(JSON.stringify(postFxKeyFields(clk, { posts: { clock: { zone: "Europe/London" } } }, before)), k1); + assert.notEqual(JSON.stringify(postFxKeyFields({ ...clk, fx: [{ kind: "clock", rewind: "on" }] }, {}, before)), k1); + // The cut's clock on: every dated item keys its clock. + assert.ok(postFxKeyFields(plain, { posts: { clock: { on: true } } }, null).clock); + // The pace: the item's, or the cut's (which the entry does not carry). + assert.deepEqual(postFxKeyFields(plain, { postNarration: { pace: "fast" } }).pace, { pace: "fast", lead: 0.1, tail: 0.15, ramp: 0.3, linger: 0.45 }); + assert.equal(postFxKeyFields({ ...plain, narration: { ...plain.narration, pace: "fast", linger: 1 } }, {}).pace.linger, 1); +}); diff --git a/umtool/report-to-video/post-render.mjs b/umtool/report-to-video/post-render.mjs @@ -19,7 +19,7 @@ import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises"; import path from "node:path"; import { pathToFileURL } from "node:url"; import { POST_PICTURE_XFADE, POST_PUSH, fxRedactionErrors, postCardHtml, postItemPlan, postLayout, stepBoxes } from "./post-item.mjs"; -import { isNarrated, narrationLevelDb, pickedTake, postNarrationFilters, rootTakeOf } from "./post-narration.mjs"; +import { isNarrated, narrationLevelDb, pickedTake, postNarrationFilters, postNarrationKnobs, rootTakeOf } from "./post-narration.mjs"; import { applyFollowState, followPath, followRuns, followStateAt, isDrawnState, measureFollow, readInViewErrors, shotStateAt } from "./read-follow.mjs"; import { redactEntry, redactionOn, shownLine, termsFor } from "./post-redact.mjs"; import { bleepFilters, slursOn, takeBleeps } from "./post-slurs.mjs"; @@ -644,6 +644,33 @@ export function postZoomPlan(entry, render, total = Infinity) { } /** + * THE SEGMENT KEY's fields for a caption, the clock and the pace (appended to + * the key, never restructuring it): `{}` for an item with none of them, so its + * key is the one it had before they existed and its segment is reused. The + * entry itself is in the key (its `fx` -- each caption's text, match, at, + * hold, place; its clock fx's on/rewind -- its `narration.pace`, its id: a + * repeated item is its own segment); what it does NOT carry is added here: + * captionV / clockV the chip's and the clock's drawing (bumped when their look changes) + * clock clockPlan -- this post's time, the time it runs from (the + * item before's, when that one is a clock item), the mode + * (forward / rewind / none, a forced rewind) and the zone + * pace the gap knobs the pace resolved to (lead, tail, ramp, linger: + * a cut-level pace changes them without touching the entry) + */ +export const POST_CAPTION_DRAW_V = 1; +export const POST_CLOCK_DRAW_V = 1; +export function postFxKeyFields(entry, render, prev = null) { + const out = {}; + const fx = Array.isArray(entry?.fx) ? entry.fx : []; + if (fx.some((f) => f?.kind === "caption")) out.captionV = POST_CAPTION_DRAW_V; + const clk = clockPlan(entry, render, prev); + if (clk) Object.assign(out, { clockV: POST_CLOCK_DRAW_V, clock: clk }); + const k = postNarrationKnobs(entry, render); + if (isNarrated(entry) && k.pace && k.pace !== "normal") out.pace = { pace: k.pace, lead: k.lead, tail: k.tail, ramp: k.ramp, linger: k.linger }; + return out; +} + +/** * Build post item `entry`'s segment. `ctx`: `{ render, outDir, manifestDir, * box, place, encode, exec, ffmpeg, emit, avatars }` -- the box it fills (the * deck's footage box, or the frame), the deck's framing after it, @@ -687,7 +714,7 @@ export async function buildPostSegment(entry, { render, outDir, manifestDir, box })); const key = createHash("sha256") // A redaction that changes what the card draws changes the key; none leaves it as it was. - .update(JSON.stringify({ v: 1, entry, ...(redactionOn(redaction) ? { published: redactEntry(entry, redaction), blank: termsFor(entry, redaction) } : {}), box, place, palette: render.palette, fonts: [render.fontRegular, render.fontBold], fps: render.fps, encode, stamps, ...(Object.keys(avatars).length ? { avatars } : {}), ...(take ? { narration: plan.narration, postNarration: render.postNarration ?? null } : {}), ...(plan.follow ? { follow: plan.follow } : {}), ...(bleeps ? { bleeps } : {}), ...(slursOn(redaction?.slurs) ? { slurs: redaction.slurs } : {}), ...(clockPlan(entry, render, prev) ? { clock: clockPlan(entry, render, prev) } : {}) })) + .update(JSON.stringify({ v: 1, entry, ...(redactionOn(redaction) ? { published: redactEntry(entry, redaction), blank: termsFor(entry, redaction) } : {}), box, place, palette: render.palette, fonts: [render.fontRegular, render.fontBold], fps: render.fps, encode, stamps, ...(Object.keys(avatars).length ? { avatars } : {}), ...(take ? { narration: plan.narration, postNarration: render.postNarration ?? null } : {}), ...(plan.follow ? { follow: plan.follow } : {}), ...(bleeps ? { bleeps } : {}), ...(slursOn(redaction?.slurs) ? { slurs: redaction.slurs } : {}), ...postFxKeyFields(entry, render, prev) })) .digest("hex"); const record = postRecordPath(seg); const had = await readFile(record, "utf8").then((t) => JSON.parse(t), () => null);