// A POSTS CHANNEL WITH NO SOURCE (lane x-trending-publish): an X posts // channel that names no account, no search and no page — nothing to fetch. // A `postFetcher` key does not make a source (review 1 M2): a fetcher is HOW // a source is read, and with no url, handle, search, library marker or page // scope there is nothing for it to read. So that key is not asked, and // writing it cannot switch this predicate, and every guard that asks it, off. // Its posts were PUT there: a topic of a private library, published by the // operator (controller/publishXTrending.ts). The channel carries no mark of // that; it is told by its shape alone, and by this one predicate. // // SUCH A CHANNEL MAKES NO REQUEST ANYWHERE: fetch-posts, an X run, Sync all, // capture-posts and the availability check skip it where they list channels // and refuse it, with the sentence below, when asked for it by name. It is an // ordinary channel otherwise: indexed, built, and put on a site by the // operator's own act. A LEAF: types only. import { isRemoteOnlyChannel, isSocialChannel, type ChannelConfig } from "./channelConfig"; type Shape = Pick & Partial>; export function isSourcelessPostsChannel(config: Shape | null | undefined): boolean { if (!config || !isSocialChannel(config) || config.platform !== "twitter") return false; if (config.url || config.socialHandle) return false; if (config.xSearch || config.xTrending || config.wayback) return false; return !isRemoteOnlyChannel(config); } // What it is, wherever a fetch, a capture or Configure is asked of it. export const SOURCELESS_POSTS_CHANNEL = (slug: string) => `${slug} holds posts published from a private library: it has no account to fetch from, and nothing is asked of X for it.`; // WHY SYNC ALL SKIPS A CHANNEL FOR WHAT IT IS (its shape, before its state): // the reason the bulk bar shows, or null. Published posts are named as such, // not as a channel somebody forgot to give a URL. export function syncSkipForShape(config: (Shape & Pick) | null | undefined): string | null { if (isSourcelessPostsChannel(config)) return "published posts: no account to fetch from"; if (!config?.url) return "no url"; if (isRemoteOnlyChannel(config)) return "remote-only"; return null; }