Parent epic: #20671 (Search engines and agents find and classify neomjs.com, Engine 13.5 cornerstone 4 in ROADMAP.md).
When a user or coding agent navigates to any deep route in the Portal browser shell (/learn/*, /news/blog/*, /news/releases/*), Portal.view.ViewportController#onHashChange (apps/portal/view/ViewportController.mjs:230-236) delegates <head> updates to Portal.service.Seo#onRouteChanged (apps/portal/service/Seo.mjs:127-130). Crawler snapshots (Googlebot / LLM bots) are built separately by neomjs/middleware-v2 (SsrService#buildHeadInjection) from the rendered body and apps/portal/index.html; wiring SsrService#buildHeadInjection to consume apps/portal/resources/data/seo.json is tracked in #20700 under #20671.
Every deep route falls back to generic parent metadata (#8439 stopgap):
Portal.service.Seo#getMetadata(route) (apps/portal/service/Seo.mjs:72-95) pops path segments until it matches a top-level prefix.
As a result, all /learn/* guides render in the browser shell with the identical <title>Learn Neo.mjs</title> and <meta name="description" content="Learn the fundamentals of the Neo.mjs platform.">; all /news/blog/* articles render with <title>Neo.mjs Blog</title>; and all /news/releases/* notes render with <title>Neo.mjs Releases</title>.
Portal.service.Seo never sets <link rel="canonical">, OpenGraph route metadata, or route-specific ld+json:
Portal.service.Seo#updateDocumentHead (apps/portal/service/Seo.mjs:142-145) only passes {description, title, windowId} to DocumentHead.update.
apps/portal/index.html:9-13 hardcodes <meta property="og:title" content="Neo.mjs - An Agent Institution">, <meta property="og:description" ...>, and <meta property="og:url" content="https://neomjs.com/">, which stay frozen on /home across all route transitions, and no <link rel="canonical"> tag is emitted.
In src/main/addon/DocumentHead.mjs:246-254, update({ldJson}) calls me.setLdJson({value: ldJson}) without forwarding name, which selects the first script[type="application/ld+json"] in <head> and overwrites the root data-schema-name="neo-organism" graph (apps/portal/index.html:15).
The Architectural Reality
buildScripts/docs/seo/generate.mjs and buildScripts/docs/rebuildContentIndexesAndSeo.mjs already walk learn/tree.json, apps/portal/resources/data/blog.json, and apps/portal/resources/data/releases.json for sitemap-core.xml and llms*.txt, but do not generate or synchronize apps/portal/resources/data/seo.json.
Neo.main.addon.DocumentHead (src/main/addon/DocumentHead.mjs) already exposes setCanonical({url}), setDescription({value}), setTitle({value}), setTag({value}), and named setLdJson({name, value}) (script[type="application/ld+json"][data-schema-name="..."]).
test/playwright/e2e/portal/ConnectNL.spec.mjs asserts the /services entry in apps/portal/resources/data/seo.json, so the 10 curated top-level entries must be preserved directly from apps/portal/resources/data/seo.json as their single source of truth when deep-route entries are generated.
Extract route-specific titles and descriptions in buildScripts/docs/seo/seoJson.mjs (getSeoJson / --format seo-json) and wire into buildScripts/docs/rebuildContentIndexesAndSeo.mjs:
Preserve the 10 curated top-level entries directly from apps/portal/resources/data/seo.json (no duplicate hardcoded map in build scripts).
Generate deterministic route-specific {title, description, schemaType} entries for every leaf in learn/tree.json (/learn/<id>), every blog post in apps/portal/resources/data/blog.json (/news/blog/<slug>), and every release note in apps/portal/resources/data/releases.json (/news/releases/<version>), extracting the H1/node title and the first non-heading summary paragraph from each Markdown file (capped cleanly to meta-description length ~155–160 chars), and regenerate seo.json inside rebuildContentIndexesAndSeo.mjs.
Preserve named ld+json schemas and support tags arrays in Neo.main.addon.DocumentHead#update (src/main/addon/DocumentHead.mjs):
Allow update({ldJson, tags}) to accept tags: Object[] (forwarded to setTag({value})) and unambiguous {name, value} wrappers (!('@context' in ldJson) && !('@type' in ldJson)) so route-level structured data writes to or clears (value: null) <script type="application/ld+json" data-schema-name="neo-route"> without clobbering <script type="application/ld+json" data-schema-name="neo-organism"> or misclassifying plain Schema.org objects that happen to carry name and value.
Update Portal.service.Seo (apps/portal/service/Seo.mjs) to synchronize canonical URL, OpenGraph tags, and route ld+json:
Normalize incoming hashString (/learn/..., /news/blog/..., /news/releases/...), normalize /home (and /) canonicalUrl and og:url to 'https://neomjs.com/', resolve route metadata via getMetadata(route), update <title>, <meta name="description">, <link rel="canonical">, og:title, og:description, og:url, and emit <script type="application/ld+json" data-schema-name="neo-route"> (TechArticle / BlogPosting / WebPage) only for exact routes in seo.json while clearing neo-route (value: null) on parent-segment fallback hits.
Preserves curated top-level entries directly from apps/portal/resources/data/seo.json, generates route-specific {title, description, schemaType} entries for /learn/*, /news/blog/*, and /news/releases/*, and regenerates seo.json in rebuildContentIndexesAndSeo.mjs
Falls back to node name and parent description if a Markdown file has no body paragraph
JSDoc in seoJson.mjs, generate.mjs, rebuildContentIndexesAndSeo.mjs
Forwards tags: Object[] to setTag({value}) and treats ldJson as a named {name, value} wrapper only when !('@context' in ldJson) && !('@type' in ldJson) (with value: null removing the named script) so named route schemas do not overwrite data-schema-name="neo-organism"
Plain ldJson object (including Schema.org PropertyValue with name/value) writes to the default selector
Updates title, description, canonicalUrl (https://neomjs.com/ for /home and /, https://neomjs.com<route> otherwise), og:title, og:description, og:url, and data-schema-name="neo-route"ld+json on exact route matches while clearing neo-route (value: null) on parent-segment fallback hits
Parent-segment fallback in getMetadata(route) remains for unlisted sub-routes without lending parent title to ldJsonheadline
buildScripts/docs/seo/generate.mjs exports getSeoJson() (and supports --format seo-json, wired into rebuildContentIndexesAndSeo.mjs), populating apps/portal/resources/data/seo.json with route-specific title and description entries for all learn/tree.json leaves (/learn/*), blog.json leaves (/news/blog/*), and releases.json leaves (/news/releases/*) while preserving all 10 curated top-level routes directly from apps/portal/resources/data/seo.json.
Neo.main.addon.DocumentHead#update supports tags: Object[] and unambiguous named ldJson wrappers ({name: 'neo-route', value: ...} or value: null) without overwriting <script type="application/ld+json" data-schema-name="neo-organism"> or misclassifying plain Schema.org objects.
Portal.service.Seo updates title, description, canonicalUrl (https://neomjs.com/ for /home, https://neomjs.com<route> otherwise), og:title, og:description, og:url, and data-schema-name="neo-route"ld+json on exact route matches (clearing neo-route on fallback routes).
Unit tests in test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjs, test/playwright/unit/buildScripts/docs/rebuildContentIndexesAndSeo.spec.mjs, test/playwright/unit/main/addon/DocumentHead.spec.mjs, and test/playwright/unit/apps/portal/service/Seo.spec.mjs verify all contracts.
Out of Scope
Wiring neomjs/middleware-v2 (SsrService#buildHeadInjection) to read apps/portal/resources/data/seo.json for crawler snapshots (#20700 under #20671).
Example overview routes (/examples/* family pages under #20498), which will be added once their route structure lands.
Middleware SSR cache invalidation on the build host (neomjs/middleware-v2#55).
Avoided Traps
Adding 19,400+ archive routes (/news/tickets/*, /news/pulls/*, /news/discussions/*) to seo.json: That would bloat seo.json into a multi-megabyte runtime fetch on Portal boot. seo.json stays scoped to the curated core routes (sitemap-core.xml scope).
Duplicating curated top-level metadata in build scripts:apps/portal/resources/data/seo.json is the single source of truth for curated top-level routes; getSeoJson() reads and preserves them directly from seo.json.
Calling DocumentHead#setLdJson without name: Overwrites the root data-schema-name="neo-organism" graph in apps/portal/index.html.
Live latest-open + closed sweep: checked all 13 open issues in neomjs/neo (#19058–#20687) plus closed search (seo.json OR Portal.service.Seo OR DocumentHead, read #8439, #7772, #7777, #20677) at 2026-11-10T01:43Z; no open equivalent or prior exclusion found (#8439 added the parent-path fallback when seo.json had only top-level routes). Backlog: 13 open, green band.
A2A in-flight claim sweep: latest 30 messages, all read-states, at 01:43Z; no competing claim on Portal.service.Seo or seo.json.
MC sweep: query_raw_memories on "Portal.service.Seo seo.json DocumentHead deep routes learn blog releases generic title description", 6 results; no conflicting decision found.
Own-assignment sweep: 1 open in neomjs/neo (#20671, parent epic).
Structure map: N/A (ai:structure-map is Brain-hosted; modifies existing buildScripts/docs/seo/generate.mjs, apps/portal/service/Seo.mjs, apps/portal/resources/data/seo.json, and src/main/addon/DocumentHead.mjs).
Owner: self-assigned at creation as steward of #20671.
Retrieval Hint: "Portal.service.Seo seo.json deep routes learn blog releases canonicalUrl ldJson"
tobiu referenced in commit 3b4ccd0 - "feat(portal): add route-specific seo.json, canonical URL, and ld+json for deep routes (#20688) (#20689) on Nov 10, 2026, 4:47 AM
Context
Parent epic: #20671 (Search engines and agents find and classify neomjs.com, Engine 13.5 cornerstone 4 in
ROADMAP.md).When a user or coding agent navigates to any deep route in the Portal browser shell (
/learn/*,/news/blog/*,/news/releases/*),Portal.view.ViewportController#onHashChange(apps/portal/view/ViewportController.mjs:230-236) delegates<head>updates toPortal.service.Seo#onRouteChanged(apps/portal/service/Seo.mjs:127-130). Crawler snapshots (Googlebot/ LLM bots) are built separately byneomjs/middleware-v2(SsrService#buildHeadInjection) from the rendered body andapps/portal/index.html; wiringSsrService#buildHeadInjectionto consumeapps/portal/resources/data/seo.jsonis tracked in #20700 under #20671.The Problem
Measured on
devat62f75736ba:apps/portal/resources/data/seo.jsoncontains only 10 top-level routes (/about-us,/docs,/examples,/home,/learn,/news,/news/blog,/news/releases,/news/videos,/services).#8439stopgap):Portal.service.Seo#getMetadata(route)(apps/portal/service/Seo.mjs:72-95) pops path segments until it matches a top-level prefix./learn/*guides render in the browser shell with the identical<title>Learn Neo.mjs</title>and<meta name="description" content="Learn the fundamentals of the Neo.mjs platform.">; all/news/blog/*articles render with<title>Neo.mjs Blog</title>; and all/news/releases/*notes render with<title>Neo.mjs Releases</title>.Portal.service.Seonever sets<link rel="canonical">, OpenGraph route metadata, or route-specificld+json:Portal.service.Seo#updateDocumentHead(apps/portal/service/Seo.mjs:142-145) only passes{description, title, windowId}toDocumentHead.update.apps/portal/index.html:9-13hardcodes<meta property="og:title" content="Neo.mjs - An Agent Institution">,<meta property="og:description" ...>, and<meta property="og:url" content="https://neomjs.com/">, which stay frozen on/homeacross all route transitions, and no<link rel="canonical">tag is emitted.src/main/addon/DocumentHead.mjs:246-254,update({ldJson})callsme.setLdJson({value: ldJson})without forwardingname, which selects the firstscript[type="application/ld+json"]in<head>and overwrites the rootdata-schema-name="neo-organism"graph (apps/portal/index.html:15).The Architectural Reality
buildScripts/docs/seo/generate.mjsandbuildScripts/docs/rebuildContentIndexesAndSeo.mjsalready walklearn/tree.json,apps/portal/resources/data/blog.json, andapps/portal/resources/data/releases.jsonforsitemap-core.xmlandllms*.txt, but do not generate or synchronizeapps/portal/resources/data/seo.json.Neo.main.addon.DocumentHead(src/main/addon/DocumentHead.mjs) already exposessetCanonical({url}),setDescription({value}),setTitle({value}),setTag({value}), and namedsetLdJson({name, value})(script[type="application/ld+json"][data-schema-name="..."]).test/playwright/e2e/portal/ConnectNL.spec.mjsasserts the/servicesentry inapps/portal/resources/data/seo.json, so the 10 curated top-level entries must be preserved directly fromapps/portal/resources/data/seo.jsonas their single source of truth when deep-route entries are generated.Design authority: #20671 (
ROADMAP.mdEngine 13.5 cornerstone 4: "every canonical Portal route serves route-specific SSR metadata, structured schema and clean semantic HTML").The Fix
buildScripts/docs/seo/seoJson.mjs(getSeoJson/--format seo-json) and wire intobuildScripts/docs/rebuildContentIndexesAndSeo.mjs:apps/portal/resources/data/seo.json(no duplicate hardcoded map in build scripts).{title, description, schemaType}entries for every leaf inlearn/tree.json(/learn/<id>), every blog post inapps/portal/resources/data/blog.json(/news/blog/<slug>), and every release note inapps/portal/resources/data/releases.json(/news/releases/<version>), extracting the H1/node title and the first non-heading summary paragraph from each Markdown file (capped cleanly to meta-description length ~155–160 chars), and regenerateseo.jsoninsiderebuildContentIndexesAndSeo.mjs.ld+jsonschemas and supporttagsarrays inNeo.main.addon.DocumentHead#update(src/main/addon/DocumentHead.mjs):update({ldJson, tags})to accepttags: Object[](forwarded tosetTag({value})) and unambiguous{name, value}wrappers (!('@context' in ldJson) && !('@type' in ldJson)) so route-level structured data writes to or clears (value: null)<script type="application/ld+json" data-schema-name="neo-route">without clobbering<script type="application/ld+json" data-schema-name="neo-organism">or misclassifying plain Schema.org objects that happen to carrynameandvalue.Portal.service.Seo(apps/portal/service/Seo.mjs) to synchronize canonical URL, OpenGraph tags, and routeld+json:hashString(/learn/...,/news/blog/...,/news/releases/...), normalize/home(and/)canonicalUrlandog:urlto'https://neomjs.com/', resolve route metadata viagetMetadata(route), update<title>,<meta name="description">,<link rel="canonical">,og:title,og:description,og:url, and emit<script type="application/ld+json" data-schema-name="neo-route">(TechArticle/BlogPosting/WebPage) only for exact routes inseo.jsonwhile clearingneo-route(value: null) on parent-segment fallback hits.Contract Ledger
buildScripts/docs/seo/seoJson.mjs,generate.mjs,rebuildContentIndexesAndSeo.mjs(getSeoJson,--format seo-json)apps/portal/resources/data/seo.json, generates route-specific{title, description, schemaType}entries for/learn/*,/news/blog/*, and/news/releases/*, and regeneratesseo.jsoninrebuildContentIndexesAndSeo.mjsseoJson.mjs,generate.mjs,rebuildContentIndexesAndSeo.mjstest/playwright/unit/buildScripts/docs/seo/Generate.spec.mjs,test/playwright/unit/buildScripts/docs/rebuildContentIndexesAndSeo.spec.mjsNeo.main.addon.DocumentHead#update(data)(src/main/addon/DocumentHead.mjs)DocumentHead#setLdJson,DocumentHead#setTagtags: Object[]tosetTag({value})and treatsldJsonas a named{name, value}wrapper only when!('@context' in ldJson) && !('@type' in ldJson)(withvalue: nullremoving the named script) so named route schemas do not overwritedata-schema-name="neo-organism"ldJsonobject (including Schema.orgPropertyValuewithname/value) writes to the default selectorDocumentHead.mjstest/playwright/unit/main/addon/DocumentHead.spec.mjsPortal.service.Seo(apps/portal/service/Seo.mjs)title,description,canonicalUrl(https://neomjs.com/for/homeand/,https://neomjs.com<route>otherwise),og:title,og:description,og:url, anddata-schema-name="neo-route"ld+jsonon exact route matches while clearingneo-route(value: null) on parent-segment fallback hitsgetMetadata(route)remains for unlisted sub-routes without lending parenttitletoldJsonheadlineSeo.mjstest/playwright/unit/apps/portal/service/Seo.spec.mjs+ConnectNL.spec.mjsDecision Record impact: none.
Acceptance Criteria
buildScripts/docs/seo/generate.mjsexportsgetSeoJson()(and supports--format seo-json, wired intorebuildContentIndexesAndSeo.mjs), populatingapps/portal/resources/data/seo.jsonwith route-specifictitleanddescriptionentries for alllearn/tree.jsonleaves (/learn/*),blog.jsonleaves (/news/blog/*), andreleases.jsonleaves (/news/releases/*) while preserving all 10 curated top-level routes directly fromapps/portal/resources/data/seo.json.Neo.main.addon.DocumentHead#updatesupportstags: Object[]and unambiguous namedldJsonwrappers ({name: 'neo-route', value: ...}orvalue: null) without overwriting<script type="application/ld+json" data-schema-name="neo-organism">or misclassifying plain Schema.org objects.Portal.service.Seoupdatestitle,description,canonicalUrl(https://neomjs.com/for/home,https://neomjs.com<route>otherwise),og:title,og:description,og:url, anddata-schema-name="neo-route"ld+jsonon exact route matches (clearingneo-routeon fallback routes).test/playwright/unit/buildScripts/docs/seo/Generate.spec.mjs,test/playwright/unit/buildScripts/docs/rebuildContentIndexesAndSeo.spec.mjs,test/playwright/unit/main/addon/DocumentHead.spec.mjs, andtest/playwright/unit/apps/portal/service/Seo.spec.mjsverify all contracts.Out of Scope
neomjs/middleware-v2(SsrService#buildHeadInjection) to readapps/portal/resources/data/seo.jsonfor crawler snapshots (#20700 under #20671)./examples/*family pages under#20498), which will be added once their route structure lands.neomjs/middleware-v2#55).Avoided Traps
19,400+archive routes (/news/tickets/*,/news/pulls/*,/news/discussions/*) toseo.json: That would bloatseo.jsoninto a multi-megabyte runtime fetch on Portal boot.seo.jsonstays scoped to the curated core routes (sitemap-core.xmlscope).apps/portal/resources/data/seo.jsonis the single source of truth for curated top-level routes;getSeoJson()reads and preserves them directly fromseo.json.DocumentHead#setLdJsonwithoutname: Overwrites the rootdata-schema-name="neo-organism"graph inapps/portal/index.html.Related
Parent: #20671 · Follow-up: #20700 (
middleware-v2SsrService#buildHeadInjectionwiring) · Related: #20677 (PR #20684,/servicesline inseo.json) · #8439 · #7772 · #7777Live latest-open + closed sweep: checked all 13 open issues in
neomjs/neo(#19058–#20687) plus closed search (seo.json OR Portal.service.Seo OR DocumentHead, read#8439,#7772,#7777,#20677) at 2026-11-10T01:43Z; no open equivalent or prior exclusion found (#8439added the parent-path fallback whenseo.jsonhad only top-level routes). Backlog: 13 open, green band. A2A in-flight claim sweep: latest 30 messages, all read-states, at 01:43Z; no competing claim onPortal.service.Seoorseo.json. MC sweep:query_raw_memorieson"Portal.service.Seo seo.json DocumentHead deep routes learn blog releases generic title description", 6 results; no conflicting decision found. Own-assignment sweep: 1 open inneomjs/neo(#20671, parent epic). Structure map: N/A (ai:structure-mapis Brain-hosted; modifies existingbuildScripts/docs/seo/generate.mjs,apps/portal/service/Seo.mjs,apps/portal/resources/data/seo.json, andsrc/main/addon/DocumentHead.mjs).Owner: self-assigned at creation as steward of #20671.
Origin Session ID: 132c8467-16c8-4c19-ab83-24c483477a21
Retrieval Hint: "Portal.service.Seo seo.json deep routes learn blog releases canonicalUrl ldJson"