LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 16, 2026, 10:28 AM
updatedAtNov 16, 2026, 3:06 PM
githubUrlhttps://github.com/neomjs/neo/issues/21122
authorneo-gemini-julia
commentsCount1
parentIssue20671
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 21125 Every neo PR fails unit on the claim-responder sibling-repository case
blocking[]
closedAtNov 16, 2026, 3:06 PM

Rewrite relative repo and learn links in Portal Markdown views

Closed v14.0.0/archive-v14-0-0-chunk-3 bugdocumentationaiportal
neo-gemini-julia
neo-gemini-julia commented on Nov 16, 2026, 10:28 AM

Parent: neomjs/neo#20671 (Cornerstone #4: Search engines and agents find and classify neomjs.com).

Context

Live Google Search Console audit of sc-domain:neomjs.com (2026-11-16) revealed 2,102 Not found (404) URLs (1,933 submitted) in Indexing -> Pages. The crawled Nov 5–13, 2026 404 examples come directly from unrewritten relative Markdown links inside Portal documents resolved against <base href="./dist/production/apps/portal/"> / /apps/portal/:

  • https://neomjs.com/apps/portal/ai/mcp/server/neural-link/Server.mjs
  • https://neomjs.com/apps/portal/ai/services/knowledge-base/VectorService.mjs
  • https://neomjs.com/apps/portal/ai/deploy/docker-compose.test.yml
  • https://neomjs.com/apps/decisions/0027-autonomous-data-recovery-actuator.md
  • https://neomjs.com/apps/agentos/IdentityFirewall.md

Repository verification (2026-11-16) confirmed real authored Markdown examples in resources/content/ including discussions/chunk-1/discussion-11002.md:159 ([ai/deploy/docker-compose.test.yml](ai/deploy/docker-compose.test.yml)), archive/issues/v13.2.0/chunk-14/issue-17343.md:49,85-88 ([VectorService.mjs:595](ai/services/knowledge-base/VectorService.mjs#L595)), and archive/issues/v13.2.0/chunk-13/issue-16972.md:279 ([VectorService.mjs:1450](../blob/dev/ai/services/knowledge-base/VectorService.mjs#L1450)).

unowned-rationale: Prio-0 team lane per operator directive (2026-11-16); open for immediate maintainer self-selection (good first issue / help wanted omitted).

The Problem

  1. Portal.view.content.Component (apps/portal/view/content/Component.mjs, base for tickets, pulls, discussions) and Portal.view.news.release.Component (apps/portal/view/news/release/Component.mjs) do not set contentRoute or override rewriteLinks (src/app/content/Component.mjs:234-270): Neo.app.content.Component#rewriteLinks immediately returns HTML untouched whenever !contentRoute || !me.record?.id (line 238), so relative links in issues, PRs, discussions, and release notes are emitted raw and resolve against /apps/portal/ into 404s.
  2. Non-.md repository source paths (ai/..., src/..., buildScripts/...) and escaped ../ links are ignored by rewriteLinks (line 254, 264): if (... || !/\.md($|#)/i.test(href)) return match; leaves [VectorService.mjs](ai/services/knowledge-base/VectorService.mjs#L595) and ../decisions/... untouched even in views that do set contentRoute (Portal.view.learn.Component, Portal.view.news.blog.Component).

The Architectural Reality

  • Design authority: src/app/content/Component.mjs:220-270 (rewriteLinks JSDoc: "a relative path is the correct link [on GitHub], and inside an app, where only that app knows how to turn the path into something navigable. This seam lets a subclass supply that translation"), apps/portal/view/news/blog/Component.mjs:34-48 (#19901 pattern, which explicitly placed non-learn/ targets out of scope), and test/playwright/unit/app/content/LinkPredicateParity.spec.mjs:36-101.
  • Critical guard invariant (LinkPredicateParity.spec.mjs:36-44, 87-100): LinkPredicateParity.spec.mjs drives ContentComponent.prototype.rewriteLinks directly (contentRoute: '#/learn/', record: {id: 'guides/uibuildingblocks/DockLayouts'}) and asserts that ContentComponent.prototype.rewriteLinks leaves external scheme URIs, #fragments, root-absolute /..., and extensionless tokens (benefits.body.ConfigSystem) alone. Putting Portal-specific repo/GitHub URL rewriting on Portal's subclasses (while keeping Neo.app.content.Component#rewriteLinks compliant with LinkPredicateParity.spec.mjs and buildScripts/util/check-relative-links.mjs) preserves the build guard contract cleanly.
  • Portal.view.content.Component (tickets, pulls, discussions) and Portal.view.news.release.Component both already configure issuesUrl: '#/news/tickets/' and extends: ContentComponent, making them the natural Portal seam (or a shared Portal content helper called from Portal.view.learn.Component, Portal.view.news.blog.Component, Portal.view.news.release.Component, and Portal.view.content.Component).

The Fix

  1. Share a Portal relative-link helper across Portal Markdown content components (apps/portal/view/...):
    • Preserve super.rewriteLinks(html) behavior in learn and blog (#19901) and keep Neo.app.content.Component#rewriteLinks passing LinkPredicateParity.spec.mjs unchanged.
    • In Portal.view.content.Component, Portal.view.news.release.Component, Portal.view.learn.Component, and Portal.view.news.blog.Component, rewrite any remaining relative <a href> (excluding EXTERNAL_TARGET scheme/# and root-absolute /...):
      • learn/blog/<slug>.md(#...) -> #/news/blog/<slug>(#...) and learn/<id>.md(#...) -> #/learn/<id>(#...).
      • Known repository paths (src/, ai/, apps/, examples/, buildScripts/, test/, resources/, .agents/, .github/, README.md, ROADMAP.md, or ../blob/dev/<path>) -> https://github.com/neomjs/neo/blob/dev/<cleanPath> with target="_blank" rel="noopener".
      • Avoid emitting unresolvable escaped ../... relative anchors against <base href="/apps/portal/">: normalize escaped ../ repo-relative paths (blob/dev/... or root repo file paths) rather than letting browsers or crawlers navigate to /apps/portal/... or /apps/... 404s.
  2. Add unit test coverage (test/playwright/unit/portal/ or test/playwright/unit/app/content/):
    • Test Portal.view.content.Component, Portal.view.news.release.Component, Portal.view.learn.Component, and Portal.view.news.blog.Component rewriting ai/services/knowledge-base/VectorService.mjs#L595, ai/deploy/docker-compose.test.yml, ../blob/dev/ai/services/knowledge-base/VectorService.mjs#L1450, and repo-relative learn/benefits/Introduction.md, while preserving #/..., /..., #anchor, and https://... URLs.
    • Run LinkPredicateParity.spec.mjs alongside the new unit spec to prove zero parity regression.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Portal.view.content.Component#rewriteLinks, Portal.view.news.release.Component#rewriteLinks, Portal.view.learn.Component#rewriteLinks, Portal.view.news.blog.Component#rewriteLinks src/app/content/Component.mjs:220-270, #19901, LinkPredicateParity.spec.mjs Translates relative learn/*.md links to Portal hash routes and relative repo source/config/escaped links to https://github.com/neomjs/neo/blob/dev/... Leaves scheme URIs, /..., #... untouched JSDoc on rewriteLinks overrides / helper Unit spec + LinkPredicateParity.spec.mjs green

Decision Record impact

none (uses the documented ContentComponent#rewriteLinks subclass seam).

Acceptance Criteria

  • Portal.view.content.Component, Portal.view.news.release.Component, Portal.view.learn.Component, and Portal.view.news.blog.Component rewrite repo-relative ai/..., src/..., ../blob/dev/..., and learn/.../*.md anchors instead of emitting raw relative <a href>s against <base href="/apps/portal/">.
  • Neo.app.content.Component#rewriteLinks still passes test/playwright/unit/app/content/LinkPredicateParity.spec.mjs unchanged.
  • Unit tests verify ai/services/knowledge-base/VectorService.mjs#L595, ai/deploy/docker-compose.test.yml, ../blob/dev/..., learn/blog/..., learn/..., #/..., and https://... handling, and pass under npm run test-unit -- <spec>.

Out of Scope

  • Middleware SSR sanitization of pre-rendered archive HTML (neomjs/middleware-v2 companion ticket).
  • Clean pathname routing (neomjs/neo#21117).

Avoided Traps

  • Modifying Neo.app.content.Component#rewriteLinks default non-.md skip rule directly without gating: test/playwright/unit/app/content/LinkPredicateParity.spec.mjs asserts ContentComponent.prototype.rewriteLinks leaves non-.md tokens (benefits.body.ConfigSystem) alone. Keep the repo/timeline translation in Portal's subclasses / helper.
  • Emitting https://github.com/neomjs/neo/blob/dev/ai/deploy/docker-compose.test.yml without normalizing ../blob/dev/ prefixes: Strip leading (../)+blob/<branch>/ segments so links like ../blob/dev/ai/... do not turn into invalid GitHub URLs.

Related

Parent: neomjs/neo#20671 · Prior: #19901 · Companion: neomjs/neo#21117, neomjs/pages#89

Live latest-open + closed sweep: checked latest 20 open issues (totalCount: 62, red band > 50 — scoped directly under Epic #20671, verified #20671 has 14 subs < 25) + open/closed search (rewriteLinks OR SsrService OR raw markdown noindex; read #19901 Out of Scope explicitly excluding moved/non-learn/ targets) in neomjs/neo at 2026-11-16T09:27Z; no duplicate found. A2A in-flight claim sweep: list_messages({status: 'all', limit: 30}) at 2026-11-16T09:26Z; no competing claim on Portal rewriteLinks. MC sweep: query_raw_memories on "Google Search Console neomjs.com sitemap raw markdown crawl budget 404 seo", 5 results, plus #19901 precedent. Own-assignment sweep: #21104, #20987, #20671 in neomjs/neo; non-overlapping. Structure map: N/A (Portal UI view code + unit test under existing directories).

Origin Session ID: 1f283c86-c55b-4aa5-a291-0cbb3786c302 Retrieval Hint: "Portal view content release rewriteLinks relative repo links ai deploy VectorService 404 GSC"