import { test } from "node:test"; import assert from "node:assert/strict"; import { access, chmod, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; import type { Paths } from "../lib/paths"; import type { VerifyProbes } from "./verifyBeforeClean"; import { verifyBeforeClean } from "./verifyBeforeClean"; import { cleanAudioFromTranscribed } from "./cleanAudioFromTranscribed"; import { runQuickAvailabilityCheck } from "./quickAvailabilityCheck"; import { foldListing, normalizeListingEvidence, readListingEvidence, recordListing } from "./listingEvidence"; import { EnumerationIncompleteError } from "../ytdlp/runYtdlp"; // Run with: // pnpm --filter yt-dlp-transcript-common exec tsx --test controller/verifyNewerEvidence.test.ts // // NEWER EVIDENCE BEATS OLDER (lane verify-resume, review 1). A stored sighting // or a "public" probe vouches for a video only while nothing newer from its // source contradicts it; a cancelled listing is never a complete one; a stamp // from a wrong clock, a probe a later download contradicts and evidence of // another channel URL vouch for nothing. Temp corpus, a fake yt-dlp, stub // per-video probes; no network. const ROOT = await mkdtemp(path.join(tmpdir(), "verify-newer-")); process.env.SETTINGS_FILE = path.join(ROOT, "settings.json"); await writeFile(process.env.SETTINGS_FILE, JSON.stringify({ verifyAvailabilityBeforeClean: true })); process.on("exit", () => void rm(ROOT, { recursive: true, force: true })); const H = 3_600_000; const iso = (ms: number) => new Date(ms).toISOString(); const RU = "https://rumble.com/c/example"; const watch = (id: string) => `https://rumble.com/${id}-a-title.html`; const DAY_S = 86_400; const T_UPLOAD = 1_790_000_000; // seconds; upload times are relative to it let n = 0; type Video = { id: string; uploadedDaysAgo?: number; url?: boolean }; // A channel on `channelUrl` whose videos are transcribed and hold audio, and a // fake yt-dlp: the listing file from `-I :`, at most `limit` entries // then a 429; `mode` "fail" prints the listing then fails (not a rate limit), // "sleep" prints it then hangs (to be cancelled), "stop" exits 101. async function channel(channelUrl: string, videos: Video[]) { const dir = path.join(ROOT, `c${n++}`); await mkdir(dir, { recursive: true }); const bin = path.join(dir, "fake-ytdlp.sh"); await writeFile( bin, [ "#!/bin/sh", `d='${dir}'`, "start=1; prev=''", 'for a in "$@"; do if [ "$prev" = "-I" ]; then start="${a%%:*}"; fi; prev="$a"; done', 'echo "$start" >> "$d/calls"', 'mode=$(cat "$d/mode" 2>/dev/null)', 'if [ "$mode" = fail ]; then cat "$d/listing.txt"; echo "ERROR: [x] x: Unsupported URL" >&2; exit 1; fi', 'if [ "$mode" = sleep ]; then cat "$d/listing.txt"; exec sleep 30; fi', 'if [ "$mode" = stop ]; then cat "$d/listing.txt"; exit 101; fi', 'lim=$(cat "$d/limit" 2>/dev/null || echo 0)', 'awk -v s="$start" -v lim="$lim" \'NR>=s { if (lim>0 && c>=lim) exit; print; c++ }\' "$d/listing.txt"', 'left=$(awk -v s="$start" \'NR>=s\' "$d/listing.txt" | wc -l)', 'if [ "$lim" -gt 0 ] && [ "$left" -gt "$lim" ]; then echo "ERROR: [x] x: Unable to download webpage: HTTP Error 429: Too Many Requests" >&2; exit 1; fi', "exit 0", "", ].join("\n"), ); await chmod(bin, 0o755); const paths = { channelsDir: path.join(dir, "channels"), transcriptsDir: dir, ytdlpBin: bin, jobsDir: path.join(dir, ".jobs") } as unknown as Paths; await mkdir(path.join(paths.channelsDir, "ch", "data"), { recursive: true }); await writeFile(path.join(paths.channelsDir, "ch", "config.json"), JSON.stringify({ handling: "transcribe", name: "ch", url: channelUrl })); await writeFile(path.join(dir, "listing.txt"), ""); for (const v of videos) { const vd = path.join(paths.channelsDir, "ch", "data", v.id); await mkdir(vd, { recursive: true }); await writeFile(path.join(vd, "transcript.json"), "{}"); await writeFile(path.join(vd, "audio.mp3"), Buffer.alloc(10)); const meta: Record = { id: v.id }; if (v.uploadedDaysAgo !== undefined) meta.timestamp = T_UPLOAD - v.uploadedDaysAgo * DAY_S; if (v.url) meta.webpage_url = watch(v.id); await writeFile(path.join(vd, "metadata.info.json"), JSON.stringify(meta)); } const file = (name: string) => path.join(dir, name); return { paths, videoDir: (id: string) => path.join(paths.channelsDir, "ch", "data", id), calls: async () => (await readFile(file("calls"), "utf8").catch(() => "")).split("\n").filter(Boolean), setListing: (urls: string[]) => writeFile(file("listing.txt"), urls.length ? urls.join("\n") + "\n" : ""), setLimit: (k: number) => writeFile(file("limit"), String(k)), setMode: (m: "fail" | "sleep" | "stop") => writeFile(file("mode"), m), hasAudio: (id: string) => access(path.join(paths.channelsDir, "ch", "data", id, "audio.mp3")).then(() => true, () => false), pinned: (id: string) => access(path.join(paths.channelsDir, "ch", "data", id, "do-not-clean.json")).then(() => true, () => false), }; } // Per-video probes: answer `verdict(id)` for each id asked (written as // runAvailabilityCheck writes it), or leave it unprobed when undefined. function probesAnswering(paths: Paths, verdict: (id: string) => string | undefined) { const asked: string[] = []; const probes: VerifyProbes = { recordBackoff: async () => {}, full: async (opts) => { const probedIds: string[] = []; for (const id of opts.onlyIds ?? []) { asked.push(id); const v = verdict(id); if (!v) continue; await writeFile( path.join(paths.channelsDir, "ch", "data", id, "availability.json"), JSON.stringify({ checkedAt: new Date().toISOString(), checkedBy: "check", availability: v }), ); probedIds.push(id); } return { attempted: probedIds.length, checked: probedIds.length, skipped: 0, byStatus: {} as never, blocked: false, probedIds }; }, }; return { asked, probes }; } const clean = (paths: Paths, probes: VerifyProbes, lines: string[] = []) => cleanAudioFromTranscribed({ channelSlug: "ch", paths, onLog: (m) => lines.push(m), probes, assertReachable: async () => {} }); // --------------------------------------------------------------------------- // Finding 1: newer evidence beats older test("F1a, the reviewer's scenario on stored evidence: seen 08:00, deleted 12:00, a complete listing at 18:05 omits it — probed, pinned, audio kept", async () => { const c = await channel(RU, [{ id: "v1gone" }, { id: "v1here" }]); const now = Date.now(); // 08:00 (10 h ago): Sync's paged walk lists both. await recordListing(c.paths, "ch", { at: iso(now - 10 * H), source: "sync-paged", urls: [watch("v1gone"), watch("v1here")], complete: false, platform: "rumble", url: RU }); // 18:05 (just now): a complete whole listing names only v1here. await recordListing(c.paths, "ch", { at: iso(now - 60_000), source: "sync-full", urls: [watch("v1here")], complete: true, platform: "rumble", url: RU }); const { asked, probes } = probesAnswering(c.paths, () => "deleted"); await clean(c.paths, probes); assert.deepEqual(asked, ["v1gone"], "the older sighting does not vouch: it is asked about by itself"); assert.equal(await c.hasAudio("v1gone"), true); assert.equal(await c.pinned("v1gone"), true); assert.equal(await c.hasAudio("v1here"), false, "named by the newest listing: cleaned"); assert.deepEqual(await c.calls(), [], "no listing was needed"); }); test("F1a: a 'public' probe older than the newest complete listing that omits the video does not vouch either", async () => { const c = await channel(RU, [{ id: "v1gone" }, { id: "v1here" }]); const now = Date.now(); await writeFile( path.join(c.videoDir("v1gone"), "availability.json"), JSON.stringify({ checkedAt: iso(now - 20 * H), checkedBy: "check", availability: "public" }), ); await recordListing(c.paths, "ch", { at: iso(now - H), source: "quick-check", urls: [watch("v1here")], complete: true, platform: "rumble", url: RU }); const { asked, probes } = probesAnswering(c.paths, () => "private"); await clean(c.paths, probes); assert.deepEqual(asked, ["v1gone"]); assert.equal(await c.hasAudio("v1gone"), true); assert.equal(await c.pinned("v1gone"), true); }); test("F1b, the scenario in one job: seen 08:00, the job's own complete listing omits it — probed, pinned, audio kept", async () => { const c = await channel(RU, [{ id: "v1gone" }, { id: "v1new" }]); await recordListing(c.paths, "ch", { at: iso(Date.now() - 10 * H), source: "sync-paged", urls: [watch("v1gone")], complete: false, platform: "rumble", url: RU }); // v1new needs a listing; the job's Quick check completes and names only it. await c.setListing([watch("v1new"), watch("v1other")]); const { asked, probes } = probesAnswering(c.paths, () => "deleted"); const lines: string[] = []; await clean(c.paths, probes, lines); assert.deepEqual(await c.calls(), ["1"]); assert.deepEqual(asked, ["v1gone"]); assert.equal(await c.hasAudio("v1gone"), true); assert.equal(await c.pinned("v1gone"), true); assert.equal(await c.hasAudio("v1new"), false); }); test("F1c: a partial listing of this job overrules older evidence only over the stretch it covered", async () => { // Newest first: v1recent (1 day), v1listed (3 days), v1older (30 days). const c = await channel(RU, [ { id: "v1recent", uploadedDaysAgo: 1 }, { id: "v1listed", uploadedDaysAgo: 3 }, { id: "v1older", uploadedDaysAgo: 30 }, { id: "v1unseen", uploadedDaysAgo: 2 }, ]); const now = Date.now(); await recordListing(c.paths, "ch", { at: iso(now - 10 * H), source: "sync-paged", urls: [watch("v1recent"), watch("v1older")], complete: false, platform: "rumble", url: RU }); // The listing returns v1listed and stops: it covered everything newer than // v1listed's upload, where v1recent was — and did not name it. await c.setListing([watch("v1listed"), watch("v1x1"), watch("v1x2")]); await c.setLimit(1); const { asked, probes } = probesAnswering(c.paths, () => "public"); const r = await clean(c.paths, probes); assert.equal(r.stopped?.kind, "rate-limit"); assert.deepEqual(asked, [], "nothing is probed after a rate limit"); assert.equal(await c.hasAudio("v1recent"), true, "inside the stretch, not named: older sighting overruled"); assert.equal(await c.hasAudio("v1listed"), false, "named: cleaned"); assert.equal(await c.hasAudio("v1older"), false, "outside the stretch: its sighting still counts"); assert.equal(await c.hasAudio("v1unseen"), true); // The overruling is kept: the next run (whose listing answers nothing) does // not let the 10-hour-old sighting vouch for v1recent again. const ev = await readListingEvidence(c.paths, "ch"); assert.ok(ev.absent.v1recent); await c.setMode("fail"); await clean(c.paths, probes); assert.equal(await c.hasAudio("v1recent"), true); }); test("F1: the saved-video prune does not run while a video a newer listing overruled stays unconfirmed", async () => { const c = await channel(RU, [{ id: "v1gone" }, { id: "v1here" }]); const now = Date.now(); await recordListing(c.paths, "ch", { at: iso(now - 10 * H), source: "sync-paged", urls: [watch("v1gone")], complete: false, platform: "rumble", url: RU }); await recordListing(c.paths, "ch", { at: iso(now - H), source: "sync-full", urls: [watch("v1here")], complete: true, platform: "rumble", url: RU }); const lines: string[] = []; await clean(c.paths, probesAnswering(c.paths, () => undefined).probes, lines); assert.equal(await c.hasAudio("v1gone"), true); assert.ok(lines.some((l) => l.includes("prune skipped") && l.includes("a newer listing does not name")), lines.join("\n")); }); test("the prune: skipped after a partial listing, run when stored evidence alone verified everything", async () => { const c = await channel(RU, [{ id: "v1aaaa" }]); await recordListing(c.paths, "ch", { at: iso(Date.now() - H), source: "sync-paged", urls: [watch("v1aaaa")], complete: false, platform: "rumble", url: RU }); let lines: string[] = []; await clean(c.paths, probesAnswering(c.paths, () => undefined).probes, lines); assert.equal(await c.hasAudio("v1aaaa"), false); assert.ok(!lines.some((l) => l.includes("prune skipped")), lines.join("\n")); const d = await channel(RU, [{ id: "v1bbbb" }, { id: "v1cccc" }]); await d.setListing([watch("v1bbbb"), watch("v1zzzz")]); await d.setLimit(1); lines = []; await clean(d.paths, probesAnswering(d.paths, () => undefined).probes, lines); assert.ok(lines.some((l) => l.includes("prune skipped")), lines.join("\n")); }); test("a candidate uploaded after a stored complete listing: probed public, cleaned; probed deleted, pinned", async () => { const c = await channel(RU, [{ id: "v1okay" }, { id: "v1gone" }]); await recordListing(c.paths, "ch", { at: iso(Date.now() - H), source: "sync-full", urls: [watch("v1older")], complete: true, platform: "rumble", url: RU }); const { asked, probes } = probesAnswering(c.paths, (id) => (id === "v1okay" ? "public" : "deleted")); await clean(c.paths, probes); assert.deepEqual(asked.sort(), ["v1gone", "v1okay"]); assert.equal(await c.hasAudio("v1okay"), false); assert.equal(await c.hasAudio("v1gone"), true); assert.equal(await c.pinned("v1gone"), true); }); test("an empty complete listing from the Quick check: every candidate is probed, none pinned or cleaned unanswered", async () => { const c = await channel(RU, [{ id: "v1aaaa" }, { id: "v1bbbb" }]); await recordListing(c.paths, "ch", { at: iso(Date.now() - 2 * H), source: "sync-paged", urls: [watch("v1aaaa")], complete: false, platform: "rumble", url: RU }); await c.setListing([]); const { asked, probes } = probesAnswering(c.paths, () => undefined); const r = await clean(c.paths, probes); assert.deepEqual(asked.sort(), ["v1aaaa", "v1bbbb"], "the stored sighting is overruled by the newer empty listing"); assert.equal(r.cleanedDirs, 0); assert.equal(await c.pinned("v1aaaa"), false); }); test("a listing that fails for another reason than a rate limit after printing entries: nothing verified, nothing recorded", async () => { const c = await channel(RU, [{ id: "v1aaaa" }]); await c.setListing([watch("v1aaaa")]); await c.setMode("fail"); const r = await clean(c.paths, probesAnswering(c.paths, () => "public").probes); assert.equal(r.cleanedDirs, 0); assert.equal(r.stopped?.kind, "error"); assert.equal((await readListingEvidence(c.paths, "ch")).attempts.length, 0); }); test("an unreadable listing-evidence.json is no evidence: the check lists", async () => { const c = await channel(RU, [{ id: "v1aaaa" }]); await writeFile(path.join(c.paths.channelsDir, "ch", "listing-evidence.json"), '{"version":2,"url":"https://rumble.com/c/exa'); await c.setListing([watch("v1aaaa")]); const r = await clean(c.paths, probesAnswering(c.paths, () => undefined).probes); assert.deepEqual(await c.calls(), ["1"]); assert.equal(r.cleanedDirs, 1); }); test("ids match exactly: a listed 'AbC…' does not vouch for a directory 'abc…'", async () => { const yt = "https://www.youtube.com/@ch/videos"; const c = await channel(yt, [{ id: "abcdefghijk" }]); await recordListing(c.paths, "ch", { at: iso(Date.now() - H), source: "sync-paged", urls: ["https://www.youtube.com/watch?v=AbCdefghijk"], complete: false, platform: "youtube", url: yt }); await c.setMode("fail"); const v = await verifyBeforeClean({ channelSlug: "ch", paths: c.paths, candidateIds: ["abcdefghijk"], onLog: () => {}, probes: probesAnswering(c.paths, () => undefined).probes }); assert.equal(v.fromEvidence, 0); assert.deepEqual([...v.unverified], ["abcdefghijk"]); }); // --------------------------------------------------------------------------- // Finding 2: complete only at the lister's own normal end test("F2: a Quick check cancelled part-way records a partial listing, never a complete one", async () => { const c = await channel(RU, [{ id: "v1aaaa" }]); await c.setListing([watch("v1aaaa"), watch("v1bbbb")]); await c.setMode("sleep"); const ac = new AbortController(); setTimeout(() => ac.abort(), 1500); await assert.rejects(runQuickAvailabilityCheck({ channelSlug: "ch", paths: c.paths, onLog: () => {}, signal: ac.signal })); const ev = await readListingEvidence(c.paths, "ch"); assert.equal(ev.attempts.length, 1); assert.equal(ev.attempts[0].complete, false); // Nothing was concluded from the prefix either. await assert.rejects(readFile(path.join(c.paths.channelsDir, "ch", "maybe-missing.json"), "utf8")); }); test("F2: a listing yt-dlp stopped early (exit 101) is not complete", async () => { const c = await channel(RU, [{ id: "v1aaaa" }]); await c.setListing([watch("v1aaaa")]); await c.setMode("stop"); await assert.rejects(runQuickAvailabilityCheck({ channelSlug: "ch", paths: c.paths, onLog: () => {}, signal: new AbortController().signal })); assert.equal((await readListingEvidence(c.paths, "ch")).attempts[0]?.complete, false); }); // --------------------------------------------------------------------------- // Finding 3: a wrong clock, the probe rule, a changed URL test("F3: a stamp from a clock that was ahead is dropped by the next write and never becomes fresh", () => { const now = Date.parse("2026-11-21T12:00:00.000Z"); const ahead = now + 5 * 24 * H; // Written by a clock five days ahead. let r = foldListing(normalizeListingEvidence(null), { at: iso(ahead), source: "sync-paged", urls: [watch("v1aaaa")], complete: true, platform: "rumble", url: RU }, ahead); assert.equal(r.seen.v1aaaa, iso(ahead)); // The next write, by a right clock: the future stamp and attempt are gone. r = foldListing(r, { at: iso(now), source: "sync-paged", urls: [watch("v1bbbb")], complete: false, platform: "rumble", url: RU }, now); assert.equal(r.seen.v1aaaa, undefined); assert.deepEqual(r.attempts.map((a) => a.at), [iso(now)]); // A listing dated in the future is refused at write. r = foldListing(r, { at: iso(now + 2 * H), source: "sync-paged", urls: [watch("v1cccc")], complete: false, platform: "rumble", url: RU }, now); assert.equal(r.seen.v1cccc, undefined); assert.equal(r.attempts.length, 1); }); test("F3: a 'public' probe is evidence only by platformPresence's rule — not when a download since found it otherwise, nor dated in the future", async () => { const c = await channel(RU, [{ id: "v1auth" }, { id: "v1ahead" }]); const now = Date.now(); await writeFile(path.join(c.videoDir("v1auth"), "availability.json"), JSON.stringify({ checkedAt: iso(now - 2 * H), checkedBy: "check", availability: "public" })); await writeFile( path.join(c.videoDir("v1auth"), "download-outcome.json"), JSON.stringify({ videoId: "v1auth", webpageUrl: watch("v1auth"), status: "failed", startedAt: iso(now - H), finishedAt: iso(now - H + 60_000), attempts: [{ n: 0, kind: "download", handling: "youtube", usedCookies: false, ytdlpExitCode: 1, availabilityClass: "needs_auth" }], }), ); await writeFile(path.join(c.videoDir("v1ahead"), "availability.json"), JSON.stringify({ checkedAt: iso(now + 3 * H), checkedBy: "check", availability: "public" })); await c.setMode("fail"); const v = await verifyBeforeClean({ channelSlug: "ch", paths: c.paths, candidateIds: ["v1auth", "v1ahead"], onLog: () => {}, probes: probesAnswering(c.paths, () => undefined).probes }); assert.equal(v.fromEvidence, 0); assert.deepEqual([...v.unverified].sort(), ["v1ahead", "v1auth"]); }); test("F3: evidence taken from another channel URL is not used, and the new URL's first listing starts the record again", async () => { const other = "https://rumble.com/c/previous"; const c = await channel(RU, [{ id: "v1aaaa" }]); await recordListing(c.paths, "ch", { at: iso(Date.now() - H), source: "sync-full", urls: [watch("v1aaaa")], complete: true, platform: "rumble", url: other }); await c.setMode("fail"); const lines: string[] = []; const v = await verifyBeforeClean({ channelSlug: "ch", paths: c.paths, candidateIds: ["v1aaaa"], onLog: (m) => lines.push(m), probes: probesAnswering(c.paths, () => undefined).probes }); assert.equal(v.fromEvidence, 0); assert.deepEqual(await c.calls(), ["1"], "it listed the current URL"); assert.ok(lines.some((l) => l.includes("another channel URL"))); await recordListing(c.paths, "ch", { at: iso(Date.now()), source: "sync-paged", urls: [watch("v1bbbb")], complete: false, platform: "rumble", url: RU }); const ev = await readListingEvidence(c.paths, "ch"); assert.equal(ev.url, RU); assert.deepEqual(Object.keys(ev.seen), ["v1bbbb"]); assert.equal(ev.attempts.length, 1); }); // Keep the import used: the partial-listing error is what the fake's 429 becomes. void EnumerationIncompleteError; // --------------------------------------------------------------------------- // Review 2 test("R2-1: the newest complete listing is kept apart from the capped attempts — 25 later paged pages do not age its omission out", async () => { const c = await channel(RU, [{ id: "v1gone" }, { id: "v1here" }]); const now = Date.now(); await recordListing(c.paths, "ch", { at: iso(now - 10 * H), source: "sync-full", urls: [watch("v1gone"), watch("v1here")], complete: true, platform: "rumble", url: RU }); await recordListing(c.paths, "ch", { at: iso(now - 8 * H), source: "quick-check", urls: [watch("v1here")], complete: true, platform: "rumble", url: RU }); for (let i = 0; i < 25; i++) { await recordListing(c.paths, "ch", { at: iso(now - 7 * H + i * 60_000), source: "sync-paged", urls: [watch("v1here")], complete: false, platform: "rumble", url: RU }); } const { asked, probes } = probesAnswering(c.paths, () => "deleted"); await clean(c.paths, probes); assert.deepEqual(asked, ["v1gone"], "still contradicted: probed"); assert.equal(await c.pinned("v1gone"), true); assert.equal(await c.hasAudio("v1gone"), true); const ev = await readListingEvidence(c.paths, "ch"); assert.equal(ev.attempts.length, 20); assert.equal(ev.lastComplete?.source, "quick-check"); assert.deepEqual(ev.lastComplete?.ids, ["v1here"]); }); test("R2-3: a complete listing contradicts from its END — a sighting while it was still running does not vouch", async () => { const c = await channel(RU, [{ id: "v1gone" }, { id: "v1here" }]); const now = Date.now(); // The listing ran from 40 to 20 minutes ago; a paged page saw v1gone 30 // minutes ago, while it ran; the listing did not name it. await recordListing(c.paths, "ch", { at: iso(now - 30 * 60_000), source: "sync-paged", urls: [watch("v1gone")], complete: false, platform: "rumble", url: RU }); await recordListing(c.paths, "ch", { at: iso(now - 40 * 60_000), endedAt: iso(now - 20 * 60_000), source: "store-playlist", urls: [watch("v1here")], complete: true, platform: "rumble", url: RU }); const { asked, probes } = probesAnswering(c.paths, () => "deleted"); await clean(c.paths, probes); assert.deepEqual(asked, ["v1gone"]); assert.equal(await c.hasAudio("v1gone"), true); // A sighting AFTER the end does vouch (here: v1here, named by it, is cleaned). assert.equal(await c.hasAudio("v1here"), false); }); test("R2-3: a partial listing whose upload dates are not in order covers nothing beyond what it returned", async () => { const c = await channel(RU, [ { id: "v1aaaa", uploadedDaysAgo: 1 }, { id: "v1bbbb", uploadedDaysAgo: 40 }, { id: "v1cccc", uploadedDaysAgo: 2 }, { id: "v1seen", uploadedDaysAgo: 10 }, ]); await recordListing(c.paths, "ch", { at: iso(Date.now() - 5 * H), source: "sync-paged", urls: [watch("v1seen")], complete: false, platform: "rumble", url: RU }); // Returned out of date order (1, 40, 2 days), then a 429. await c.setListing([watch("v1aaaa"), watch("v1bbbb"), watch("v1cccc"), watch("v1more")]); await c.setLimit(3); const lines: string[] = []; await clean(c.paths, probesAnswering(c.paths, () => undefined).probes, lines); assert.equal(await c.hasAudio("v1aaaa"), false, "returned: cleaned"); assert.equal(await c.hasAudio("v1seen"), false, "nothing is assumed about an omission: its sighting still counts"); assert.ok(lines.some((l) => l.includes("not in upload order")), lines.join("\n")); });