Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 9730269a39c091976b67e27bf240783c2de7c148
parent da811d8b677feba193367e1a0bcf468e3bed1ff0
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 11 Nov 2026 11:24:08 -0500

chain: cut-windows asks the editor only for the windows the build would not find on disk (demo epic D1 item 5)

The build looks for a clip's window in the project's out/clips-raw, then the
corpus's windows, then a saved recording (report-to-video/sources.mjs) before
any fetch; cut-windows now asks the editor for the misses only, and is done
with nothing to ask when the cut's windows are held. The whole umtool run at
0744a701 lost both Draft everything tests in media-surfaces to it: the msurf
project holds its cut's window in clips-raw, and the stub editor does not
serve that channel's windows. Test: a cut whose windows are in clips-raw
passes the step with the editor a closed port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Diffstat:
Mumtool/lib/report/chain-run.mjs | 15++++++++++++++-
Mumtool/lib/report/chain-run.test.mjs | 17+++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/umtool/lib/report/chain-run.mjs b/umtool/lib/report/chain-run.mjs @@ -56,6 +56,7 @@ import { deckChrome, deckRefusedDetail, deckStepDetail, draftFileOf, draftOutcom import { ChromeRefused, addDeckChrome } from "./manifest.mjs"; import { socialTexts } from "umtool-report-to-video/social"; import { PIPELINE_DIR } from "./driver.mjs"; +import { resolveLocalSource } from "umtool-report-to-video/sources"; import { dedupeMedia, seedFromParent } from "./iterations.mjs"; import { tmpPathFor } from "yt-dlp-transcript-common/lib/atomicFile.mjs"; import { WHOLE_RECORDING_REFUSED, originOfHandle } from "yt-dlp-transcript-common/lib/remoteArchives"; @@ -178,7 +179,19 @@ const STEPS = { if (!manifest) throw new StepFailed(`no video manifest at ${file}: run the chain's manifest step first`); const body = cutWindows(manifest, { pad: CHAIN_WINDOW_PAD, requestedBy: `umtool chain ${ctx.article} i${ctx.n} cut` }); if (body.items.length === 0) return "the cut has no clip"; - return fetchWindowsStep(ctx, body, "of the cut's"); + // What the build would find on disk is not asked for: the project's own + // out/clips-raw, the corpus's windows, a saved recording (sources.mjs, the + // build's lookup order). + const rawDir = path.join(ctx.project, "out", "clips-raw"); + const missing = []; + for (const item of body.items) { + const hit = await resolveLocalSource({ video: item.id, slug: item.slug, from: item.from, to: item.to }, { rawDir, channelsDir: ctx.paths.channelsDir }).catch(() => null); + if (!hit) missing.push(item); + } + if (missing.length === 0) return `the cut's ${body.items.length} window(s) are on disk already`; + const held = body.items.length - missing.length; + const said = await fetchWindowsStep(ctx, { ...body, items: missing }, "of the cut's"); + return held ? `${said}; ${held} on disk already` : said; }, async prepare(ctx) { diff --git a/umtool/lib/report/chain-run.test.mjs b/umtool/lib/report/chain-run.test.mjs @@ -175,3 +175,20 @@ test("manifest: with no sweep.md naming an origin, the archive the sweep read (s const m = json(path.join(PROJECTS, "synth-remote", "i1", "video.manifest.json")); assert.equal(m.provenance.siteOrigin, "https://stub.test"); }); + +test("cut-windows (Draft everything, demo epic D1): the cut's windows the project already holds are not asked of the editor", () => { + // i2's project: its manifest (from the manifest test) and the cut's window in out/clips-raw. + const project = path.join(PROJECTS, "synth-basic", "i2"); + const m = json(path.join(project, "video.manifest.json")); + const clips = (m.timeline ?? []).filter((e) => e.type === "clip"); + assert.ok(clips.length > 0); + for (const c of clips) { + const from = Math.max(0, Math.floor((c.start - 3) * 100) / 100); + const to = Math.ceil((c.end + 3) * 100) / 100; + put(path.join(project, "out", "clips-raw", `${c.video}_${from.toFixed(2)}-${to.toFixed(2)}.mp4`), Buffer.alloc(64, 1)); + } + // The editor is a closed port: had the step asked it, it would have failed. + const r = step(2, "cut-windows", "--mode", "draft-all"); + assert.equal(r.code, 0, r.out); + assert.match(recorded(2)["chain:cut-windows"].detail, /the cut's \d+ window\(s\) are on disk already/); +});