commit 01a7780ce5c6dfdc9766088644c732be5b5fbf67
parent db8fa4a151d09e1776d10ccc1d90f104183c5715
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 19 Oct 2026 05:51:37 -0400
Merge r35/e2e-fixes: the phrase finder's kind from the registry; the editor stub fetches windows only for montage-ops' own channels
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
5 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/umtool/components/tools/PhraseFinder.tsx b/umtool/components/tools/PhraseFinder.tsx
@@ -275,12 +275,12 @@ export default function PhraseFinder({ state, initialScan, prefill }: { state: P
</Panel>
</form>
- {scan && <ScanResults scan={scan} names={names} onStop={stop} />}
+ {scan && <ScanResults scan={scan} names={names} onStop={stop} montageKind={state.montageKind} />}
</div>
);
}
-function ScanResults({ scan, names, onStop }: { scan: PhraseScanView; names: Map<string, string>; onStop: () => void }) {
+function ScanResults({ scan, names, onStop, montageKind }: { scan: PhraseScanView; names: Map<string, string>; onStop: () => void; montageKind: string }) {
const p = scan.progress;
if (scan.state === "running") {
const meter = p && p.total ? { fraction: p.done / p.total, text: `${p.done}/${p.total}` } : null;
@@ -314,7 +314,7 @@ function ScanResults({ scan, names, onStop }: { scan: PhraseScanView; names: Map
</p>
{rows.length > 1 && <Compare rows={rows} />}
{rows.map((r) => (
- <PhraseResult key={r.id} scan={scan} row={r} names={names} />
+ <PhraseResult key={r.id} scan={scan} row={r} names={names} montageKind={montageKind} />
))}
</div>
);
@@ -375,7 +375,7 @@ function YearBars({ years }: { years: Record<string, number> }) {
);
}
-function PhraseResult({ scan, row, names }: { scan: PhraseScanView; row: PhraseScanRowView; names: Map<string, string> }) {
+function PhraseResult({ scan, row, names, montageKind }: { scan: PhraseScanView; row: PhraseScanRowView; names: Map<string, string>; montageKind: string }) {
const s = row.summary;
const span = s.first ? `${String(s.first).slice(0, 4)}–${String(s.last).slice(0, 4)}` : "";
return (
@@ -440,7 +440,7 @@ function PhraseResult({ scan, row, names }: { scan: PhraseScanView; row: PhraseS
))}
</ol>
)}
- <CreateMontage scan={scan} row={row} />
+ <CreateMontage scan={scan} row={row} montageKind={montageKind} />
</Panel>
);
}
@@ -523,7 +523,7 @@ function Sample({ s, names }: { s: PhraseSample; names: Map<string, string> }) {
);
}
-function CreateMontage({ scan, row }: { scan: PhraseScanView; row: PhraseScanRowView }) {
+function CreateMontage({ scan, row, montageKind }: { scan: PhraseScanView; row: PhraseScanRowView; montageKind: string }) {
const router = useRouter();
const [slug, setSlug] = useState(() => montageSlug(row.label ?? row.text));
// The cap (release 35): N instances spread across the years; empty = all.
@@ -540,7 +540,7 @@ function CreateMontage({ scan, row }: { scan: PhraseScanView; row: PhraseScanRow
headers: { "content-type": "application/json" },
cache: "no-store",
body: JSON.stringify({
- kind: "report-video",
+ kind: montageKind,
slug: slug.trim(),
title: row.label ?? row.text,
seed: "phrase",
diff --git a/umtool/e2e/fixtures/editor-stub-fetch-windows.mjs b/umtool/e2e/fixtures/editor-stub-fetch-windows.mjs
@@ -8,6 +8,7 @@
// GET /api/jobs/<id>/log the job's log (ungated, as the editor's is): one line per window,
// ` ✗ <slug>/<id> <from>–<to> (<clipId>): network — … 403 …` for a refused one
//
+// Only the montage-ops fixture's channels are served (FETCH_WINDOWS_CHANNELS); any other body is a 404.
// A window already on disk (<CHANNELS_DIR>/<slug>/data/<id>/clips/<from>-<to>.mp4, or one that holds
// it) is cached. A video id starting `vrefuse` is the Rumble embed lookup answering 403: its window
// fails. Every other window is written (a real mp4, the stub's writeWindow) when its job finishes.
@@ -15,6 +16,14 @@
import { existsSync, readdirSync, readFileSync } from "node:fs";
import path from "node:path";
+// THE CHANNELS THIS DOOR SERVES: the montage-ops fixture's own. Any other
+// body is answered as an editor without the route (404), as before release 35:
+// the fixture corpus is shared, and a window written into another spec's
+// channel (testchan/vid1's clips/, the chain's windows step) changes what that
+// spec's cache lookup finds — specs must stay order-independent. And the
+// article chain's `windows` step relies on that 404 to stop (article-iterations.spec).
+export const FETCH_WINDOWS_CHANNELS = new Set(["opsrumble", "opsyt"]);
+
const fwJobs = new Map();
let next = 1;
@@ -44,6 +53,9 @@ export function fetchWindowsRoute(req, res, url, { channels, json, readBody, wri
if (req.method === "POST" && url.pathname === "/api/ops/fetch-windows") {
readBody(req, (body) => {
record({ route: "fetch-windows", ...(body ?? {}) });
+ if (Array.isArray(body?.items) && body.items.some((it) => !FETCH_WINDOWS_CHANNELS.has(String(it?.slug)))) {
+ return json(res, 404, { ok: false, error: "not found" });
+ }
if (!body?.requestedBy || !Array.isArray(body.items) || !body.items.length) return json(res, 400, { ok: false, error: "items and requestedBy are required" });
const cached = [];
const groups = new Map();
diff --git a/umtool/lib/phrase-finder/server.ts b/umtool/lib/phrase-finder/server.ts
@@ -6,6 +6,7 @@ import { CHANNELS_DIR, REPORTS_ROOT, cacheFile } from "@/lib/paths";
import { UMTOOL_DIR } from "@/lib/report/driver.mjs";
import { CHANNEL_RE, checkSpec } from "./scan.mjs";
import { summarisePhrase } from "./summary.mjs";
+import { MONTAGE_KIND } from "../projects/create.mjs";
import type { PhraseChannel, PhraseFinderState, PhraseScanRowView, PhraseScanSpec, PhraseScanView, PhraseSuggestion } from "./types";
// ---------------------------------------------------------------------------
@@ -300,6 +301,7 @@ export async function phraseFinderState(): Promise<PhraseFinderState> {
.slice(0, 8);
const known = new Set(channels.map((c) => c.slug));
return {
+ montageKind: MONTAGE_KIND,
channels,
suggestions,
last: last
diff --git a/umtool/lib/phrase-finder/types.ts b/umtool/lib/phrase-finder/types.ts
@@ -69,6 +69,8 @@ export type PhraseFinderState = {
last: { channels: string[]; prefer: string | null; exclude: string | null; rows: { text: string; mode: PhraseMode; label?: string }[] } | null;
running: string | null;
recent: string[];
+ // The project kind Create montage scaffolds (lib/projects/create.mjs MONTAGE_KIND).
+ montageKind: string;
};
export type TranscriptAround = {
diff --git a/umtool/lib/projects/create.mjs b/umtool/lib/projects/create.mjs
@@ -23,6 +23,9 @@ const SWEEP = "sweep-report";
/** The kind each scaffolding make writes. */
export const MAKE_KIND = { "video-recording": REPORT_VIDEO, "video-report": REPORT_VIDEO, song: SONG };
+/** The kind a montage from a phrase search is (the phrase finder's Create montage). */
+export const MONTAGE_KIND = REPORT_VIDEO;
+
/**
* The kind a make scaffolds, with what its form asks for (the registry's
* `scaffold`), or null when that kind cannot be scaffolded here.