commit f77bb2c3262437e29535ae80db551e89033ad1fc
parent 3a3215ec7b2dc1a639b3b8f9334cbddaa43a8feb
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 12 Nov 2026 21:25:30 -0500
umtool Play: the analysis item's page on the stage, as a teaser's (silent)
The teasers' preview route and Play's card player take an analysis item too:
composed for preview under chrome/analysis-preview-<id>/ (served one segment
deeper, as a teaser's), Play's seek on its own timeline, laid full frame and
seeked on the cut clock. Silent in Play: the sound under it is the render's.
play-teaser.spec: an analysis item from a fixture ledger, its pace rows over/under.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
8 files changed, 96 insertions(+), 15 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,7 +1,7 @@
# Changelog
## [Unreleased]
-- **umtool: a report video can end on an analysis item, built from the ledger.** A new timeline entry, `{type: "analysis"}`, draws a full-frame ending on the deck's fonts and colours. It has a chart of a named run of his weights with a shaded band and marks, a pace table, status rows and one reading line. The line draws in and the rows land; there is no slam, hit or camera move. Every figure comes from a ledger row. A loss ("down 31.5") is placed against the run's start, the same weight a loss goal's base uses. A pace row's pounds and days are computed, never typed. A bound ("under 300") is drawn as a hollow point, and a pace row ending on one says "over" or "under" in the right direction. With `audio`, a clip's sound plays under the item and its citation and QR code are shown, but not its picture. Without audio the item is silent for at most 8 seconds. `umtool lint` names the row behind every refusal. `umtool timeline <p> [--take <t>] add-analysis | set-analysis` writes one into the draft or a take, with an undo point, and `--dry-run` prints every figure with its row. A cut without an analysis item builds exactly as before.
+- **umtool: a report video can end on an analysis item, built from the ledger.** A new timeline entry, `{type: "analysis"}`, draws a full-frame ending on the deck's fonts and colours. It has a chart of a named run of his weights with a shaded band and marks, a pace table, status rows and one reading line. The line draws in and the rows land; there is no slam, hit or camera move. Every figure comes from a ledger row. A loss ("down 31.5") is placed against the run's start, the same weight a loss goal's base uses. A pace row's pounds and days are computed, never typed. A bound ("under 300") is drawn as a hollow point, and a pace row ending on one says "over" or "under" in the right direction. With `audio`, a clip's sound plays under the item and its citation and QR code are shown, but not its picture. Without audio the item is silent for at most 8 seconds. `umtool lint` names the row behind every refusal. `umtool timeline <p> [--take <t>] add-analysis | set-analysis` writes one into the draft or a take, with an undo point, and `--dry-run` prints every figure with its row. Play the cut draws the item as the build does, but silently. A cut without an analysis item builds exactly as before.
- **umtool: a build and a take refuse a picked read that says an anonymous author's handle or name.** `umtool lint` reported it, but the lint a build enforces (and so every take's render) did not, so a recorded "@realguy is lying" rendered with the card anonymised and the audio saying the handle. The enforced lint now carries the same error in the same words; `--no-lint` is still the only override, and a video with no anonymous character lints exactly as before. Also: a video with anonymous characters whose `video.manifest.json` is missing or unreadable is refused rather than read with an empty set; a read collapses a status link to an anonymous author's post; a `--post-take` part takes its words from what the source take said; and the words sent to a model lose an anonymous author's display name, bare handle, `/i/web/status/` links and percent-encoded handles too.
- **umtool: anonymity covers the whole project, every link, the podcast and the previews; old reads keep their speed.** Re-checking the anonymous characters found several gaps. An item that named one in another variant, or one dropped by a ruling, `--only`, a window or a take, left the author in clear. The deck's corner QR on an anonymous author's post item still led to the real post. Links were rewritten with the status id kept. The podcast's show notes and the chrome preview, still and onscreen routes had no pass at all. Now:
- The set is built from the whole project manifest (and a take's), and the build, the chrome composer, the podcast, Play, Present and the previews all take it from one function.
diff --git a/umtool/app/api/report/chrome/teasers/route.ts b/umtool/app/api/report/chrome/teasers/route.ts
@@ -1,5 +1,6 @@
import { composeTeaserPreviews } from "@/lib/report/onscreen.mjs";
-import { resolveReport, teaserPreviewSrc } from "@/lib/report/serve.mjs";
+import { analysisPreviewSrc, resolveReport, teaserPreviewSrc } from "@/lib/report/serve.mjs";
+import { analysisSeconds } from "umtool-report-to-video/analysis-plan";
import { selectVariant } from "umtool-report-to-video/build-video";
import { teaserSeconds, transitionOf } from "umtool-report-to-video/deck";
import { cachedTakeManifest, takePlayDir, writePlayManifest } from "@/lib/report/takeManifest.mjs";
@@ -43,7 +44,8 @@ export async function POST(request: Request) {
}
const selected = selectVariant(manifest, r.variant);
const render = (selected.render ?? {}) as Record<string, unknown>;
- const timeline = ((selected.timeline ?? []) as Record<string, unknown>[]).filter((e) => e && e.type === "teaser");
+ // An analysis item (analysis-plan.mjs) is a full-frame page as a teaser is: composed and served the same way.
+ const timeline = ((selected.timeline ?? []) as Record<string, unknown>[]).filter((e) => e && (e.type === "teaser" || e.type === "analysis"));
const composed = await composeTeaserPreviews(target, r.variant, timeline);
const D = transitionOf(render);
const fps = typeof render.fps === "number" ? render.fps : 30;
@@ -55,7 +57,9 @@ export async function POST(request: Request) {
teasers: composed.map((c) => {
const e = timeline.find((x) => x.id === c.id)!;
return c.ok
- ? { id: c.id, seconds: teaserSeconds(e, D, fps), width, height, src: `${teaserPreviewSrc(r.project.id, r.variant, c.id, take)}?v=${stamp}` }
+ ? e.type === "analysis"
+ ? { id: c.id, seconds: analysisSeconds(e), width, height, src: `${analysisPreviewSrc(r.project.id, r.variant, c.id, take)}?v=${stamp}` }
+ : { id: c.id, seconds: teaserSeconds(e, D, fps), width, height, src: `${teaserPreviewSrc(r.project.id, r.variant, c.id, take)}?v=${stamp}` }
: { id: c.id, error: c.error ?? "did not compose" };
}),
},
diff --git a/umtool/components/projects/review/playCore.tsx b/umtool/components/projects/review/playCore.tsx
@@ -164,7 +164,8 @@ export function usePlayCore(view: PlayViewData, { showRejected = false }: { show
// THE TEASERS (lane leaflit-labels): each text card's own page, composed for preview (POST
// /api/report/chrome/teasers) and laid full frame while it is on screen -- the build's card, not a placeholder.
// Composed again whenever the manifest moved (its token), with or without a deck.
- const teaserKey = useMemo(() => view.entries.filter((e) => e.type === "teaser").map((e) => e.id).join("\n"), [view.entries]);
+ // An analysis item's page too (analysis-plan.mjs): full frame, silent in Play.
+ const teaserKey = useMemo(() => view.entries.filter((e) => e.type === "teaser" || e.type === "analysis").map((e) => e.id).join("\n"), [view.entries]);
// THE INTRO (lane intro-play): its page composed for preview (POST /api/report/chrome/intro), again when the manifest moved.
const introPage = useIntroPage(project, take, view.entries.some((e) => e.type === "intro"), view.token);
const [teaserPages, setTeaserPages] = useState<Record<string, TeaserPage | { id: string; error: string }>>({});
@@ -279,7 +280,7 @@ export function usePlayCore(view: PlayViewData, { showRejected = false }: { show
const vstage = hasVideoEntries ? videoStageAt(plan, entryOf, t) : null;
const videoNow = vstage?.video ? { ...vstage, video: vstage.video } : null;
// A teaser plays its own page (TeaserCardPlayer), once composed; until then -- or if it did not compose -- a placeholder.
- const teaserPage = item && entry?.type === "teaser" ? teaserPages[item.id] : undefined;
+ const teaserPage = item && (entry?.type === "teaser" || entry?.type === "analysis") ? teaserPages[item.id] : undefined;
const teaserNow = item && teaserPage && "src" in teaserPage ? { item, page: teaserPage } : null;
// THE INTRO (lane intro-play): the build's own page and its sound (IntroCardPlayer), once composed; until then -- or if
// it did not compose -- a placeholder that says so.
diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md
@@ -508,7 +508,9 @@ air); a short one's motion is scaled to leave a 1.5 s hold. Works with no model
teaser's is) and encoded with its sound; `segments/<id>.analysis.json` keys the frames, the sound (the
source file, its offset, its gain) and the encode, so an unchanged item is not encoded again, and
`--chrome-only` rebuilds it from the cache. The deck is away over it (full frame). No vertical form: a
-9:16 cut refuses it. A cut without an analysis item builds byte for byte as before.
+9:16 cut refuses it. A cut without an analysis item builds byte for byte as before. **Play the cut** draws
+its page as the build does (composed for preview by `POST /api/report/chrome/teasers`, as a teaser's),
+seeked on the cut clock -- silent: the sound under it is the render's.
```sh
umtool timeline <p> --take rev9-a10 add-analysis @first-use.json --after c99 --dry-run # every figure with its row
diff --git a/umtool/e2e/fixtures/make-fixture.mjs b/umtool/e2e/fixtures/make-fixture.mjs
@@ -2102,6 +2102,34 @@ pt.timeline = pt.timeline.map((e) => (e.id === "k01"
writeFileSync(ptFile, JSON.stringify(pt, null, 2) + "\n");
}
+// AN ANALYSIS ITEM in Play the cut (play-teaser.spec.ts, lane analysis-ending): the Play cut with its card k01
+// replaced by an analysis item a01 drawn from a small measure ledger (silent, 6 s), shown as the build draws it.
+{
+const { dir: playAnalysisDir } = makePlayCutFixture({
+ reports, deckManifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"),
+ name: "play-analysis-fixture", title: "The Play Analysis Fixture",
+});
+const paFile = path.join(playAnalysisDir, "video.manifest.json");
+const pa = JSON.parse(readFileSync(paFile, "utf8"));
+const W = (id, population, date, value, extra = {}) => ({ id, scope: "weight", population, date, value, ...extra });
+pa.ledgerSchema = {
+ kind: "measure", unit: "lb", bandGapDays: 60, tracks: [{ key: "weight", role: "value", label: "Weight" }],
+ fields: [{ key: "qualifier", label: "Bound", kind: "enum", options: [">", "<", "≈"], render: "cell" }],
+};
+pa.ledger = [
+ W("w1", "delta", "2026-07-23", -5), W("w2", "past", "2026-08-03", 349, { asOf: "2026-07-19" }), W("w3", "delta", "2026-09-04", -31.5),
+ W("w4", "current", "2026-09-24", 310.5), W("w5", "current", "2026-10-15", 300, { qualifier: "<" }), W("w6", "current", "2026-10-26", 291.5, { asOf: "2026-10-23" }),
+];
+pa.timeline = pa.timeline.map((e) => (e.id === "k01"
+ ? {
+ type: "analysis", id: "a01", seconds: 6, title: "What his own numbers say", kicker: "THE RUN",
+ series: { rows: ["w2", "w3", "w4", "w5", "w6"] }, pace: [{ from: "w4", to: "w5" }, { from: "w5", to: "w6" }],
+ reading: "The loss is steady.", mark: 300,
+ }
+ : e));
+writeFileSync(paFile, JSON.stringify(pa, null, 2) + "\n");
+}
+
// THE INTRO, PLAYABLE (intro-play.spec.ts, lane intro-play): the Play cut opening on a title-card intro with a
// sound of its own, and a whole-cut version v1 the spec switches the intro off and on in. WRITABLE, its own.
makeIntroPlayFixture({ reports, deckManifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"), makePlayCutFixture });
diff --git a/umtool/e2e/play-teaser.spec.ts b/umtool/e2e/play-teaser.spec.ts
@@ -70,3 +70,30 @@ test("a teaser card that carries a mark plays as the build draws it: its lines,
await expect(root(page)).toHaveAttribute("data-play-item", "c01");
await expect(card(page)).toHaveCount(0);
});
+
+// AN ANALYSIS ITEM (lane analysis-ending): its own page (chrome-analysis.mjs) composed for preview by the same route
+// and laid full frame, seeked on the cut clock -- the build's figures from the fixture's ledger, a bound said over/under.
+test("an analysis item plays as the build draws it: its page full frame, its pace rows computed from the ledger", async ({ page }) => {
+ const P = "reports/play-analysis-fixture";
+ const item = page.locator('[data-play-teaser="a01"]');
+ const f = page.frameLocator('[data-testid="play-teaser-iframe"]');
+ await page.setViewportSize({ width: 1366, height: 1000 });
+ await page.goto(urls.playHref(P, { clip: "a01", at: 5.5 }));
+ await expect(root(page)).toHaveAttribute("data-play-item", "a01", { timeout: 30_000 });
+ await expect(item).toHaveAttribute("data-play-teaser-ready", "1", { timeout: 30_000 });
+ await expect(page.locator("[data-play-placeholder]")).toHaveCount(0);
+ await expect(f.locator(".ttl")).toHaveText("What his own numbers say");
+ await expect(f.locator('[data-k="r0"] .v')).toHaveText("over−10.5 lb");
+ await expect(f.locator('[data-k="r1"] .v')).toHaveText("under−8.5 lb");
+ await expect(f.locator('[data-k="r0"] .ls')).toHaveText("21 days · to < 300");
+ // Landed by now (the rows land after the line): seeked, not a still of its first frame.
+ await expect.poll(() => f.locator('[data-k="rd"]').evaluate((el) => Number(getComputedStyle(el).opacity)), { timeout: 10_000 }).toBeGreaterThan(0.9);
+ // Shown, not only loaded: the page's frame is visible on the stage.
+ await expect(item).toHaveAttribute("data-play-teaser-ready", "1");
+ await expect(page.locator('[data-play-teaser="a01"] iframe')).toBeVisible();
+ await page.screenshot({ path: test.info().outputPath("play-analysis.png") });
+ // Out of it (c01): no page on screen.
+ await page.locator('[data-play-row="c01"]').press("Enter");
+ await expect(root(page)).toHaveAttribute("data-play-item", "c01");
+ await expect(item).toHaveCount(0);
+});
diff --git a/umtool/lib/report/onscreen.mjs b/umtool/lib/report/onscreen.mjs
@@ -54,7 +54,7 @@ import {
readCues,
} from "../projects/report.mjs";
import { normalizePostPatches, splitOnscreenRow } from "./manifest.mjs";
-import { INTRO_PREVIEW_FILES, deckPreviewDir, feedPreviewDir, finalePreviewDir, introPreviewDir, postsPreviewDir, stampPreviewDir, teaserPreviewDir } from "./serve.mjs";
+import { INTRO_PREVIEW_FILES, analysisPreviewDir, deckPreviewDir, feedPreviewDir, finalePreviewDir, introPreviewDir, postsPreviewDir, stampPreviewDir, teaserPreviewDir } from "./serve.mjs";
import { ensureWriteDir } from "./storage.mjs";
/** The schedule document deck.mjs defines, built or estimated. */
@@ -660,10 +660,11 @@ export const TEASER_SEEK_SCRIPT = `<script data-play-seek="">
})();
</script>`;
-/** The page with Play's seek before its `</body>`. */
-export const withTeaserSeek = (html) => {
+/** The page with Play's seek before its `</body>`; `id` the page's timeline (an analysis item's is "analysis"). */
+export const withTeaserSeek = (html, id = "teaser") => {
+ const script = id === "teaser" ? TEASER_SEEK_SCRIPT : TEASER_SEEK_SCRIPT.replace('__timelines["teaser"]', `__timelines[${JSON.stringify(id)}]`);
const at = html.lastIndexOf("</body>");
- return at < 0 ? html + TEASER_SEEK_SCRIPT : `${html.slice(0, at)}${TEASER_SEEK_SCRIPT}\n ${html.slice(at)}`;
+ return at < 0 ? html + script : `${html.slice(0, at)}${script}\n ${html.slice(at)}`;
};
/**
@@ -682,20 +683,21 @@ export const withTeaserSeek = (html) => {
*/
export async function composeTeaserPreviews(project, variant, timeline, { compose = composeChrome } = {}) {
const outDir = path.join(project.dir, "out", variant);
- const teasers = (timeline ?? []).filter((e) => e?.type === "teaser" && typeof e.id === "string");
+ // An analysis item (analysis-plan.mjs) is a full-frame page too: its own region, the same handshake.
+ const teasers = (timeline ?? []).filter((e) => (e?.type === "teaser" || e?.type === "analysis") && typeof e.id === "string");
const out = [];
for (const e of teasers) {
- const want = teaserPreviewDir(project.dir, variant, e.id);
+ const want = e.type === "analysis" ? analysisPreviewDir(project.dir, variant, e.id) : teaserPreviewDir(project.dir, variant, e.id);
try {
await serialised(want, async () => {
/** @type {Record<string, unknown>} */
- const args = { manifestPath: manifestOf(project), outDir, variant, region: "teaser", segment: e.id, preview: true };
+ const args = { manifestPath: manifestOf(project), outDir, variant, region: e.type, segment: e.id, preview: true };
const r = await compose(/** @type {any} */ (args));
if (r?.projDir && path.resolve(r.projDir) !== path.resolve(want)) {
throw new Error(`compose-chrome wrote the teaser preview to ${r.projDir}, not ${want}`);
}
const file = path.join(want, "index.html");
- await writeFile(file, withTeaserSeek(await readFile(file, "utf8")), "utf8");
+ await writeFile(file, withTeaserSeek(await readFile(file, "utf8"), e.type), "utf8");
});
out.push({ id: e.id, ok: true });
} catch (err) {
diff --git a/umtool/lib/report/serve.mjs b/umtool/lib/report/serve.mjs
@@ -935,6 +935,17 @@ export const teaserPreviewDir = (projectDir, variant, segment) =>
export const teaserPreviewSrc = (projectId, variant, segment, take = null) =>
`${previewBase(projectId, variant, take)}/${TEASER_PREVIEW_PREFIX}${encodeURIComponent(segment)}/index.html`;
+// An ANALYSIS item's preview page (Play the cut): compose-chrome's `analysis-preview-<id>/`, as a teaser's.
+const ANALYSIS_PREVIEW_PREFIX = "analysis-preview-";
+
+/** The preview project of one analysis entry. */
+export const analysisPreviewDir = (projectDir, variant, segment) =>
+ path.join(projectDir, "out", variant, "chrome", `${ANALYSIS_PREVIEW_PREFIX}${segment}`);
+
+/** @type {(projectId: string, variant: string, segment: string, take?: string | null) => string} */
+export const analysisPreviewSrc = (projectId, variant, segment, take = null) =>
+ `${previewBase(projectId, variant, take)}/${ANALYSIS_PREVIEW_PREFIX}${encodeURIComponent(segment)}/index.html`;
+
// THE INTRO's preview page (`render.intro`; Play's first segment, Present's
// first slide, the Cut tab's intro editor): report-to-video intro.mjs's own
// page, written beside GSAP (and the words' face) under
@@ -1006,6 +1017,12 @@ export function previewDirFor(projectDir, variant, rest, segmentIds) {
if (!new Set(segmentIds).has(seg)) return null;
return { dir: teaserPreviewDir(projectDir, variant, seg), rest: rest.slice(1) };
}
+ if (typeof head === "string" && head.startsWith(ANALYSIS_PREVIEW_PREFIX)) {
+ const seg = head.slice(ANALYSIS_PREVIEW_PREFIX.length);
+ if (!seg || /[\/\\\0]/.test(seg) || seg === "." || seg === "..") return null;
+ if (!new Set(segmentIds).has(seg)) return null;
+ return { dir: analysisPreviewDir(projectDir, variant, seg), rest: rest.slice(1) };
+ }
if (typeof head === "string" && head.startsWith(POSTS_PREVIEW_PREFIX)) {
const seg = head.slice(POSTS_PREVIEW_PREFIX.length);
if (!seg || /[\/\\\0]/.test(seg) || seg === "." || seg === "..") return null;