commit 894db7f963cace8ede03472f7221bc7c773cbf08
parent bfe860703b5bd3c84be4b95e5a2703fccaca673e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 26 Oct 2026 07:22:17 -0400
umtool check: clip-no-cues names its fix (pnpm ops build-cues for that video)
A video directory that is in the corpus gets the build-cues command for that one
video; one that is not there gets the Rumble two-ids check.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/umtool/lib/projects/report.mjs b/umtool/lib/projects/report.mjs
@@ -517,6 +517,28 @@ async function probeContainerMemo(file) {
return info;
}
+/**
+ * What to run for a clip whose video has no transcript.cues.json. A video
+ * directory that is there has its transcript, and the cue file is built from
+ * it: `pnpm ops build-cues` for that one video (an editor job on the
+ * channel's queue). One that is not there is not in this corpus under that id
+ * -- almost always the Rumble two-ids trap.
+ *
+ * @param {Record<string, any>} m
+ * @param {Record<string, any>} e
+ * @param {string | null} file cuePathFor's answer
+ */
+export async function noCuesFix(m, e, file) {
+ const chan = channelFor(m, e);
+ if (!file || !chan) return "The manifest names no channel for it: set provenance.channelSlug, or the clip's channel";
+ const dirThere = await stat(path.dirname(file)).then((st) => st.isDirectory(), () => false);
+ if (!dirThere) {
+ return `The corpus has no ${chan}/${e.video}. On Rumble, check \`video\` is the URL slug and not the site id`;
+ }
+ const json = JSON.stringify({ slug: chan, ids: [String(e.video)] });
+ return `Build it: pnpm ops build-cues --json '${json}' --wait`;
+}
+
export const cuePathFor = (m, e, channelsDir) => {
const chan = channelFor(m, e);
if (!chan) return null;
@@ -1082,11 +1104,15 @@ export async function reportDecisions(ctx, summary) {
// manifest that builds cleanly.
const cited = src.clips?.length ?? 0;
const claimed = src.claims?.length ?? 0;
+ const fix =
+ src.state === "no-cues" && cited && typeof src.video === "string"
+ ? ` ${await noCuesFix(m, { video: src.video, channel: src.channel ?? undefined }, cuePathFor(m, { video: src.video, channel: src.channel ?? undefined }, channelsDir))}`
+ : "";
add(
src.state === "no-cues" ? "clip-no-cues" : "clip-unfetchable",
src.key,
cited
- ? `${src.state} — ${cited} clip(s) cite it; the build dies here`
+ ? `${src.state} — ${cited} clip(s) cite it; the build dies here${fix ? `.${fix}` : ""}`
: `${src.state} — no clip cites it${claimed ? `, ${claimed} ledger claim(s) do` : ""}. ` +
"A cut that quotes it on a card is unaffected; one that adds a clip from it will not build",
cited ? "blocking" : "info",
@@ -1121,8 +1147,7 @@ export async function reportDecisions(ctx, summary) {
shadowBuilder
? "no transcript.cues.json — but this project ships make-shadow-channels.sh, " +
`which is what puts it there. Run it before building ${list.map((e) => e.id).join(", ")}`
- : `no transcript.cues.json — the build dies at ${list.map((e) => e.id).join(", ")}. ` +
- "On Rumble, check `video` is the URL slug and not the site id",
+ : `no transcript.cues.json — the build dies at ${list.map((e) => e.id).join(", ")}. ${await noCuesFix(m, list[0], file)}`,
"blocking",
);
}
diff --git a/umtool/lib/report/no-cues-fix.test.mjs b/umtool/lib/report/no-cues-fix.test.mjs
@@ -0,0 +1,42 @@
+// `umtool check`'s clip-no-cues names its fix: a video directory that is in
+// the corpus has its cue file built by `pnpm ops build-cues` for that one
+// video; one that is not there is the Rumble two-ids trap (or not archived).
+//
+// Run with: pnpm test:scripts
+import assert from "node:assert/strict";
+import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import path from "node:path";
+import test from "node:test";
+
+import { decisionsFor } from "../projects/core.mjs";
+import { walkProjects } from "../projects/walk.mjs";
+
+test("clip-no-cues: the build-cues command for a video that is here, the Rumble hint for one that is not", async () => {
+ const root = await mkdtemp(path.join(tmpdir(), "no-cues-fix-"));
+ try {
+ const channelsDir = path.join(root, "channels");
+ const reportsRoot = path.join(root, "reports");
+ // "here" is archived (its transcript, no cue file yet); "gone" has no directory at all.
+ await mkdir(path.join(channelsDir, "chan", "data", "here"), { recursive: true });
+ await writeFile(path.join(channelsDir, "chan", "data", "here", "transcript.en.vtt"), "WEBVTT\n");
+ const dir = path.join(reportsRoot, "cut");
+ await mkdir(dir, { recursive: true });
+ await writeFile(path.join(dir, "video.manifest.json"), JSON.stringify({
+ schemaVersion: 1, slug: "cut", title: "Cut",
+ provenance: { channelSlug: "chan", channelsDir: path.relative(dir, channelsDir), siteOrigin: "https://example.test" },
+ render: { width: 1920, height: 1080, fps: 30, transition: 0.5 },
+ timeline: [
+ { type: "clip", id: "a", video: "here", start: 10, end: 20, cite: 10 },
+ { type: "clip", id: "b", video: "gone", start: 10, end: 20, cite: 10 },
+ ],
+ }, null, 2));
+ const [ref] = (await walkProjects(reportsRoot)).filter((p) => p.id === "cut");
+ const ds = (await decisionsFor(ref, reportsRoot)).filter((d) => d.kind === "clip-no-cues");
+ const by = Object.fromEntries(ds.map((d) => [d.target, d.why]));
+ assert.match(by["chan/here"], /the build dies at a\. Build it: pnpm ops build-cues --json '\{"slug":"chan","ids":\["here"\]\}' --wait$/);
+ assert.match(by["chan/gone"], /the build dies at b\. The corpus has no chan\/gone\. On Rumble, check `video` is the URL slug/);
+ } finally {
+ await rm(root, { recursive: true, force: true });
+ }
+});