Archilyzer · Source

archilyzer

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

commit f0ba25104e9d86ef3bfa3815ef2eb47346d9be67
parent 552bfa9db267f0234ba41d922a44c188fea9b763
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sun, 18 Oct 2026 03:41:01 -0400

Merge r33/takes-kind: makesTakes declared on the kind registry (the umtool e2e suite's one failure)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/app/api/report/takes/make/route.ts | 3++-
Mumtool/lib/projects/kinds.mjs | 6++++++
Mumtool/lib/report/takeCli.mjs | 3++-
Mumtool/lib/report/takeMaker.test.mjs | 8++++++--
4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/umtool/app/api/report/takes/make/route.ts b/umtool/app/api/report/takes/make/route.ts @@ -3,6 +3,7 @@ import { projectRef } from "@/lib/projects"; import { clipsOf, readManifest } from "@/lib/projects/report.mjs"; import { loadMontageStyles, takeSteps } from "@/lib/report/takeMaker.mjs"; import { listTakes } from "@/lib/report/takes.mjs"; +import { kindMakesTakes } from "@/lib/projects/kinds.mjs"; export const dynamic = "force-dynamic"; @@ -50,7 +51,7 @@ export async function POST(request: Request) { if (!body || typeof body !== "object") return Response.json({ error: "bad json" }, { status: 400 }); const project = await projectRef(String(body.project ?? "")); if (!project) return Response.json({ error: "no such project" }, { status: 404 }); - if (project.kind !== "report-video") return Response.json({ error: "takes are made of a report video" }, { status: 400 }); + if (!kindMakesTakes(project.kind)) return Response.json({ error: "takes are made of a report video" }, { status: 400 }); const manifest = await readManifest(project.dir); if (!manifest) return Response.json({ error: "no manifest" }, { status: 400 }); diff --git a/umtool/lib/projects/kinds.mjs b/umtool/lib/projects/kinds.mjs @@ -114,6 +114,9 @@ export const PROJECT_KINDS = [ // Its manifest can be an ARTICLE's video (lib/articles/links.mjs): a // top-level `article`, else its slug against the report id. linksArticles: true, + // Takes are made of it (lib/report/takeMaker.mjs): its manifest patched + // and rendered into takes/<id>/. + makesTakes: true, }, { id: "song", @@ -205,6 +208,9 @@ export const kindTakesNotes = (id) => kindById(id)?.notes === true; */ export const kindPieceFlow = (id) => kindById(id)?.piece?.flow ?? null; +/** Are takes made of a project of this kind (lib/report/takeMaker.mjs)? Declared on the kind. */ +export const kindMakesTakes = (id) => kindById(id)?.makesTakes === true; + /** Can a project of this kind be an article's video (lib/articles/links.mjs)? Declared on the kind. */ export const kindLinksArticles = (id) => kindById(id)?.linksArticles === true; diff --git a/umtool/lib/report/takeCli.mjs b/umtool/lib/report/takeCli.mjs @@ -13,6 +13,7 @@ import { mkdir, readFile, writeFile } from "node:fs/promises"; import path from "node:path"; import { REPORTS_ROOT, resolveProject } from "../projects/core.mjs"; +import { kindMakesTakes } from "../projects/kinds.mjs"; import { ensureWriteDir } from "./storage.mjs"; import { ALL_STYLES_RECIPE, @@ -80,7 +81,7 @@ async function pickProject(arg, root) { const r = await resolveProject(arg, root); if (r.ambiguous) throw new CliError(`"${arg}" is the name of ${r.ambiguous.length} projects — pass its id`); if (!r.project) throw new CliError(`no project matches "${arg}"`); - if (r.project.kind !== "report-video") throw new CliError(`${r.project.id} is a ${r.project.kind}, not a report video`); + if (!kindMakesTakes(r.project.kind)) throw new CliError(`${r.project.id} is a ${r.project.kind}, not a report video`); return r.project; } diff --git a/umtool/lib/report/takeMaker.test.mjs b/umtool/lib/report/takeMaker.test.mjs @@ -28,6 +28,10 @@ import { windowEntries, } from "./takeMaker.mjs"; import { listTakes, readVerdicts, setTakeVerdict } from "./takes.mjs"; +import { PROJECT_KINDS } from "../projects/kinds.mjs"; + +// The kind takes are made of, from the registry (never its id spelled here). +const TAKES_KIND = PROJECT_KINDS.find((k) => k.makesTakes).id; import { takeCommand, takesCommand } from "./takeCli.mjs"; const clip = (id, start, end, extra = {}) => ({ type: "clip", id, video: `v-${id}`, start, end, cite: start, section: 0, ...extra }); @@ -292,7 +296,7 @@ test("allStylesRecipe: one take per style, ids made from the names", () => { test("pickTake: the take's manifest over the project's, an undo point first, one pick per group", async () => { const { root, dir } = await project(); const r = stubRender(); - const proj = { id: "proj", dir, kind: "report-video" }; + const proj = { id: "proj", dir, kind: TAKES_KIND }; try { await makeTake(dir, { id: "flash", label: "Flash", group: "m", style: "flash" }, opts(r)); await makeTake(dir, { id: "straight", label: "Straight", group: "m", style: "straight" }, opts(r)); @@ -328,7 +332,7 @@ test("pickTake: the take's manifest over the project's, an undo point first, one test("pickTake: a take that does not record its base needs anyway; an unknown take is an error", async () => { const { root, dir } = await project(); - const proj = { id: "proj", dir, kind: "report-video" }; + const proj = { id: "proj", dir, kind: TAKES_KIND }; try { const takeDir = path.join(dir, "takes", "by-hand"); await mkdir(takeDir, { recursive: true });