Archilyzer · Source

archilyzer

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

commit f092e65e1dbaaa65f55c74c55c0a9c9fe08eb404
parent fae9d78600ef8acf945d3eefb2bac6e76cf1555e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 14 Oct 2026 03:19:27 -0400

Merge r28/integration: release 28 smoke fix — Title Case short lines flagged, spelled-out numbers matched

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

Diffstat:
Mcommon/lib/report/draft/grounding.ts | 2++
Mcommon/lib/report/draft/tasks/onscreen.test.ts | 25+++++++++++++++++++++----
Mcommon/lib/report/draft/tasks/onscreen.ts | 26+++++++++++++++++++++++---
Mcommon/lib/report/draft/tasks/teaser.test.ts | 4+++-
Mcommon/lib/report/draft/tasks/teaser.ts | 9++++++---
5 files changed, 55 insertions(+), 11 deletions(-)

diff --git a/common/lib/report/draft/grounding.ts b/common/lib/report/draft/grounding.ts @@ -225,6 +225,8 @@ export function groundedProblems(text: string, reference: string, where = "the r const low = text.toLowerCase(); const refNorm = strictNormalize(reference); const refNums = new Set(reference.replace(/,/g, "").match(/\d+/g) ?? []); + // A number the reference spells out ("about four ferrets") is that number in digits too. + for (const w of refNorm.split(/\s+/)) if (NUM_WORDS[w] !== undefined) refNums.add(String(NUM_WORDS[w])); for (const d of text.match(/\d[\d,]*/g) ?? []) { if (!refNums.has(d.replace(/,/g, ""))) out.add(`number ${d} is not in ${where}`); } diff --git a/common/lib/report/draft/tasks/onscreen.test.ts b/common/lib/report/draft/tasks/onscreen.test.ts @@ -11,7 +11,8 @@ import os from "node:os"; import path from "node:path"; import { jsonReply, startFakeOllama, type FakeOllama } from "../../../../testing/llm/fakeOllama.mjs"; import { createIteration, projectOf, readIteration, updateIteration, writeIterationFile } from "../../iterations"; -import { checkOnscreen, isTitleCase, isVerbatimOf, onscreen, onscreenBatches, quotedParts, titleAsSentence, ONSCREEN_SPEC } from "./onscreen"; +import { checkOnscreen, isTitleCase, isVerbatimOf, onscreen, onscreenBatches, quotedParts, titleAsSentence, titleLineGrounding, ONSCREEN_SPEC } from "./onscreen"; +import { groundedProblems } from "../grounding"; import type { DraftFile } from "./media"; import type { TaskDeps } from "./types"; @@ -124,9 +125,10 @@ test("onscreen's checks, each alone", () => { assert.equal(isVerbatimOf("sel the", "I would never sell the bakery"), false, "whole words"); }); -test("onscreen: a Title Case title passes as its sentence case; an unknown name in one still fails (release 28 M9 ruling)", () => { +test("onscreen: a Title Case title passes as its sentence case; an unknown name in one is flagged soft (release 28 M9 ruling, smoke)", () => { const u = { quote: "I would never sell the bakery to a chain", evidence: "Report: Synth Kitchen\nSection: The bakery\nClaim: The baker says she will not sell to a chain.\nQuote: \"I would never sell the bakery to a chain\"\nSource: Bread day, 2026-01-05" }; const hard = (title: string) => checkOnscreen({ title }, u).hard; + const soft = (title: string) => checkOnscreen({ title }, u).soft; // Ordinary Title Case: every word capitalised, none a name. assert.deepEqual(hard("The Baker Will Never Sell The Bakery"), []); assert.deepEqual(hard("She Refuses To Sell To A Chain"), []); @@ -134,8 +136,11 @@ test("onscreen: a Title Case title passes as its sentence case; an unknown name // A name the evidence has keeps its capital and passes. assert.deepEqual(hard("Synth Kitchen Will Not Sell"), []); // A name it lacks still fails, Title Case or not. - assert.match(hard("Why Marco Says The Bakery Stays").join(), /name “Marco” is not in the clip's evidence/); - assert.match(hard("The Bakery Stays, Says Marco").join(), /name “Marco” is not in the clip's evidence/); + // In a Title Case title an unknown capital is soft (the review holds it): code + // cannot tell a headline word from a name the evidence lacks. + assert.match(soft("Why Marco Says The Bakery Stays").join(), /name “Marco” is not in the clip's evidence/); + assert.match(soft("The Bakery Stays, Says Marco").join(), /name “Marco” is not in the clip's evidence/); + assert.deepEqual(hard("Why Marco Says The Bakery Stays"), []); assert.match(hard("The bakery stays, says Marco").join(), /name “Marco” is not in the clip's evidence/); assert.equal(isTitleCase("The Baker Will Never Sell"), true); assert.equal(isTitleCase("The baker will never sell"), false); @@ -174,3 +179,15 @@ test("onscreen: the operator's text kept (forced, the draft an alternative); ent const sizes = onscreenBatches(many, small).map((b) => b.length); assert.ok(sizes.every((n) => n >= 1 && n < 8) && sizes.reduce((a, b) => a + b, 0) === 20, String(sizes)); }); + +test("short lines (release 28 smoke): a Title Case word the evidence lacks is soft, numbers stay hard; a spelled-out number matches its digits", () => { + const ev = "The rescue grew from about four ferrets to 56. Loki was found at 55."; + const t = titleLineGrounding("Ferret Rescue Expansion", ev, "the report"); + assert.deepEqual(t.hard, []); + assert.match(t.soft.join(), /name “Expansion”.*Title Case/); + // Not Title Case: an unknown name is hard, as it always was. + assert.match(titleLineGrounding("The rescue hired Gordon", ev, "the report").hard.join(), /name “Gordon”/); + // A number is hard in either case; "four" in the evidence is 4. + assert.match(titleLineGrounding("Ferret Rescue Grows To 70", ev, "the report").hard.join(), /number 70/); + assert.deepEqual(groundedProblems("Did they grow from 4 to 56?", ev), []); +}); diff --git a/common/lib/report/draft/tasks/onscreen.ts b/common/lib/report/draft/tasks/onscreen.ts @@ -115,6 +115,25 @@ export function titleAsSentence(title: string, evidence: string): string { }); } +/** + * The names-and-numbers check of one short line (an on-screen title, a teaser + * line). A Title Case line is checked in its sentence case (titleAsSentence), + * and what is left capitalised and absent from the evidence is SOFT: without a + * lexicon code cannot tell an ordinary headline word ("Expansion") from a name + * the evidence lacks, so it is said to the reviewer (the drafts review holds a + * final build until the line is approved) rather than refused. Numbers, and + * names in a line that is not Title Case, stay hard. + */ +export function titleLineGrounding(text: string, evidence: string, where: string): { hard: string[]; soft: string[] } { + if (!isTitleCase(text)) return { hard: groundedProblems(text, evidence, where), soft: [] }; + const hard: string[] = []; + const soft: string[] = []; + for (const p of groundedProblems(titleAsSentence(text, evidence), evidence, where)) { + (p.startsWith("name ") ? soft : hard).push(p.startsWith("name ") ? `${p} (a Title Case word — check it is not a name)` : p); + } + return { hard, soft }; +} + /** Every code check of one clip's on-screen text: `hard` refuses it. */ export function checkOnscreen(v: OnscreenValue, u: Pick<OnscreenUnit, "quote" | "evidence">): { hard: string[]; soft: string[] } { const hard: string[] = []; @@ -135,10 +154,11 @@ export function checkOnscreen(v: OnscreenValue, u: Pick<OnscreenUnit, "quote" | // Title Case title is checked in its sentence case (titleAsSentence): its // capitals are not a name's signal, so an ordinary word is lowercased and an // unknown name still stands out. - const said = `${titleAsSentence(title, u.evidence)}. ${sub.replace(QUOTED_RE, " ")}`; - hard.push(...groundedProblems(said, u.evidence, "the clip's evidence")); + const t = titleLineGrounding(title, u.evidence, "the clip's evidence"); + hard.push(...t.hard); + hard.push(...groundedProblems(sub.replace(QUOTED_RE, " "), u.evidence, "the clip's evidence")); hard.push(...firstPersonProblems(`${title}. ${sub}`)); - return { hard: [...new Set(hard)], soft: [] }; + return { hard: [...new Set(hard)], soft: [...new Set(t.soft)] }; } const stripCites = (s: string) => s.replace(/\[([^\]]+)\]\(cite:[^)]+\)/g, "$1").replace(/\(cite:[^)]+\)/g, "").replace(/\s+/g, " ").trim(); diff --git a/common/lib/report/draft/tasks/teaser.test.ts b/common/lib/report/draft/tasks/teaser.test.ts @@ -106,7 +106,9 @@ test("teaser's checks, each alone; the build's validateTeaser is one of them", a assert.match(hard(["Synth Kitchen", "“The bakery”", "The contest"]).join(), /line 2 has quotation marks/); assert.deepEqual(hard(["Synth Kitchen", "The baker's bakery", "The contest"]), [], "an apostrophe is not a quotation"); assert.match(hard(["Synth Kitchen", "The bakery", "In 2025"]).join(), /line 3: number 2025 is not in the report/); - assert.match(hard(["Synth Kitchen", "The bakery", "Ask Marco"]).join(), /line 3: name “Marco” is not in the report/); + assert.match(hard(["Synth Kitchen", "The bakery", "Then ask Marco"]).join(), /line 3: name “Marco” is not in the report/); + // A Title Case line's unknown capital is soft (the review holds it). + assert.match(checkTeaser(["Synth Kitchen", "The bakery", "Ask Marco"], u).soft.join(), /line 3: name “Marco”/); // A middle line is a title: past its row's fit, code sets its end as the // second tier; a line no split can fit (one long word) the build refuses. assert.deepEqual(hard(["Synth Kitchen", "The bakery and the contest and the oven", "The contest"]), []); diff --git a/common/lib/report/draft/tasks/teaser.ts b/common/lib/report/draft/tasks/teaser.ts @@ -18,7 +18,7 @@ import { strictNormalize } from "../../../citations/verify"; import { applyDraft, entriesWithId } from "../../drafted.mjs"; -import { groundedProblems } from "../grounding"; +import { titleLineGrounding } from "./onscreen"; import type { ManifestEntry, VideoManifest } from "../videoOps"; import type { DeckChecks } from "./deckChecks"; import { runMediaTask, type MediaContext, type MediaReport, type MediaTaskInput, type MediaTaskSpec, type MediaUnit } from "./media"; @@ -130,6 +130,7 @@ export const teaserEntryOf = (u: Pick<TeaserUnit, "entry" | "id">, lines: string /** Every code check of a teaser's lines: `hard` refuses them. */ export function checkTeaser(lines: string[], u: Pick<TeaserUnit, "entry" | "id" | "evidence" | "quotes" | "deck">): { hard: string[]; soft: string[] } { const hard: string[] = []; + const soft: string[] = []; if (lines.length < TEASER_MIN_LINES || lines.length > TEASER_MAX_LINES) hard.push(`${lines.length} lines (${TEASER_MIN_LINES} to ${TEASER_MAX_LINES})`); lines.forEach((l, i) => { const n = `line ${i + 1}`; @@ -139,13 +140,15 @@ export function checkTeaser(lines: string[], u: Pick<TeaserUnit, "entry" | "id" if (QUOTE_MARKS_RE.test(l)) hard.push(`${n} has quotation marks: a teaser reads no quote out`); const run = quoteRunIn(l, u.quotes); if (run) hard.push(`${n} repeats a quote ("${run}"): the clips say it; the teaser does not read it out`); - for (const p of groundedProblems(l, u.evidence, "the report")) hard.push(`${n}: ${p}`); + const g = titleLineGrounding(l, u.evidence, "the report"); + for (const p of g.hard) hard.push(`${n}: ${p}`); + for (const p of g.soft) soft.push(`${n}: ${p}`); }); if (!hard.length) { if (!u.deck) hard.push("the build's teaser check (deck.mjs validateTeaser) is not available, so the lines are not written"); else for (const e of u.deck.validateTeaser(teaserEntryOf(u, lines), `teaser ${u.id}`)) hard.push(`it would not build: ${e}`); } - return { hard, soft: [] }; + return { hard, soft }; } export function teaserSystem(): string {