commit aa4d0d2756b942913b9ee35499869d71e9a20bc9
parent e20c1ef8723403d30e9f103901b82cea7ec10da2
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 10 Oct 2026 12:19:08 -0400
publish: a cited-only channel signs its trees; its corpus never ships
inputSig signs each cited-only channel's shared transcripts and posts trees
(compose reads its cited records and posts from the data they are built from),
only when the site has one, so every other site keeps its signature. A new
`builtCitedOnlyProblem` refuses a build or deploy whose out dir holds a
cited-only channel's transcripts, subs, posts (tombstones aside), digests,
stats or archives tree, or lists it in corpus.json's or site.json's channels;
it is chained beside builtScopeProblem in the build phase, the deploy stage
and deployAudienceProblem.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
9 files changed, 272 insertions(+), 33 deletions(-)
diff --git a/common/lib/builtExport.test.ts b/common/lib/builtExport.test.ts
@@ -5,6 +5,7 @@ import { tmpdir } from "node:os";
import path from "node:path";
import {
builtBundleProblem,
+ builtCitedOnlyProblem,
builtHomepageAt,
builtHomepageProblem,
builtHubProblem,
@@ -19,6 +20,7 @@ import {
publishFileSizeProblem,
reportHistoryProblem,
isTombstonePostsTree,
+ isTombstoneChannelPostsDir,
hubReportDataIn,
} from "./builtExport";
@@ -538,6 +540,70 @@ test("a site configured cited with a full build is refused at deploy; a cited bu
}
});
+// RELEASE 23: a cited-only channel (`citedChannels`) publishes its cited
+// moments and clips, never its corpus.
+test("a build that publishes a cited-only channel's corpus is refused; its moments and clips are not", () => {
+ const site = {
+ siteId: "citing",
+ channels: [{ slug: "pool" }],
+ citedChannels: [{ slug: "critic" }],
+ };
+ const corpus = { spec: 5, kind: "site", site: { id: "citing" }, channels: [{ slug: "pool" }] };
+ const t = bundle({ site: { siteId: "citing", channels: [{ slug: "pool" }] }, corpus });
+ const put = (rel: string, body = "{}") => {
+ mkdirSync(path.dirname(path.join(t.dir, rel)), { recursive: true });
+ writeFileSync(path.join(t.dir, rel), body);
+ };
+ try {
+ // The pool's trees, and the cited channel's moments and clips: clean.
+ put("transcripts/pool/page-0000.json", "[]");
+ put("posts/pool/page-0000.json", "[]");
+ put("m/critic/abc123/10.00-20.00/moment.json");
+ put("media/clips/critic/abc123/10.00-20.00.mp4", "mp4");
+ assert.equal(builtCitedOnlyProblem(site, t.dir), null);
+ assert.equal(deployAudienceProblem(site, t.dir), null);
+ // A site with no cited scope, or the id alone, is never asked.
+ assert.equal(builtCitedOnlyProblem({ siteId: "citing" }, t.dir), null);
+ // A tombstone of its posts is not its posts.
+ put("posts/critic/manifest.json", JSON.stringify({ pageCount: 0, slugToPage: {} }));
+ put("posts/critic/page-0000.json", "[]");
+ assert.equal(isTombstoneChannelPostsDir(path.join(t.dir, "posts", "critic")), true);
+ assert.equal(builtCitedOnlyProblem(site, t.dir), null);
+
+ // Its trees, each named.
+ put("transcripts/critic/page-0000.json", "[]");
+ put("digests/critic/manifest.json");
+ put("posts/critic/page-0001.json", '[{"id":"1"}]');
+ const problem = builtCitedOnlyProblem(site, t.dir)!;
+ assert.match(problem, /^Site "citing" cites "critic" only \(citedChannels\), but .* publishes its corpus: /);
+ assert.match(problem, /transcripts\/critic\//);
+ assert.match(problem, /digests\/critic\//);
+ assert.match(problem, /posts\/critic\//);
+ assert.match(problem, /compose the site again$/);
+ assert.equal(deployAudienceProblem(site, t.dir), problem);
+ // A slug the pool also holds is the pool's: nothing is cited-only.
+ assert.equal(builtCitedOnlyProblem({ ...site, channels: [{ slug: "pool" }, { slug: "critic" }] }, t.dir), null);
+ } finally {
+ t.cleanup();
+ }
+ // Listed in corpus.json's or site.json's channels.
+ const listed = bundle({
+ site: { siteId: "citing", channels: [{ slug: "pool" }, { slug: "critic" }] },
+ corpus: { ...corpus, channels: [{ slug: "pool" }, { slug: "critic" }] },
+ });
+ try {
+ const problem = builtCitedOnlyProblem(site, listed.dir)!;
+ assert.match(problem, /"critic" in corpus\.json's channels/);
+ assert.match(problem, /"critic" in site\.json's channels/);
+ } finally {
+ listed.cleanup();
+ }
+ // Nothing built: the identity checks answer that, not this one.
+ const empty = tempOut();
+ assert.equal(builtCitedOnlyProblem(site, empty.dir), null);
+ empty.cleanup();
+});
+
test("the publish limit: 24 MiB, inside Pages' 25, one sentence naming the file over it", () => {
assert.equal(PUBLISH_MAX_FILE_BYTES, 24 * 1024 * 1024);
assert.ok(PUBLISH_MAX_FILE_BYTES < PAGES_MAX_FILE_BYTES);
diff --git a/common/lib/builtExport.ts b/common/lib/builtExport.ts
@@ -15,7 +15,7 @@
import { existsSync, readdirSync, readFileSync, statSync, type Dirent } from "node:fs";
import path from "node:path";
-import { isCitedSite } from "./siteSchema";
+import { isCitedOnlyChannel, isCitedSite } from "./siteSchema";
import { REPORT_HISTORY_REPO_FILE_RE } from "./report/revisions";
import {
MOMENTS_INDEX_PATH,
@@ -160,10 +160,15 @@ export function builtAudienceProblem(outDir: string): string | null {
* logs or throws, or null.
*/
export function deployAudienceProblem(
- site: { siteId: string; audience?: string; search?: boolean },
+ site: CitedOnlySite & { audience?: string; search?: boolean },
outDir: string,
): string | null {
- return siteDeployProblem(site) ?? builtAudienceProblem(outDir) ?? builtScopeProblem(site, outDir);
+ return (
+ siteDeployProblem(site) ??
+ builtAudienceProblem(outDir) ??
+ builtScopeProblem(site, outDir) ??
+ builtCitedOnlyProblem(site, outDir)
+ );
}
// ─── A CITED build (a report-only site: site.json `search: false`) ───
@@ -398,6 +403,76 @@ export function builtScopeProblem(
);
}
+// ─── A cited-only channel (site.json `citedChannels`, release 23) ───
+
+// The site keys builtCitedOnlyProblem reads; a caller without the channel
+// lists (an audience check) passes the id alone, and nothing is cited-only.
+export type CitedOnlySite = {
+ siteId: string;
+ channels?: readonly { slug: string }[];
+ citedChannels?: readonly { slug: string }[];
+};
+
+// The per-channel trees a bundle publishes a channel's corpus in.
+const CHANNEL_TREES = ["transcripts", "subs", "posts", "digests", "stats", "archives"] as const;
+
+// The slugs a bundle's `<file>` lists under `channels[]` (corpus.json and
+// site.json both carry `{slug}` entries), or none when it cannot be read.
+function listedChannelSlugsIn(outDir: string, file: string): Set<string> {
+ try {
+ const parsed: unknown = JSON.parse(readFileSync(path.join(outDir, file), "utf8"));
+ const channels = (parsed as { channels?: unknown } | null)?.channels;
+ if (!Array.isArray(channels)) return new Set();
+ return new Set(
+ channels
+ .map((c) => (c as { slug?: unknown } | null)?.slug)
+ .filter((slug): slug is string => typeof slug === "string"),
+ );
+ } catch {
+ return new Set();
+ }
+}
+
+/**
+ * Why `outDir` may not be built or deployed as `site` because it publishes a
+ * CITED-ONLY channel's corpus, as one sentence — or null. A cited-only channel
+ * (`citedChannels`) publishes its cited moments and clips (`m/`, `media/`) and
+ * nothing else: no transcripts, subs, posts, digests, stats or archives tree
+ * named for it (a posts tree of tombstones only aside), and no entry in
+ * corpus.json's or site.json's `channels`. Compose never writes those for it;
+ * this is the second line, chained beside builtScopeProblem by the build
+ * (publish/build.ts), the deploy stage and deployAudienceProblem.
+ */
+export function builtCitedOnlyProblem(site: CitedOnlySite, outDir: string): string | null {
+ const pool = { channels: site.channels ?? [], citedChannels: site.citedChannels };
+ const citedOnly = [...new Set((site.citedChannels ?? []).map((c) => c.slug))].filter((slug) =>
+ isCitedOnlyChannel(pool, slug),
+ );
+ if (citedOnly.length === 0 || !existsSync(outDir)) return null;
+ const listedIn = {
+ "corpus.json": listedChannelSlugsIn(outDir, "corpus.json"),
+ "site.json": listedChannelSlugsIn(outDir, "site.json"),
+ };
+ const found: string[] = [];
+ for (const slug of citedOnly.sort()) {
+ for (const tree of CHANNEL_TREES) {
+ const dir = path.join(outDir, tree, slug);
+ if (!existsSync(dir)) continue;
+ if (tree === "posts" && isTombstoneChannelPostsDir(dir)) continue;
+ found.push(`${tree}/${slug}/`);
+ }
+ for (const [file, slugs] of Object.entries(listedIn)) {
+ if (slugs.has(slug)) found.push(`"${slug}" in ${file}'s channels`);
+ }
+ }
+ if (found.length === 0) return null;
+ const shown = found.slice(0, 8).join(", ") + (found.length > 8 ? `, … (${found.length} in all)` : "");
+ return (
+ `Site "${site.siteId}" cites ${citedOnly.map((s) => `"${s}"`).join(", ")} only (citedChannels), ` +
+ `but ${outDir} publishes its corpus: ${shown} — compose the site again`
+ );
+}
+
// corpus.json's `site.id`, or null when there is no readable one.
function corpusSiteIdIn(outDir: string): string | null {
try {
@@ -480,24 +555,39 @@ export function isTombstonePostsTree(postsDir: string): boolean {
for (const e of entries) {
if (e.name === "manifest.json" && e.isFile()) continue;
if (!e.isDirectory()) return false;
- const dir = path.join(postsDir, e.name);
- const channel = readJson(path.join(dir, "manifest.json")) as
- | { pageCount?: unknown; slugToPage?: unknown }
- | undefined;
- if (!channel || channel.pageCount !== 0) return false;
- if (channel.slugToPage && Object.keys(channel.slugToPage as object).length > 0) return false;
- let files: Dirent[];
+ if (!isTombstoneChannelPostsDir(path.join(postsDir, e.name))) return false;
+ }
+ return true;
+}
+
+/**
+ * Whether one channel's posts dir (`posts/<slug>/`) is a TOMBSTONE: a posts
+ * manifest at pageCount 0 with no `slugToPage` entries, and only `[]` pages.
+ */
+export function isTombstoneChannelPostsDir(dir: string): boolean {
+ const readJson = (file: string): unknown => {
try {
- files = readdirSync(dir, { withFileTypes: true });
+ return JSON.parse(readFileSync(file, "utf8"));
} catch {
- return false;
- }
- for (const f of files) {
- if (f.name === "manifest.json") continue;
- if (!f.isFile() || !/^page-\d+\.json$/.test(f.name)) return false;
- const page = readJson(path.join(dir, f.name));
- if (!Array.isArray(page) || page.length > 0) return false;
+ return undefined;
}
+ };
+ const channel = readJson(path.join(dir, "manifest.json")) as
+ | { pageCount?: unknown; slugToPage?: unknown }
+ | undefined;
+ if (!channel || channel.pageCount !== 0) return false;
+ if (channel.slugToPage && Object.keys(channel.slugToPage as object).length > 0) return false;
+ let files: Dirent[];
+ try {
+ files = readdirSync(dir, { withFileTypes: true });
+ } catch {
+ return false;
+ }
+ for (const f of files) {
+ if (f.name === "manifest.json") continue;
+ if (!f.isFile() || !/^page-\d+\.json$/.test(f.name)) return false;
+ const page = readJson(path.join(dir, f.name));
+ if (!Array.isArray(page) || page.length > 0) return false;
}
return true;
}
diff --git a/common/lib/siteSchema.ts b/common/lib/siteSchema.ts
@@ -302,16 +302,21 @@ export function isListedSite(site: Pick<Site, "listed" | "audience" | "search">)
// lists in its corpus.json. Pool-only: a cited-only channel (`citedChannels`)
// is not here. Used to scope the editor's site-specific views (dashboard,
// channels) and everything a build publishes per channel.
-export function siteChannelSlugs(site: Pick<Site, "channels">): Set<string> {
+// The channel lists the helpers below read, readonly so a guard's narrower
+// shape (lib/builtExport.ts) fits as well as a Site.
+type ChannelLists = {
+ channels: readonly { slug: string }[];
+ citedChannels?: readonly { slug: string }[];
+};
+
+export function siteChannelSlugs(site: Pick<ChannelLists, "channels">): Set<string> {
return new Set(site.channels.map((c) => c.slug));
}
// THE CITABLE SET: the pool plus the cited-only channels — what a report on
// this site may cite (compose's and reportMedia's membership checks). Never a
// publish set: a cited-only channel publishes only the moments cited.
-export function siteCitableChannelSlugs(
- site: Pick<Site, "channels" | "citedChannels">,
-): Set<string> {
+export function siteCitableChannelSlugs(site: ChannelLists): Set<string> {
const out = siteChannelSlugs(site);
for (const c of site.citedChannels ?? []) out.add(c.slug);
return out;
@@ -319,10 +324,7 @@ export function siteCitableChannelSlugs(
// THE ONE PREDICATE for a cited-only channel on a site: in `citedChannels` and
// not in the pool (the pool wins, as the parser drops such a slug anyway).
-export function isCitedOnlyChannel(
- site: Pick<Site, "channels" | "citedChannels">,
- slug: string,
-): boolean {
+export function isCitedOnlyChannel(site: ChannelLists, slug: string): boolean {
if (site.channels.some((c) => c.slug === slug)) return false;
return (site.citedChannels ?? []).some((c) => c.slug === slug);
}
diff --git a/common/publish/build.ts b/common/publish/build.ts
@@ -15,6 +15,7 @@ import { Upload } from "@aws-sdk/lib-storage";
import { runChildIntoLog } from "../jobs/runChild";
import {
builtBundleProblem,
+ builtCitedOnlyProblem,
builtHubProblem,
builtScopeProblem,
citedBuildProblem,
@@ -199,10 +200,15 @@ export async function runBuildPhase(
if (code !== 0) return code;
// A CITED site's build must hold nothing but its reports, their moments and
// the shell (lib/builtExport.ts citedBuildProblem) — and must BE a cited
- // build. Failing here is loud and early; every deploy path asks again.
+ // build; and no site's build may publish a cited-only channel's corpus
+ // (builtCitedOnlyProblem). Failing here is loud and early; every deploy
+ // path asks again.
const outDir = resolveOutDir(siteId, paths);
+ const builtSite = getSite(siteId, paths);
const scopeProblem =
- citedBuildProblem(outDir) ?? builtScopeProblem(getSite(siteId, paths), outDir);
+ citedBuildProblem(outDir) ??
+ builtScopeProblem(builtSite, outDir) ??
+ builtCitedOnlyProblem(builtSite, outDir);
if (scopeProblem) {
onLog(`[build] REFUSED — ${scopeProblem}.\n`);
return 1;
diff --git a/common/publish/composeReports.test.ts b/common/publish/composeReports.test.ts
@@ -47,7 +47,9 @@ const { REPORT_MEDIA_FORMAT, REPORT_MEDIA_VERSION, reportMediaDir, reportMediaIn
const { QUOTE_CHECK_METHOD } = await import("../lib/citations/verify");
const { parseCitationSet } = await import("../lib/citations/validate");
const { CONTRACT } = await import("../lib/archive/contract");
-const { citedBuildProblem, builtBundleProblem, reportHistoryProblem } = await import("../lib/builtExport");
+const { citedBuildProblem, builtBundleProblem, builtCitedOnlyProblem, reportHistoryProblem } = await import(
+ "../lib/builtExport"
+);
const paths = getPaths();
const VIDEOS = "demo-channel";
@@ -908,6 +910,9 @@ test("a cited-only channel: its moment pages and clips publish on the citing sit
await compose("padded");
assert.ok(existsSync(pub("transcripts", VIDEOS)));
assert.equal(readJson<Moment>(pub("m", abc, "moment.json")).record.corpusUrl, `/?v=${VIDEOS}%2Fabc123&t=10`);
+ // A padded build is refused as the cited site's: it publishes the corpus.
+ const asCited = { siteId: "padded-cited", channels: pool, citedChannels: [{ slug: VIDEOS }] };
+ assert.match(builtCitedOnlyProblem(asCited, paths.exportPublicDir) ?? "", /transcripts\/demo-channel\//);
// What a padded build leaves in the shared public dir, and a stray digest.
writeText(pub("digests", VIDEOS, "manifest.json"), "{}");
@@ -956,6 +961,8 @@ test("a cited-only channel: its moment pages and clips publish on the citing sit
assert.deepEqual(site.channels.map((c) => c.slug), [SOCIAL], siteId);
// The sitemap lists the moment.
assert.match(readFileSync(pub("sitemap.xml"), "utf8"), new RegExp(`/m/${abc}/`), siteId);
+ // And the build guard passes what compose wrote.
+ assert.equal(builtCitedOnlyProblem({ ...asCited, siteId }, paths.exportPublicDir), null, siteId);
}
assert.equal(readJson<{ site: { audience?: string } }>(pub("corpus.json")).site.audience, "private");
diff --git a/common/publish/deployStage.test.ts b/common/publish/deployStage.test.ts
@@ -384,7 +384,7 @@ test("production ships only a build of main; the same build may go to a preview"
}
});
-test("the bundle guards: another site's bundle and a private build are refused before wrangler", async () => {
+test("the bundle guards: another site's bundle, a private build and a cited-only channel's corpus are refused before wrangler", async () => {
const fx = fixture();
try {
site(fx, "anilyzer");
@@ -401,8 +401,17 @@ test("the bundle guards: another site's bundle and a private build are refused b
3,
/private build of "bonnellyzer"/,
);
+ // A cited-only channel's corpus in the bundle (release 23).
+ site(fx, "citing", { channels: [{ slug: "pool" }], citedChannels: [{ slug: "critic" }] });
+ built(fx, "citing", { corpus: { site: { id: "citing" }, channels: [{ slug: "pool" }, { slug: "critic" }] } });
+ await refused(
+ runDeployStage(ctx(fx, TOKEN), { kind: "deploy-site", target: "citing" }),
+ 3,
+ /cites "critic" only \(citedChannels\), but .* publishes its corpus: "critic" in corpus\.json's channels/,
+ );
assert.deepEqual(sidecar(fx, "anilyzer"), []);
assert.deepEqual(sidecar(fx, "bonnellyzer"), []);
+ assert.deepEqual(sidecar(fx, "citing"), []);
} finally {
fx.cleanup();
}
diff --git a/common/publish/deployStage.ts b/common/publish/deployStage.ts
@@ -25,7 +25,7 @@
// 5. the bundle guards over the bundle itself (exit 3): builtBundleProblem
// (the site's own, by site.json AND corpus.json — the stricter twin of
// builtSiteProblem, naming the directory), builtAudienceProblem,
-// builtScopeProblem; the hub's builtHubProblem; the homepage's
+// builtScopeProblem, builtCitedOnlyProblem; the hub's builtHubProblem; the homepage's
// builtHomepageProblem + publishedSourceProblem
// 6. `--to local`: the bundle is copied into ARCHILYZER_SITE_OUT (the
// directory the compose `site` service serves; the homepage's is
@@ -53,6 +53,7 @@ import { runChildIntoLog } from "../jobs/runChild";
import {
builtAudienceProblem,
builtBundleProblem,
+ builtCitedOnlyProblem,
builtHomepageProblem,
builtHubProblem,
builtScopeProblem,
@@ -427,7 +428,10 @@ export async function runDeployStage(
// --- 5. the bundle guards ---
if (req.kind === "deploy-site") {
const problem =
- builtBundleProblem(outDir, target) ?? builtAudienceProblem(outDir) ?? builtScopeProblem(site!, outDir);
+ builtBundleProblem(outDir, target) ??
+ builtAudienceProblem(outDir) ??
+ builtScopeProblem(site!, outDir) ??
+ builtCitedOnlyProblem(site!, outDir);
if (problem) {
refuse(`${problem}. Nothing was sent to Cloudflare Pages; build ${target} again, then deploy.`, 3);
}
diff --git a/common/publish/inputSig.test.ts b/common/publish/inputSig.test.ts
@@ -180,6 +180,43 @@ test("inputSig moves with what the export BUILD renders: social links, the hub u
}
});
+// RELEASE 23: a cited-only channel's records and posts are read by compose
+// (its cited moments), so its shared transcripts and posts trees are signed —
+// and its subs and digests, which nothing on the site publishes, are not.
+test("inputSig signs a cited-only channel's transcripts and posts trees, and nothing changes for a site with none", async () => {
+ const s = setup();
+ try {
+ const none = await s.sig();
+ // An empty cited scope is no change at all.
+ (s.site as { citedChannels?: unknown }).citedChannels = [];
+ assert.equal(await s.sig(), none, "an empty citedChannels signs as before");
+ // A pool slug in citedChannels is the pool's: nothing new is signed.
+ (s.site as { citedChannels?: unknown }).citedChannels = [{ slug: "a" }];
+ assert.equal(await s.sig(), none, "the pool wins");
+ s.write(path.join(s.paths.exportSharedTranscriptsDir, "other", "page-0002.json"), "[8]");
+ assert.equal(await s.sig(), none, "another channel's tree is not this site's input");
+
+ (s.site as { citedChannels?: unknown }).citedChannels = [{ slug: "other" }];
+ let last = await s.sig();
+ assert.notEqual(last, none, "the cited scope is part of the signature");
+ const moved = async (what: string) => {
+ const now = await s.sig();
+ assert.notEqual(now, last, what);
+ last = now;
+ };
+ s.write(path.join(s.paths.exportSharedTranscriptsDir, "other", "page-0003.json"), "[9]");
+ await moved("a cited-only channel's transcripts");
+ s.write(path.join(s.paths.exportSharedPostsDir, "other", "page-0000.json"), "[10]");
+ await moved("a cited-only channel's posts");
+ s.write(path.join(s.paths.exportSharedSubsDir, "other", "page-0000.json"), "[11]");
+ assert.equal(await s.sig(), last, "its subs are never published here");
+ s.write(path.join(s.paths.exportSharedDigestsDir, "other", "page-0000.json"), "[12]");
+ assert.equal(await s.sig(), last, "nor its digests");
+ } finally {
+ rmSync(s.root, { recursive: true, force: true });
+ }
+});
+
test("a manifest-only member tree is signed as one, not as absent", async () => {
const s = setup();
try {
diff --git a/common/publish/inputSig.ts b/common/publish/inputSig.ts
@@ -11,6 +11,10 @@
// report media and exports);
// - each PUBLISHED member channel's shared transcripts / subs / posts /
// digests tree, `manifest.json` ignored (its `generatedAt` churns);
+// - each cited-only channel's (`citedChannels`) shared transcripts / posts
+// tree: compose reads its cited records and posts from the channel's data,
+// which those trees are built from (release 23). Signed only when the site
+// has one, so a site with none keeps its signature;
// - the bytes of `site.json`, and the signature of the site's config dir
// (`sites/<id>/`: tags, aliases, reports);
// - the corpus-wide files compose reads at compose time (search aliases,
@@ -42,7 +46,7 @@ import {
siteIndexDir,
type Site,
} from "../lib/site";
-import { isListedSite } from "../lib/siteSchema";
+import { isCitedOnlyChannel, isListedSite } from "../lib/siteSchema";
import { INDEX_SCANNED_AT_KEY } from "../lib/stats";
import { readChannelConfig } from "../controller/channels";
import type { ChannelConfig } from "../lib/channelConfig";
@@ -118,6 +122,20 @@ export async function siteInputSig(i: SiteSigInputs): Promise<string> {
lines.push(`${tree}/${slug}\t${await channelTreeSig(root, slug, cache)}`);
}
}
+ // A cited-only channel publishes only its cited moments, but they are read
+ // from its records and posts: a change there must make the site stale.
+ const citedOnly = [...new Set((site.citedChannels ?? []).map((c) => c.slug))]
+ .filter((slug) => isCitedOnlyChannel(site, slug))
+ .sort();
+ if (citedOnly.length > 0) lines.push(`cited-only\t${citedOnly.join(",")}`);
+ for (const slug of citedOnly) {
+ for (const [tree, root] of [
+ ["transcripts", paths.exportSharedTranscriptsDir],
+ ["posts", paths.exportSharedPostsDir],
+ ] as const) {
+ lines.push(`cited/${tree}/${slug}\t${await channelTreeSig(root, slug, cache)}`);
+ }
+ }
lines.push(`site.json\t${await fileBytesSig(siteConfigFile(paths, site.siteId))}`);
lines.push(`site-dir\t${await dirSignature(siteDir(paths, site.siteId))}`);
for (const file of [