LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-julia
createdAtOct 25, 2026, 2:21 AM
updatedAtOct 25, 2026, 2:25 AM
githubUrlhttps://github.com/neomjs/neo/issues/20101
authorneo-gemini-julia
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 25, 2026, 2:25 AM

Segment sitemap into core/archive index and emit llms-full.txt and llms-all.txt

Closed v13.4.0/archive-v13-4-0-chunk-3 enhancementaiarchitecturebuild
neo-gemini-julia
neo-gemini-julia commented on Oct 25, 2026, 2:21 AM

Problem

After #20089 (PR #20097) excluded the 19,436 raw GitHub archive routes (tickets, pull-requests, discussions) from the default sitemap.xml and llms.txt (469 core URLs vs 19,905 total; 40 KB vs 1.6 MB), two downstream consumer and observability requirements need a segmented Sitemap Index and tiered llms-*.txt hierarchy:

  1. Middleware prerender route source + Search Console per-child coverage (sitemap.xml): While every ticket page sidebar already links the archive for crawler discovery (neomjs/middleware-v2#35 / #36), neomjs/middleware-v2's BuildService#fetchDynamicRoutes derives its prerender route set from sitemap.xml. Turning sitemap.xml into a <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> over sitemap-core.xml (469 core URLs) and sitemap-archive.xml (19,436 archive URLs) preserves the full 19,905 route set for middleware-v2 (once neomjs/middleware-v2#40 expands <sitemapindex>) while giving per-child coverage reporting in Google Search Console.
  2. Tiered LLM context consumption (llms.txt vs llms-full.txt vs llms-all.txt): Following the llmstxt.org specification and the Map vs. World Atlas paradigm (ADR 0007), AI coding assistants need:
    • llms.txt (~40 KB Map): Curated index of core documentation, blog posts, release notes, and examples, with an ## Optional section pointing to deeper tiers.
    • llms-full.txt (~1.67 MB / ~427k tokens Core Documentation Atlas): Concatenated full Markdown prose of all 124 leaf guides in learn/tree.json (143 nodes minus 19 parent folders) in a single file for 1M-token context-window ingestion without N+1 fetches.
    • llms-all.txt (~1.26 MB Exhaustive Archive Index): Complete route index including all 19,436 ticket, PR, and discussion /raw/ links for deep forensic lookup.
  3. Distribution copy list (buildScripts/docs/seo/copy.mjs): SEO_FILES only copies ['robots.txt', 'llms.txt', 'sitemap.xml'] into dist/{development,esm,production}/apps/portal/, omitting the segmented sitemaps and tiered llms-*.txt files.

Intended Outcome

  1. buildScripts/docs/seo/generate.mjs:
    • Support onlyArchives filtering so getSitemapXml can emit either the core <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> (includeArchives: false) or the archive-only <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> (onlyArchives: true, containing tickets, pull-requests, and discussions).
    • Export getSitemapIndexXml({ baseUrl, sitemaps }) emitting a valid <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> referencing sitemap-core.xml and sitemap-archive.xml (with their newest <lastmod> when available).
    • Export getLlmsFullTxt({ baseUrl, basePath }) that walks the 124 leaf learn/tree.json guide routes and concatenates their Markdown content with canonical source URL headers.
    • Include a standard ## Optional section in the curated getLlmsTxt({ includeArchives: false }) output linking to llms-full.txt and llms-all.txt.
  2. buildScripts/docs/rebuildContentIndexesAndSeo.mjs:
    • Generate and write sitemap.xml (index), sitemap-core.xml, sitemap-archive.xml, llms.txt, llms-full.txt, and llms-all.txt under apps/portal/.
  3. buildScripts/docs/seo/copy.mjs:
    • Copy robots.txt, llms.txt, llms-full.txt, llms-all.txt, sitemap.xml, sitemap-core.xml, and sitemap-archive.xml into dist/*/apps/portal/.

Contract Ledger

Surface / Artifact Producer Consumers Contract / Deploy Order
sitemap.xml getSitemapIndexXml (buildScripts/docs/seo/generate.mjs) via rebuildContentIndexesAndSeo.mjs 1. neomjs/middleware-v2 BuildService#fetchDynamicRoutes (neomjs/middleware-v2#40)
2. neomjs/pages buildScripts/enhanceSeo.mjs (neomjs/pages#54)
3. Search engine crawlers via robots.txt
Root element changes from <urlset> to <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">. Deploy order: neomjs/middleware-v2#40 MUST be deployed before any neomjs/pages deploy ships a neomjs/neo build with #20102 (pre-#40 middleware matches only <url> blocks and would silently resolve 0 routes).
sitemap-core.xml & sitemap-archive.xml getSitemapXml (includeArchives: false / onlyArchives: true) via rebuildContentIndexesAndSeo.mjs 1. sitemap.xml <sitemapindex>
2. neomjs/middleware-v2#40 child-sitemap fetcher
3. neomjs/pages#54 enhanceSeo.mjs (OPTIONAL_SEO_FILES)
Valid <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> documents (469 core URLs in sitemap-core.xml; 19,436 archive URLs in sitemap-archive.xml).
llms.txt, llms-full.txt, llms-all.txt getLlmsTxt & getLlmsFullTxt via rebuildContentIndexesAndSeo.mjs 1. neomjs/pages#54 enhanceSeo.mjs
2. LLM/agent consumers (llmstxt.org discovery)
3. /raw/ markdown middleware (neomjs/middleware-v2#41 tracks /raw/ coverage for learn/PR/discussion links)
llms.txt (~40 KB curated Map) includes ## Optional pointing to llms-full.txt (124 leaf guides, ~1.67 MB / ~427k tokens) and llms-all.txt (19,904 links, ~1.26 MB).

Acceptance Criteria

  • getSitemapXml supports onlyArchives: true (emitting only tickets, pull-requests, and discussions routes) and includeArchives: false (emitting only core routes) using the standard http://www.sitemaps.org/schemas/sitemap/0.9 XML namespace.
  • getSitemapIndexXml emits a valid <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> pointing to sitemap-core.xml and sitemap-archive.xml, deriving each child entry's <lastmod> from the newest <lastmod> in that child <urlset> when present.
  • getLlmsTxt({ includeArchives: false }) includes an ## Optional section linking to llms-full.txt and llms-all.txt.
  • getLlmsFullTxt concatenates the Markdown prose of all 124 leaf learn/tree.json guides with # [Title](url) headers.
  • rebuildContentIndexesAndSeo writes sitemap.xml, sitemap-core.xml, sitemap-archive.xml, llms.txt, llms-full.txt, and llms-all.txt, and buildScripts/docs/seo/copy.mjs includes all 7 SEO/LLM files in SEO_FILES.
  • Unit tests in test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjs and test/playwright/unit/buildScripts/docs/RebuildContentIndexesAndSeo.spec.mjs verify the segmented sitemaps, sitemap index, llms-full.txt, llms-all.txt, and rebuild pipeline.
tobiu referenced in commit a882c8b - "feat(seo): segment sitemap into core/archive index and emit llms-full.txt and llms-all.txt (#20101) (#20102) on Oct 25, 2026, 2:25 AM
tobiu closed this issue on Oct 25, 2026, 2:25 AM