commit b6ec25a9a5bd9e5b6484aae97e77369a2285e91c
parent d2fe31854c5bee67b67ee947ed0791c5226c98f2
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 30 Sep 2026 19:38:25 -0400
common: corpus.test pins useWithAi to AI_DOC_URL (site and hub) and llms.txt's two Ask AI lines (review L3)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/common/lib/corpus.test.ts b/common/lib/corpus.test.ts
@@ -9,7 +9,7 @@ import {
renderSitemapXml,
CORPUS_SPEC_VERSION,
} from "./corpus";
-import { PROJECT_GENERATOR } from "./project";
+import { AI_DOC_URL, PROJECT_GENERATOR } from "./project";
import type { PublicSiteDescriptor } from "./siteDescriptor";
// Run with:
@@ -159,6 +159,37 @@ test("both builders stamp the project generator, and llms.txt trails it", () =>
}
});
+test("Use with AI is the homepage's AI and MCP doc; the chat is the instance's /ask/", () => {
+ // Release 16 slice DX: no site or hub has a /use-with-ai page. corpus.json
+ // keeps the key and names the doc; llms.txt's Ask AI section is two lines.
+ const site = buildSiteCorpus(descriptor({ siteUrl: "https://demo.example" }), {
+ hasArchives: false,
+ });
+ const hub = buildHubCorpus(
+ [{ siteId: "a", siteTitle: "A", siteUrl: "https://a.example" }],
+ { hubTitle: "The Hub", hubUrl: "https://hub.example", generatedAt: "t" },
+ );
+ assert.equal(site.useWithAi, AI_DOC_URL);
+ assert.equal(hub.useWithAi, AI_DOC_URL);
+ assert.equal(AI_DOC_URL, "https://archilyzer.pages.dev/docs/ai-and-mcp/");
+
+ const siteLines = renderSiteLlmsTxt(site).split("\n");
+ const siteAt = siteLines.indexOf("## Ask AI");
+ assert.deepEqual(siteLines.slice(siteAt + 1, siteAt + 3), [
+ "- [Ask AI](https://demo.example/ask/): in-browser chat (bring your own API key).",
+ `- [Use with AI](${AI_DOC_URL}): MCP-server setup for Claude Code, Cursor, and other tools.`,
+ ]);
+ const hubLines = renderHubLlmsTxt(hub).split("\n");
+ const hubAt = hubLines.indexOf("## Ask AI");
+ assert.deepEqual(hubLines.slice(hubAt + 1, hubAt + 3), [
+ "- [Ask AI](https://hub.example/ask/): ask across the whole federation (bring your own API key).",
+ `- [Use with AI](${AI_DOC_URL}): wire up the MCP server.`,
+ ]);
+ for (const txt of [renderSiteLlmsTxt(site), renderHubLlmsTxt(hub)]) {
+ assert.doesNotMatch(txt, /use-with-ai/);
+ }
+});
+
test("the spec is 4, and `generator` is still not why", () => {
// Guard on the reasoning, not just the number: a bump announces a new
// FETCHABLE document. spec 4 is /tags.json. The informational credit string