fix(docs): render Mermaid diagrams with accessible titles and descriptions - #2744
Merged
Bill Berry (WilliamBerryiii) merged 7 commits intoAug 29, 2026
Merged
Conversation
…tions - enable Docusaurus Mermaid rendering with exact theme and mermaid versions - add accTitle and accDescr to all 64 deployed documentation fences - add Node source validation, native tests, and Chrome rendering coverage ♿ - Generated by Copilot
Contributor
Dependency ReviewThe following issues were found:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2744 +/- ##
==========================================
+ Coverage 83.08% 83.11% +0.02%
==========================================
Files 183 183
Lines 33712 34109 +397
Branches 25 25
==========================================
+ Hits 28010 28348 +338
- Misses 5699 5758 +59
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Contributor
Eval Execution |
- add pkg:npm/robust-predicates to allow-dependencies-licenses - document why the compound public-domain expression cannot match 📜 - Generated by Copilot
Jamie Kim (jkim323)
approved these changes
Aug 25, 2026
Katrien De Graeve (katriendg)
approved these changes
Aug 26, 2026
Katrien De Graeve (katriendg)
left a comment
Contributor
There was a problem hiding this comment.
The Mermaid renderer, source validation, and SVG metadata associations are implemented well, and the focused validator passes all 64 fences. The review raised five findings, mostly medium and some may be considered optional. Leaving inline comments where possible.
Approving as I know you tackle each one. Thanks.
Jamie Kim (jkim323)
approved these changes
Aug 27, 2026
Allen Greaves (agreaves-ms)
approved these changes
Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Mermaid fences on the documentation site shipped as syntax-highlighted source blocks rather than diagrams. Screen readers announced the raw Mermaid program — NVDA read the
-->connection operator as "dash dash greater" — and the graphics carried no accessible name or description. This enables Mermaid rendering, gives every deployed diagram an authored title and description, and adds validation that keeps the corpus complete.Rendering configuration and dependencies
Enabling the renderer was the prerequisite for everything else, since accessibility directives are inert while fences ship as code blocks.
markdown.mermaidand registered @docusaurus/theme-mermaid as the first entry inthemesin docusaurus.config.js, with athemeConfig.mermaidblock binding theneutralanddarkpalettes to the site's existing color modes.@docusaurus/theme-mermaidat 3.10.2 andmermaidat 11.16.1, matching the file's existing no-range convention.@mermaid-js/parser. Every entry resolves from the canonical public npm registry withintegrityandlicenserecorded.Diagram metadata across the documentation corpus
accTitleandaccDescrpairs across 44 documentation files, covering agent guides, architecture pages, ADRs, BRDs, PRDs, security documentation, and templates.flowchart, legacygraph,stateDiagram-v2,journey, anderDiagram.stateDiagram-v2transition labels in agentic-workflows.md that used a semicolon. A semicolon terminates a Mermaid statement, so those labels failed to parse once rendering was live. The pre-repair form is now the parse-invalid negative control in the e2e spec.ms.dateon every edited file.Validation
Three layers were added so that a diagram authored later cannot silently ship without metadata.
git ls-files, filters to the Docusaurus deployment boundary, extracts fences with matched markers, and requires exactly one activeaccTitleandaccDescrper fence. Directives inside%%comments do not count. Failures report asfile:line: messagewith a non-zero exit;--jsonemits the inventory for downstream consumers.node:testcases, including the deployment-boundary predicate, unclosed-fence errors, multi-lineaccDescrflattening, and rejection of a commented-out title.--jsoninventory, so no second hand-maintained diagram list exists. It renders every fence in Chrome and asserts each SVG exposesrole="graphics-document"witharia-labelledbyandaria-describedbyresolving to non-emptytitleanddescwhose text matches the authored source. Two negative controls guard against passing by vacuity: a parse-invalid fixture the browser must reject, and a broken ARIA association the assertion helper must reject. Four representative routes then assert exact diagram counts, zero remainingpre code.language-mermaidblocks, and resolvable accessible names on the published pages.test:mermaid-a11yintotestandtest:coverage, and excluded the native ESM validator test from Jest discovery sonode --test, Jest, and Playwright each own a distinct layer.Related Issue(s)
Fixes #2677
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
hve-builderand addressed all actionable findings.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md).github/hooks/*/*.json)evals/)Other:
.ps1,.sh,.py)Sample Prompts (for AI Artifact Contributions)
User Request:
Execution Flow:
Output Artifacts:
Success Indicators:
For detailed contribution requirements, see:
Testing
Automated validation run on this branch:
npm ci(docs/docusaurus)npm run test:mermaid-a11ynpm run typecheck(docs/docusaurus)npm run lint:a11y(docs/docusaurus)npm run validate:locallint:md-linksfailed on three unrelated skill reference filesnpm run validate:docsnpm run spell-checknpm run lint:md-linksThe
lint:md-linksfailures are in.github/skills/project-planning/security-planning/references/data-classification.md,.github/skills/rai/rai-standards/references/eu-ai-act.md, and.github/skills/rai/rai-standards/SKILL.md. None of those files is in this change set. Becausevalidate:localis a sequential chain, that failure initially masked the 19 checks that follow it; those were run individually and all passed.Diff-based assessment confirmed the four asserted route counts against source (Customization 1, Release Process 1, Agentic Workflows 3, SSSC Planner PRD 5) and corrected two figures that had gone stale against current
main: the inventory lock moved from 65 to 64, and Release Process from 2 diagrams to 1, aftermainremoved the Maturity Lifecycle state diagram. An Agentic Workflows route was added sostateDiagramstays covered at the route tier.The full Playwright documentation lane is CI-owned and was not run locally on this branch.
Important
Manual assistive-technology verification has not been performed on this branch. The automated layers prove that every diagram renders as a named, described graphic with correct ARIA associations; they cannot prove that a title conveys the right purpose or that a description is equivalent to the diagram it replaces. A qualified accessibility reviewer should confirm the 64 title and description pairs, the complex-diagram prose equivalents, and representative screen-reader, forced-colors, and zoom behavior before this is considered conformant.
Checklist
Required Checks
AI Artifact Contributions
hve-builderreview mode to review contributionhve-builderreviewRequired Local Checks
The following local-safe validation commands must pass before merging:
npm run validate:local(26 of 27 checks passed;lint:md-linksfailed on three files outside this change set)npm run validate:docsnpm run spell-checknpm run lint:md-links(skipped by explicit direction)Security Considerations
scripts/security/changed)Both new scripts call
execFileSyncin argument-array form with no shell, so no command-injection surface exists, and the e2e spec invokesprocess.execPathrather than aPATH-resolved binary. File paths originate fromgit ls-filesscoped todocs, are normalized, allowlist-filtered, and joined against a resolved repository root before any read. Neither script writes files, opens network connections, or reads credentials. Mermaid initializes withsecurityLevel: 'strict', and the browser bundle loads from localnode_modulesrather than a CDN. Both added dependencies are exact-pinned and resolve from the canonical public npm registry.Additional Notes
The inventory lock and per-route diagram counts are deliberate but create a maintenance coupling: authoring or removing a Mermaid fence anywhere under
docs/requires updatingexpect(inventory).toHaveLength(64), and editing one of the four asserted pages requires updating itsdiagramCount. The expected family list is a closed set, so introducing asequenceDiagramorganttfence requires editing that assertion as well. The failure message names the offending file and line, so the required edit is discoverable from the test output.One rough edge worth a follow-up: the validator's
--jsonmode emits no JSON when failures exist, so a failing corpus surfaces in the e2e spec as a module-load exception during collection rather than a readable test failure.