Context
While auditing https://neomjs.com/sitemap.xml and buildScripts/docs/seo/generate.mjs (2026-10-24) to diagnose Google Search Console indexing failures with @tobiu, we discovered that all 20 internal blog routes in sitemap.xml and llms.txt carry a doubled /news/blog/blog/<slug> path prefix.
Sweep Attestations (ticket-create §1a):
Live latest-open sweep: checked latest 20 open issues in neomjs/neo (#19145–#20086) and neomjs/middleware-v2 (#9–#34) at 2026-10-24T01:07:10Z; no equivalent open ticket found.
A2A in-flight claim sweep: checked latest 30 messages (status: 'all'); no competing claim on buildScripts/docs/seo/generate.mjs.
MC sweep: query_raw_memories({query: "middleware-v2 Googlebot Search Console sitemap SsrService canonical SEO"}), 10 results; surfaced 7530ffa3-5d88-4ebe-980a-f91fe667082f (2026-10-16), which noticed /news/blog/blog/<slug> in passing after #19503 without filing the double-prefix bug in collectBlogRoutes().
Own-assignment sweep: 0 open issues assigned to @neo-gemini-julia in neomjs/neo.
The Problem
- In
apps/portal/resources/data/blog.json, every internal blog entry stores its id with a leading blog/ prefix, e.g.: "id": "blog/where-an-agent-institution-sits"
- In
buildScripts/docs/seo/generate.mjs:649 (collectBlogRoutes), the generator prepends /news/blog/ directly onto post.id: id: `/news/blog/${post.id}`
- Likewise, in
apps/portal/view/news/blog/MainContainerController.mjs and apps/portal/view/news/blog/Component.mjs, /news/blog is prepended onto blog/<slug> record IDs, emitting doubled /news/blog/blog/<slug> URLs in sitemap.xml, content-routes.json, TreeList links, and sibling blog markdown links (verified live on https://neomjs.com/sitemap.xml: https://neomjs.com/news/blog/blog/where-an-agent-institution-sits, https://neomjs.com/news/blog/blog/a-workspace-that-can-leave-its-window, etc.).
The Architectural Reality
Design authority: "Extracts paths for Neo-hosted blog posts (those without a 'publisher' property, meaning they are hosted natively inside the Portal App rather than on external platforms like Medium)." (buildScripts/docs/seo/generate.mjs:626-635)
- Why
apps/portal/resources/data/blog.json stores "id": "blog/<slug>":
Neo.app.content.Component#resolveContentId (src/app/content/Component.mjs:195) computes const segments = this.record.id.split('/').slice(0, -1) so "blog/<slug>" provides the 1-folder depth inside learn/ needed for ../guides/... relative links inside learn/blog/*.md to resolve without escaping the root.
- Therefore,
"id": "blog/<slug>" must remain intact in blog.json, while collectBlogRoutes(), Portal.view.news.blog.MainContainerController, and Portal.view.news.blog.Component#resolveContentId normalize routes to /news/blog/<slug> and resolve /news/blog/<slug> (plus legacy /news/blog/blog/<slug>) back to the store's blog/<slug> records.
The Fix
- In
buildScripts/docs/seo/generate.mjs (collectBlogRoutes):
- Normalize
const slug = post.id.replace(/^blog\//, ''); before constructing /news/blog/${slug} so sitemap.xml and content-routes.json emit canonical /news/blog/<slug> URLs instead of /news/blog/blog/<slug>.
- In
apps/portal/view/news/blog/MainContainerController.mjs (navigateTo, onRouteItem):
- Set
tree.routePrefix = '/news' so TreeList leaf clicks (${routePrefix}/${record.id}) emit /news/blog/<slug>.
- Strip leading
blog/ in navigateTo(item) and resolve const slug = itemId.split('#')[0].replace(/^blog\//, ''), recordId = store.get(\blog/${slug}`) ? `blog/${slug}` : slug;inonRouteItem({itemId})`.
- In
apps/portal/view/news/blog/Component.mjs (resolveContentId):
- Return
id.startsWith('blog/') ? \news/${id}` : `learn/${id}`so sibling blog markdown links rewrite to#/news/blog/`.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
collectBlogRoutes() (buildScripts/docs/seo/generate.mjs:626-656) |
buildScripts/docs/seo/generate.mjs JSDoc |
Strips leading blog/ from post.id so emitted route id is /news/blog/<slug> |
Handles post.id with or without leading blog/ |
JSDoc in generate.mjs |
Generate.spec.mjs |
Portal.view.news.blog.MainContainerController (navigateTo, onRouteItem) |
apps/portal/view/news/blog/MainContainerController.mjs |
Emits /news/blog/<slug>, sets tree.routePrefix = '/news', and resolves /news/blog/<slug> to store.get('blog/<slug>') |
Resolves both /news/blog/<slug> (with #fragment) and legacy /news/blog/blog/<slug> |
JSDoc in MainContainerController.mjs |
MainContainerController.spec.mjs |
Portal.view.news.blog.Component#resolveContentId (apps/portal/view/news/blog/Component.mjs:34-48) |
apps/portal/view/news/blog/Component.mjs JSDoc |
Returns news/${id} when id.startsWith('blog/') so sibling blog links resolve to #/news/blog/<slug> |
Non-blog learn/ targets continue returning learn/${id} |
JSDoc in Component.mjs |
BlogLinks.spec.mjs |
Decision Record impact
none
Acceptance Criteria
Out of Scope
- External blog posts (entries with
post.publisher that link off-site).
- Sitemap ticket/PR dilution (tracked in sibling ticket
#20089).
Avoided Traps
- Do not strip
blog/ inside blog.json without checking whether TreeList or relative link resolution in apps/portal/view/news/blog/Component.mjs depends on record.id starting with blog/; normalizing the route in generate.mjs, MainContainerController.mjs, and Component.mjs preserves the 1-folder relative link depth inside learn/.
Related
neomjs/neo#19501
neomjs/neo#19503
unowned-rationale: Filed upfront during operator-directed SEO/Search Console root-cause audit; implementation deferred until after current memory-restoration and neo-stage architecture lanes.
Origin Session ID: 7bbb249d-903b-4ad7-b69c-658b286ce4a0
Retrieval Hint: "collectBlogRoutes /news/blog/blog/ generate.mjs blog.json"
Context
While auditing
https://neomjs.com/sitemap.xmlandbuildScripts/docs/seo/generate.mjs(2026-10-24) to diagnose Google Search Console indexing failures with@tobiu, we discovered that all 20 internal blog routes insitemap.xmlandllms.txtcarry a doubled/news/blog/blog/<slug>path prefix.Sweep Attestations (
ticket-create §1a):Live latest-open sweep:checked latest 20 open issues inneomjs/neo(#19145–#20086) andneomjs/middleware-v2(#9–#34) at2026-10-24T01:07:10Z; no equivalent open ticket found.A2A in-flight claim sweep:checked latest 30 messages (status: 'all'); no competing claim onbuildScripts/docs/seo/generate.mjs.MC sweep:query_raw_memories({query: "middleware-v2 Googlebot Search Console sitemap SsrService canonical SEO"}), 10 results; surfaced7530ffa3-5d88-4ebe-980a-f91fe667082f(2026-10-16), which noticed/news/blog/blog/<slug>in passing after#19503without filing the double-prefix bug incollectBlogRoutes().Own-assignment sweep:0 open issues assigned to@neo-gemini-juliainneomjs/neo.The Problem
apps/portal/resources/data/blog.json, every internal blog entry stores itsidwith a leadingblog/prefix, e.g.:"id": "blog/where-an-agent-institution-sits"buildScripts/docs/seo/generate.mjs:649(collectBlogRoutes), the generator prepends/news/blog/directly ontopost.id:id: `/news/blog/${post.id}`apps/portal/view/news/blog/MainContainerController.mjsandapps/portal/view/news/blog/Component.mjs,/news/blogis prepended ontoblog/<slug>record IDs, emitting doubled/news/blog/blog/<slug>URLs insitemap.xml,content-routes.json,TreeListlinks, and sibling blog markdown links (verified live onhttps://neomjs.com/sitemap.xml:https://neomjs.com/news/blog/blog/where-an-agent-institution-sits,https://neomjs.com/news/blog/blog/a-workspace-that-can-leave-its-window, etc.).The Architectural Reality
Design authority: "Extracts paths for Neo-hosted blog posts (those without a 'publisher' property, meaning they are hosted natively inside the Portal App rather than on external platforms like Medium)." (buildScripts/docs/seo/generate.mjs:626-635)apps/portal/resources/data/blog.jsonstores"id": "blog/<slug>":Neo.app.content.Component#resolveContentId(src/app/content/Component.mjs:195) computesconst segments = this.record.id.split('/').slice(0, -1)so"blog/<slug>"provides the 1-folder depth insidelearn/needed for../guides/...relative links insidelearn/blog/*.mdto resolve without escaping the root."id": "blog/<slug>"must remain intact inblog.json, whilecollectBlogRoutes(),Portal.view.news.blog.MainContainerController, andPortal.view.news.blog.Component#resolveContentIdnormalize routes to/news/blog/<slug>and resolve/news/blog/<slug>(plus legacy/news/blog/blog/<slug>) back to the store'sblog/<slug>records.The Fix
buildScripts/docs/seo/generate.mjs(collectBlogRoutes):const slug = post.id.replace(/^blog\//, '');before constructing/news/blog/${slug}sositemap.xmlandcontent-routes.jsonemit canonical/news/blog/<slug>URLs instead of/news/blog/blog/<slug>.apps/portal/view/news/blog/MainContainerController.mjs(navigateTo,onRouteItem):tree.routePrefix = '/news'soTreeListleaf clicks (${routePrefix}/${record.id}) emit/news/blog/<slug>.blog/innavigateTo(item)and resolveconst slug = itemId.split('#')[0].replace(/^blog\//, ''), recordId = store.get(\blog/${slug}`) ? `blog/${slug}` : slug;inonRouteItem({itemId})`.apps/portal/view/news/blog/Component.mjs(resolveContentId):id.startsWith('blog/') ? \news/${id}` : `learn/${id}`so sibling blog markdown links rewrite to#/news/blog/Contract Ledger Matrix
collectBlogRoutes()(buildScripts/docs/seo/generate.mjs:626-656)buildScripts/docs/seo/generate.mjsJSDocblog/frompost.idso emitted routeidis/news/blog/<slug>post.idwith or without leadingblog/generate.mjsGenerate.spec.mjsPortal.view.news.blog.MainContainerController(navigateTo,onRouteItem)apps/portal/view/news/blog/MainContainerController.mjs/news/blog/<slug>, setstree.routePrefix = '/news', and resolves/news/blog/<slug>tostore.get('blog/<slug>')/news/blog/<slug>(with#fragment) and legacy/news/blog/blog/<slug>MainContainerController.mjsMainContainerController.spec.mjsPortal.view.news.blog.Component#resolveContentId(apps/portal/view/news/blog/Component.mjs:34-48)apps/portal/view/news/blog/Component.mjsJSDocnews/${id}whenid.startsWith('blog/')so sibling blog links resolve to#/news/blog/<slug>learn/targets continue returninglearn/${id}Component.mjsBlogLinks.spec.mjsDecision Record impact
noneAcceptance Criteria
collectBlogRoutes()inbuildScripts/docs/seo/generate.mjsstrips any leadingblog/prefix frompost.id, emitting/news/blog/<slug>instead of/news/blog/blog/<slug>.llms.txtandsitemap.xmlgeneration emit/news/blog/<slug>for all internal blog entries inapps/portal/resources/data/blog.json./news/blog/<slug>resolves and renders the corresponding blog post inapps/portal.Out of Scope
post.publisherthat link off-site).#20089).Avoided Traps
blog/insideblog.jsonwithout checking whetherTreeListor relative link resolution inapps/portal/view/news/blog/Component.mjsdepends onrecord.idstarting withblog/; normalizing the route ingenerate.mjs,MainContainerController.mjs, andComponent.mjspreserves the 1-folder relative link depth insidelearn/.Related
neomjs/neo#19501neomjs/neo#19503unowned-rationale: Filed upfront during operator-directed SEO/Search Console root-cause audit; implementation deferred until after current memory-restoration and neo-stage architecture lanes. Origin Session ID: 7bbb249d-903b-4ad7-b69c-658b286ce4a0 Retrieval Hint: "collectBlogRoutes /news/blog/blog/ generate.mjs blog.json"