Archilyzer · Source

archilyzer

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

commit c73d31645c079f2e376b3cbde6a687a27ee5428b
parent f16785c5a7cb73ba6109edaa4c10f5ec442f9d56
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 23 Oct 2026 14:40:17 -0400

Merge lane/live-duration: a recording saved from a live capture plays in umtool (its span from the container when the cues have none)

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

Diffstat:
Meditor/CHANGELOG.md | 1+
Mumtool/lib/projects/report.mjs | 32+++++++++++++++++++++++++++++---
Mumtool/lib/report/raw-cache.test.mjs | 37+++++++++++++++++++++++++++++++++++++
3 files changed, 67 insertions(+), 3 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **A recording saved from a live capture now plays in umtool's clip editor.** A stream recorded while it was on air has no length in its transcript's record, and umtool read a saved recording's length from there, so the whole recording counted as no window and every clip cut from it sat in the clip walk as not fetched. umtool now asks the saved file itself for its length when the record has none (once per file). - **umtool's clip editor keeps a voice's pitch at any speed, and goes up to 4×.** A selection, an edge, a transcript line or the auto-audition played at 1.5× or 2× used to rise in pitch with the speed (2× was an octave up), unlike the same video at 2× in a player: the bench plays a range from decoded audio, whose speed control is a tape-speed knob. At any speed but 1× the range is now time-stretched at its own pitch first (waveform-similarity overlap-add) and played at 1×, still starting and stopping on the exact sample; a clip's selection is stretched ahead while the editor is idle, so playing it does not wait. The speed list adds 1.75×, 2.5×, 3×, 3.5× and 4×. Needs a restart of umtool. - **A clip whose recording umtool cannot play is skipped by the clip walk, not opened broken.** A whole recording saved with **Fetch the whole recording** sits in the saved-video store, which umtool was not allowed to read: a clip it alone held counted as fetched, the walk stopped on it, and the player answered "outside the roots" (`costco-ok`). The store (`SAVED_VIDEOS_DIR`, else `transcripts/saved-videos`) is now readable, as the corpus is, so such a clip plays; and a window umtool may not read is no longer counted at all, so a clip with no window it can play is passed by and comes back once one is fetched. Needs a restart of umtool. - **A forum thread's fetch no longer skips the pages an interrupted catch-up still owed.** When a catch-up stopped partway down a thread and new pages were posted before the next fetch, the next fetch read the new pages, met the posts the stopped run had saved, took them for the point where it was caught up, and went on to the older history: the pages between were never read (on 2026-10-23, 93 pages of a 3,798-page thread). It now continues where the stopped catch-up left off, then goes on to the history. And a page that comes back as no thread page at all just after a browser check clears is loaded once more before the fetch stops on it, as an empty page already was. Needs a restart of the editor. diff --git a/umtool/lib/projects/report.mjs b/umtool/lib/projects/report.mjs @@ -12,6 +12,7 @@ import { SHADOW_CHANNELS as SOURCES_SHADOW_CHANNELS, channelsDirFor as sourcesChannelsDirFor, corpusWindowsOf, + ffprobeSource, } from "umtool-report-to-video/sources"; import { rawCacheOf } from "../report/raw-cache.mjs"; import { resolveVideoDirSync } from "yt-dlp-transcript-common/lib/videoDir-server.mjs"; @@ -411,8 +412,20 @@ export async function readAvailability(dir) { * recording is, it is memoised against mtime (see below), and it is asked for * only when a container is actually there -- which keeps the index load as * cheap as it was. No duration is no window rather than a guess. + * + * A RECORD CAPTURED LIVE HAS NO DURATION IN ITS CUES (2026-10-23: a Rumble + * stream saved from its from-start recording, `duration: 0` in the cue doc, + * 875 cues to 5012.96 s): its metadata was written while it was still on air. + * The container then answers for itself -- one ffprobe, memoised against the + * file's mtime and size like the cues, and paid only by a record the cues + * cannot vouch for. Before this the whole saved stream was no window, and + * every clip cut from it sat in the walk as "not fetched". */ -export const clipWindowDirs = async (m, channelsDir, { readable = (p) => resolveInRoots(p) !== null } = {}) => { +export const clipWindowDirs = async ( + m, + channelsDir, + { readable = (p) => resolveInRoots(p) !== null, probeContainer = probeContainerMemo } = {}, +) => { const root = channelsDir ?? GLOBAL_CHANNELS_DIR(); const seen = new Set(); const out = []; @@ -424,9 +437,10 @@ export const clipWindowDirs = async (m, channelsDir, { readable = (p) => resolve seen.add(key); // The record's directory: a Twitch v<n> is data/<n>/ (release 23 F1b). const cueFile = path.join(resolveVideoDirSync(root, chan, e.video), "transcript.cues.json"); - const probe = async () => { + const probe = async (file) => { const duration = Number((await readCues(cueFile))?.duration); - return Number.isFinite(duration) && duration > 0 ? { duration } : null; + if (Number.isFinite(duration) && duration > 0) return { duration }; + return file ? probeContainer(file) : null; }; const windows = (await corpusWindowsOf({ video: e.video, slug: chan, channelsDir: root, probe })).filter((w) => readable(w.path), @@ -436,6 +450,18 @@ export const clipWindowDirs = async (m, channelsDir, { readable = (p) => resolve return out; }; +// The container's own answer, for a record whose cues carry no duration. +const containerMemo = new Map(); +async function probeContainerMemo(file) { + const st = await stat0(file); + if (!st) return null; + const key = `${file}|${Math.round(st.mtimeMs)}|${st.size}`; + if (containerMemo.has(key)) return containerMemo.get(key); + const info = await ffprobeSource(file); + containerMemo.set(key, info); + return info; +} + export const cuePathFor = (m, e, channelsDir) => { const chan = channelFor(m, e); if (!chan) return null; diff --git a/umtool/lib/report/raw-cache.test.mjs b/umtool/lib/report/raw-cache.test.mjs @@ -172,3 +172,40 @@ test("clipWindowDirs: a window umtool may not read is no window, so the walk pas await rm(f.root, { recursive: true, force: true }); } }); + +test("clipWindowDirs: a record captured live (no duration in its cues) takes its span from the saved container", async () => { + const f = await fixture(); + try { + const b = await f.video("live01"); + const store = path.join(f.root, "store", SLUG, "live01"); + await mkdir(store, { recursive: true }); + const container = path.join(store, "source-media.mp4"); + await touch(container); + await writeFile(path.join(b, "saved-video.json"), JSON.stringify({ dir: store, file: "source-media.mp4", bytes: 16 })); + // Written while it was on air: duration 0, though its cues run on. + await writeFile( + path.join(b, "transcript.cues.json"), + JSON.stringify({ duration: 0, cues: [{ start: 5000, end: 5012.96, text: "end" }] }), + ); + const m = { + provenance: { channelSlug: SLUG }, + timeline: [{ id: "c1", type: "clip", video: "live01", start: 440, end: 479 }], + }; + const asked = []; + const probeContainer = async (file) => { + asked.push(file); + return { duration: 5014.56 }; + }; + const extra = await clipWindowDirs(m, f.channelsDir, { readable: () => true, probeContainer }); + assert.deepEqual(asked, [container], "the container is asked, once"); + assert.deepEqual( + extra.map((e) => [e.video, e.windows.map((w) => [w.kind, w.name, w.from, w.to])]), + [["live01", [["saved-video", "source-media.mp4", 0, 5014.56]]]], + ); + // A container that cannot say either is still no window, not a guess. + const none = await clipWindowDirs(m, f.channelsDir, { readable: () => true, probeContainer: async () => null }); + assert.deepEqual(none, []); + } finally { + await rm(f.root, { recursive: true, force: true }); + } +});