// THE INSPECTOR PANELS (umtool redesign L6; e2e/inspector-*.spec.ts): one WRITABLE project per panel, each // play-cut-fixture's cut (c01 c02 k01 c03 c04 on playvid, its window cached in out/clips-raw) unless said, each // with a made take (takes/short/take.json) the specs check is never written -- every UI edit lands in the draft. // // inspector-provenance-fixture provenance with no channelSlug (the gap `umtool new` leaves) and an old origin // inspector-title-fixture the title, a subtitle // inspector-teaser-fixture no teaser yet // inspector-ledger-fixture a MEASURE ledger (one value track, one regime track) with two rows, w01 pinned to c01 // inspector-post-fixture two post items -- p-long (a long text post, an excerpt picked by selection) and // p-vid (a video with sound, and a picture of the post it does not carry) -- from // post-items-fixture's archive files // inspector-rumble-fixture three Rumble clips on inspectrumble, two naming a URL-slug FOLDER the archive does not // serve (v7slug1 -> v7emb01, v7slug2 -> v7emb02, in the project's .shadow-channels), // one its own; out/links.json records both folder links dead // inspector-still-fixture the cut alone (Play's Still button) // // Synthetic, like every fixture. import { spawnSync } from "node:child_process"; import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import path from "node:path"; const TAKE = (dir) => JSON.parse(readFileSync(path.join(dir, "takes", "short", "take.json"), "utf8")); /** * @param {{ reports: string, channels: string, deckManifest: Function, cachedWindow: string, makePlayCutFixture: Function }} o */ export async function makeInspectorFixtures({ reports, channels, deckManifest, cachedWindow, makePlayCutFixture }) { const cut = (name, title, edit = (m) => m) => { const { dir } = makePlayCutFixture({ reports, deckManifest, cachedWindow, name, title }); const file = path.join(dir, "video.manifest.json"); const m = edit(JSON.parse(readFileSync(file, "utf8"))); writeFileSync(file, JSON.stringify(m, null, 2) + "\n"); TAKE(dir); // the take is there to be left alone return dir; }; cut("inspector-provenance-fixture", "The Inspector Provenance Fixture", (m) => ({ ...m, provenance: { siteOrigin: "https://old.example" } })); cut("inspector-title-fixture", "The Inspector Title Fixture", (m) => ({ ...m, subtitle: "an old subtitle" })); cut("inspector-teaser-fixture", "The Inspector Teaser Fixture"); cut("inspector-still-fixture", "The Inspector Still Fixture"); cut("inspector-ledger-fixture", "The Inspector Ledger Fixture", (m) => ({ ...m, ledgerSchema: { kind: "measure", unit: "lb", yLabel: "POUNDS", yMin: 200, yMax: 400, tracks: [ { key: "weight", role: "value", label: "What he says he weighs" }, { key: "regime", role: "regime", label: "The diet he names", regimes: ["keto", "off"] }, ], forms: ["current", "past", "delta", "status"], regimes: [{ key: "keto", label: "Keto" }, { key: "off", label: "No diet" }], fields: [], }, ledger: [ { id: "w01", date: "2026-10-01", asOf: null, scope: "weight", population: "current", value: 291, display: "291 lb", label: "on the scale", scopeBasis: "his words: I weigh 291", scopeConfidence: "read", valueKind: "uttered", flags: [], entryId: "c01", channel: "inspchan", video: "playvid", cite: 1 }, { id: "d01", date: "2026-09-01", asOf: null, scope: "regime", population: "status", value: "keto", event: "start", display: "keto", label: "starts keto", scopeBasis: "I'm doing keto", scopeConfidence: "read", valueKind: "uttered", flags: [] }, ], })); // ---- post items -------------------------------------------------------------------------------------------- { const name = "inspector-post-fixture"; const dir = path.join(reports, name); const media = path.join(dir, "posts-media", "postchan-x", "3"); mkdirSync(media, { recursive: true }); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "playvid_0.00-9.00.mp4")); const cap = path.join(channels, "postchan-x", "posts-media"); copyFileSync(path.join(cap, "3", "3_1.mp4"), path.join(media, "3_1.mp4")); copyFileSync(path.join(cap, "2", "2_1.png"), path.join(media, "3_2.png")); const base = (id, text, o = {}) => ({ type: "post", id, post: `postchan-x/${id.slice(2)}`, platform: "x", author: "Post Subject", handle: "postsubject", date: "2026-10-30T12:00:00.000Z", text, url: `https://x.com/postsubject/status/${id.slice(2)}`, subjects: ["postsubject"], ...o, }); const timeline = [ { type: "clip", id: "c01", video: "playvid", start: 1.0, end: 3.0, cite: 1, section: 0, lock: true, quote: "This is a complete sentence." }, base("p-5", "The scale said 291 this morning. I said the scale was broken, and then the scale said 290 by the evening. Nobody believes the scale anyway."), base("p-3", "@someone_private Yes, and here is the video.", { media: [{ src: "posts-media/postchan-x/3/3_1.mp4", kind: "video", seconds: 4, width: 320, height: 180, audio: true }] }), ]; const m = deckManifest(name, "The Inspector Post Fixture", timeline); m.provenance = { ...m.provenance, channelSlug: "postchan-x" }; m.render.fetchPad = 0; m.render.lockedEdges = false; writeFileSync(path.join(dir, "video.manifest.json"), JSON.stringify(m, null, 2) + "\n"); // "Use my recording"'s file: a second and a half of a tone with silence either side (the trim keeps the tone). const wav = path.join(path.dirname(reports), "inspector-recording.wav"); const ff = spawnSync("ffmpeg", ["-nostdin", "-v", "error", "-y", "-f", "lavfi", "-i", "sine=frequency=330:duration=1.5", "-af", "adelay=400|400,apad=pad_dur=0.4", "-ar", "48000", "-ac", "1", wav], { encoding: "utf8" }); if (ff.status !== 0) throw new Error(`ffmpeg failed: ${ff.stderr}`); mkdirSync(path.join(dir, "takes", "short"), { recursive: true }); writeFileSync(path.join(dir, "takes", "short", "take.json"), JSON.stringify({ id: "short", group: "takes", order: 1, label: "Short", kind: "different", preview: "preview.mp4", window: "full", style: null, patch: { timeline: [timeline[1]] } }, null, 2) + "\n"); } // ---- Rumble clips naming the URL-slug folder --------------------------------------------------------------- { const dir = cut("inspector-rumble-fixture", "The Inspector Rumble Fixture", (m) => ({ ...m, provenance: { siteOrigin: "https://archive.example", channelSlug: "inspectrumble", channelsFallback: false }, timeline: [ { type: "clip", id: "r01", video: "v7slug1", start: 1.0, end: 3.0, cite: 1, section: 0, lock: true, quote: "the first" }, { type: "clip", id: "r02", video: "v7slug2", start: 3.5, end: 5.5, cite: 4, section: 0, lock: true, quote: "the second" }, { type: "clip", id: "r03", video: "v7own03", start: 6.0, end: 8.0, cite: 6, section: 0, lock: true, quote: "its own id" }, ], })); const ch = path.join(dir, ".shadow-channels", "inspectrumble"); writeFileSync(path.join(mkdirP(ch), "config.json"), JSON.stringify({ platform: "rumble", handling: "transcribe", url: "https://rumble.com/c/inspectrumble", name: "Inspect Rumble" }, null, 2)); for (const [folder, id] of [["v7slug1", "v7emb01"], ["v7slug2", "v7emb02"], ["v7own03", "v7own03"]]) { writeFileSync(path.join(mkdirP(path.join(ch, "data", folder)), "metadata.info.json"), JSON.stringify({ id, extractor: "Rumble", webpage_url: `https://rumble.com/${folder}-a-title.html`, title: `Recording ${folder}` })); } // The last link check: both folder links dead (the archive serves the embed ids), the own id open -- each // QR's link as the build draws it (linkCheck.mjs linksOf), so the panel reads them against the cut as it is. const { linksOf, withArchiveId } = await import("../../lib/report/linkCheck.mjs"); const m = JSON.parse(readFileSync(path.join(dir, "video.manifest.json"), "utf8")); const embed = { r01: ["v7slug1", "v7emb01"], r02: ["v7slug2", "v7emb02"] }; writeFileSync(path.join(mkdirP(path.join(dir, "out")), "links.json"), JSON.stringify({ version: 1, checkedAt: "2026-11-08T10:00:00.000Z", fetched: 3, origins: { "https://archive.example": { state: "ok", generatedAt: "2026-11-07T10:00:00.000Z", title: "Archive" } }, links: linksOf(m).map((l) => { const e = embed[l.clip]; return e ? { clip: l.clip, url: l.url, state: "dead", origin: "https://archive.example", why: `no record ${e[0]}`, fix: withArchiveId(l.url, e[0], e[1]), fixSiteVideo: e[1] } : { clip: l.clip, url: l.url, state: "ok", origin: "https://archive.example" }; }), }, null, 2) + "\n"); } } function mkdirP(d) { mkdirSync(d, { recursive: true }); return d; }