commit 69129b97d545fb250ea0e867b723f4134f3dfcfe
parent 883021c38238c72c4c1f41b740064f07dfbcebd1
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 2 Oct 2026 01:30:55 -0400
common, editor: review N6 — legacy channels on the corpus row are to migrate, not unmeasured
Their text and clips are on their retired dataDir: left out of the corpus
volume's sums and named "legacy (n to migrate)" in its breakdown.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
3 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/common/views/storage.test.ts b/common/views/storage.test.ts
@@ -442,6 +442,24 @@ test("an old report's missing text figure is unknown on the internal row, never
assert.equal(rows[0].bytesText, "5.00 GB + 3 unmeasured");
});
+test("the corpus row names legacy channels to migrate, never as unmeasured", () => {
+ const { rows } = buildStorageRows({
+ locations: [],
+ internal: {
+ root: "/corpus/channels",
+ corpus: { textBytes: 1 * GB, clipsBytes: 0, unknown: 0, legacy: 2 },
+ },
+ defaultLocationId: "",
+ probes: {},
+ rollups: { internal: rollup({ locationId: "internal", total: 1, ok: 1, bytes: 1 * GB }) },
+ registry: NO_JOBS,
+ now: 0,
+ });
+ assert.equal(rows[0].unknownBytes, 0);
+ assert.equal(rows[0].bytesText, "2.00 GB");
+ assert.match(rows[0].tiersText, /legacy \(2 to migrate\)/);
+});
+
test("a legacy channel counts as unreachable, with how many are to migrate", () => {
const { rows } = buildStorageRows({
locations: [loc("cold", "/mnt/cold")],
diff --git a/common/views/storage.ts b/common/views/storage.ts
@@ -216,7 +216,14 @@ export type StorageRowsInputs = {
internal?: {
root: string;
freeBytes?: number;
- corpus?: { textBytes: number; clipsBytes: number; unknown: number };
+ // `legacy`: channels still on the retired whole-directory layout, whose
+ // text is NOT on this volume — named "(n to migrate)", never unmeasured.
+ corpus?: {
+ textBytes: number;
+ clipsBytes: number;
+ unknown: number;
+ legacy?: number;
+ };
};
defaultLocationId: string;
// By location id. A location with no entry has never been probed in this
@@ -293,11 +300,15 @@ export function storageTiersText(
textBytes: number,
clipsBytes: number,
inPlaceMediaBytes: number,
+ legacy = 0,
): string {
return (
`text ${bytesLabel(textBytes)} + clips ${bytesLabel(clipsBytes)} on the ` +
`corpus volume, plus ${bytesLabel(inPlaceMediaBytes)} media of in-place ` +
- `channels`
+ `channels` +
+ (legacy > 0
+ ? `; legacy (${legacy} to migrate) — their text is still on their media drive`
+ : "")
);
}
@@ -556,7 +567,12 @@ function internalRow(
clipsBytes,
clipsText: storageClipsText(clipsBytes),
tiersText: corpus
- ? storageTiersText(corpus.textBytes, corpus.clipsBytes, inPlaceMedia)
+ ? storageTiersText(
+ corpus.textBytes,
+ corpus.clipsBytes,
+ inPlaceMedia,
+ corpus.legacy ?? 0,
+ )
: "",
...(internal.freeBytes !== undefined ? { freeBytes: internal.freeBytes } : {}),
lastProbeAgeMs: 0,
diff --git a/editor/app/storage/buildStorage.ts b/editor/app/storage/buildStorage.ts
@@ -57,11 +57,19 @@ export async function buildStorage(): Promise<StorageRowsPayload> {
const mediaBytes: Record<string, number | undefined> = {};
const clipsBytes: Record<string, number | undefined> = {};
const textBytes: Record<string, number | undefined> = {};
- const corpus = { textBytes: 0, clipsBytes: 0, unknown: 0 };
+ const corpus = { textBytes: 0, clipsBytes: 0, unknown: 0, legacy: 0 };
for (const b of briefs) {
mediaBytes[b.slug] = b.snapshot?.totalMediaBytes;
clipsBytes[b.slug] = b.snapshot?.totalClipsBytes;
textBytes[b.slug] = b.snapshot?.totalTextBytes;
+ // A LEGACY channel's text and clips are not on the corpus volume at all
+ // (they are on its retired `dataDir`, and its report cannot be refreshed
+ // until it is migrated): counted as "to migrate", never added here and
+ // never "unmeasured" (review N6).
+ if (b.config.dataDir?.trim()) {
+ corpus.legacy += 1;
+ continue;
+ }
const text = b.snapshot?.totalTextBytes;
const clips = b.snapshot?.totalClipsBytes;
if (typeof text === "number") corpus.textBytes += text;
@@ -69,7 +77,7 @@ export async function buildStorage(): Promise<StorageRowsPayload> {
// Unmeasured on the corpus volume: a report with no text figure — except
// an in-place channel whose MEDIA is unmeasured too, which the internal
// rollup already counts (one channel, one "unmeasured").
- const inPlace = !b.config.mediaDir?.trim() && !b.config.dataDir?.trim();
+ const inPlace = !b.config.mediaDir?.trim();
if (
typeof text !== "number" &&
!(inPlace && typeof b.snapshot?.totalMediaBytes !== "number")