commit 251102e38815f3f00198bf2b229c6d69b4381762
parent d816088420e4c38dac4f4eeeaa92903ca7b24e2b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 20 Oct 2026 17:15:56 -0400
x search: the site guard reads no pool a scratch Paths does not have; the CLI's --leads and x-search-lead pinned
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/common/lib/site.ts b/common/lib/site.ts
@@ -237,6 +237,8 @@ export function xSearchChannelOnSite(
site: Pick<Site, "channels" | "citedChannels">,
paths: Paths,
): string | null {
+ // A Paths with no channel pool (a test's scratch paths) has nothing to read.
+ if (!paths.channelsDir) return null;
const slugs = [...site.channels.map((c) => c.slug), ...(site.citedChannels ?? []).map((c) => c.slug)];
for (const slug of slugs) {
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(slug)) continue;
diff --git a/scripts/archilyzer-ops.test.mjs b/scripts/archilyzer-ops.test.mjs
@@ -104,6 +104,19 @@ test("get channel --counts asks for the live on-disk counts", () => {
assert.equal(parseArgs(["get", "channel", "x"]).path, "/api/ops/channel/x");
});
+// Release 38 lane S: an X search channel's leads, and the action on one.
+test("get channel --leads [--limit] reads an X search channel's leads; x-search-lead posts its body", () => {
+ assert.equal(parseArgs(["get", "channel", "s", "--leads"]).path, "/api/ops/channel/s?leads=1");
+ assert.equal(parseArgs(["get", "channel", "s", "--leads", "--limit", "20"]).path, "/api/ops/channel/s?leads=1&limit=20");
+ assert.equal(parseArgs(["get", "channel", "s", "--counts", "--leads"]).path, "/api/ops/channel/s?counts=1&leads=1");
+ assert.match(parseArgs(["get", "channel", "s", "--limit", "20"]).error, /--limit goes with --leads/);
+ assert.match(parseArgs(["get", "jobs", "--leads"]).error, /get jobs does not take --leads/);
+ const p = parseArgs(["x-search-lead", "--json", '{"slug":"s","handle":"h","action":"never"}']);
+ assert.equal(p.method, "POST");
+ assert.equal(p.path, "/api/ops/x-search-lead");
+ assert.deepEqual(p.body, { slug: "s", handle: "h", action: "never" });
+});
+
// --- curated tags -----------------------------------------------------------
test("the tag actions are registered and post to their routes", () => {