// FULL AUDIO BEFORE A SALVAGE (operator ruling 2026-10-17; release 32 R8). // // A corrupt-full-source video (release 30, lane Q: the download completed, its // audio stayed malformed) used to be salvage-transcribed as soon as anyone // transcribed it. The ruling: a partial transcript is fine and stays marked, // but only once the full audio has been tried. For a record whose platform // serves its stored media URL (lib/storedMediaUrl.ts, STORED_URL_PLATFORMS), // the corrupt-source path first downloads from that URL — R7's ranged reader // with the audio check (ytdlp/storedUrlDownload.ts) — FULL_AUDIO_ATTEMPTS // times, paced by R7's gap (STORED_URL_NEW_FILE_GAP_MS), and only then may a // salvage transcript be made. A clean download retires a salvage already made // (corruptRefetch.ts, release 30's rule). // // AN ATTEMPT is a `stored-url-ranged` attempt in the video's download record: // a refetch appends its attempts to the corrupt-full-source record, so the // count is the video's whole stored-URL history. A refusal (429) counts: the // ruling is a number of attempts, not of successes. // // NOT APPLICABLE (null): a video that is not a corrupt full source, a record // with no trusted stored URL, a channel that is not transcribe handling, or a // stored-URL mode of "never" (the request's, else the channel's // `storedUrlDownloads` — an explicit never keeps release 30's behaviour). // // Pure: the reader is fullAudioFirst-server.ts. import type { DownloadOutcomeRecord } from "./downloadOutcome"; import type { StoredUrlMode } from "./storedMediaUrl"; export const FULL_AUDIO_ATTEMPTS = 2; export type FullAudioState = { // Stored-URL full-download attempts made so far. attempts: number; of: number; // Every attempt made: a salvage may follow. exhausted: boolean; }; export function fullAudioAttemptsOf(record: Pick | null | undefined): number { return (record?.attempts ?? []).filter((a) => a.kind === "stored-url-ranged").length; } export function fullAudioState( record: Pick | null | undefined, o: { storedUrlTrusted: boolean; handling?: string; mode?: StoredUrlMode }, ): FullAudioState | null { if (record?.status !== "corrupt-full-source") return null; if (!o.storedUrlTrusted || o.mode === "never") return null; if (o.handling !== undefined && o.handling !== "transcribe") return null; const attempts = fullAudioAttemptsOf(record); return { attempts, of: FULL_AUDIO_ATTEMPTS, exhausted: attempts >= FULL_AUDIO_ATTEMPTS }; } // "full audio attempts: 1 of 2" export function fullAudioLine(s: Pick): string { return `full audio attempts: ${s.attempts} of ${s.of}`; } // What a transcription that would salvage too early says (transcribeOne's // refusal; the editor's Transcribe downloads the attempts first). export function fullAudioFirstRefusal(s: FullAudioState): string { return ( `Full audio first (${fullAudioLine(s)}): a salvage transcript waits until the stored media URL ` + `has been tried ${s.of} times. Transcribe from the video page downloads them first; ` + `transcribe with salvage to make the partial transcript now.` ); }