LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-sophie
createdAtNov 21, 2026, 7:39 PM
updatedAtNov 21, 2026, 9:21 PM
githubUrlhttps://github.com/neomjs/neo/issues/21808
authorneo-gemini-julia
commentsCount2
parentIssue20671
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[x] 21811 Index the latest 25 release notes in sitemap-core.xml and seo.json
closedAtNov 21, 2026, 9:21 PM

Drop orphaned Portal sitemap/llms bloat and sync seo.json in prepare

Closed v14.0.0/archive-v14-0-0-chunk-6 bugaibuildportal
neo-gemini-julia
neo-gemini-julia commented on Nov 21, 2026, 7:39 PM

Context

Owned directly by @neo-gemini-julia under #20671 ahead of the Engine 14 cut (#21033 / #21775), so contributor labels (good first issue, help wanted) are omitted.

Inspecting apps/portal/sitemap.xml and the SEO generator pipeline in buildScripts/docs/seo/*.mjs plus buildScripts/release/prepare.mjs surfaced two coupled defects on dev:

  1. 2.24 MB (79,215 lines) of orphaned generated Portal crawler bloat is still tracked in neomjs/neo:
    • apps/portal/sitemap.xml (78,772 lines, 2.2 MB) is a frozen 2026-08-30 (7ecd6b8b6e) <urlset> monolith advertising /home and 19k+ raw ticket/PR routes, whereas the real deployed https://neomjs.com/sitemap.xml is an 11-line (369 B) <sitemapindex> referencing sitemap-core.xml and sitemap-discussions.xml.
    • apps/portal/llms.txt (443 lines, 36 KB) carries a broken - [v13.4.0 (2026-11-09): Update](...) placeholder at line 33 that violates validateLlmsTxtContent (buildScripts/docs/seo/verify.mjs:380).
    • Eight recent PRs (#20931, #20994, #21003, #21182, #21278, #21362, #21435, #21495) hand-edited apps/portal/sitemap.xml or apps/portal/llms.txt assuming they were live, while neomjs/pages (buildScripts/updateNeoVersion.mjs:236-245) regenerates sitemap*.xml and llms*.txt from --corpus-root at deploy time and .npmignore:17-18 excludes both from the npm tarball.
  2. node buildScripts/docs/seo/verify.mjs currently fails on dev, and buildScripts/release/prepare.mjs leaves seo.json stale across releases:
       Error: apps/portal/resources/data/seo.json is out of date with getSeoJson(). Run: node buildScripts/docs/seo/generate.mjs -f seo-json -o apps/portal/resources/data/seo.json
        at runCli (buildScripts/docs/seo/verify.mjs:870:19)
    apps/portal/resources/data/seo.json on dev holds 380 routes vs 392 expected — missing 12 standalone Engine 14 example routes (/examples/board/{bigData,cardEditor,columns,multiSelect}/index.html, /examples/gantt/{dependencies,taskColumns,taskEditor}/index.html, /examples/scheduler/{eventEditor,liveUpdates,resourceColumns,timeZones,zoom}/index.html) and carrying 45 stale lastmod / v14.0.0 release-note entries.

The Problem

  1. When #19322 (7ff8467baa) removed resources/content/ and data-sync-pipeline.yml from neomjs/neo, and #19408 (4658fbfa00) removed rebuildContentIndexesAndSeo() from buildScripts/release/prepare.mjs:108-111 (because sitemap*.xml and llms*.txt require --corpus-root), neither PR deleted the orphaned apps/portal/sitemap.xml and apps/portal/llms.txt files or added them to .gitignore, and .npmignore:14-18 kept a false comment claiming "Tracked so the deployment can serve them... Regenerated by the release prepare step".
  2. Unlike sitemap*.xml and llms*.txt, getSeoJson() (buildScripts/docs/seo/seoJson.mjs:819) requires zero --corpus-root (learn/, apps/, examples/, and .github/RELEASE_NOTES all live in neomjs/neo) — and must run inside neomjs/neo where .git history exists! When neomjs/pages runs rebuildContentIndexesAndSeo.mjs inside node_modules/neo.mjs, hasReliableGitHistory() (gitLastmod.mjs:40) is false, so getSeoJson() and getSitemapXml() depend on the pre-baked lastmod dates shipped inside apps/portal/resources/data/seo.json. Skipping getSeoJson() in buildScripts/release/prepare.mjs leaves new routes without <lastmod> in sitemap-core.xml and ships stale v14.0.0 metadata at release time.
  3. verify.mjs (runCli, lines 850–938) validates sitemapIndexXml and llmsTxt only in memory, never failing when stale apps/portal/sitemap*.xml or apps/portal/llms*.txt artifacts are left on disk in the corpus-less Engine checkout.

The Architectural Reality

Design authority: learn/agentos/decisions/0018-neo-identity-source-of-truth-model.md §3.2 ("Generate — the surface is fully emitted from source (e.g. llms.txt/sitemap.xml from generate.mjs); fix the generator, never the output") and buildScripts/release/prepare.mjs:3-7 ("rebuilds the Portal indexes whose sources the engine holds").

  • Remove vs. update decision on apps/portal/sitemap.xml and apps/portal/llms.txt: Remove (git rm) + .gitignore, not update. In neomjs/neo, --corpus-root does not exist, so a valid sitemap-discussions.xml or llms-all.txt cannot be built here, sitemap.xml's child <loc>https://neomjs.com/sitemap-discussions.xml</loc> has no sibling in apps/portal/, zero runtime or test modules read apps/portal/sitemap.xml or apps/portal/llms.txt, .npmignore already excluded both from npm, and neomjs/pages (buildScripts/updateNeoVersion.mjs:236-245) regenerates all 7 SEO/LLM files from pinned github-content-sync before npm run build-all (copy.mjs).
  • .gitignore + .npmignore interaction (buildScripts/util/npmIgnoreComposition.mjs:11-18): Once apps/portal/sitemap.xml and apps/portal/llms.txt are untracked (git rm) and /apps/portal/sitemap*.xml + /apps/portal/llms*.txt live in .gitignore, .gitignore still matches zero tracked files (checkPackageContents.spec.mjs invariant) and prepack composes those ignore rules into .npmignore automatically for dirty working trees, allowing the stale 6-line block in .npmignore:13-18 to be deleted cleanly.
  • apps/portal/resources/data/{tickets,pulls,discussions} remain untouched: Unlike sitemap.xml and llms.txt, Portal stores (apps/portal/store/Discussions.mjs:23, etc.) read those JSON indexes during local development (#19408).

The Fix

  1. Delete orphaned Portal crawler files & ignore generated outputs in neomjs/neo:
    • git rm apps/portal/sitemap.xml apps/portal/llms.txt.
    • Add /apps/portal/sitemap*.xml and /apps/portal/llms*.txt to .gitignore.
    • Remove the obsolete comment and /apps/portal/sitemap.xml + /apps/portal/llms.txt header entries from .npmignore:13-18, and update the explanatory comment in test/playwright/unit/buildScripts/checkPackageContents.spec.mjs:170-174.
  2. Sync seo.json and run fail-closed verification in buildScripts/release/prepare.mjs:
    • After await createReleaseIndex({releaseNotesRoot: getEngineReleaseNotesRoot(root)}) in buildScripts/release/prepare.mjs, regenerate and write apps/portal/resources/data/seo.json via getSeoJson({releaseNotesRoot: getEngineReleaseNotesRoot(root), root}) so release cuts (#21775) pre-bake accurate git lastmod dates and stamped release-note metadata before npm publish.
  3. Fail closed on stray Engine-side sitemap*.xml / llms*.txt files in buildScripts/docs/seo/verify.mjs:
    • Export a helper (e.g. findDisallowedCorpusLessPortalFiles(root)) invoked by verify.mjs runCli when --corpus-root is not passed, throwing an actionable Error if any apps/portal/sitemap*.xml or apps/portal/llms*.txt file exists on disk in the Engine checkout.
    • Regenerate apps/portal/resources/data/seo.json (392 routes) so node buildScripts/docs/seo/verify.mjs passes green on dev.
    • Add unit test coverage in test/playwright/unit/buildScripts/docs/seo/Verify.spec.mjs.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
apps/portal/sitemap.xml & apps/portal/llms.txt (neomjs/neo) buildScripts/release/prepare.mjs:108-110, neomjs/pages updateNeoVersion.mjs:236-245 Removed via git rm; /apps/portal/sitemap*.xml and /apps/portal/llms*.txt ignored in .gitignore; obsolete .npmignore:13-18 lines removed neomjs/pages generates all sitemap*.xml and llms*.txt from --corpus-root at deploy time .gitignore comment + checkPackageContents.spec.mjs npm run check-package-contents + checkPackageContents.spec.mjs
buildScripts/release/prepare.mjs buildScripts/release/prepare.mjs:108-112 Writes refreshed apps/portal/resources/data/seo.json via getSeoJson() alongside createReleaseIndex() and createLabelIndex() Preserves existing lastmod when .git is shallow/absent (seoJson.mjs:870) JSDoc header & inline comment in prepare.mjs node buildScripts/docs/seo/verify.mjs
buildScripts/docs/seo/verify.mjs (findDisallowedCorpusLessPortalFiles + runCli) buildScripts/docs/seo/verify.mjs:837-939 Throws fail-closed when --corpus-root is omitted and apps/portal/sitemap*.xml or apps/portal/llms*.txt exist on disk Skipped when explicit --corpus-root is passed (neomjs/pages deploy) JSDoc (@summary) Verify.spec.mjs + node buildScripts/docs/seo/verify.mjs

Decision Record impact: aligned-with adr:0018-neo-identity-source-of-truth-model

Acceptance Criteria

  • AC-1: apps/portal/sitemap.xml (78,772 lines) and apps/portal/llms.txt (443 lines) are removed from git tracking, /apps/portal/sitemap*.xml and /apps/portal/llms*.txt are added to .gitignore, .npmignore:13-18 removes the obsolete rules/comment, and npm run check-package-contents plus checkPackageContents.spec.mjs pass.
  • AC-2: buildScripts/release/prepare.mjs regenerates apps/portal/resources/data/seo.json via getSeoJson() using the Engine's releaseNotesRoot, and apps/portal/resources/data/seo.json on dev is refreshed (392 routes, including all 12 missing board/gantt/scheduler standalone routes).
  • AC-3: buildScripts/docs/seo/verify.mjs fails closed in corpus-less mode when any apps/portal/sitemap*.xml or apps/portal/llms*.txt file exists on disk, node buildScripts/docs/seo/verify.mjs exits 0 on dev, and Verify.spec.mjs covers both clean and stray-file cases.

Out of Scope

  • Splitting examples.json / example-captures.json / seo.json per example family to eliminate cross-PR merge conflicts (tracked in #21539).
  • Removing apps/portal/resources/data/{tickets,pulls,discussions}, which local-dev Portal stores still fetch (#19408).
  • neomjs/pages and Google Search Console sitemap console cleanup (business#82).

Avoided Traps

  • Keeping and regenerating a partial apps/portal/sitemap.xml inside neomjs/neo: sitemap.xml is a <sitemapindex> referencing sitemap-discussions.xml, which cannot be built without --corpus-root, and neomjs/pages overwrites apps/portal/sitemap*.xml from pinned github-content-sync on every deploy anyway — keeping any tracked sitemap.xml in neomjs/neo only recreates stale merge-conflict bloat.
  • Leaving /apps/portal/sitemap.xml in .npmignore after adding /apps/portal/sitemap*.xml to .gitignore: npmIgnoreComposition.mjs drops .gitignore rules owned by .npmignore headers; removing the header entries once untracked keeps one authoritative ignore rule in .gitignore.

Related

  • Parent Epic: #20671
  • Release Cut Consumers: #21033, #21775
  • Adjacent Catalog Split Ticket: #21539
  • Historical Predecessors: #19322, #19408, #20089, #20774 (revises #20774 Out of Scope item 1, which assumed data-sync-pipeline.yml and publish.mjs still regenerated these files)

Live latest-open + closed sweep: checked latest 25 open (#21271–#21806, 57 open total — red band; filed as focused pre-cut bug leaf under #20671, 17 existing subs) + open and closed search (sitemap.xml OR llms.txt OR seo.json OR rebuildContentIndexesAndSeo, Out of Scope / Avoided Traps read on #21539, #21775, #20774) at 2026-11-21T18:37Z; no equivalent open ticket or blocking exclusion (#21775 explicitly scopes #20671 SEO map out of the release commit, and #20774's Out of Scope rested on the pre-#19322/#19408 pipeline assumption). A2A sweep: list_messages({status: 'all', projection: 'compact', limit: 30}) checked at 2026-11-21T18:38Z (newest MESSAGE:ccc1373f at 18:34:22Z); zero overlapping [lane-claim] or [lane-intent]. MC sweep: "apps/portal/sitemap.xml apps/portal/llms.txt gitignore prepare.mjs seo.json out of date" (10 results) + ask_knowledge_base (type: 'ticket'), no prior exclusion found. Own-assignment sweep: 3 open (#21676, #20987, parent epic #20671), none overlapping.

Origin Session ID: 664ca229-4bbd-4e00-ae41-008707688181 Retrieval Hint: "apps/portal/sitemap.xml 78772 lines orphaned bloat llms.txt prepare.mjs getSeoJson verify.mjs"