Bug Report BR-068: Docusaurus strict MDX cannot resolve monorepo markdown links — production build fails
Status: COMPLETE
Priority: HIGH
Severity: HIGH — portal/ npm run build fails under strict link/MDX rules; browsable docs site cannot be regenerated reliably while the corpus uses cross-root relative links common in GitHub-native authoring.
Created: 2026-04-19
Last updated: 2026-04-19
Version: v0.5.9.11+5
Code: BR-068
Implementing Task: E5:S09:T11
Problem Statement
The documentation portal (portal/) uses @docusaurus/preset-classic with path: '../docs' (repository docs/ only). With onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'throw', and onBrokenAnchors: 'throw', MDX compilation fails when a Markdown file under docs/ contains a relative link to a path outside that plugin root.
The repository’s authoring model predates this boundary: Kanban, FR/BR, ADRs, and user-docs routinely link to:
INSTALL_IN_YOUR_PROJECT.mdat repository root (not underdocs/), via patterns such as../../../INSTALL_IN_YOUR_PROJECT.mdfrom nesteddocs/paths.- Framework packages, e.g.
packages/frameworks/workflow mgt/docs/..., via relative traversals fromdocs/that leave the docs-plugin corpus.
Result: npm run build (see Observed behavior) exits with errors such as “Markdown link with URL ../../../INSTALL_IN_YOUR_PROJECT.md … couldn't be resolved … within the current plugin” — for many files, not a single typo.
Strict FR-067 / T08 / T10 “throw” behavior is working as configured; the defect is that the combined policy (strict gates + monorepo link graph) is incompatible, so the published site pipeline is effectively broken until links are normalized, stubbed, or explicitly exempted.
Expected Behavior
npm run buildinportal/completes green ondevwith the same Markdown corpus intended for publication (or an explicitly documented subset viaexclude:/ split site).- Authors have a single, documented pattern for linking to:
- repo-root install entry (
INSTALL_IN_YOUR_PROJECT.md), - framework packages under
packages/, - and other out-of-
docs/artifacts, without breaking MDX resolution.
- repo-root install entry (
- CI (if present) matches local build strictness so main / publish branch cannot drift into a broken publish state.
Observed Behavior
-
cd portal && npm run build→ failure (non-zero exit). -
Representative MDX errors (paraphrased from compiler output):
- Unresolved
../../../INSTALL_IN_YOUR_PROJECT.mdfrom e.g.docs/documentation/user-docs/*.md,docs/architecture/standards-and-adrs/ADR-003-*.md,docs/project-management/kanban/fr-br/FR-080-*.md. - Unresolved
../../../../packages/frameworks/...from Kanban / FR documents. - Additional unresolved intra-repo paths where relative navigation leaves
docs/.
- Unresolved
-
GitHub-native browsing of the same files often works (different base path); Docusaurus does not accept those relative targets inside the docs plugin.
Scope / Affected Areas
| Area | Role |
|---|---|
portal/docusaurus.config.js | Docs path, exclude, strict hooks |
portal/sidebars.js | Autogenerated sections only — no fix without link/corpus strategy |
Repository docs/**/*.md | Many relative links to root / packages/ |
Root INSTALL_IN_YOUR_PROJECT.md | Canonical adopter entry outside docs/ |
Acceptance Criteria
-
npm run buildsucceeds with policy-aligned link strategy (documented in portal README or maintenance doc). - Linking policy for out-of-
docs/targets (INSTALL, framework paths) is recorded — e.g. stubs underdocs/guides/, approved absolute GitHub URLs,pathname://, symlink, or controlledexclude— with no silent regression of FR-067 strict intent. - Spot-check: pages that previously failed MDX (INSTALL pointer from user-docs;
packages/links from fr-br) render or link per policy. - Optional: CI workflow runs portal build on relevant paths — satisfied by
.github/workflows/docusaurus-build.yml(FR-069 / E5:S09:T05).
Resolution
Delivered: 2026-04-19 — v0.5.9.11+5 (RW E5:S09:T11 --art, Wave 4 traceability).
- Strategy A corpus normalization (IPW §1.5) + Waves 2–3 verification (TD1–TD3) restored strict
portal/production build (throwlinks/anchors unchanged vs FR-067 intent). - Contributor policy:
portal/README.md— BR-068 anddocusaurus-corpus-triage-fr-067.md.
Related
- FR-067 — production corpus triage; enabled strict checks.
- Story 009 – Docusaurus Documentation Portal — T08 / T10 strict links & anchors (COMPLETE historically; this BR is post-completion regression class).
- BR-066 — planning artifacts filing (related portal surface).
- FR-070 — GitHub Pages deployment depends on green build.
Intake Decision
Intake Status: ACCEPTED (filed from maintainer decision: BR tracks Docusaurus/build defect vs monorepo link graph)
Intake Date: 2026-04-19