Archilyzer · Source

archilyzer

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

commit d99c713381083e297016abe4a18ddc2de89e0429
parent 3044db1d3738a9ef5762002b5421160bb4141040
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 11 Nov 2026 03:04:33 -0500

speakers: the freed-bytes ledger is transcripts/.speakers-run.json (a dot path, like the corpus root's other runtime state: .x-runs, .x-session, .auto-queue); OPERATING.md's recipe says what clean after capture holds and why, that already-fingerprinted videos (outcome `fresh`) go by hand -- ops diarize -> spot-check -> Clean audio -- and what makes a fingerprint real

scripts/diarize.mjs keeps its own tmp+rename: no atomic-write helper is
importable from scripts/ on main (the consolidation lane's is unmerged).

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

Diffstat:
MOPERATING.md | 27+++++++++++++++++++++++----
Mcommon/controller/cleanAfterCapture.test.ts | 2++
Mcommon/lib/speakersLedger-server.ts | 4+++-
Mcommon/lib/speakersReadout.ts | 2+-
Meditor/app/api/ops/speakers/route.ts | 2+-
5 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/OPERATING.md b/OPERATING.md @@ -626,10 +626,29 @@ pnpm ops diarize --json '{"slug":"example"}' --wait # one channe channels whose media is on the corpus disk first, then the videos freeing the most bytes per audio-hour. The channel tiers on /channels still come first. - **Work through speakers** (the Speakers lane card, `speakers: "work"`) arms the lane, lifts its hold and starts a - run; **Pause** holds it (the video in flight finishes). With `cleanAfterCapture` on, each captured video's audio - is removed at once through every Clean audio gate (keep-latest, do-not-clean, the availability check: a video - gone upstream is pinned, not deleted), and the bytes are counted in "freed this run" (`transcripts/speakers-run.json`). - Off, Clean audio on each channel (or `cleanup {"sweep":"transcribed"}`) frees them later. + run; **Pause** holds it (the video in flight finishes). It refuses a lane not narrowed to `["diarization"]` (it + names the command above) and a lane a render holds. With `cleanAfterCapture` on, each captured video's audio is + removed at once through every Clean audio gate (keep-latest, do-not-clean), and the bytes are counted in "freed + this run" (`transcripts/.speakers-run.json`). Off, Clean audio on each channel (or `cleanup + {"sweep":"transcribed"}`) frees them later. +- **Clean after capture never asks a platform anything.** It reads the channel's availability verdict + (`availability-verdict.json`, written by the Quick check): a video a listing younger than + `diarization.cleanVerdictMaxAgeHours` (24) names is cleaned; one it does not name is held ("maybe missing" — Check + maybe missing resolves it); with no fresh listing the video is held "awaiting an availability check" and ONE + Quick check of the channel is queued on its platform's queue (once per max age, never while the platform is + held). A video whose cached availability says it is gone is pinned, as the sweep does. +- **Held by clean after capture, cleaned by hand**: a channel with no `url` ("no source to check: clean by hand"; + `cleanAfterCaptureUnverified: true` in its config lets it through) and a whole-recording channel + (`clips.wholeRecordingPlatforms`, Rumble — its audio is the recording clock's source; `diarization. + cleanWholeRecordingAudio` lets it through). +- **Videos already fingerprinted are not cleaned by the lane**: a unit that finds the work done reports `fresh` and + the hook does not fire. They — and the audio already clearable before voiceprints existed — go by hand, per + channel: `pnpm ops diarize --json '{"slug":"<slug>"}' --wait` (fingerprints from the existing turns) → spot-check + a few `diarization.json` (`voiceprints` with 192-float centroids for the speakers with long turns, + `voiceprintsFrom` naming the audio) → Clean audio on the channel (`cleanup {"sweep":"transcribed"}`). +- **A fingerprint is real or it is not recorded**: every speaker with a turn of 0.5 s or more needs a 192-float + centroid from the record's embedding model; the voiceprint step cuts only the video's own audio (never a + container or a saved video, whose clock can differ), and refuses a file whose duration is not the record's. - **The readout** (`get speakers`, the lane card, /cleanup): waiting = the audio the lane will clear; days left = the audio-hours left times the seconds per audio-hour the sidecars measured, at one video at a time. Diarized videos whose audio is already gone are `noFingerprintPossible` — listed, never an error. Audio the engine cannot diff --git a/common/controller/cleanAfterCapture.test.ts b/common/controller/cleanAfterCapture.test.ts @@ -180,6 +180,8 @@ test("clean after capture: on, a captured video's audio goes at once, counted an assert.equal(report.audioCleaned, 1); assert.equal(report.audioFreedBytes, 5000); const ledger = await readSpeakersLedger(paths); + // Runtime state, at a dot path beside the corpus root's others. + assert.equal(await exists(path.join(paths.transcriptsDir, ".speakers-run.json")), true); assert.equal(ledger.freedBytes, 5000); assert.equal(ledger.freedVideos, 1); assert.ok(logs.some((l) => l.startsWith("Freed 4.9 KB of audio from v1")), logs.join("\n")); diff --git a/common/lib/speakersLedger-server.ts b/common/lib/speakersLedger-server.ts @@ -20,7 +20,9 @@ import { writeJsonAtomic, } from "./jsonFile-server"; -export const SPEAKERS_LEDGER_FILENAME = "speakers-run.json"; +// A dot path, like the corpus root's other runtime state (.x-runs, .x-session, +// .auto-queue): state, not corpus data. +export const SPEAKERS_LEDGER_FILENAME = ".speakers-run.json"; export type SpeakersLedger = { version: 1; diff --git a/common/lib/speakersReadout.ts b/common/lib/speakersReadout.ts @@ -29,7 +29,7 @@ export type SpeakersReadout = { waitingVideos: number; neverClearsBytes: number; neverClearsVideos: number; - // This run (speakers-run.json). + // This run (.speakers-run.json). freedBytes: number; freedVideos: number; runStartedAt: string | null; diff --git a/editor/app/api/ops/speakers/route.ts b/editor/app/api/ops/speakers/route.ts @@ -14,7 +14,7 @@ export const dynamic = "force-dynamic"; // ("waiting: X GB in N videos · freed this run: Y GB · about D days left"), // then the numbers it is made of — waiting (the audio held for the Speakers // lane that it WILL clear), neverClears (held there and never cleared by it), -// freed this run (speakers-run.json), the measured rate (seconds of engine per +// freed this run (.speakers-run.json), the measured rate (seconds of engine per // audio-hour, from the sidecars' durationMs/audioSeconds), the audio-hours // left and the days at concurrency 1, voiceprinted and noFingerprintPossible // (diarized, the audio already gone) — and per channel, corpus disk first.