Archilyzer · Source

archilyzer

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

commit 56e1a4b41ea39c16667f6ec19da18088650d071d
parent 20402534b9892adbf113584f905fa04a0534d62e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 26 Aug 2026 18:50:21 -0400

operations: digest is a registry entry to every reader

Four `if (id === DIGEST_OPERATION_ID) … digestWorkOf(snapshot)` detours existed
only to cover a snapshot with no `backfill.digest` entry — the case the bucket
fallback was for. All four go:

- components/pipelines/buildBands.ts — the band builder folds digest through
  addRegistryEntry like every other operation.
- controller/sweepPreview.ts — reachableIdsFor and countsFor. countsFor returns
  null for an operation with no entry, which is what the caller already handles
  for diarization.
- controller/sweepRecency.ts — reachableIdsFor.

No entry now means the same thing for digest as for diarization: no work known,
coverage unknown. `bandCoverage` refuses to divide by a zero denominator, so a
channel with no entry draws an unfilled outline rather than a filled 0 %.

`digestWorkOf` has no callers left in common/; it stays in channelSnapshot.ts as
the editor's one adapter from an OperationSnapshotEntry to the digest surfaces,
and its header says so.

Diffstat:
Mcommon/controller/channelSnapshot.ts | 7++++---
Mcommon/controller/sweepPreview.ts | 33++++++++-------------------------
Mcommon/controller/sweepRecency.ts | 0
Meditor/app/components/pipelines/buildBands.test.ts | 6++++--
Meditor/app/components/pipelines/buildBands.ts | 23++++-------------------
5 files changed, 20 insertions(+), 49 deletions(-)

diff --git a/common/controller/channelSnapshot.ts b/common/controller/channelSnapshot.ts @@ -447,9 +447,10 @@ export function foldBackfillEntry( // entry is now a channel whose FIRST snapshot has not been written yet, not an // old generation of one — and it reports unknown coverage, never zero. // -// Left in this module rather than moved after commit 2 left it with no callers -// in `common/`: it is the editor's one adapter from an `OperationSnapshotEntry` -// to the digest surfaces, and moving it would be churn without a deletion. +// NO CALLERS IN `common/` any more — the sweep planner and the band builder read +// `snapshot.backfill[id]` generically, digest included. It stays in this module +// anyway: it is the editor's one adapter from an `OperationSnapshotEntry` to the +// digest surfaces, and moving it would be churn without a deletion. export type DigestWork = { // Videos needing digest work that the lane can do right now. ids: string[]; diff --git a/common/controller/sweepPreview.ts b/common/controller/sweepPreview.ts @@ -17,10 +17,7 @@ // is the number an operator arms a multi-day commitment against. import type { AutoQueueOrder } from "../jobs/autoQueuePolicy"; -import { - DIGEST_OPERATION_ID, - presentOperationWork, -} from "../lib/operations"; +import { presentOperationWork } from "../lib/operations"; import { foldSweepPlan, type SweepChannelCounts, @@ -28,7 +25,7 @@ import { type SweepPlanEntry, } from "../lib/sweepPlan"; import { countFromSnapshot } from "./backfillSweep"; -import { digestWorkOf, type ChannelSnapshot } from "./channelSnapshot"; +import { type ChannelSnapshot } from "./channelSnapshot"; // Exactly what listChannelBriefs already returns, narrowed to the two fields // this needs. Structural, so the editor's per-request brief cache feeds it with @@ -80,12 +77,9 @@ function reachableIdsFor( ): ReadonlyArray<string> { const entry = snapshot.backfill?.[id]; if (entry) return entry.ids ?? []; - // Digest joined the operation registry after most snapshots on disk were - // written, and digestWorkOf is the fallback that reads the same population off - // the buckets with the transcript and cues-staleness gates applied — the same - // one components/pipelines/buildBands.ts uses, for the same reason: without it - // a stale channel reads "all digested". - if (id === DIGEST_OPERATION_ID) return digestWorkOf(snapshot).ids; + // No entry: no work KNOWN for this operation on this channel. True of digest + // exactly as it is of diarization — there is one work list per operation and + // it is the registry's. return []; } @@ -110,20 +104,9 @@ function countsFor(snapshot: ChannelSnapshot, id: string): WorkCounts | null { present: presentOperationWork(entry), }; } - if (id === DIGEST_OPERATION_ID) { - const work = digestWorkOf(snapshot); - return { - reachable: work.reachable, - // The bucket fallback genuinely does not know a missing-input count; 0 - // here is the honest statement that this snapshot carries no such split, - // not a claim that no media is gone. - missingInput: 0, - blocked: work.blocked, - deferred: work.deferred, - eligible: work.eligible, - present: work.present, - }; - } + // Null, never zeroes: a channel whose snapshot carries no entry for this + // operation cannot say how much work it holds, and the caller already handles + // that answer for every other kind. return null; } diff --git a/common/controller/sweepRecency.ts b/common/controller/sweepRecency.ts Binary files differ. diff --git a/editor/app/components/pipelines/buildBands.test.ts b/editor/app/components/pipelines/buildBands.test.ts @@ -122,8 +122,10 @@ test("digest with no registry entry is an unfilled outline, never 0 %", () => { }); const digest = bandOf(bands, "digest"); assert.equal(digest.reachable, 0); - assert.equal(digest.eligible, null); - assert.equal(digest.present, null); + // Nothing to have an opinion about, and bandCoverage refuses to divide by it: + // the band draws as an empty outline rather than a filled 0 %. + assert.equal(digest.eligible, 0); + assert.equal(bandCoverage(digest), null); }); test("the external pipelines get bands from totals and buckets", () => { diff --git a/editor/app/components/pipelines/buildBands.ts b/editor/app/components/pipelines/buildBands.ts @@ -1,10 +1,6 @@ import type { ChannelSnapshot } from "yt-dlp-transcript-common/controller/channelSnapshot"; +import { excludedDownloadIdSet } from "yt-dlp-transcript-common/controller/channelSnapshot"; import { - digestWorkOf, - excludedDownloadIdSet, -} from "yt-dlp-transcript-common/controller/channelSnapshot"; -import { - DIGEST_OPERATION_ID, operationCostBasis, operationLabel, presentOperationWork, @@ -176,20 +172,9 @@ export function buildOperationBands({ for (const id of operationIds) { const band = bands.get(id); if (!band) continue; - if (id === DIGEST_OPERATION_ID && !snapshot.backfill?.[id]) { - // A snapshot written before digest joined the registry has no entry, and - // digestWorkOf is the fallback that reads the same population off the - // buckets with the transcript and cues-staleness gates applied. Without - // it a stale channel reads "all digested", which is the one failure mode - // the source:"bucket" fallback exists to prevent. - const work = digestWorkOf(snapshot); - band.reachable += work.reachable; - band.blocked += work.blocked; - band.deferred += work.deferred; - band.eligible = sumOrNull([band.eligible, work.eligible]); - band.present = sumOrNull([band.present, work.present]); - continue; - } + // Digest is a plain registry entry here, like every other operation: a + // snapshot with no entry contributes no work and no coverage, and the + // band stays an unfilled outline rather than reading 0 %. addRegistryEntry(band, snapshot); } }