Parent: #20671 · Companion: neomjs/middleware-v2#59 / PR #60 · Handoff from: #20690 (AC-8) & PR #20703 (Post-Merge Validation) · Target window: before the v13.5 cut (2026-11-23)
Context
In #20690 (PR #20703, merged at 56a333fbac), the Portal examples section switched to component-family navigation (apps/portal/view/examples/TabContainer.mjs:40–48 familyDefinitions: /examples, /examples/grid, /examples/forms, /examples/multi-window, /examples/calendar, /examples/components, /examples/state). TabContainerController#onCatalogLoad (apps/portal/view/examples/TabContainerController.mjs:49–69) publishes tabs only for families that have records in apps/portal/resources/data/examples.json, while TabContainerController#onExamplesRoute (lines 75–93) resolves unpopulated family routes and legacy build routes (dist_prod, dist_esm, dist_dev, devmode) to the /examples (Featured) tab.
#20688 (PR #20689) and #20690 (AC-8) explicitly deferred /examples/<family> SEO metadata and sitemap integration to #20671 once the family route structure landed.
- Live latest-open + closed sweep: checked latest 25 open issues (
#20726, #20724, #20722, #20720, #20717, #20715, #20671, etc.; 26 open total, orange band 25–50, filed as a planned leaf under parent epic #20671) and closed search (examples family seo sitemap, read Out of Scope / Avoided Traps on #20690 and #20688) at 2026-11-10T14:40:26Z; no duplicate or prior exclusion found.
- A2A in-flight claim sweep: checked 30 newest messages across all read states (
list_messages({status: 'all', projection: 'compact', limit: 30})) at 2026-11-10T14:40:20Z; no competing claim on /examples/<family> SEO/sitemap wiring.
- Memory Core & own-assignment sweep:
query_raw_memories("Portal examples family routes /examples/grid missing from seo.json and sitemap-core.xml") (5 results, no prior decision) and gh issue list --repo neomjs/neo --state open --assignee @me (2 open: #20671, #20715; bodies read).
- Structure map: N/A (modifies existing files in
buildScripts/docs/seo/, apps/portal/, and test/playwright/unit/; no ai/ surfaces or new .mjs files).
- Ownership disposition:
assignee: @neo-gemini-julia (Cornerstone 4 steward under #20671; excluded from good first issue because it completes the immediate post-merge handoff from #20690 / PR #20703 and neomjs/middleware-v2#59).
Design Authority
- #20671 (
ROADMAP.md Engine 13.5 Cornerstone 4 — Search engines and agents find and classify neomjs.com)
- #20690 (
AC-8 & Contract Ledger: /examples/<family> routes enter seo.json and the sitemap once available families land, while familyDefinitions in apps/portal/view/examples/TabContainer.mjs remains the single source of truth)
- #20688 / PR #20689 (
buildScripts/docs/seo/seoJson.mjs and Portal.service.Seo)
The Problem
Measured on dev at 56a333fbac:
- Populated
/examples/<family> routes are absent from apps/portal/resources/data/seo.json, sitemap-core.xml, llms.txt, and getContentRouteObjects():
apps/portal/resources/data/examples.json currently has 21 published records with family: 'grid-table' (making /examples/grid a live published family tab), and subsequent leaves under #20498 will populate forms, multi-window, calendar, components, and state.
- Neither
buildScripts/docs/seo/seoJson.mjs#getSeoJson nor buildScripts/docs/seo/generate.mjs#collectAllRoutes reads familyDefinitions and examples.json, so /examples/grid (and future populated /examples/<family> routes) has no entry in seo.json, sitemap-core.xml, llms.txt, or getContentRouteObjects().
- Unpopulated
/examples/<family> routes and legacy build routes emit self-referential canonical URLs in Portal.service.Seo instead of canonicalizing to /examples:
- When a user or crawler visits
/#/examples/forms (while forms has 0 records in examples.json) or /#/examples/dist_prod, TabContainerController#onExamplesRoute (apps/portal/view/examples/TabContainerController.mjs:88–92) falls back to the /examples (Featured) tab.
- However,
Portal.service.Seo#getMetadata (apps/portal/service/Seo.mjs:99–113) pops path segments to lookupRoute === '/examples' and returns route: normalizedRoute ('/examples/forms' or '/examples/dist_prod'), causing #updateDocumentHead to set <link rel="canonical" href="https://neomjs.com/examples/forms"> and og:url to the unpopulated/legacy URL rather than https://neomjs.com/examples.
The Architectural Reality
apps/portal/view/examples/TabContainer.mjs:40–48 (familyDefinitions) is the single ordered source of truth for family identity (family), title (title), and route (route). Because TabContainer.mjs imports UI classes and calls Neo.setupClass, Node build scripts (buildScripts/docs/seo/seoJson.mjs) can extract familyDefinitions directly from TabContainer.mjs's AST via acorn (already a devDependency used by buildScripts/util/check-*.mjs) without duplicating the table or booting the runtime.
- Pairing
familyDefinitions (definition.family !== null) with non-hidden records in apps/portal/resources/data/examples.json (!record.hidden && record.family === definition.family) determines which /examples/<family> routes are currently published, so adding records for forms, multi-window, calendar, components, or state under #20498 automatically adds their seo.json, sitemap-core.xml, llms.txt, and getContentRouteObjects() entries on regeneration.
- In
Portal.service.Seo#getMetadata, returning route: '/examples' when a nested /examples/* route falls back to lookupRoute === '/examples' aligns the browser's <link rel="canonical"> and og:url (https://neomjs.com/examples) with TabContainerController#onExamplesRoute's Featured tab fallback while preserving route: normalizedRoute for other section fallbacks (such as /news/tickets/123).
The Fix
- Derive published
/examples/<family> metadata in buildScripts/docs/seo/seoJson.mjs (extractExampleFamilyDefinitions, getPublishedExampleFamilies, + getSeoJson) and regenerate apps/portal/resources/data/seo.json:
- Parse
familyDefinitions from apps/portal/view/examples/TabContainer.mjs via acorn (throwing on missing, non-array, or non-literal/incomplete AST entries, and accepting examplesPath, examplesTabContainerPath, and familyDefinitions options for isolated unit-test fixtures) and match each non-Featured family (definition.family !== null) against non-hidden records in apps/portal/resources/data/examples.json.
- Exclude
route.startsWith('/examples/') from existingSeo preservation in getSeoJson so unpopulated or withdrawn family routes never linger, and emit {title: 'Neo.mjs ${definition.title} Examples', description, schemaType: 'CollectionPage'} for every family with records.length > 0.
- Regenerate
apps/portal/resources/data/seo.json (adding /examples/grid).
- Include published
/examples/<family> routes via collectExampleFamilyRoutes (buildScripts/docs/seo/seoJson.mjs, re-exported and consumed by buildScripts/docs/seo/generate.mjs):
- Emit
{category: 'example-family', filePath: examplesPath, id: definition.route, name: '${definition.title} Examples'} for each populated family route so getContentRoutes (/#/examples/grid), getContentRouteObjects ({route: '/examples/grid', clientSideRoute: '/#/examples/grid'}), getSitemapXml (https://neomjs.com/examples/grid at <priority>0.9</priority>, dated by examples.json), and getLlmsTxt (listed under ## Demo Apps and Examples) stay synchronized with examples.json.
- Canonicalize fallback
/examples/* sub-routes to /examples in Portal.service.Seo#getMetadata (apps/portal/service/Seo.mjs):
- When an unlisted
/examples/* route falls back to lookupRoute === '/examples', return route: '/examples' so #updateDocumentHead sets canonicalUrl and og:url to 'https://neomjs.com/examples'.
- Add unit test coverage in
test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjs and test/playwright/unit/apps/portal/service/Seo.spec.mjs:
- Verify populated vs unpopulated family handling in
getSeoJson, getContentRoutes, getContentRouteObjects, getSitemapXml, getLlmsTxt, and Portal.service.Seo.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
extractExampleFamilyDefinitions, getPublishedExampleFamilies, & getSeoJson (buildScripts/docs/seo/seoJson.mjs, re-exported from generate.mjs) |
#20671, #20690 (TabContainer.mjs familyDefinitions + examples.json) |
Extracts familyDefinitions from TabContainer.mjs (throwing on unreadable/incomplete AST shapes) and emits {title, description, schemaType: 'CollectionPage'} in seo.json for each family with >= 1 non-hidden record in examples.json |
Unpopulated families (0 records) are omitted from seo.json |
JSDoc in seoJson.mjs |
test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjs |
collectExampleFamilyRoutes (buildScripts/docs/seo/seoJson.mjs, re-exported and consumed by buildScripts/docs/seo/generate.mjs) |
#20671, #20690 |
Includes populated /examples/<family> routes in getContentRoutes, getContentRouteObjects, getSitemapXml (priority: 0.9, dated by examples.json), and getLlmsTxt |
Unpopulated families are omitted until examples.json has records for them |
JSDoc in seoJson.mjs |
test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjs |
Portal.service.Seo#getMetadata (apps/portal/service/Seo.mjs) |
#20671, TabContainerController#onExamplesRoute |
Resolves populated /examples/<family> routes from seo.json and canonicalizes unlisted /examples/* fallback routes (lookupRoute === '/examples') to route: '/examples' (https://neomjs.com/examples) |
Non-/examples parent fallbacks (e.g. /news/tickets/123) keep route: normalizedRoute |
JSDoc in Seo.mjs |
test/playwright/unit/apps/portal/service/Seo.spec.mjs |
Decision Record impact: none.
Acceptance Criteria
Out of Scope
- Authoring new catalog records for
forms, multi-window, calendar, components, or state in apps/portal/resources/data/examples.json (owned by the family leaves under #20498).
- Middleware route table and bot fallback for
/examples/<family> (delivered in neomjs/middleware-v2#59 / PR #60).
Avoided Traps
- Duplicating
familyDefinitions in buildScripts/docs/seo/: Hardcoding a second copy of the family list would violate #20690 AC-6 ("the tab order has one source") and drift whenever TabContainer.mjs is updated.
- Emitting
sitemap-core.xml or seo.json entries for empty families (0 records): Empty families render no tab and fall back to Featured (/examples); indexing them before their records land would create soft-404 / duplicate pages in Search Console.
Related
Origin Session ID: 183d3e3a-0891-4cc2-8a9d-b628b26c6841
Retrieval Hint: "examples family routes seoJson.mjs generate.mjs sitemap-core.xml Portal.service.Seo /examples/grid"
Parent: #20671 · Companion:
neomjs/middleware-v2#59/PR #60· Handoff from: #20690 (AC-8) & PR #20703 (Post-Merge Validation) · Target window: before thev13.5cut (2026-11-23)Context
In #20690 (PR #20703, merged at
56a333fbac), the Portal examples section switched to component-family navigation (apps/portal/view/examples/TabContainer.mjs:40–48familyDefinitions:/examples,/examples/grid,/examples/forms,/examples/multi-window,/examples/calendar,/examples/components,/examples/state).TabContainerController#onCatalogLoad(apps/portal/view/examples/TabContainerController.mjs:49–69) publishes tabs only for families that have records inapps/portal/resources/data/examples.json, whileTabContainerController#onExamplesRoute(lines 75–93) resolves unpopulated family routes and legacy build routes (dist_prod,dist_esm,dist_dev,devmode) to the/examples(Featured) tab.#20688 (PR #20689) and #20690 (
AC-8) explicitly deferred/examples/<family>SEO metadata and sitemap integration to #20671 once the family route structure landed.#20726,#20724,#20722,#20720,#20717,#20715,#20671, etc.;26open total, orange band25–50, filed as a planned leaf under parent epic #20671) and closed search (examples family seo sitemap, readOut of Scope/Avoided Trapson#20690and#20688) at2026-11-10T14:40:26Z; no duplicate or prior exclusion found.list_messages({status: 'all', projection: 'compact', limit: 30})) at2026-11-10T14:40:20Z; no competing claim on/examples/<family>SEO/sitemap wiring.query_raw_memories("Portal examples family routes /examples/grid missing from seo.json and sitemap-core.xml")(5results, no prior decision) andgh issue list --repo neomjs/neo --state open --assignee @me(2open: #20671, #20715; bodies read).buildScripts/docs/seo/,apps/portal/, andtest/playwright/unit/; noai/surfaces or new.mjsfiles).assignee: @neo-gemini-julia(Cornerstone 4 steward under #20671; excluded fromgood first issuebecause it completes the immediate post-merge handoff from #20690 / PR #20703 andneomjs/middleware-v2#59).Design Authority
ROADMAP.mdEngine 13.5 Cornerstone 4 — Search engines and agents find and classify neomjs.com)AC-8&Contract Ledger:/examples/<family>routes enterseo.jsonand the sitemap once available families land, whilefamilyDefinitionsinapps/portal/view/examples/TabContainer.mjsremains the single source of truth)buildScripts/docs/seo/seoJson.mjsandPortal.service.Seo)The Problem
Measured on
devat56a333fbac:/examples/<family>routes are absent fromapps/portal/resources/data/seo.json,sitemap-core.xml,llms.txt, andgetContentRouteObjects():apps/portal/resources/data/examples.jsoncurrently has21published records withfamily: 'grid-table'(making/examples/grida live published family tab), and subsequent leaves under #20498 will populateforms,multi-window,calendar,components, andstate.buildScripts/docs/seo/seoJson.mjs#getSeoJsonnorbuildScripts/docs/seo/generate.mjs#collectAllRoutesreadsfamilyDefinitionsandexamples.json, so/examples/grid(and future populated/examples/<family>routes) has no entry inseo.json,sitemap-core.xml,llms.txt, orgetContentRouteObjects()./examples/<family>routes and legacy build routes emit self-referential canonical URLs inPortal.service.Seoinstead of canonicalizing to/examples:/#/examples/forms(whileformshas 0 records inexamples.json) or/#/examples/dist_prod,TabContainerController#onExamplesRoute(apps/portal/view/examples/TabContainerController.mjs:88–92) falls back to the/examples(Featured) tab.Portal.service.Seo#getMetadata(apps/portal/service/Seo.mjs:99–113) pops path segments tolookupRoute === '/examples'and returnsroute: normalizedRoute('/examples/forms'or'/examples/dist_prod'), causing#updateDocumentHeadto set<link rel="canonical" href="https://neomjs.com/examples/forms">andog:urlto the unpopulated/legacy URL rather thanhttps://neomjs.com/examples.The Architectural Reality
apps/portal/view/examples/TabContainer.mjs:40–48(familyDefinitions) is the single ordered source of truth for family identity (family), title (title), and route (route). BecauseTabContainer.mjsimports UI classes and callsNeo.setupClass, Node build scripts (buildScripts/docs/seo/seoJson.mjs) can extractfamilyDefinitionsdirectly fromTabContainer.mjs's AST viaacorn(already adevDependencyused bybuildScripts/util/check-*.mjs) without duplicating the table or booting the runtime.familyDefinitions(definition.family !== null) with non-hidden records inapps/portal/resources/data/examples.json(!record.hidden && record.family === definition.family) determines which/examples/<family>routes are currently published, so adding records forforms,multi-window,calendar,components, orstateunder #20498 automatically adds theirseo.json,sitemap-core.xml,llms.txt, andgetContentRouteObjects()entries on regeneration.Portal.service.Seo#getMetadata, returningroute: '/examples'when a nested/examples/*route falls back tolookupRoute === '/examples'aligns the browser's<link rel="canonical">andog:url(https://neomjs.com/examples) withTabContainerController#onExamplesRoute's Featured tab fallback while preservingroute: normalizedRoutefor other section fallbacks (such as/news/tickets/123).The Fix
/examples/<family>metadata inbuildScripts/docs/seo/seoJson.mjs(extractExampleFamilyDefinitions,getPublishedExampleFamilies, +getSeoJson) and regenerateapps/portal/resources/data/seo.json:familyDefinitionsfromapps/portal/view/examples/TabContainer.mjsviaacorn(throwing on missing, non-array, or non-literal/incomplete AST entries, and acceptingexamplesPath,examplesTabContainerPath, andfamilyDefinitionsoptions for isolated unit-test fixtures) and match each non-Featured family (definition.family !== null) against non-hidden records inapps/portal/resources/data/examples.json.route.startsWith('/examples/')fromexistingSeopreservation ingetSeoJsonso unpopulated or withdrawn family routes never linger, and emit{title: 'Neo.mjs ${definition.title} Examples', description, schemaType: 'CollectionPage'}for every family withrecords.length > 0.apps/portal/resources/data/seo.json(adding/examples/grid)./examples/<family>routes viacollectExampleFamilyRoutes(buildScripts/docs/seo/seoJson.mjs, re-exported and consumed bybuildScripts/docs/seo/generate.mjs):{category: 'example-family', filePath: examplesPath, id: definition.route, name: '${definition.title} Examples'}for each populated family route sogetContentRoutes(/#/examples/grid),getContentRouteObjects({route: '/examples/grid', clientSideRoute: '/#/examples/grid'}),getSitemapXml(https://neomjs.com/examples/gridat<priority>0.9</priority>, dated byexamples.json), andgetLlmsTxt(listed under## Demo Apps and Examples) stay synchronized withexamples.json./examples/*sub-routes to/examplesinPortal.service.Seo#getMetadata(apps/portal/service/Seo.mjs):/examples/*route falls back tolookupRoute === '/examples', returnroute: '/examples'so#updateDocumentHeadsetscanonicalUrlandog:urlto'https://neomjs.com/examples'.test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjsandtest/playwright/unit/apps/portal/service/Seo.spec.mjs:getSeoJson,getContentRoutes,getContentRouteObjects,getSitemapXml,getLlmsTxt, andPortal.service.Seo.Contract Ledger Matrix
extractExampleFamilyDefinitions,getPublishedExampleFamilies, &getSeoJson(buildScripts/docs/seo/seoJson.mjs, re-exported fromgenerate.mjs)TabContainer.mjsfamilyDefinitions+examples.json)familyDefinitionsfromTabContainer.mjs(throwing on unreadable/incomplete AST shapes) and emits{title, description, schemaType: 'CollectionPage'}inseo.jsonfor each family with>= 1non-hidden record inexamples.json0records) are omitted fromseo.jsonseoJson.mjstest/playwright/unit/buildScripts/docs/seo/Generate.spec.mjscollectExampleFamilyRoutes(buildScripts/docs/seo/seoJson.mjs, re-exported and consumed bybuildScripts/docs/seo/generate.mjs)/examples/<family>routes ingetContentRoutes,getContentRouteObjects,getSitemapXml(priority: 0.9, dated byexamples.json), andgetLlmsTxtexamples.jsonhas records for themseoJson.mjstest/playwright/unit/buildScripts/docs/seo/Generate.spec.mjsPortal.service.Seo#getMetadata(apps/portal/service/Seo.mjs)TabContainerController#onExamplesRoute/examples/<family>routes fromseo.jsonand canonicalizes unlisted/examples/*fallback routes (lookupRoute === '/examples') toroute: '/examples'(https://neomjs.com/examples)/examplesparent fallbacks (e.g./news/tickets/123) keeproute: normalizedRouteSeo.mjstest/playwright/unit/apps/portal/service/Seo.spec.mjsDecision Record impact: none.
Acceptance Criteria
getSeoJson()inbuildScripts/docs/seo/seoJson.mjsderives populated/examples/<family>entries fromapps/portal/view/examples/TabContainer.mjs(familyDefinitions) andapps/portal/resources/data/examples.jsonwithout duplicatingfamilyDefinitions, emitting/examples/grid(schemaType: 'CollectionPage') inapps/portal/resources/data/seo.jsonand omitting unpopulated families.buildScripts/docs/seo/generate.mjsincludes populated/examples/<family>routes ingetContentRoutes,getContentRouteObjects,getSitemapXml(<loc>https://neomjs.com/examples/grid</loc>with<priority>0.9</priority>), andgetLlmsTxtwhile omitting unpopulated families.Portal.service.Seo#getMetadataresolves exact metadata for/examples/gridand canonicalizes unlisted/examples/*routes (such as/examples/unlisted-familyor legacy/examples/dist_prod) toroute: '/examples'(canonicalUrl: 'https://neomjs.com/examples').test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjsandtest/playwright/unit/apps/portal/service/Seo.spec.mjspass.Out of Scope
forms,multi-window,calendar,components, orstateinapps/portal/resources/data/examples.json(owned by the family leaves under #20498)./examples/<family>(delivered inneomjs/middleware-v2#59/PR #60).Avoided Traps
familyDefinitionsinbuildScripts/docs/seo/: Hardcoding a second copy of the family list would violate #20690AC-6("the tab order has one source") and drift wheneverTabContainer.mjsis updated.sitemap-core.xmlorseo.jsonentries for empty families (0records): Empty families render no tab and fall back to Featured (/examples); indexing them before their records land would create soft-404 / duplicate pages in Search Console.Related
neomjs/middleware-v2#59/PR #60Origin Session ID: 183d3e3a-0891-4cc2-8a9d-b628b26c6841 Retrieval Hint: "examples family routes seoJson.mjs generate.mjs sitemap-core.xml Portal.service.Seo /examples/grid"