// A SYNTHETIC LARGE REPORT, for the page-size test (app/lib/reportSize.test.ts) // and for measuring a built page: 400 citations — 100 `source` citations of ONE // source that carries 300 archive links, 200 video spans and 100 posts — over // 100 claims in 10 sections, each claim with its source sentence, findings // citing two spans and a post inline, and those listed under it. // // Neutral generated text; the shape is what matters. import type { Report } from "yt-dlp-transcript-common/lib/report/schema"; import { buildReportPageView, type RecordView, type ReportPageView } from "yt-dlp-transcript-common/lib/report/views"; export const SYNTHETIC_REPORT_ID = "synthetic-large"; const WORDS = [ "harbor", "ledger", "council", "bridge", "orchard", "lantern", "meadow", "quarry", "signal", "timber", "valley", "warden", "beacon", "canyon", "delta", "ember", "falcon", "garnet", "hollow", "island", ]; // Claim i's sentence: words chosen by i, so claims differ and archive // contexts can be built to overlap exactly one of them. export function syntheticSentence(i: number): string { const w = (k: number) => WORDS[(i * 7 + k * 3) % WORDS.length]; return `In paragraph ${i} the article says the ${w(0)} ${w(1)} met the ${w(2)} ${w(3)} near the ${w(4)} in ${2000 + (i % 25)}.`; } export function syntheticReport(): Report { const archives = Array.from({ length: 300 }, (_, k) => ({ label: `archive ${k + 1}`, url: `https://web.archive.org/web/2026/https://example.org/ref/${k + 1}`, // Each archive link sits in claim (k % 100)'s sentence. context: syntheticSentence(k % 100), })); const citations: NonNullable = {}; for (let i = 0; i < 100; i++) { citations[`a${i}`] = { kind: "source", source: "s0", quote: syntheticSentence(i), image: `stills/a${i}.png` }; } for (let i = 0; i < 200; i++) { citations[`v${i}`] = { kind: "video", channel: "demo-channel", id: `vid${i % 40}`, start: 60 + i * 30, end: 80 + i * 30, pad: { before: 5, after: 5 }, quote: `Span ${i}: and that is when I said the ${WORDS[i % 20]} was never part of the plan, not once, not ever, and I stand by it today.`, verification: { quoteScore: 0.95, quoteCheckedAt: "2026-10-04T12:00:00Z", method: "token recall v1" }, }; } for (let i = 0; i < 100; i++) { citations[`p${i}`] = { kind: "post", channel: "demo-social", id: `${1000000 + i}`, quote: `Post ${i}: the ${WORDS[i % 20]} thing again? I covered it already, read the thread.`, }; } const sections: Report["sections"] = Array.from({ length: 10 }, (_, s) => ({ id: `section-${s}`, title: `Section ${s}`, body: `Section ${s} looks at ten claims.`, claims: Array.from({ length: 10 }, (_, c) => { const i = s * 10 + c; return { id: `claim-${i}`, title: `Claim ${i}`, text: syntheticSentence(i), verdict: (["CORROBORATED", "PARTLY", "CONTRADICTED", "NOT_FOUND", "UNTESTABLE"] as const)[i % 5], sourceQuote: { citation: `a${i}` }, findings: `The recordings say otherwise [here](cite:v${2 * i}) and [here](cite:v${2 * i + 1}); a [post](cite:p${i}) agrees.`, citations: [`v${2 * i}`, `v${2 * i + 1}`, `p${i}`], }; }), })); return { format: "archilyzer-report", version: 1, id: SYNTHETIC_REPORT_ID, kind: "factcheck", title: "A synthetic large fact-check", summary: "Four hundred citations of one source, spans and posts.", subject: { source: "s0" }, sources: { s0: { kind: "article", title: "A long example article", url: "https://example.org/long", publisher: "Example Gazette", archives, }, }, citations, sections, }; } const record = (channel: string, id: string): RecordView => ({ channel, channelTitle: "Demo Channel", id, title: `Demo record ${id}`, date: "2026-01-10", platform: "youtube", originalUrl: `https://media.example.org/${channel}/${id}`, }); export function syntheticReportView(report = syntheticReport()): ReportPageView { return buildReportPageView(report, { record: (c) => record(c.channel, c.id), post: (c) => ({ author: "@demo_account", text: `${c.quote}\n\nMore words after the quote.` }), }); }