Found while implementing #184 (asserting the locale composition of the built llms bodies). Out of that card's file surface — it only touches .github/scripts/check-locale-surface.mjs — hence a separate card. No behaviour is wrong today; this is about a comment that would mislead the next person to check it.
What the comment claims
apps/docs/app/llms.txt/route.ts:31-36, the block that explains why LANG is pinned:
English only, by AGENTS.md rule 1 [...] source.getPages() and source.getPageTree() list every language when called without one, which is how this file used to emit all 335 pages across 7 locales as one flat list.
The claim about getPages() is correct and well evidenced — lib/seo.ts records that a bare source.getPages() returns 553 pages against 79 real English ones, and I reproduced exactly that.
The claim about getPageTree() is not.
Measurement
Against fumadocs-core 16.8.12 with this repo's content, on 9a1a7ad, dropping the argument from source.getPageTree(LANG) in this route and rebuilding with pnpm turbo run build --force:
|
llms.txt.body sha256 |
source.getPageTree(LANG) |
883ebd3834fb1deb49f0c58cb153ed0a2eb06de16b854da592ce8e013ca85b1b |
source.getPageTree() |
883ebd3834fb1deb49f0c58cb153ed0a2eb06de16b854da592ce8e013ca85b1b |
Byte-identical. The mutation was confirmed on disk before the build (the getPageTree(LANG) occurrence count went 1 to 0, and the file's blob moved from 790d942a to fa061ce3), so this is a real no-op and not an unbuilt measurement. getPageTree() with no language resolves to the default language.
The historical defect this route was fixed for was in fact source.getPages(). git show 9c29df6^:apps/docs/app/llms.txt/route.ts is nine lines long and reads for (const page of source.getPages()) — a flat bullet list, which is what "as one flat list" in the comment is describing. Restoring that exact blob does reproduce the seven-locale leak.
Why it is worth fixing rather than leaving
The comment is the only thing on the page explaining why LANG exists. Its stated justification for the current call is checkable in about two minutes and comes back false. The failure mode is a future reader verifying it, finding the pin makes no difference to getPageTree, and concluding the pin is cargo cult — removing it, or removing it from the next route written from this one as a template. The pin should stay: nothing in the API contract promises getPageTree() will keep defaulting to the default language, and #184's gate now asserts the output either way.
Suggested repair: attribute the leak to getPages(), which is where it was and where it still is, and state the getPageTree() position as "passes the language because the tree is per-locale and the default is not contractual" rather than as an observed leak.
Related, same neighbourhood: apps/docs/app/llms-full.txt/route.ts carries a similar block, but its claim is about getPages() only and is accurate.
Generated by Claude Code
Found while implementing #184 (asserting the locale composition of the built
llmsbodies). Out of that card's file surface — it only touches.github/scripts/check-locale-surface.mjs— hence a separate card. No behaviour is wrong today; this is about a comment that would mislead the next person to check it.What the comment claims
apps/docs/app/llms.txt/route.ts:31-36, the block that explains whyLANGis pinned:The claim about
getPages()is correct and well evidenced —lib/seo.tsrecords that a baresource.getPages()returns 553 pages against 79 real English ones, and I reproduced exactly that.The claim about
getPageTree()is not.Measurement
Against fumadocs-core 16.8.12 with this repo's content, on
9a1a7ad, dropping the argument fromsource.getPageTree(LANG)in this route and rebuilding withpnpm turbo run build --force:llms.txt.bodysha256source.getPageTree(LANG)883ebd3834fb1deb49f0c58cb153ed0a2eb06de16b854da592ce8e013ca85b1bsource.getPageTree()883ebd3834fb1deb49f0c58cb153ed0a2eb06de16b854da592ce8e013ca85b1bByte-identical. The mutation was confirmed on disk before the build (the
getPageTree(LANG)occurrence count went 1 to 0, and the file's blob moved from790d942atofa061ce3), so this is a real no-op and not an unbuilt measurement.getPageTree()with no language resolves to the default language.The historical defect this route was fixed for was in fact
source.getPages().git show 9c29df6^:apps/docs/app/llms.txt/route.tsis nine lines long and readsfor (const page of source.getPages())— a flat bullet list, which is what "as one flat list" in the comment is describing. Restoring that exact blob does reproduce the seven-locale leak.Why it is worth fixing rather than leaving
The comment is the only thing on the page explaining why
LANGexists. Its stated justification for the current call is checkable in about two minutes and comes back false. The failure mode is a future reader verifying it, finding the pin makes no difference togetPageTree, and concluding the pin is cargo cult — removing it, or removing it from the next route written from this one as a template. The pin should stay: nothing in the API contract promisesgetPageTree()will keep defaulting to the default language, and #184's gate now asserts the output either way.Suggested repair: attribute the leak to
getPages(), which is where it was and where it still is, and state thegetPageTree()position as "passes the language because the tree is per-locale and the default is not contractual" rather than as an observed leak.Related, same neighbourhood:
apps/docs/app/llms-full.txt/route.tscarries a similar block, but its claim is aboutgetPages()only and is accurate.Generated by Claude Code