// What article-delete.spec.ts deletes (release 27 follow-up): its own, so the // other specs' fixtures (zeta, the report projects) are never touched. // // articles/omega/ (makeOmega, written by the spec) a DRAFT // article (report.json) with iterations: // iterations/1 sweep, done; project gen-projects/omega/i1 // iterations/2 revise-report of i1, done: the CURRENT article // iterations/3 a copy of i1, done; project gen-projects/omega/i3 // iterations/current.json report i2 // articles/psi/ an article IN THE MAKING: i1 only // reports/delete-fixture/ a report-video project with out/ and two takes: // takes/keep/ its manifest IS the project's (refused) // takes/drop/ another (deleted) // // Synthetic, like every fixture: invented text, the fixture's own channel. import { mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; const put = (file, value) => { mkdirSync(path.dirname(file), { recursive: true }); writeFileSync(file, typeof value === "string" ? value : JSON.stringify(value, null, 2) + "\n"); }; const AT = "2026-10-13T10:00:00.000Z"; const CITE = { kind: "video", channel: "sitechan", id: "sv1", start: 3, end: 6, quote: "The vote was rigged and everybody knew.", speaker: "Site Channel", date: "2024-03-15" }; const report = (id, title) => ({ format: "archilyzer-report", version: 1, id, kind: "sweep", title, citations: { c1: CITE }, sections: [{ id: "s1", title: "The claim", body: "She said [the vote was rigged](cite:c1) in the first stream." }], }); const iteration = (article, n, extra) => ({ format: "archilyzer-iteration", version: 1, article, n, parent: null, copyOf: null, status: "done", model: "qwen3:8b", question: "What did the channel say about the vote?", scope: { channels: ["sitechan"] }, usage: {}, steps: [], createdAt: AT, updatedAt: AT, endedAt: AT, ...extra, }); const videoManifest = (title) => ({ title, provenance: { siteOrigin: "https://archive.example" }, // /browse scans every project: no origin is a BLOCKING defect timeline: [ { type: "card", id: "t0", heading: title, narration: { text: "What the channel said about the vote." } }, { type: "clip", id: "a1", video: "sv1", channel: "sitechan", start: 3, end: 6, quote: "The vote was rigged" }, ], }); // omega: a draft with three iterations, i2 current — written by the spec // itself (beforeAll) and removed after, because a draft is a row of /articles // and articles.spec.ts counts the store's rows. export function makeOmega({ articles, projects }) { const its = (id, n) => path.join(articles, id, "iterations", String(n)); put(path.join(articles, "omega", "report.json"), report("omega", "Omega: the vote, revised")); put(path.join(its("omega", 1), "iteration.json"), iteration("omega", 1, { kind: "sweep", projectDir: path.join(projects, "omega", "i1") })); put(path.join(its("omega", 1), "report.json"), report("omega", "Omega: the vote")); put(path.join(its("omega", 2), "iteration.json"), iteration("omega", 2, { kind: "revise-report", parent: 1, feedback: "Say when.", question: undefined })); put(path.join(its("omega", 2), "report.json"), report("omega", "Omega: the vote, revised")); put(path.join(its("omega", 3), "iteration.json"), iteration("omega", 3, { kind: "sweep", copyOf: 1, model: "claude-haiku-4-5", projectDir: path.join(projects, "omega", "i3") })); put(path.join(its("omega", 3), "report.json"), report("omega", "Omega: the vote, on another model")); put(path.join(articles, "omega", "iterations", "current.json"), { format: "archilyzer-iterations-current", version: 1, report: 2, reportFrom: 2, video: null, reportAt: AT }); for (const n of [1, 3]) { put(path.join(projects, "omega", `i${n}`, "video.manifest.json"), videoManifest(`Omega i${n}`)); put(path.join(projects, "omega", `i${n}`, "out", "omega.mp4"), "not really a video\n"); } } export function makeDeleteFixture({ dest, articles, reports }) { const its = (id, n) => path.join(articles, id, "iterations", String(n)); // psi: in the making (not a row of /articles: listed "in the making"). put(path.join(its("psi", 1), "iteration.json"), iteration("psi", 1, { kind: "sweep" })); put(path.join(its("psi", 1), "report.json"), report("psi", "Psi: a first look")); // A report-video project with two takes. const project = path.join(reports, "delete-fixture"); const m = videoManifest("The Delete Fixture"); put(path.join(project, "video.manifest.json"), m); put(path.join(project, "out", "final", "delete-fixture.mp4"), "not really a video\n"); for (const [id, order, manifest] of [ ["keep", 1, m], ["drop", 2, { ...m, title: "The Delete Fixture, shorter" }], ]) { put(path.join(project, "takes", id, "take.json"), { id, group: "ending", order, label: id === "keep" ? "Kept ending" : "Dropped ending", kind: "similar", preview: "preview.mp4" }); put(path.join(project, "takes", id, "preview.mp4"), "not really a video\n"); put(path.join(project, "takes", id, "video.manifest.json"), manifest); } return { project }; }