Archilyzer · Source

archilyzer

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

commit 1f7c69b4912c558f926464e86300a419a4094ac2
parent ac6bbd52ab77aadcab7e529cff84dfe26dddd88a
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu,  5 Nov 2026 02:57:20 -0500

umtool: a rendered take's Check the joins (umtool check-joins --take, the measured SSIM across each post-to-post boundary) as a queue step from the take card's tools, its table in the step's log on Jobs

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

Diffstat:
Mumtool/app/api/report/takes/tools/route.ts | 17++++++++++++++++-
Mumtool/components/projects/TakeTools.tsx | 29++++++++++++++++++++++++++---
Mumtool/components/projects/TakesBench.tsx | 2+-
3 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/umtool/app/api/report/takes/tools/route.ts b/umtool/app/api/report/takes/tools/route.ts @@ -4,6 +4,8 @@ import { lintCommand } from "@/lib/report/lintCli.mjs"; import { takeCommand } from "@/lib/report/takeCli.mjs"; import { isTakeId, listTakes } from "@/lib/report/takes.mjs"; import { REPORTS_ROOT } from "@/lib/paths"; +import { addStep } from "@/lib/queue/store.mjs"; +import { kickQueue, queueDir } from "@/lib/queue/runner"; export const dynamic = "force-dynamic"; @@ -22,6 +24,9 @@ export const dynamic = "force-dynamic"; // POST { project, op: "draft-new", label, group?, style?, patch?, window? } // umtool take <p> --id <slug of label> --label L --draft // -> { exit, id, report } [--group G] [--style S] [--patch-json P] [--full | --at A --dur D] +// POST { project, take, op: "queue-check-joins" } QUEUED: umtool check-joins <p> --take <t> (the measured +// -> { exit: 0, queued: <qid> } SSIM over the master is long: a queue step, its table in +// the step's log on Jobs) export async function POST(request: Request) { const refused = refuseCaller(request, "/api/report/takes/tools"); if (refused) return refused; @@ -80,6 +85,16 @@ export async function POST(request: Request) { const exit = await takeCommand([project.id, "--id", id, "--draft", "--from", take, ...label, "--json"], io); return answer(exit, { id }); } + if (body.op === "queue-check-joins") { + const step = (await addStep(queueDir(), { + argv: ["check-joins", project.id, "--take", take], + label: `check the joins of ${project.id} take ${take}`, + target: { project: project.id, take }, + by: "the umtool app (take tools)", + })) as { qid: string }; + kickQueue(); + return Response.json({ exit: 0, queued: step.qid }, { headers: { "cache-control": "no-store" } }); + } if (body.op === "import") { const refs = typeof body.refs === "string" ? body.refs.trim() : ""; if (!refs) return Response.json({ error: "import needs <project>:<item>[,<item>…]" }, { status: 400 }); @@ -87,7 +102,7 @@ export async function POST(request: Request) { const exit = await takeCommand([project.id, "--id", take, ...refs.split(/\s+/).flatMap((r) => ["--import-item", r]), ...place, ...(body.dryRun ? ["--dry-run"] : []), "--json"], io); return answer(exit); } - return Response.json({ error: "op must be lint, draft-from, draft-new or import" }, { status: 400 }); + return Response.json({ error: "op must be lint, draft-from, draft-new, import or queue-check-joins" }, { status: 400 }); } catch (e) { return Response.json({ error: e instanceof Error ? e.message : String(e) }, { status: 500 }); } diff --git a/umtool/components/projects/TakeTools.tsx b/umtool/components/projects/TakeTools.tsx @@ -4,7 +4,7 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import { buttonVariants } from "@/components/ui/button"; -import { takeWalkHref } from "@/lib/hrefs"; +import { jobsHref, takeWalkHref } from "@/lib/hrefs"; import { cn } from "@/lib/utils"; import PlayLink from "./PlayLink"; @@ -197,11 +197,34 @@ export function ImportItems({ project, take }: { project: string; take: string } ); } -/** The three, as a take card's or a take walk's row. */ -export default function TakeTools({ project, take, editable = true }: { project: string; take: string; editable?: boolean }) { +/** Check the joins of a rendered take (umtool check-joins), queued: its table is the step's log on Jobs. */ +export function CheckJoinsButton({ project, take }: { project: string; take: string }) { + const [busy, setBusy] = useState(false); + const [res, setRes] = useState<(Tools & { queued?: string }) | null>(null); + return ( + <span className="inline-flex flex-wrap items-center gap-1.5" data-take-check-joins={take}> + <button type="button" data-action="check-joins" disabled={busy} onClick={() => (setBusy(true), void tool({ project, take, op: "queue-check-joins" }).then((r) => (setRes(r), setBusy(false))))} className={buttonVariants({ variant: "outline", size: "sm" })} title={`umtool check-joins ${project} --take ${take}, as a queue step`}> + Check the joins + </button> + {res?.queued && ( + <span className="text-[11.5px] text-text-2" data-take-check-joins-queued={res.queued}> + queued {res.queued} —{" "} + <Link href={jobsHref()} className="ink-link"> + its table on Jobs + </Link> + </span> + )} + {res && !res.queued && <span className="text-[11.5px] text-reject-text">{res.error ?? res.said ?? "refused"}</span>} + </span> + ); +} + +/** The take's tools, as a take card's or a take walk's row. */ +export default function TakeTools({ project, take, editable = true, rendered = false }: { project: string; take: string; editable?: boolean; rendered?: boolean }) { return ( <span className="flex flex-wrap items-start gap-1.5" data-take-tools={take}> <LintButton project={project} take={take} /> + {rendered && <CheckJoinsButton project={project} take={take} />} <DraftFromButton project={project} take={take} /> {editable && <ImportItems project={project} take={take} />} </span> diff --git a/umtool/components/projects/TakesBench.tsx b/umtool/components/projects/TakesBench.tsx @@ -884,7 +884,7 @@ function TakeCard({ </button> )} </div> - <TakeTools project={project} take={t.id} editable={walkable} /> + <TakeTools project={project} take={t.id} editable={walkable} rendered={!!t.builtAt && !t.draft} /> <div className="flex flex-wrap items-center gap-1.5" data-take-variants={t.id}> <ForkVariant project={project} take={t.id} ready={ready} /> <CompareWith project={project} take={t.id} options={compareOptions} />