commit 46ec18ed7b9fe9098b23952d22816b04e079a6a6
parent f924bf1e3d5d345acc4426cd87b020e3193e1ea1
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 24 Sep 2026 16:50:10 -0400
comments: name what slices 3a and 4b left — sidecar(), writeJsonAtomic, reportStateOf's home
Comment-only; every file keeps its line count.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
8 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/common/controller/channels.ts b/common/controller/channels.ts
@@ -152,9 +152,9 @@ export async function countPlaylist(p: string): Promise<number | null> {
// THE CHANNEL config.json READER, WRITER AND PATCHER (one-core phase 3 slice
// 4b). The shape is lib/channelConfigSchema.ts; everything that reads or
// writes a config.json on the server goes through these three, except the two
-// places that read the RAW file on purpose (lib/channelMedia.ts's `dataDir`
-// guard, and the legacy `group` / `excludeFromSync` migrations, which need keys
-// the schema no longer names).
+// places that touch the RAW file on purpose: lib/channelMedia.ts's `dataDir`
+// guard reads it; the legacy `group` / `excludeFromSync` migrations need keys
+// the schema no longer names, and the latter also writes it back raw.
export function channelConfigPath(paths: Paths, slug: string): string {
return path.join(paths.channelsDir, slug, "config.json");
diff --git a/common/lib/attribution.ts b/common/lib/attribution.ts
@@ -29,8 +29,8 @@
// reason this is its own artifact. Recorded here so the idea is not re-proposed
// as an obvious saving.
//
-// WHY THE FILENAME MATTERS: never name a sidecar `transcript.<x>.<y>` —
-// SUB_FILE_RE in lib/videoStatus.ts claims any such file as a subtitle track.
+// WHY THE FILENAME MATTERS: SUB_FILE_RE (lib/videoStatus.ts) claims any
+// `transcript.<x>.<y>` as a subtitle track; sidecar() throws on such a name.
// One person, as this record names them. `index` is what segments point at, so
// it is stable within the record regardless of which lane produced it.
diff --git a/common/lib/clipWindow-server.ts b/common/lib/clipWindow-server.ts
@@ -84,8 +84,8 @@ export async function findContainingClipWindow(
return tightestClipWindow(await listClipWindows(videoDir), from, to);
}
-// tmp + rename, the idiom the rest of the repo writes sidecars with, so a
-// crash mid-write never leaves a half-parsed provenance under the real name.
+// Atomic (jsonFile-server's writeJsonAtomic, as every sidecar), so a crash
+// mid-write never leaves a half-parsed provenance under the real name.
export async function writeClipProvenance(
videoDir: string,
from: number,
diff --git a/common/lib/diarization.ts b/common/lib/diarization.ts
@@ -12,8 +12,8 @@
// recomputed from it at any time.
//
// WHY THE FILENAME MATTERS: never name a sidecar `transcript.<x>.<y>` —
-// SUB_FILE_RE in lib/videoStatus.ts claims any such file as a subtitle track.
-// The constant lives beside the other video-dir filenames in videoStatus.ts.
+// SUB_FILE_RE in lib/videoStatus.ts claims it as a subtitle track, and sidecar()
+// throws on it. The constant lives beside the other video-dir filenames there.
// One contiguous stretch of audio attributed to a single (anonymous) speaker
// cluster. Times are seconds from the start of the audio. `speaker` is a
diff --git a/common/lib/digest-server.ts b/common/lib/digest-server.ts
@@ -1,8 +1,8 @@
-// Server-only disk I/O for the two digest sidecars. Modelled on
-// availability-server.ts, which is the only per-video sidecar writer in the repo
-// with all four properties this needs: atomic tmp+rename, a tolerant validated
-// read that degrades to null, append-on-change history so re-runs are auditable,
-// and a PARTIAL-OWNERSHIP merge that preserves fields another writer owns.
+// Server-only disk I/O for the two digest sidecars. The atomic write and the
+// tolerant read that degrades to null are `sidecar()`'s (lib/sidecar-server.ts),
+// as for every sidecar; what is this file's own is the append-on-change history
+// (modelled on availability-server.ts) and a PARTIAL-OWNERSHIP merge that
+// preserves fields another writer owns.
//
// The partial-ownership property is the load-bearing one here: writeDigestSection
// replaces exactly one section and leaves the other alone, so a metered tags run
diff --git a/common/lib/digest.ts b/common/lib/digest.ts
@@ -15,7 +15,7 @@
// opens the machine file. Readers compose the two with effectiveDigest().
//
// NEVER rename these to `transcript.<x>.<y>` — SUB_FILE_RE in videoStatus.ts
-// would claim such a file as a subtitle track.
+// claims such a file as a subtitle track; sidecar() throws at declaration.
import type { FieldDocs } from "./fieldDocs";
diff --git a/common/lib/siteSchema.ts b/common/lib/siteSchema.ts
@@ -15,8 +15,8 @@
// the per-key object followed by ONE object-level step that resolves them.
//
// WHAT A WRITE PROMISES (writeSite in lib/site.ts): the throwing validations,
-// then `siteToDisk` below — which persists only what is not a default — through
-// the atomic writer. `siteToDisk(parseSite(x))` parses back to `parseSite(x)`
+// then `siteToDisk` below — the eight keys it always writes, and every other
+// key only when it is not its default — through the atomic writer. `siteToDisk(parseSite(x))` parses back to `parseSite(x)`
// (siteSchema.test.ts pins that over fixtures).
//
// The types moved here from lib/site.ts with their parsers (lib/site.ts
@@ -284,9 +284,9 @@ export function parseSite(siteId: string, raw: unknown): Site {
return site;
}
-// What a save puts on disk for an ALREADY-VALIDATED site: only the keys that
-// are not defaults. Pure — writeSite (lib/site.ts) runs the throwing
-// validations first and passes their normalized results in.
+// On disk for an ALREADY-VALIDATED site: siteId, the titles, homeTagline,
+// groups, defaultGroupId, channels always; any other key only when not its
+// default. Pure — writeSite (lib/site.ts) validates (throwing) first.
export function siteToDisk(site: Site): Site {
const groups = parseChannelGroups(site.groups);
const channels = parseSiteChannels(site.channels).filter(
diff --git a/editor/app/components/channelWork/ChannelWorkTable.tsx b/editor/app/components/channelWork/ChannelWorkTable.tsx
@@ -123,8 +123,8 @@ function Section({
// The shared row, for a table that draws no bands, no tier, no media badge and
// no Location column: those inputs are neutral rather than read. The report
-// state is the builder's `reportStateOf` — the loader's own definition, which
-// this table used to carry a copy of.
+// state is the builder's `reportStateOf` (common/views/channelRow.ts, moved
+// there from loadActionable), which this table used to carry a copy of.
function workRowOf(row: ActionableRow): ChannelRowView {
return buildChannelRowView({
slug: row.channel.slug,