Archilyzer · Source

archilyzer

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

commit 71530ad0e44787a58394d115ac73e1df569ab81f
parent aae8e05d0e3432826eb9bbd4eca6079f4568cd03
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sat, 17 Oct 2026 01:37:01 -0400

common: the snapshot's fullAudio reads each corrupt full source's record for a trusted stored media URL (one metadata read for those only) instead of standing the channel's platform in for it — a record with no trusted URL is not waiting on full audio

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

Diffstat:
Mcommon/controller/channelSnapshot.test.ts | 16+++++++++++-----
Mcommon/controller/channelSnapshot.ts | 24+++++++++++++-----------
2 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/common/controller/channelSnapshot.test.ts b/common/controller/channelSnapshot.test.ts @@ -911,9 +911,9 @@ test("a salvage transcript is salvagedTranscript; its corrupt full source stays } }); -// Release 32 R8: on a channel whose platform serves stored media URLs, the -// snapshot's `fullAudio` counts each corrupt full source's stored-URL download -// attempts, and lists the untranscribed ones still owed one (`awaiting`). +// Release 32 R8: the snapshot's `fullAudio` counts the stored-URL download +// attempts of each corrupt full source whose record stores a trusted media URL, +// and lists the untranscribed ones still owed one (`awaiting`). test("fullAudio: a stored-URL channel's corrupt full sources, their attempts, the ones awaiting full audio", async () => { const dir = await mkdtemp(path.join(tmpdir(), "ttb-snap-fullaudio-")); try { @@ -935,8 +935,14 @@ test("fullAudio: a stored-URL channel's corrupt full sources, their attempts, th attempts: Array.from({ length: n }, () => stored), }); const salvaged = { source: "audio.mp4", decodedSeconds: 100, totalSeconds: 600, gaps: [[100, 600]] }; + const odysee = url.startsWith("https://odysee.com/"); for (const id of ids) { - await put(id, "metadata.info.json", { id, duration: 600 }); + await put(id, "metadata.info.json", { + id, + duration: 600, + webpage_url: odysee ? `https://odysee.com/synthetic:${id}` : `https://www.youtube.com/watch?v=${id}`, + formats: [{ url: `https://player.odycdn.com/v6/streams/${id}/a.mp4`, protocol: "https" }], + }); await put(id, "audio.mp4", "x"); } await put("aaaa0000001", "download-outcome.json", cfs("aaaa0000001", 0)); @@ -954,7 +960,7 @@ test("fullAudio: a stored-URL channel's corrupt full sources, their attempts, th attempts: { aaaa0000001: 0, bbbb0000002: 2, cccc0000003: 1 }, awaiting: ["aaaa0000001"], }); - assert.equal((await generateChannelSnapshot(paths, "yt")).fullAudio, undefined, "not a stored-URL platform"); + assert.equal((await generateChannelSnapshot(paths, "yt")).fullAudio, undefined, "no record stores a trusted media URL"); assert.equal((await generateChannelSnapshot(paths, "never")).fullAudio, undefined, "the channel says never"); } finally { await rm(dir, { recursive: true, force: true }); diff --git a/common/controller/channelSnapshot.ts b/common/controller/channelSnapshot.ts @@ -87,8 +87,7 @@ import { deriveChannelSets } from "./channelSets"; import { readTranscriptCoverage } from "./normalizeTranscript"; import { resolveCaptionsProvenance } from "../lib/subtitleProvenance"; import { isIncompleteTranscript } from "../lib/transcriptCoverage"; -import { detectPlatform } from "../lib/platform"; -import { isStoredUrlPlatform } from "../lib/storedMediaUrl"; +import { storedMediaUrl } from "../lib/storedMediaUrl-server"; import { FULL_AUDIO_ATTEMPTS, fullAudioAttemptsOf } from "../lib/fullAudioFirst"; // THE PER-OPERATION WORK LISTS, keyed by operation id. @@ -186,12 +185,12 @@ export type ChannelSnapshot = { // every reader falls back to the bucket fold until a channel's next regen. backfill?: ChannelSnapshotOperations; // FULL AUDIO BEFORE A SALVAGE (release 32 R8, lib/fullAudioFirst.ts), on a - // channel whose platform serves stored media URLs (STORED_URL_PLATFORMS) and - // whose stored-URL mode is not "never": every corrupt full source's + // transcribe-handling channel whose stored-URL mode is not "never": every + // corrupt full source whose record stores a trusted media URL (one metadata + // read for each corrupt full source, none for any other video) — its // stored-URL download attempts so far (`attempts`, by id), of `of`, and the // untranscribed ones still owed one (`awaiting` — no salvage until then). - // The channel's platform stands in for each record's trusted URL (no - // metadata read per video). Omitted when there are none. + // Omitted when there are none. fullAudio?: { of: number; attempts: Record<string, number>; awaiting: string[] }; buckets: { noTranscript: string[]; @@ -1054,6 +1053,10 @@ export async function generateChannelSnapshot( const excludedFromTruncatedCheck = await isExcludedFromTruncatedCheck(dir); const outcome = await loadDownloadOutcome(dir); + // Release 32 R8: a corrupt full source's record stores a trusted media + // URL (full audio before a salvage) — one metadata read, for those only. + const storedUrlTrusted = + outcome?.status === "corrupt-full-source" ? (await storedMediaUrl(dir)) !== null : false; // A salvage transcript says so in its transcribe-outcome.json (release // 30, lane Q). Only a whisper transcript can be one, so only those // with the sidecar pay the small read. @@ -1141,6 +1144,7 @@ export async function generateChannelSnapshot( doNotClean, excludedFromTruncatedCheck, outcome, + storedUrlTrusted, salvaged, heldAudioDamaged, integrityState, @@ -1263,10 +1267,7 @@ export async function generateChannelSnapshot( const salvagedTranscript: string[] = []; const corruptHeldAudio: string[] = []; // Release 32 R8: full audio before a salvage (the snapshot's `fullAudio`). - const fullAudioChannel = - config?.handling === "transcribe" && - config.storedUrlDownloads !== "never" && - isStoredUrlPlatform(config.platform ?? detectPlatform(config.url)); + const fullAudioChannel = config?.handling === "transcribe" && config.storedUrlDownloads !== "never"; const fullAudioAttempts: Record<string, number> = {}; const fullAudioAwaiting: string[] = []; // The audio audit's verdicts over the channel (release 32): every @@ -1316,6 +1317,7 @@ export async function generateChannelSnapshot( backfill, effectiveAvailability, outcome, + storedUrlTrusted, salvaged, heldAudioDamaged, integrityState, @@ -1399,7 +1401,7 @@ export async function generateChannelSnapshot( if (salvaged) salvagedTranscript.push(id); if (outcome?.status === "corrupt-full-source") { corruptFullSource.push(id); - if (fullAudioChannel) { + if (fullAudioChannel && storedUrlTrusted) { const n = fullAudioAttemptsOf(outcome); fullAudioAttempts[id] = n; if (n < FULL_AUDIO_ATTEMPTS && !salvaged && !isVideoTranscribed(files)) fullAudioAwaiting.push(id);