// The REFRESH fixture (plans/umtool-redesign.md, R4): an article whose current // report was made by a traced sweep over Research's local corpus, and which // one recording there now matches that the sweep did not see. // // refreshfix/report.json the article (a draft), i1's report // refreshfix/iterations/1 a done sweep over harbor-radio: its // trace's enumeration of the research // phrase matched four recordings — // hr-2021a ("storm season") is not // among them, so the daily check finds // it new // refreshfix/iterations/current.json report i1 // // e2e/refresh.spec.ts plans and starts a Refresh against the editor stub // (which writes the refresh iteration and its refresh.json), and runs the // daily check through /api/articles/refresh/check. Synthetic, like every // fixture: the words are the research fixture's invented lines. import { mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; import { RESEARCH_PHRASE } from "./research-fixture.mjs"; export const REFRESH_ARTICLE = "refreshfix"; export const REFRESH_QUESTION = "What did Harbor Radio say about the lighthouse budget?"; /** The recording the check finds new (in the research fixture, not in i1's enumeration). */ export const REFRESH_NEW = { id: "hr-2021a", title: "Harbor Radio 52: storm season" }; const AT = "2026-10-14T09:00:00.000Z"; const put = (file, value) => { mkdirSync(path.dirname(file), { recursive: true }); writeFileSync(file, typeof value === "string" ? value : `${JSON.stringify(value, null, 2)}\n`); }; const QUOTE = `the ${RESEARCH_PHRASE} was never approved`; export const REFRESH_REPORT = { format: "archilyzer-report", version: 1, id: REFRESH_ARTICLE, kind: "sweep", title: "The lighthouse budget, on Harbor Radio", summary: "What the station said about it.", citations: { c1: { kind: "video", channel: "harbor-radio", id: "hr-2019a", start: 600, end: 604, quote: QUOTE, label: "Harbor Radio 1: the old pier", date: "2019-03-14" }, }, sections: [{ id: "the-budget", title: "The budget", claims: [{ id: "k1", text: "The budget was never approved", citations: ["c1"] }] }], }; // `article` and `channels`: another article like it (the unit tests' checks of // a build that is gone, or a scope the research corpus does not hold). export function makeRefreshFixture({ articles, source, article = REFRESH_ARTICLE, channels = ["harbor-radio"] }) { const REFRESH_ARTICLE_ = article; const it1 = path.join(articles, REFRESH_ARTICLE_, "iterations", "1"); put(path.join(it1, "iteration.json"), { format: "archilyzer-iteration", version: 1, article: REFRESH_ARTICLE_, n: 1, kind: "sweep", parent: null, copyOf: null, model: "claude-sonnet-5-5", question: REFRESH_QUESTION, scope: { channels }, status: "done", usage: { "claude-sonnet-5-5": { usd: 0.4, inputTokens: 20000, outputTokens: 1000, calls: 3 } }, coverage: { matched: 4, read: 4, partial: false, unreached: [] }, steps: [], createdAt: AT, updatedAt: AT, endedAt: AT, }); const ev = (e) => JSON.stringify({ at: AT, run: 1, ...e }); put( path.join(it1, "trace.jsonl"), [ ev({ t: "run", phase: "start", task: "sweep-agent", model: "claude-sonnet-5-5" }), ev({ t: "scope", source, channels, question: REFRESH_QUESTION, model: "claude-sonnet-5-5" }), ev({ t: "enumerate", query: RESEARCH_PHRASE, n: 4, ids: ["hr-2019a", "hr-2022a", "hr-2024a", "hr-2026a"], partial: false, unreached: [], counts: { "hr-2019a": 1, "hr-2022a": 1, "hr-2024a": 1, "hr-2026a": 1 } }), ev({ t: "run", phase: "end", status: "done", summary: "ok", usd: 0.4, minutes: 1 }), ].join("\n") + "\n", ); const report = { ...REFRESH_REPORT, id: REFRESH_ARTICLE_ }; put(path.join(it1, "report.json"), report); put(path.join(articles, REFRESH_ARTICLE_, "report.json"), report); put(path.join(articles, REFRESH_ARTICLE_, "iterations", "current.json"), { format: "archilyzer-iterations-current", version: 1, report: 1, reportFrom: 1, video: null, reportAt: AT, }); return { article: REFRESH_ARTICLE_ }; }