Archilyzer · Source

archilyzer

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

commit 1e50c19047d35b56377a6aef4bf7eaba6c03ba16
parent 968ce9fc496f029e54f208c33509aaecf90eca71
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 10 Nov 2026 18:08:24 -0500

umtool: the Removed list never says `?/<video>` -- a rejected clip goes on record with its channel, the cut's (provenance.channelSlug) when the clip names none, and removedSourceOf says where a removed clip came from for the Cut tab and `timeline <p> removed` (an older record's channel from the cut; with none anywhere, the video alone; with no video, nothing beside the id) (E5 A5, the E1 leftover)

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

Diffstat:
Mumtool/components/projects/report/CutTab.tsx | 7++-----
Mumtool/components/projects/report/RemovedClips.tsx | 10+++-------
Mumtool/lib/report/manifest.mjs | 22+++++++++++++++++++++-
Mumtool/lib/report/reject-reasons.test.mjs | 2+-
Mumtool/lib/report/restore-removed.test.mjs | 14+++++++++++++-
Mumtool/lib/report/timelineCli.mjs | 3++-
6 files changed, 42 insertions(+), 16 deletions(-)

diff --git a/umtool/components/projects/report/CutTab.tsx b/umtool/components/projects/report/CutTab.tsx @@ -39,7 +39,7 @@ import { clipMomentKey } from "umtool-report-to-video/montage-rulings"; import { trailerCandidates } from "@/lib/report/trailerCandidates.mjs"; import IntroRow from "./IntroEditor"; import RemovedClips, { type RemovedRow } from "./RemovedClips"; -import { readRemoved, removedOutOfCut } from "@/lib/report/manifest.mjs"; +import { readRemoved, removedOutOfCut, removedSourceOf } from "@/lib/report/manifest.mjs"; import { rejectReasonOf } from "@/lib/report/rejectReasons.mjs"; // The inspector panels for this week's hand edits (umtool redesign L6), mounted here until L7's workspace inspector. import { InspectorToggle, WhenOpen } from "../inspector/shared"; @@ -70,10 +70,7 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor // The clips taken out on record and still out (removed.json), each with Restore (un-reject). const removed: RemovedRow[] = (removedOutOfCut(await readRemoved(project.dir), m) as Record<string, unknown>[]).map((r) => ({ id: String(r.id), - channel: typeof r.channel === "string" ? r.channel : null, - video: typeof r.video === "string" ? r.video : null, - start: typeof r.start === "number" ? r.start : null, - end: typeof r.end === "number" ? r.end : null, + source: removedSourceOf(r, m), why: rejectReasonOf(String(r.reason ?? ""))?.label ?? String(r.reason ?? "removed"), note: typeof r.note === "string" ? r.note : typeof r.correction === "string" ? r.correction : null, when: typeof r.when === "string" ? r.when : null, diff --git a/umtool/components/projects/report/RemovedClips.tsx b/umtool/components/projects/report/RemovedClips.tsx @@ -14,10 +14,8 @@ import { announceManifestChanged, refusalOf, timelineOp } from "../timelineApi"; export type RemovedRow = { id: string; - channel: string | null; - video: string | null; - start: number | null; - end: number | null; + /** Where it came from (manifest.mjs removedSourceOf): `<channel>/<video> @ s–e`, the video alone, or "". */ + source: string; why: string; note: string | null; when: string | null; @@ -54,9 +52,7 @@ export default function RemovedClips({ project, rows }: { project: string; rows: <Link href={clipBenchHref(project, r.id)} className="ink-link font-mono text-[11px]"> {r.id} </Link> - <span className="text-[11px] text-[var(--color-dim)]"> - {r.channel ?? "?"}/{r.video ?? "?"} @ {r.start ?? "?"}–{r.end ?? "?"} - </span> + {r.source && <span className="text-[11px] text-[var(--color-dim)]">{r.source}</span>} <span data-removed-why=""> {r.why} {r.note ? `: ${r.note}` : ""} diff --git a/umtool/lib/report/manifest.mjs b/umtool/lib/report/manifest.mjs @@ -2602,9 +2602,12 @@ export async function removeWrongSpeaker(dir, id, { token = null, at = null, cor export async function rejectClip(dir, id, reason, { token = null, at = null, note = null, now = () => new Date() } = {}) { const r = rejectReasonOf(String(reason ?? "").trim()); const verdictPatch = rejectPatch(String(reason ?? "").trim(), note); + let cutChannel = null; const res = await structural(dir, r?.id === "wrong-speaker" ? "wrong-speaker" : "reject", token, (m) => { const entry = m.timeline[entryIndex(m.timeline, id, at)]; if (entry.type !== "clip") throw new Error(`${id} is a ${entry.type ?? "non-clip"} entry, not a clip`); + // Most clips name no channel of their own: the cut's (projects/report.mjs channelFor), on record with it. + cutChannel = typeof m.provenance?.channelSlug === "string" ? m.provenance.channelSlug : null; patchClipEntry(m, id, verdictPatch); return removeIn(m, id, at); }); @@ -2615,7 +2618,7 @@ export async function rejectClip(dir, id, reason, { token = null, at = null, not reason: r?.id ?? String(reason), correction: String(e.correction ?? "").trim() || null, ...(rejectNote ? { note: rejectNote } : {}), - channel: typeof e.channel === "string" ? e.channel : null, + channel: typeof e.channel === "string" ? e.channel : cutChannel, video: typeof e.video === "string" ? e.video : null, start: e.start ?? null, end: e.end ?? null, @@ -2649,6 +2652,23 @@ export function removedOutOfCut(rows, manifest) { } /** + * Where a removed clip came from, as the Removed list and `timeline <p> removed` say it: `<channel>/<video> @ s–e` + * -- its record's channel, else the cut's (`provenance.channelSlug`: a record from before removals carried it); + * with no channel to name, the video alone; with no video, "" (the clip's id says it). Never `?/`. + * + * @param {Record<string, any>} r a removed.json row + * @param {Record<string, any> | null} manifest + * @param {{ dash?: string, at?: string }} [o] the CLI's compact form: `{ dash: "-", at: "@" }` + */ +export function removedSourceOf(r, manifest, { dash = "–", at = " @ " } = {}) { + const channel = typeof r?.channel === "string" && r.channel ? r.channel : typeof manifest?.provenance?.channelSlug === "string" && manifest.provenance.channelSlug ? manifest.provenance.channelSlug : null; + const video = typeof r?.video === "string" && r.video ? r.video : null; + if (!video) return ""; + const span = Number.isFinite(r?.start) && Number.isFinite(r?.end) ? `${at}${r.start}${dash}${r.end}` : ""; + return `${channel ? `${channel}/` : ""}${video}${span}`; +} + +/** * The newest revision of the manifest (revisions/, newest first; then a legacy copy) whose timeline holds clip `id`: the entry as it * was there -- claim, quote, cite, edges and all -- with the ids before and after it. null when none does. * diff --git a/umtool/lib/report/reject-reasons.test.mjs b/umtool/lib/report/reject-reasons.test.mjs @@ -123,7 +123,7 @@ test("rejectClip: rejected, taken out, re-anchored and on record with the reason const rec = (await readRemoved(dir)).at(-1); assert.deepEqual( { ...rec, reanchored: rec.reanchored.length }, - { id: "c02", reason: "repeats", correction: null, note: "covered by c01", channel: null, video: "v-c02", start: 10, end: 20, at: 1, reanchored: 0, when: "2026-10-30T12:00:00.000Z" }, + { id: "c02", reason: "repeats", correction: null, note: "covered by c01", channel: "chan", video: "v-c02", start: 10, end: 20, at: 1, reanchored: 0, when: "2026-10-30T12:00:00.000Z" }, ); await undoStructural(dir); const back = JSON.parse(await readFile(path.join(dir, MANIFEST_NAME), "utf8")); diff --git a/umtool/lib/report/restore-removed.test.mjs b/umtool/lib/report/restore-removed.test.mjs @@ -11,7 +11,7 @@ import test from "node:test"; const ROOT = await mkdtemp(path.join(tmpdir(), "umtool-restore-")); process.env.REPORTS_DIR = ROOT; -const { MANIFEST_NAME, readRemoved, rejectClip, removeEntry, removedOutOfCut, restoreRemoved, updateClip } = await import("./manifest.mjs"); +const { MANIFEST_NAME, readRemoved, rejectClip, removeEntry, removedOutOfCut, removedSourceOf, restoreRemoved, updateClip } = await import("./manifest.mjs"); const { timelineCommand } = await import("./timelineCli.mjs"); const C02 = { @@ -98,3 +98,15 @@ test("umtool timeline <p> removed | restore <id>: the list, then the clip back, assert.equal(await run("cli", "restore", "c02"), 1); assert.match(lines.at(-1), /c02 is in the cut already/); }); + +test("a removed clip names where it came from: its channel on record (the cut's when the clip names none), never `?/`", async () => { + const dir = await project("source"); + await rejectClip(dir, "c02", "irrelevant"); + const [row] = await readRemoved(dir); + assert.equal(row.channel, "chan", "the cut's channel, on record"); + assert.equal(removedSourceOf(row, await read(dir)), `chan/${C02.video} @ ${C02.start}–${C02.end}`); + // An older record with no channel: the cut's, at display; with none anywhere, the video alone. + assert.equal(removedSourceOf({ ...row, channel: null }, await read(dir)), `chan/${C02.video} @ ${C02.start}–${C02.end}`); + assert.equal(removedSourceOf({ ...row, channel: null }, { provenance: {} }, { dash: "-", at: "@" }), `${C02.video}@${C02.start}-${C02.end}`); + assert.equal(removedSourceOf({ id: "x" }, null), "", "no video: the id says it"); +}); diff --git a/umtool/lib/report/timelineCli.mjs b/umtool/lib/report/timelineCli.mjs @@ -75,6 +75,7 @@ import { rejectClip, readRemoved, removedOutOfCut, + removedSourceOf, restoreRemoved, sectionsOf, updateSection, @@ -609,7 +610,7 @@ export async function timelineCommand(args, { root = REPORTS_ROOT, out = (s) => } for (const r of rows) { const why = rejectReasonOf(String(r.reason ?? "")); - out(`${String(r.id).padEnd(10)} ${r.channel ?? "?"}/${r.video ?? "?"}@${r.start ?? "?"}-${r.end ?? "?"} ${why?.label ?? r.reason ?? ""}${r.note || r.correction ? `: ${r.note ?? r.correction}` : ""} (${String(r.when ?? "").slice(0, 16)}, was at ${r.at})`); + out(`${String(r.id).padEnd(10)} ${removedSourceOf(r, manifest, { dash: "-", at: "@" }) || "-"} ${why?.label ?? r.reason ?? ""}${r.note || r.correction ? `: ${r.note ?? r.correction}` : ""} (${String(r.when ?? "").slice(0, 16)}, was at ${r.at})`); } out(`${rows.length} removed clip${rows.length === 1 ? "" : "s"} out of ${project.id}${rows.length ? ` -- umtool timeline ${project.id} restore <id> puts one back` : ""}`); return 0;