Archilyzer · Source

archilyzer

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

commit 2a32bd0a66321a05af66cff618bbcb04dee8dac8
parent 6966fb4229abeac529dd5f26c60baa307fd04dea
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 30 Oct 2026 13:23:39 -0400

Merge lane/repeat-of: repeatOf marks a deliberate repeat (a callback or flash-forward) so its overlap is neither flagged nor trimmed

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

Diffstat:
Mumtool/app/api/report/window/route.ts | 3+++
Mumtool/bin/umtool.mjs | 4++++
Mumtool/docs/knobs.md | 1+
Mumtool/lib/projects/report.mjs | 3+++
Mumtool/lib/report/manifest.mjs | 18++++++++++++++++++
Mumtool/lib/report/window-overlap.test.mjs | 31+++++++++++++++++++++++++++++++
Mumtool/report-to-video/resolve-windows.mjs | 3+++
7 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/umtool/app/api/report/window/route.ts b/umtool/app/api/report/window/route.ts @@ -59,6 +59,9 @@ export async function PUT(request: Request) { // plays on, in source seconds; empty or null clears it. Checked by the // writer against the clip's window, like the cut. "muteFrom", + // The clip this one re-plays on purpose (a callback, a flash-forward), so + // their overlap is not flagged or trimmed; empty or null clears it. + "repeatOf", // Whether the walk has looked at this clip: "confirmed", or empty to clear // it. A non-empty `correction` is the other answer and needs no value. "verdict", diff --git a/umtool/bin/umtool.mjs b/umtool/bin/umtool.mjs @@ -732,6 +732,7 @@ function usage() { " `article`): what settles link-ambiguous; noted for the generator on a generated manifest", " umtool window <project> <clip> [--start S] [--end E] [--lock|--lock-end|…]", " attribution too: --title, --date YYYY-MM-DD, --cite, --cite-url, --quote", + " --repeat-of <clip> it re-plays that clip on purpose (a callback): their overlap is not flagged or trimmed", " --correction TEXT what the REPORT got wrong here (never rendered)", " --verdict confirmed|incorrect what the walk said; incorrect needs --correction", " --cut-start S --cut-end E --lock-cut the cut the video renders", @@ -1009,6 +1010,9 @@ async function cmdWindow() { ["--cite-url", "citeUrl"], ["--quote", "quote"], ["--correction", "correction"], + // Not attribution: the clip this one re-plays on purpose (a callback, a + // flash-forward), so its overlap with that clip is neither flagged nor trimmed. + ["--repeat-of", "repeatOf"], // Not attribution: what the walk said about this clip. "confirmed" or // "incorrect" ('' clears it); the writer refuses `incorrect` with no note. ["--verdict", "verdict"], diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -22,6 +22,7 @@ that generates it ([notes.md](notes.md)). | `claim.label` — this stamp's text (≤ 20; default the verdict's stamp word) | Marks, **label** | `claim.label="2 SEIZURES"` | same | | `claim.eventDate` — `YYYY-MM-DD`, the day the event this mark counts happened when it is not the clip's (a seizure he tells of on 8 Oct that was on 22 Sep): a deck claim's window dates the mark by it ([Claim checks](#claim-checks-on-the-rail)); the stamp lands where it always did | Marks, **happened** | `claim.eventDate=2026-09-22` (`--mark <id>` for another mark) | same | | marks — more than one stamp and count on a clip (≤ 8): see [Marks](#marks) | Marks: **Add mark at playhead** (Shift+M), a mark's verdict, **Remove**, **Clear** | `mark.add=Episodes@190.2` `mark.remove=<id>` `mark.verdict=Grift` `marks=<json>` | `POST /api/report/clip-editor {op: "marks", clip, add \| remove \| mark+verdict \| set}` | +| `repeatOf` — the id of the clip this one re-plays ON PURPOSE (a closing callback, a flash-forward cut out of a longer clip): the check's `window-overlap` row and the build's de-overlap leave that pair alone. Must name another clip of the cut; empty clears it | — | `umtool window <p> <clip> --repeat-of <other>` (`--repeat-of ''` clears) | `PUT /api/report/window {project, clip, repeatOf}` | | `audio.offset` — ms, + = the sound later (−2000…2000) | clip editor, **Audio**: **sync**, the ±10/±40 nudges, **listen** (the 3 s around the playhead) | `umtool set <p> <clip> audio.offset=-40` | `POST /api/report/clip-editor {op: "audio", clip, audio: {offset}}` | | `audio.gain` — dB (−20…20) | Audio, **gain** | `audio.gain=-3` | same | | `audio.fadeIn`, `audio.fadeOut` — seconds (0–5) | Audio, **fade in / fade out** | `audio.fadeIn=0.3` | same | diff --git a/umtool/lib/projects/report.mjs b/umtool/lib/projects/report.mjs @@ -1226,6 +1226,9 @@ export async function reportDecisions(ctx, summary) { const b = sorted[i + 1]; const overlap = played(a).to - played(b).from; if (overlap <= 0) continue; + // A DELIBERATE REPEAT: one clip names the other as the clip it re-plays + // (`repeatOf` -- a callback, a flash-forward). The overlap is the point. + if (a.repeatOf === b.id || b.repeatOf === a.id) continue; const seam = timelineIndex.get(b) === timelineIndex.get(a) + 1 && overlap <= D + 0.01; if (seam) continue; add( diff --git a/umtool/lib/report/manifest.mjs b/umtool/lib/report/manifest.mjs @@ -359,6 +359,24 @@ export function patchClipEntry(manifest, clipId, patch, { edit = "trim", now = n } } + // ---- a deliberate repeat ------------------------------------------------ + // + // `repeatOf`: the id of the clip this one re-plays on purpose -- a callback, + // a flash-forward cut out of a longer clip. Their overlap is the point, so + // the check's window-overlap row and the build's de-overlap leave the pair + // alone. It must name another clip of the cut; empty or null deletes it. + if (patch.repeatOf !== undefined) { + const v = patch.repeatOf == null ? "" : String(patch.repeatOf).trim(); + if (!v) delete entry.repeatOf; + else { + if (v === entry.id) throw new Error(`repeatOf names ${v} itself -- name the clip it re-plays`); + if (!(manifest.timeline ?? []).some((e) => e.type === "clip" && e.id === v)) { + throw new Error(`repeatOf names ${v}, which is not a clip of the cut`); + } + entry.repeatOf = v; + } + } + // ---- the mute mark ------------------------------------------------------ // // `muteFrom`: from this source second to the end of the clip the sound diff --git a/umtool/lib/report/window-overlap.test.mjs b/umtool/lib/report/window-overlap.test.mjs @@ -107,3 +107,34 @@ test("judged on the cuts that play when a clip has the pair", async () => { ["s51: overlaps s52 by 1.8s"], ); }); + +test("a deliberate repeat (repeatOf) is not an overlap, either way round; an undeclared one still is", async () => { + // tr3z re-plays the tail of tr3 as a closing callback (EmberParadox, 30 Oct). + const tr3 = { id: "tr3", start: 100, end: 130, lockEnd: true }; + const tr3z = { id: "tr3z", start: 123, end: 129, lockEnd: true }; + assert.deepEqual(await overlapsOf([tr3, { id: "x", start: 150, end: 160 }, { ...tr3z, repeatOf: "tr3" }]), []); + assert.deepEqual(await overlapsOf([{ ...tr3, repeatOf: "tr3z" }, { id: "x", start: 150, end: 160 }, tr3z]), []); + assert.deepEqual( + await overlapsOf([tr3, { id: "x", start: 150, end: 160 }, tr3z]), + ["tr3: overlaps tr3z by 7.0s and has lockEnd, so nothing will trim it"], + ); +}); + +test("repeatOf: the writer keeps a clip of the cut, refuses itself or a stranger, and clears on empty", async () => { + const { patchClipEntry } = await import("./manifest.mjs"); + const manifest = () => ({ + timeline: [ + { type: "clip", id: "tr3", video: "v", start: 100, end: 130 }, + { type: "card", id: "c1" }, + { type: "clip", id: "tr3z", video: "v", start: 123, end: 129 }, + ], + }); + const m = manifest(); + patchClipEntry(m, "tr3z", { repeatOf: "tr3" }); + assert.equal(m.timeline[2].repeatOf, "tr3"); + patchClipEntry(m, "tr3z", { repeatOf: "" }); + assert.equal("repeatOf" in m.timeline[2], false); + assert.throws(() => patchClipEntry(manifest(), "tr3z", { repeatOf: "tr3z" }), /itself/); + assert.throws(() => patchClipEntry(manifest(), "tr3z", { repeatOf: "nope" }), /not a clip of the cut/); + assert.throws(() => patchClipEntry(manifest(), "tr3z", { repeatOf: "c1" }), /not a clip of the cut/); +}); diff --git a/umtool/report-to-video/resolve-windows.mjs b/umtool/report-to-video/resolve-windows.mjs @@ -485,6 +485,9 @@ async function main() { const a = list[i]; const b = list[i + 1]; if (a.end <= b.start) continue; + // A deliberate repeat (`repeatOf`: a callback or flash-forward re-playing + // the other clip) overlaps on purpose -- trimming it would cut the repeat. + if (a.repeatOf === b.id || b.repeatOf === a.id) continue; const overlap = a.end - b.start; if (a.lockEnd) { console.log(` ⚠ ${a.id} overlaps ${b.id} by ${overlap.toFixed(1)}s but has lockEnd — not trimmed`);