Archilyzer · Source

archilyzer

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

commit 2686b01103fb24543229b88a2c23e14800d0f5d1
parent 71ced297ac77bdba1985e92b55ce7d5a81e14514
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 13 Oct 2026 10:51:51 -0400

common: to-manifest gives the title card a foot and a section with nothing to show no chapter card (release 27 S7)

reportToManifest's title card now carries `foot: ""` (render-cards printed
"undefined" without one), and render-cards renders a missing sub or foot
empty. A section that emits no timeline entry — a trailing Coverage note, a
posts-only section — gets no chapter card, with a warning, so the cut never
ends on a silent card; the article keeps the section. The derived fixtures
in common/testing/draft/manifests are regenerated.

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

Diffstat:
Mcommon/lib/report/convert.test.ts | 20++++++++++++++++++++
Mcommon/lib/report/convertManifest.ts | 16++++++++++++++--
Mcommon/testing/README.md | 6++++--
Mcommon/testing/draft/manifests/basic.video.manifest.json | 3++-
Mcommon/testing/draft/manifests/paragraphs.video.manifest.json | 10++--------
Mcommon/testing/draft/manifests/posts-only.video.manifest.json | 10++--------
Mumtool/report-to-video/render-cards.mjs | 9++++++---
Aumtool/report-to-video/title-card.test.mjs | 25+++++++++++++++++++++++++
8 files changed, 75 insertions(+), 24 deletions(-)

diff --git a/common/lib/report/convert.test.ts b/common/lib/report/convert.test.ts @@ -616,3 +616,23 @@ test("reportToManifest: a post with no known platform or link is left out with a postId: "3abcxyz", }); }); + +// Release 27 S7: two owed bugs of to-manifest, over the synthetic `paragraphs` +// sweep (a trailing Coverage section of prose only). +test("reportToManifest: the title card carries a foot; a section with nothing to show gets no chapter card", async () => { + const { convertFixture, deriveFixture } = await import("../../testing/draft/derive"); + const { report } = await convertFixture("paragraphs"); + assert.ok(report.sections.some((s) => s.title === "Coverage"), "the report keeps its Coverage section"); + const result = await reportToManifest(report, { today: "2026-10-13" }); + assert.ok(result.ok); + const timeline = result.manifest.timeline as Record<string, unknown>[]; + assert.equal(timeline[0].style, "title"); + assert.equal(timeline[0].foot, ""); + assert.ok(!timeline.some((e) => e.type === "card" && e.heading === "Coverage"), "no Coverage card"); + // The cut no longer ends on a card. + assert.equal(timeline[timeline.length - 1].type, "clip"); + assert.ok(result.warnings.some((w) => /section "Coverage" \(.*\): nothing in it to show — no chapter card/.test(w)), result.warnings.join("\n")); + // The committed fixture is what the converter now makes. + const { manifest } = await deriveFixture("paragraphs"); + assert.ok(!(manifest.timeline as Record<string, unknown>[]).some((e) => e.heading === "Coverage")); +}); diff --git a/common/lib/report/convertManifest.ts b/common/lib/report/convertManifest.ts @@ -435,6 +435,9 @@ export async function reportToManifest(raw: unknown, opts: ManifestOptions = {}) seconds: CARD_SECONDS.title, heading: report.title, sub: report.subtitle ?? "", + // The title card's third line (render-cards.mjs): empty until the + // operator writes one. A card without the key printed "undefined". + foot: "", }); const claimTag = (claim: Claim | null) => (claim?.verdict ? { claim: { id: claim.id, verdict: claim.verdict } } : {}); @@ -525,13 +528,15 @@ export async function reportToManifest(raw: unknown, opts: ManifestOptions = {}) }; for (const section of report.sections) { - timeline.push({ + const card = { type: "card", id: entryIds.claim(section.id, "section"), style: "chapter", seconds: CARD_SECONDS.chapter, heading: section.title, - }); + }; + timeline.push(card); + const at = timeline.length; for (const cid of citedIds(section.body)) await emit(cid, null); for (const claim of section.claims ?? []) { if (claim.sourceQuote) await emit(claim.sourceQuote.citation, claim, true); @@ -540,6 +545,13 @@ export async function reportToManifest(raw: unknown, opts: ManifestOptions = {}) if (cid !== claim.sourceQuote?.citation) await emit(cid, claim); } } + // A section with nothing to show (a trailing Coverage note, prose only) + // would be a chapter card followed by the next one — or, last, a silent + // card at the end of the cut. It gets none; the article keeps the section. + if (timeline.length === at) { + timeline.pop(); + warnings.push(`section "${section.title}" (${section.id}): nothing in it to show — no chapter card (the article keeps the section)`); + } } const channelSlug = [...channels.entries()].sort((a, b) => b[1] - a[1])[0]?.[0] ?? ""; diff --git a/common/testing/README.md b/common/testing/README.md @@ -18,5 +18,7 @@ transcript, channel or person goes in these fixtures, ever. | `draft/reports/`, `draft/manifests/` | `basic`, `posts-only`, `paragraphs` converted (`report.json`) and taken to a video manifest, as the converters make them today. | | `draft/derive.ts`, `draft/regenerate.ts` | How the derived files are made. After a converter change: `cd common && pnpm exec tsx testing/draft/regenerate.ts`, review the diff, commit. `fakes.test.ts` fails until they match. | -As committed (S0), the `paragraphs` manifest shows two owed bugs that release 27 S7 fixes: the title -card has no `foot`, and the Coverage section becomes a bare chapter card. S7 regenerates it. +As committed at S0, the `paragraphs` manifest showed two owed bugs: the title card had no `foot`, and +the Coverage section became a bare chapter card. Release 27 S7 fixed both and regenerated the files: +every title card has `foot: ""`, and a section with nothing to show (Coverage; `posts-only`'s Posts) +gets no chapter card. diff --git a/common/testing/draft/manifests/basic.video.manifest.json b/common/testing/draft/manifests/basic.video.manifest.json @@ -49,7 +49,8 @@ "style": "title", "seconds": 4, "heading": "Synth Kitchen — what the baker says about the bakery", - "sub": "" + "sub": "", + "foot": "" }, { "type": "card", diff --git a/common/testing/draft/manifests/paragraphs.video.manifest.json b/common/testing/draft/manifests/paragraphs.video.manifest.json @@ -49,7 +49,8 @@ "style": "title", "seconds": 4, "heading": "Paragraphs between findings", - "sub": "" + "sub": "", + "foot": "" }, { "type": "card", @@ -77,13 +78,6 @@ "end": 9.8, "cite": 5, "quote": "we tried the sourdough recipe from last week" - }, - { - "type": "card", - "id": "coverage", - "style": "chapter", - "seconds": 3.5, - "heading": "Coverage" } ] } diff --git a/common/testing/draft/manifests/posts-only.video.manifest.json b/common/testing/draft/manifests/posts-only.video.manifest.json @@ -49,14 +49,8 @@ "style": "title", "seconds": 4, "heading": "Posts only", - "sub": "" - }, - { - "type": "card", - "id": "posts", - "style": "chapter", - "seconds": 3.5, - "heading": "Posts" + "sub": "", + "foot": "" } ], "posts": [ diff --git a/umtool/report-to-video/render-cards.mjs b/umtool/report-to-video/render-cards.mjs @@ -94,7 +94,7 @@ const faceOf = (faces, role) => (faces ? { face: faces[role] } : {}); // Each style returns Pango markup for the whole card body. Blank lines are real // newlines in the markup — Pango honours them, which is how vertical rhythm is // set without positioning each run separately. -function markupFor(card, pal, faces = null) { +export function markupFor(card, pal, faces = null) { const H = (t, size = 62) => span(esc(t), { size, color: pal.fg, weight: "bold", ...faceOf(faces, "display") }); const KICKER = (t) => @@ -106,10 +106,13 @@ function markupFor(card, pal, faces = null) { return [ span(esc(card.heading), { size: 82, color: pal.fg, weight: "bold", ...faceOf(faces, "display") }), "", - span(esc(card.sub), { size: 38, color: pal.accent, ...faceOf(faces, "body") }), + // A title card without a `sub` or a `foot` (a manifest to-manifest + // made before release 27) renders them empty, as "" does — never the + // word "undefined". + span(esc(card.sub ?? ""), { size: 38, color: pal.accent, ...faceOf(faces, "body") }), "", "", - SUB(card.foot, 24), + SUB(card.foot ?? "", 24), ].join("\n"); case "chapter": diff --git a/umtool/report-to-video/title-card.test.mjs b/umtool/report-to-video/title-card.test.mjs @@ -0,0 +1,25 @@ +// The title card's markup (release 27 S7): a card without `sub` or `foot` — +// every manifest `reports to-manifest` made before release 27 lacked `foot` — +// renders them empty, never the word "undefined". +// +// Run with: node --test umtool/report-to-video/title-card.test.mjs + +import assert from "node:assert/strict"; +import test from "node:test"; +import { markupFor } from "./render-cards.mjs"; + +const PAL = { bg: "#000000", fg: "#ffffff", muted: "#888888", accent: "#c8752a", amber: "#ffc860" }; + +test("a title card with no foot and no sub: no 'undefined' in its markup", () => { + const markup = markupFor({ type: "card", id: "title", style: "title", heading: "A heading" }, PAL); + assert.ok(!markup.includes("undefined"), markup); + assert.match(markup, /A heading/); +}); + +test("a title card with an empty foot renders the same as one with none", () => { + const none = markupFor({ type: "card", id: "title", style: "title", heading: "H", sub: "S" }, PAL); + const empty = markupFor({ type: "card", id: "title", style: "title", heading: "H", sub: "S", foot: "" }, PAL); + assert.equal(none, empty); + const set = markupFor({ type: "card", id: "title", style: "title", heading: "H", sub: "S", foot: "Channel · 2026" }, PAL); + assert.match(set, /Channel · 2026/); +});