Archilyzer · Source

archilyzer

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

commit d1d249ff285ed7b678d2ba4b34ad690620d38d99
parent a1dbe0b13af15e1083f18df55854fab3b7caa587
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri,  2 Oct 2026 01:30:55 -0400

common: review L4 — the live-chat archive counts what it left out

While a channel's media is away, a video with a raw replay and no cues on disk
is counted in the build log ("N video(s) with a raw replay and no cues left
out of this build"); the channel is never dropped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Diffstat:
Mcommon/controller/archiveLiveChat.ts | 18++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/common/controller/archiveLiveChat.ts b/common/controller/archiveLiveChat.ts @@ -18,6 +18,7 @@ import path from "node:path"; import { access, link, + lstat, mkdir, readdir, rm, @@ -28,6 +29,7 @@ import pLimit from "p-limit"; import { listChannelStatsFromDisk, type ChannelStat } from "./channels"; import { isLiveChatCuesFresh, normalizeLiveChat } from "./normalizeLiveChat"; import { inspectChannelMedia } from "../lib/channelMedia"; +import { LIVE_CHAT_MEDIA_FILENAME } from "../lib/mediaTier"; import { archiveExtension, archiveSidecarPath, @@ -156,6 +158,10 @@ async function stageChannel( let linkedCount = 0; let normalizeFailed = 0; let keptStale = 0; + // Videos with a raw replay (a link onto the away drive, lstat'd) and no cues + // on disk yet: left out of this build, and COUNTED — a drive outage must not + // shrink a site silently (review L4). + let leftOut = 0; const requiresRewrite = !build.includeMetadata || build.prettyPrint; @@ -185,7 +191,14 @@ async function stageChannel( (st) => st.isFile(), () => false, ); - if (!have) return; + if (!have) { + const hasRaw = await lstat(path.join(videoDir, LIVE_CHAT_MEDIA_FILENAME)).then( + () => true, + () => false, + ); + if (hasRaw) leftOut++; + return; + } if (!fresh) keptStale++; outcome = { status: "fresh" as const, cuesPath }; } @@ -218,7 +231,8 @@ async function stageChannel( log( ` ${ch.slug}: its media is not reachable (${media.detail ?? media.status}) — ` + `staged the live-chat cues on disk as they are` + - (keptStale > 0 ? ` (${keptStale} older than their raw replay)` : ""), + (keptStale > 0 ? ` (${keptStale} older than their raw replay)` : "") + + `; ${leftOut} video(s) with a raw replay and no cues left out of this build`, ); }