@devries-cameron20 / composio-1 / commits / c2ade96e6
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(docs): retain local search section destinations

Keep section-linked prose alongside converted task instructions, assert the HTTP result anchor, and log expected mutations without false CI error annotations.

Brendan O'Leary committed Oct 15, 2026 at 00:40 UTC c2ade96e66defef87c024a49f047690afb3649de
4 files changed +25 -6
docs/agent-guidance/context/semantic-parity.md
+1 -1
@@ -20,7 +20,7 @@ Set `TEST_BASE_URL` to check a deployed site. The standard docs CI already runs
20
21 `tests/fixtures/semantic-parity.ts` defines 35 reviewed facts across eight pages: the product chooser, quickstart, Anthropic provider, For You plugins, coding-agent setup, current and legacy REST tools pages, and the standup bot example. The [component audit](./markdown-components.md) informs the coverage: installation commands, package and toolkit selection rules, warnings, executable code, API versions, image captions and links, staged example source, and repository-availability notices.
22
23 -The static suite checks both the complete Algolia replacement payload after chunking and the local `/api/search` corpus. The HTTP suite checks actual page Markdown and each page's section in `/llms-full.txt`. A fact on another page cannot satisfy the assertion. Legacy REST pages are checked individually and in search, including their legacy classification. The current full corpus must exclude them.
23 +The static suite checks both the complete Algolia replacement payload after chunking and the local `/api/search` corpus. Local search keeps its existing section-linked prose alongside converted commands and code. The HTTP suite checks actual page Markdown and each page's section in `/llms-full.txt`. A fact on another page cannot satisfy the assertion. Legacy REST pages are checked individually and in search, including their legacy classification. The current full corpus must exclude them.
24
25 Failures name the page, fact ID, and surface that lost it. Mutation checks remove every expected fact from real surface output and verify that its assertion fails. The external checker test also logs a deliberately removed command and its expected failure to CI output. Assertions ignore whitespace differences from line wrapping and paragraph boundaries, but retain command flags, package names, version numbers, and code punctuation. Review the source instructions before changing an expectation. Do not regenerate expectations from converter output.
26
docs/lib/search-index.ts
+6 -3
@@ -712,8 +712,8 @@ export async function getDocsSearchIndexes(): Promise<SearchIndex[]> {
712 ].filter((page) =>
713 !isExcludedFromSearch(page.url) && !isHiddenApiTagUrl(page.url)
714 ).map(async (page) => {
715 - // Structured MDX search data omits code and custom-component instructions.
716 - // Preserve the same converted text used by the agent-readable page surface.
715 + // Keep section-linked prose and add code and custom-component instructions
716 + // omitted by structured MDX search data.
717 const content = 'getText' in page.data
718 ? mdxToCleanMarkdown(await page.data.getText('raw'), page.url)
719 : undefined;
@@ -726,7 +726,10 @@ export async function getDocsSearchIndexes(): Promise<SearchIndex[]> {
726 ? page.data.structuredData
727 : {
728 ...page.data.structuredData,
729 - contents: [{ heading: undefined, content }],
729 + contents: [
730 + ...(page.data.structuredData?.contents ?? []),
731 + { heading: undefined, content },
732 + ],
733 },
734 keywords: 'keywords' in page.data ? (page.data.keywords as string[]) : undefined,
735 } satisfies SearchIndex;
docs/tests/integration/semantic-parity.test.ts
+15
@@ -1,4 +1,5 @@
1 import { beforeAll, expect, test } from 'bun:test';
2 +import { z } from 'zod';
3 import { fetchPage } from './helpers';
4 import { assertPageFacts, corpusPages, parityPages } from '../fixtures/semantic-parity';
5
@@ -43,3 +44,17 @@ for (const page of parityPages) {
44 }
45 }
46 }
47 +
48 +test('local HTTP search retains section links alongside the added command and code corpus', async () => {
49 + const query = encodeURIComponent('session has access to every toolkit');
50 + const response = await fetchPage(`/api/search?query=${query}`);
51 + expect(response.status).toBe(200);
52 + const results = z.array(z.object({
53 + type: z.string(), url: z.string(), content: z.string(),
54 + })).parse(await response.json());
55 + const destinations = results
56 + .filter(result => result.type === 'text'
57 + && result.content.replace(/<\/?mark>/g, '').includes('every toolkit'))
58 + .map(result => result.url);
59 + expect(destinations).toContain('/docs/configuring-sessions#creating-a-session');
60 +});
docs/tests/static/semantic-parity.test.ts
+3 -2
@@ -88,8 +88,9 @@ test('external checker preserves ordered line chunks and names missing facts and
88 content: page.content.replaceAll('composio login', ''),
89 })) });
90 expect(missingFact.exitCode).not.toBe(0);
91 - expect(missingFact.stderr.toString()).toContain('test external export /docs/agent-plugins lost fact login-and-setup');
92 - console.info(`Expected mutation failure from external checker:\n${missingFact.stderr.toString()}`);
91 + const diagnostic = 'test external export /docs/agent-plugins lost fact login-and-setup';
92 + expect(missingFact.stderr.toString()).toContain(diagnostic);
93 + console.info(`Expected mutation caught (checker exit ${missingFact.exitCode}): ${diagnostic}`);
94 const missingPage = run({ ...snapshot, pages: snapshot.pages.filter(page => !page.url.includes('/quickstart')) });
95 expect(missingPage.exitCode).not.toBe(0);
96 expect(missingPage.stderr.toString()).toContain('test external export /docs/quickstart lost fact typescript-install');