agentic-mermaid 0.4.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/AGENT_NATIVE.md +94 -627
  2. package/CHANGELOG.md +651 -0
  3. package/Instructions_for_agents.md +44 -23
  4. package/LICENSES/Khroma-MIT.txt +21 -0
  5. package/LICENSES/Mermaid-MIT.txt +21 -0
  6. package/LICENSES/es-toolkit-MIT.txt +21 -0
  7. package/LICENSES/pele-MIT.txt +40 -0
  8. package/LICENSES/zenuml-core-MIT.txt +21 -0
  9. package/README.md +93 -50
  10. package/SECURITY.md +28 -12
  11. package/THIRD_PARTY_NOTICES.md +60 -0
  12. package/assets/hero.png +0 -0
  13. package/dist/agent-core.d.ts +478 -210
  14. package/dist/agent-core.js +1 -396
  15. package/dist/agent.d.ts +17 -8
  16. package/dist/agent.js +1 -408
  17. package/dist/agentic-mermaid-mcp.js +1 -11
  18. package/dist/am.js +1 -34562
  19. package/dist/browser-lazy/chunks/agentic-producer-core-CC6OOLDW.js +1 -0
  20. package/dist/browser-lazy/chunks/architecture-QUFVKYJR.js +13 -0
  21. package/dist/browser-lazy/chunks/block-6J3Q63BO.js +11 -0
  22. package/dist/browser-lazy/chunks/builtin-backends-7SOZZHPF.js +12 -0
  23. package/dist/browser-lazy/chunks/c4-SQVBZAKJ.js +10 -0
  24. package/dist/browser-lazy/chunks/chunk-2GPK4VFF.js +5 -0
  25. package/dist/browser-lazy/chunks/chunk-2I4UPL7Q.js +3 -0
  26. package/dist/browser-lazy/chunks/chunk-2SH76OTH.js +1 -0
  27. package/dist/browser-lazy/chunks/chunk-2UIA2IME.js +3 -0
  28. package/dist/browser-lazy/chunks/chunk-4LHYF3BS.js +1 -0
  29. package/dist/browser-lazy/chunks/chunk-5B2Z7575.js +1 -0
  30. package/dist/browser-lazy/chunks/chunk-5FQ534HP.js +1 -0
  31. package/dist/browser-lazy/chunks/chunk-5UVGUSD6.js +1 -0
  32. package/dist/browser-lazy/chunks/chunk-5X6MJX3H.js +1 -0
  33. package/dist/browser-lazy/chunks/chunk-AMJLVPUB.js +4 -0
  34. package/dist/browser-lazy/chunks/chunk-BU5LHXNJ.js +3 -0
  35. package/dist/browser-lazy/chunks/chunk-BY2CPG6B.js +1 -0
  36. package/dist/browser-lazy/chunks/chunk-CN7WTBWB.js +1 -0
  37. package/dist/browser-lazy/chunks/chunk-CQE4HQEW.js +1 -0
  38. package/dist/browser-lazy/chunks/chunk-CSFUKSU6.js +1 -0
  39. package/dist/browser-lazy/chunks/chunk-DF6765YX.js +17 -0
  40. package/dist/browser-lazy/chunks/chunk-E2WMJZNM.js +1 -0
  41. package/dist/browser-lazy/chunks/chunk-FAIMVOX5.js +6 -0
  42. package/dist/browser-lazy/chunks/chunk-GVOEAY52.js +1 -0
  43. package/dist/browser-lazy/chunks/chunk-HLWUNUCM.js +1 -0
  44. package/dist/browser-lazy/chunks/chunk-ICC7HBJX.js +1 -0
  45. package/dist/browser-lazy/chunks/chunk-J35HAQQF.js +20 -0
  46. package/dist/browser-lazy/chunks/chunk-J7FFAFQF.js +1 -0
  47. package/dist/browser-lazy/chunks/chunk-LH7HUDKW.js +1 -0
  48. package/dist/browser-lazy/chunks/chunk-N5ELX7LR.js +2 -0
  49. package/dist/browser-lazy/chunks/chunk-NMQQMRIR.js +1 -0
  50. package/dist/browser-lazy/chunks/chunk-NO7ZIVRU.js +1 -0
  51. package/dist/browser-lazy/chunks/chunk-OZ443IVJ.js +16 -0
  52. package/dist/browser-lazy/chunks/chunk-PQGPS2YV.js +7 -0
  53. package/dist/browser-lazy/chunks/chunk-QA6GJQ4X.js +1 -0
  54. package/dist/browser-lazy/chunks/chunk-RIVTHZAQ.js +1 -0
  55. package/dist/browser-lazy/chunks/chunk-SZELX2EJ.js +1 -0
  56. package/dist/browser-lazy/chunks/chunk-TYZOZXUJ.js +22 -0
  57. package/dist/browser-lazy/chunks/chunk-UL6NDWLL.js +1 -0
  58. package/dist/browser-lazy/chunks/chunk-VQYYGAXP.js +1 -0
  59. package/dist/browser-lazy/chunks/chunk-VWVZGQE2.js +1 -0
  60. package/dist/browser-lazy/chunks/chunk-X2UYKWKM.js +4 -0
  61. package/dist/browser-lazy/chunks/chunk-YCEICNM6.js +1 -0
  62. package/dist/browser-lazy/chunks/chunk-Z3FDIVLN.js +20 -0
  63. package/dist/browser-lazy/chunks/class-5QA4SCTS.js +13 -0
  64. package/dist/browser-lazy/chunks/decode-63UIZGD2.js +1 -0
  65. package/dist/browser-lazy/chunks/elk.bundled-L4CADV5W.js +24 -0
  66. package/dist/browser-lazy/chunks/er-7ZSKGN7Y.js +11 -0
  67. package/dist/browser-lazy/chunks/eventmodeling-2BPLHWRN.js +19 -0
  68. package/dist/browser-lazy/chunks/flowchart-NEIMZTB5.js +4 -0
  69. package/dist/browser-lazy/chunks/forest-implementation-AEP24AIP.js +1 -0
  70. package/dist/browser-lazy/chunks/gantt-RDPIFYAF.js +11 -0
  71. package/dist/browser-lazy/chunks/gitgraph-N4Y5RYB7.js +9 -0
  72. package/dist/browser-lazy/chunks/ishikawa-LD3YBDJN.js +6 -0
  73. package/dist/browser-lazy/chunks/journey-6YQR5DJX.js +16 -0
  74. package/dist/browser-lazy/chunks/kanban-PLMJ7NBW.js +20 -0
  75. package/dist/browser-lazy/chunks/mermaid-yaml-runtime-QVYX4EWK.js +136 -0
  76. package/dist/browser-lazy/chunks/mindmap-K2UBFO3Y.js +12 -0
  77. package/dist/browser-lazy/chunks/packet-CUW4QY6Y.js +7 -0
  78. package/dist/browser-lazy/chunks/pie-7F7UUCG3.js +15 -0
  79. package/dist/browser-lazy/chunks/quadrant-TOONO2WC.js +10 -0
  80. package/dist/browser-lazy/chunks/radar-J6JVWVAX.js +16 -0
  81. package/dist/browser-lazy/chunks/render-core-BZOM3K7D.js +3 -0
  82. package/dist/browser-lazy/chunks/requirement-CMAKDJPO.js +19 -0
  83. package/dist/browser-lazy/chunks/sankey-AWXQEP3F.js +13 -0
  84. package/dist/browser-lazy/chunks/sequence-Q2RJRB4L.js +5 -0
  85. package/dist/browser-lazy/chunks/state-WRBFQEDX.js +4 -0
  86. package/dist/browser-lazy/chunks/timeline-D2KILFXM.js +6 -0
  87. package/dist/browser-lazy/chunks/treemap-N3VYX5D4.js +6 -0
  88. package/dist/browser-lazy/chunks/xychart-G73OGK66.js +16 -0
  89. package/dist/browser-lazy/chunks/zenuml-H4BXNYXR.js +16 -0
  90. package/dist/browser-lazy/index.d.ts +544 -275
  91. package/dist/browser-lazy/index.js +1 -1
  92. package/dist/browser.global.js +802 -565
  93. package/dist/chunk-3LGLPG33.js +2 -0
  94. package/dist/chunk-7CRDX2QR.js +2 -0
  95. package/dist/chunk-7PPW2BMO.js +2 -0
  96. package/dist/chunk-DQDKA5ND.js +2 -0
  97. package/dist/chunk-EHCMJUMD.js +52 -0
  98. package/dist/chunk-GVCHLSHH.js +4 -0
  99. package/dist/chunk-H3NCS2XZ.js +19 -0
  100. package/dist/chunk-JZOJ4YGS.js +201 -0
  101. package/dist/chunk-MKE7GNYU.js +146 -0
  102. package/dist/chunk-NKNFOREZ.js +2 -0
  103. package/dist/chunk-O7H2UX5K.js +2 -0
  104. package/dist/chunk-OMY6NRQD.js +58 -0
  105. package/dist/chunk-UA234O4M.js +4 -0
  106. package/dist/chunk-VUFVLGTH.js +2 -0
  107. package/dist/chunk-XU5LPD2D.js +2 -0
  108. package/dist/cli-YGGTJZH7.js +226 -0
  109. package/dist/elk-constructor.js +2 -0
  110. package/dist/elk-constructor.node.js +11 -0
  111. package/dist/index-EeXqJXr5.d.ts +1223 -0
  112. package/dist/index.d.ts +4 -1
  113. package/dist/index.js +1 -334
  114. package/dist/jsonl-RPJY6YWO.js +2 -0
  115. package/dist/mcp-cli-63DYXTVD.js +2 -0
  116. package/dist/{index-BGA_-6LV.d.ts → paint-certification-6rwQjIv_.d.ts} +5283 -6173
  117. package/dist/server-5NEOHOFS.js +524 -0
  118. package/dist/svg-styles-BdnoM7AT.d.ts +724 -0
  119. package/dist/svg-styles.d.ts +1 -0
  120. package/dist/svg-styles.js +2 -0
  121. package/dist/svg.d.ts +13 -0
  122. package/dist/svg.js +2 -0
  123. package/dist/types-BcS52Mjt.d.ts +1360 -0
  124. package/dist/zenuml/chunks/appearance-UOQ5KA6O.js +1 -0
  125. package/dist/zenuml/chunks/builtin-backends-KDKE7YHO.js +12 -0
  126. package/dist/zenuml/chunks/chunk-42DXZ5C6.js +4 -0
  127. package/dist/zenuml/chunks/chunk-7TVYPTDW.js +1 -0
  128. package/dist/zenuml/chunks/chunk-EVPSMEKN.js +1 -0
  129. package/dist/zenuml/chunks/chunk-OXQWRSBM.js +20 -0
  130. package/dist/zenuml/chunks/chunk-QWX77U7G.js +2 -0
  131. package/dist/zenuml/chunks/chunk-RLJEI7YN.js +29 -0
  132. package/dist/zenuml/chunks/chunk-RZ6XK5CD.js +29 -0
  133. package/dist/zenuml/chunks/decode-BWERFDGK.js +1 -0
  134. package/dist/zenuml/chunks/mermaid-yaml-runtime-KZVU74WU.js +136 -0
  135. package/dist/zenuml/chunks/render-core-V5RQ737O.js +3 -0
  136. package/dist/zenuml/chunks/zenuml-EA2ZFRUX.js +20 -0
  137. package/dist/zenuml-frame.global.js +3626 -0
  138. package/dist/zenuml.d.ts +83 -0
  139. package/dist/zenuml.js +1 -0
  140. package/docs/MCP-DIRECTORY-LISTINGS.md +5 -1
  141. package/docs/README.md +59 -103
  142. package/docs/agent-api-cookbook.md +26 -16
  143. package/docs/agent-mutation-policy.md +86 -15
  144. package/docs/agent-workflow-examples.md +1 -1
  145. package/docs/api-advanced.md +385 -0
  146. package/docs/api.md +320 -366
  147. package/docs/ascii.md +40 -4
  148. package/docs/browser.md +46 -7
  149. package/docs/choosing-a-diagram.md +148 -0
  150. package/docs/code-mode-impact.md +1 -0
  151. package/docs/comparison.md +244 -28
  152. package/docs/computational-aesthetics-prototype-plan.md +10 -10
  153. package/docs/config.md +60 -2
  154. package/docs/custom-fonts.md +78 -21
  155. package/docs/diagram-families.md +160 -10
  156. package/docs/eventmodeling-and-zenuml.md +165 -0
  157. package/docs/features.md +21 -19
  158. package/docs/fork-differences.md +105 -32
  159. package/docs/getting-started.md +56 -51
  160. package/docs/layout-certification.md +126 -0
  161. package/docs/mcp-code-mode-rationale.md +20 -12
  162. package/docs/mcp-http-transport.md +14 -8
  163. package/docs/quality.md +145 -15
  164. package/docs/react.md +76 -31
  165. package/docs/style-authoring.md +23 -11
  166. package/docs/svg-semantic-contract.md +104 -4
  167. package/docs/testing-strategy.md +684 -126
  168. package/docs/theming.md +27 -8
  169. package/examples/styles/readme-hero.md +25 -0
  170. package/examples/styles/readme-hero.mmd +13 -0
  171. package/examples/styles/readme-hero.style.json +7 -0
  172. package/package.json +114 -57
  173. package/server.json +2 -2
  174. package/skills/agentic-mermaid-diagram-workflow/SKILL.md +26 -8
  175. package/skills/agentic-mermaid-diagram-workflow/references/cli.md +13 -3
  176. package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +2 -1
  177. package/skills/agentic-mermaid-diagram-workflow/references/flowchart.md +9 -6
  178. package/skills/agentic-mermaid-diagram-workflow/references/hosted-mcp.md +1 -0
  179. package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +4 -3
  180. package/skills/agentic-mermaid-diagram-workflow/references/timeline.md +7 -6
  181. package/skills/agentic-mermaid-diagram-workflow/references/upstream/agentflow.md +574 -0
  182. package/skills/agentic-mermaid-diagram-workflow/references/upstream/architecture.md +10 -2
  183. package/skills/agentic-mermaid-diagram-workflow/references/upstream/c4.md +18 -0
  184. package/skills/agentic-mermaid-diagram-workflow/references/upstream/classDiagram.md +123 -0
  185. package/skills/agentic-mermaid-diagram-workflow/references/upstream/cynefin.md +6 -1
  186. package/skills/agentic-mermaid-diagram-workflow/references/upstream/entityRelationshipDiagram.md +129 -9
  187. package/skills/agentic-mermaid-diagram-workflow/references/upstream/eventmodeling.md +22 -0
  188. package/skills/agentic-mermaid-diagram-workflow/references/upstream/flowchart.md +188 -60
  189. package/skills/agentic-mermaid-diagram-workflow/references/upstream/gitgraph.md +13 -7
  190. package/skills/agentic-mermaid-diagram-workflow/references/upstream/mindmap.md +110 -1
  191. package/skills/agentic-mermaid-diagram-workflow/references/upstream/packet.md +38 -0
  192. package/skills/agentic-mermaid-diagram-workflow/references/upstream/requirementDiagram.md +115 -0
  193. package/skills/agentic-mermaid-diagram-workflow/references/upstream/sequenceDiagram.md +101 -0
  194. package/skills/agentic-mermaid-diagram-workflow/references/upstream/stateDiagram.md +87 -0
  195. package/skills/agentic-mermaid-diagram-workflow/references/upstream/swimlanes.md +105 -2
  196. package/skills/agentic-mermaid-diagram-workflow/references/upstream/timeline.md +12 -6
  197. package/skills/agentic-mermaid-diagram-workflow/references/upstream/usecase.md +953 -0
  198. package/skills/agentic-mermaid-diagram-workflow/references/upstream/venn.md +77 -0
  199. package/skills/agentic-mermaid-diagram-workflow/references/upstream/xyChart.md +1 -1
  200. package/dist/browser-lazy/chunks/architecture-KTHE2HX3.js +0 -31
  201. package/dist/browser-lazy/chunks/chunk-2XCPFAD5.js +0 -46
  202. package/dist/browser-lazy/chunks/chunk-3H4F7RBT.js +0 -1
  203. package/dist/browser-lazy/chunks/chunk-4EVLW2NJ.js +0 -1
  204. package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +0 -1
  205. package/dist/browser-lazy/chunks/chunk-6OAPWSDO.js +0 -1
  206. package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +0 -143
  207. package/dist/browser-lazy/chunks/chunk-C7FJO2I3.js +0 -4
  208. package/dist/browser-lazy/chunks/chunk-D3XXDKIO.js +0 -1
  209. package/dist/browser-lazy/chunks/chunk-DXA5WL7H.js +0 -4
  210. package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +0 -1
  211. package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +0 -2
  212. package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +0 -2
  213. package/dist/browser-lazy/chunks/chunk-G6OLSHRG.js +0 -7
  214. package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
  215. package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +0 -1
  216. package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +0 -1
  217. package/dist/browser-lazy/chunks/chunk-L227EPFP.js +0 -11
  218. package/dist/browser-lazy/chunks/chunk-LNIHDJSF.js +0 -1
  219. package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +0 -1
  220. package/dist/browser-lazy/chunks/chunk-NZRUMODH.js +0 -1
  221. package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +0 -1
  222. package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +0 -1
  223. package/dist/browser-lazy/chunks/chunk-PXKL3O6H.js +0 -1
  224. package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +0 -1
  225. package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +0 -1
  226. package/dist/browser-lazy/chunks/chunk-SUFMSWTX.js +0 -1
  227. package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +0 -3
  228. package/dist/browser-lazy/chunks/chunk-UAEZO5VL.js +0 -1
  229. package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +0 -1
  230. package/dist/browser-lazy/chunks/chunk-X64T74C5.js +0 -24
  231. package/dist/browser-lazy/chunks/class-F7R6TJ73.js +0 -9
  232. package/dist/browser-lazy/chunks/er-BDK7CM5L.js +0 -9
  233. package/dist/browser-lazy/chunks/flowchart-KFU6XV7S.js +0 -4
  234. package/dist/browser-lazy/chunks/gantt-I64VVDSP.js +0 -28
  235. package/dist/browser-lazy/chunks/gitgraph-EDUVJ5IJ.js +0 -8
  236. package/dist/browser-lazy/chunks/journey-TLO2RNM3.js +0 -40
  237. package/dist/browser-lazy/chunks/mindmap-OJCNDYPM.js +0 -9
  238. package/dist/browser-lazy/chunks/pie-HVG6XO7K.js +0 -19
  239. package/dist/browser-lazy/chunks/quadrant-U6S2L4MJ.js +0 -24
  240. package/dist/browser-lazy/chunks/radar-ZDLOBTVG.js +0 -32
  241. package/dist/browser-lazy/chunks/render-core-Y2DFNMQG.js +0 -12
  242. package/dist/browser-lazy/chunks/sequence-Z4WFS3VB.js +0 -12
  243. package/dist/browser-lazy/chunks/state-2HV2YGN3.js +0 -4
  244. package/dist/browser-lazy/chunks/timeline-XM4UFPOC.js +0 -20
  245. package/dist/browser-lazy/chunks/xychart-7JDHWTQY.js +0 -36
  246. package/dist/chunk-GGXCNCNA.js +0 -4118
  247. package/dist/chunk-IVD4NXNE.js +0 -615
  248. package/dist/chunk-JDMRPUAG.js +0 -37
  249. package/dist/chunk-JWAAW3FH.js +0 -149
  250. package/dist/chunk-LCGBT32P.js +0 -62036
  251. package/dist/chunk-RWMZRUIC.js +0 -4715
  252. package/dist/mcp-cli-4MLKC3ZH.js +0 -17
  253. package/docs/mutation-testing.md +0 -285
package/CHANGELOG.md CHANGED
@@ -4,6 +4,657 @@ This changelog tracks user-facing changes for **Agentic Mermaid**, a fork of `lu
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.5.3 — 2026-10-29
8
+
9
+ Includes the 0.5.2 changes below. Its registry publication was blocked when
10
+ GitHub could not allocate a macOS arm64 runner; its source tag is retained.
11
+
12
+ ### Fixed
13
+
14
+ - Keep styled arrowheads clear of connector bends in Flowchart, Architecture,
15
+ Block, Class, Requirement, C4, Event Modeling and Gantt dependencies by
16
+ reserving the painted marker depth plus 4 px of straight shaft through
17
+ routing and rounding.
18
+ - Run the required macOS release build and rendering contracts on a standard
19
+ Intel macOS 26 runner. Windows coverage, the rendering suite, build heap
20
+ allowance and verified-artifact publication gates are unchanged.
21
+
22
+ ## 0.5.2 — 2026-10-29
23
+
24
+ ### Fixed
25
+
26
+ - Parse long same-line Flowchart chains without rescanning the remaining
27
+ chain for each node's edge-ID diagnostic. Preserve the existing syntax
28
+ warnings and source-map spans.
29
+ - Align ELK routes whose straight runs differ only by floating-point roundoff
30
+ as they are read back, so wide Class diagrams with padded cards keep their
31
+ card contacts instead of refusing to render, and Flowchart, State, ER and
32
+ Requirement routes start exactly orthogonal.
33
+ - Render Class diagrams with rounded relationship corners, such as the
34
+ `publication-figure` style, when a relationship must bypass a namespace
35
+ header, including nested namespaces.
36
+ - Render publication-styled Flowcharts with compound long links when joined
37
+ route sections differ only by floating-point roundoff, retaining their
38
+ endpoint contacts and existing route-safety checks.
39
+ - Keep Flowchart relationship ends readable: clear endpoint labels and styled
40
+ arrowheads, symmetric grouped fan-outs with safe caption seats, and distinct
41
+ terminals for differently painted or separately captioned relationships.
42
+ - Reject shared buses that imply invisible or differently painted relationships,
43
+ including replacements that introduce a new misleading overlap without
44
+ increasing the overlap count.
45
+
46
+ ## 0.5.1 — 2026-10-29
47
+
48
+ Includes the 0.5.0 changes below. That version's npm and MCP Registry
49
+ publication was blocked by the macOS declaration build; its GitHub source tag
50
+ is retained.
51
+
52
+ ### Fixed
53
+
54
+ - Give release-platform builds a 4 GiB Node old-space limit so tsup's declaration
55
+ worker can finish on macOS runners. The limit applies only to the build step;
56
+ rendering smoke tests and verified-artifact publication retain their checks.
57
+
58
+ ## 0.5.0 — 2026-10-28
59
+
60
+ Changes since 0.4.1, including the unpublished 0.4.2 development cycle.
61
+
62
+ ### Added
63
+
64
+ - Explicit source-preserving edits for opaque Class and Flowchart diagrams
65
+ across library, CLI, MCP and editor-worker workflows. Class supports adding
66
+ members and removing owned whole-line members; Flowchart supports label
67
+ overrides and owned node renames. Edits retain other source bytes and require
68
+ complete native-model read-back; ambiguous ownership, dependencies and
69
+ semantic changes outside the requested edit are refused atomically.
70
+
71
+ - Serve existing Markdown directly from the canonical API, warning and error
72
+ page URLs when GET/HEAD requests prefer `text/markdown`, with page-specific
73
+ discovery, `Content-Location` and cache-safe `Vary: Accept` headers.
74
+
75
+ - Generate the website's library reference and Markdown download from the
76
+ canonical API documentation, with task-first examples, runtime-derived option
77
+ defaults, source/release version information and a separate advanced reference.
78
+
79
+ - Export synchronous `renderResolvedScene` and `RESOLVED_SCENE_VERSION = 2`
80
+ from the main entry. Resolved parts retain their Scene nodes and expose
81
+ backend-painted paths, text runs, concrete paint, transforms and expanded
82
+ markers without a browser. The returned SVG matches `renderMermaidSVG`;
83
+ unsupported artwork fails with its owning part instead of being dropped.
84
+
85
+ ### Performance
86
+
87
+ - Source-preserving edits avoid duplicate Flowchart parsing when authored and
88
+ rendered parser inputs are identical, and avoid redundant Class quote-provenance
89
+ work when the authored grammar is unchanged. Distinct text interpretations
90
+ retain independent read-back. Local edit-kernel measurements do not establish
91
+ an end-to-end CLI, MCP or browser speedup.
92
+ - Published Node bundles compact whitespace without rewriting syntax or renaming
93
+ callable exports. The package keeps its existing exports, resources and lazy ELK
94
+ boundary.
95
+ - Benchmarks retain verified packed inputs, dependency locks, complete peer
96
+ observations and explicit cache/assertion policy. Scoped findings and remaining
97
+ competitor gaps are in the benchmark report linked from the documentation hub.
98
+
99
+ ### Known limitations
100
+
101
+ - The #363 decision record distinguishes generous reads from portable
102
+ structured output. Quadrant text/style exports, unsupported Architecture
103
+ IDs/icons and empty Class output retain named limitations; Class, Quadrant
104
+ and Architecture also have accepted-source reader gaps. The decisions are
105
+ complete, but those runtime follow-ups remain in `TODO.md`.
106
+ - These source changes do not establish publication or deployment. Default
107
+ verbatim wrapper preservation is distinct from canonical rewriting;
108
+ successful structural verification alone is not a general lossless-editing
109
+ guarantee.
110
+
111
+ ### Fixed
112
+
113
+ - GitGraph string exports preserve authored values through Mermaid reload;
114
+ Class namespace admission and Kanban authored-source provenance retain their
115
+ respective identity and text contracts. Marker certification checks the
116
+ serialized marker paint and placement used by the shipped SVG (#572).
117
+
118
+ - Preserve Class direction-like label text in portable exports, refuse lossy
119
+ empty Class and unrepresentable Quadrant labels, and share Ishikawa/Sankey
120
+ header handling between direct rendering and typed reads (#548–#552).
121
+
122
+ - Canonical writes preserve empty accessibility descriptions using native
123
+ metadata comments, protect directive-looking Kanban labels and metadata,
124
+ and move C4 global metadata out of nested boundaries. Sequence message IDs
125
+ that collide with keyword prefixes stay diagnosed and source-only rather
126
+ than entering a typed body with no portable spelling.
127
+
128
+ - Resolved scenes report the input diagram's registered family. Both State
129
+ headers return `state` instead of their shared `flowchart` rendering family.
130
+ Resolved Scene version 2 records this metadata change; SVG artwork and part
131
+ ownership are unchanged.
132
+
133
+ - Use one vocabulary for diagram families, source objects, Scene parts,
134
+ resolved primitives and typed-family narrowing across reference docs,
135
+ website guidance, CLI help and agent discovery, retaining existing API names.
136
+
137
+ - Sequence terminal output retains fragment headers and dividers inside wide
138
+ participant boxes, including combined `box`/`alt`/note cases, in both ASCII
139
+ and Unicode. The historical witness remains pinned in the test suite.
140
+ - Architecture layouts separate expanded aligned group frames and reconcile
141
+ cross-group alignment after child reordering, preserving complete group contents
142
+ and routing from the final endpoint positions.
143
+ - XY charts wrap rotated axis titles into the authored canvas height and reserve
144
+ their complete multiline gutter, preserving fixed chart dimensions and text.
145
+
146
+ - Kanban edits retain keyword-like column and task IDs such as `kanban` and
147
+ `kanban-board` in Mermaid-readable source, preserving labels and membership.
148
+ - Mixed labelled and unlabelled parallel edges can use a clear target-side
149
+ corridor when a feedback loop blocks the source-side jog. Placement reserves
150
+ the full painted label halo and retains prior routing when the label cannot
151
+ fit the proposed lanes.
152
+ - A copied or stale `bundle` route certificate can no longer hide a hitch.
153
+ Exemptions remain bound to the routes constructed by the shared-trunk,
154
+ symmetric-convergence and parallel-lane producers.
155
+ - Losing cosmetic centering proposals retain the previous feasible geometry.
156
+ Straight-route repairs retain canonical ports unless higher-priority conflicts
157
+ improve. Four generated valid-flowchart failures now render.
158
+ - Wildcard HTTP listeners advertise a connectable loopback URL while retaining
159
+ their configured bind address and bearer-token policy.
160
+ - Lazy browser SVG loading fetches ELK only when placement needs it, and keeps
161
+ one admitted request across deferred dependencies. Ordinary native rendering
162
+ avoids declaration-ledger reconciliation and full text inspection evidence;
163
+ strict, verify, extension admission and final paint/security checks remain.
164
+ - An inexpensive Scene admission cannot bypass a later strict cross-check.
165
+ - Class layouts preserve authored `ns:` IDs, actual namespace ancestry, empty
166
+ namespace frames and freestanding notes. Notes-only terminal output retains
167
+ its content too.
168
+
169
+ ### Maintenance
170
+
171
+ - Retire copied discovery/API inventories, the empty-divergence pin and
172
+ exclusions-ledger hygiene gates. Keep live generated discovery, executable
173
+ divergence behavior and shipped/external artifact integrity checks.
174
+ - Family portfolio selects four distinct inputs for all 23 native families.
175
+ Degenerate-route failures always retain their complete diagnostic report.
176
+
177
+ ### Earlier fixes
178
+
179
+ - `verify` on a source string checks the request `render` makes from that
180
+ string, including its `%%{init}%%` and frontmatter config. It used to check
181
+ a canonical copy that drops that config, so it measured a different layout
182
+ (for example ignoring `flowchart.rankSpacing`) and passed sources `render`
183
+ refuses: raw `themeCSS`, an unsafe `themeVariables.fontFamily`, or spacing
184
+ so large the canvas exceeds its cap. These are now `RENDER_FAILED`.
185
+ - Refused config no longer makes `parseMermaid` and `verify` throw: config
186
+ the admission refuses (a reserved key such as `__proto__`, nesting or size
187
+ past its bounds) is a new `CONFIG_REJECTED` parse error, which `verify`
188
+ reports as `RENDER_FAILED` with origin `config`. `verify` reports any
189
+ non-empty source that fails to parse (a syntax error, frontmatter that is
190
+ not valid YAML, a diagram over a work limit) as `RENDER_FAILED` with the
191
+ parser's message, not `EMPTY_DIAGRAM`, and suppressing that finding no
192
+ longer makes such a source verify `ok`. A work limit only the render path
193
+ enforces (state nesting) no longer escapes `verify` as an exception.
194
+ - `verify` on a Flowchart or State diagram whose render fails (refused config
195
+ such as raw `themeCSS`, or a layout past the canvas cap) still reports the
196
+ findings it reads from the diagram itself (`LABEL_OVERFLOW`,
197
+ `EDGE_MISANCHORED`, `UNKNOWN_SHAPE` and the advisory lints) beside
198
+ `RENDER_FAILED`, so fixing the config does not surface them one at a time.
199
+ A refused color is still the whole finding.
200
+ - A registered family whose parse hook throws no longer makes `parseMermaid`
201
+ and `verify` throw: the throw is a `FAMILY_DESCRIPTOR_CONTRACT` parse error,
202
+ which `verify` reports as `RENDER_FAILED` with origin `config`.
203
+ - A State transition to a state that another composite or concurrency region
204
+ already holds (`state B { y }` then `state A { x --> y }`) draws the
205
+ transition across to it. Each mention used to add the state to every
206
+ composite, which the layout refused as a duplicate (`INTERNAL_ERROR`). The
207
+ first composite to mention a state owns it; Mermaid moves it into the last,
208
+ a difference recorded in `docs/project/divergences.md`.
209
+ - A parsed State diagram, and the source `serializeMermaid` writes for it,
210
+ lay out as its source does. The writer put every declared state and
211
+ composite block ahead of the transitions, so a state described or declared
212
+ after the transitions that introduce its siblings (including one a
213
+ `C:::hot` shorthand declares) moved in the layout, and `[*]` nodes were
214
+ renumbered. The writer now keeps each scope's states in the order the source
215
+ creates them, the typed body lists them in that order (it used to list
216
+ declared states first), and a `[*]` inside composite `X` is `X_start`,
217
+ `X_start2`, … (`X_end`, …), numbered within `X` rather than across the
218
+ diagram. Top-level ids stay `_start`, `_start2`, ….
219
+ - A State diagram that names a state `_start` or `_end` (or `_start2`, …)
220
+ keeps its `[*]` start and end nodes. The generated pseudostate took the
221
+ author's id, so the start node vanished into the authored state and
222
+ `verify` still reported `ok`; a generated id now skips any an author wrote.
223
+ - A Flowchart, State, Sequence, Class or ER diagram with a frontmatter title
224
+ and nothing else draws its title, as every other family does and as its
225
+ terminal output already did. Flowchart and State used to fail the render
226
+ (`LayoutCertificationError`: the title fell outside a 0×0 canvas); Sequence,
227
+ Class and ER drew an empty canvas without it. `verify` still reports
228
+ `EMPTY_DIAGRAM`.
229
+ - A `theme` config value that is not a string (`%%{init: {"theme": 5}}%%`)
230
+ no longer crashes every render and makes `verify` report `INTERNAL_ERROR`.
231
+ Like an unknown theme name, it names no theme and the default colors apply.
232
+ - The MCP `describe` tool no longer reports success for a source that does
233
+ not parse in its default text format. Every format returns `ok: false`
234
+ with the parser's errors (text also keeps its prose line), as JSON and
235
+ facts did and as `am describe` exits non-zero.
236
+ - A parsed diagram drawn from its canonical body (Flowchart, Timeline, Class,
237
+ ER, Journey, Architecture, any source-preserved body, and extension families
238
+ that render canonically) renders, lays out and verifies under its authored
239
+ config wrapper (frontmatter title and config, `%%{init}%%` directives), as
240
+ its source and its serialized output do (an edited diagram already did).
241
+ `renderMermaidSVG(parsed)`, `layoutMermaid(parsed)` and
242
+ `verifyMermaid(parsed)` used to drop that wrapper for a freshly parsed
243
+ diagram, losing the title, theme and spacing the saved source would draw.
244
+ `renderMermaidWithActions` takes its target regions from that layout, so
245
+ under a frontmatter title they sat a title band above the targets the
246
+ output draws, for a source string too; they now cover them.
247
+ - A state diagram that reopens a composite state (a second `state A { … }`
248
+ block, one-line or not) draws one state A holding both blocks' states, as
249
+ Mermaid does. Each block used to add its own container with the same id,
250
+ which the layout engine could not resolve, so the render failed. A stays
251
+ where its first block is, a block reopening a `--`-split composite
252
+ continues its last region, and the first block's `direction` holds. A
253
+ later block's label labels A, joined with any other label or description
254
+ as one composite's are (`state_composite_description` where Mermaid
255
+ rejects them). The readings that differ from Mermaid's are recorded in
256
+ `docs/project/divergences.md`.
257
+ - Sankey and XYChart SVGs draw the canvas that `layoutMermaid`, `verify` and
258
+ `renderMermaidWithActions` regions describe. The final paint check
259
+ over-measured their ink (half a line width past the butt-capped ends of
260
+ XYChart axis and grid lines, which end on the canvas edge; far past the ends
261
+ of thick Sankey ribbons, and twice their width in every direction once a
262
+ ribbon's control point had been rounded), so the SVG widened its `viewBox`
263
+ beyond the layout's bounds (an XYChart's 700×500 became 701×500.71, a
264
+ Sankey's 648×448 became 672×464.59 or as much as 1728×1194.67) and drew the
265
+ whole diagram scaled down inside the same width and height. A Sankey ribbon
266
+ thicker than its bend, which folds past the node it meets, now widens the
267
+ canvas to hold that ink.
268
+ - A diagram whose ink touches the canvas edge only by floating-point noise
269
+ keeps its canvas. A Journey actor legend title whose top came out at
270
+ -3.6e-15 made the SVG floor its `viewBox` to `0 -1 409.43 373` against the
271
+ layout's 408×372; the final paint check now treats ink within 1e-6 of the
272
+ edge as on the canvas.
273
+ - An XYChart line series clamps a value past the axis range to the plot edge,
274
+ as a bar already does, and keeps its value (`verify` still reports
275
+ `VALUES_OUTSIDE_RANGE`). The line used to run off the plot, and the SVG
276
+ widened its `viewBox` to hold it (`0 -457 1622.6 1159` for one out-of-range
277
+ value), drawing the chart at under half size. Where the plot meets the
278
+ canvas edge, it now leaves room for the marks centered on that edge: a line
279
+ point's cap or dot at a linear x-axis end, the last tick there, and the end
280
+ grid lines and ticks of a chart with no title or value labels beside them.
281
+ Each of these widened the `viewBox` by a pixel or two. A line point's
282
+ measurement footprint is the part of it inside the plot.
283
+ - Font families may be double-quoted, as Mermaid's own default
284
+ `"trebuchet ms", verdana, arial, sans-serif` is: the font option,
285
+ `fontFamily` config, theme variables, Journey font config, style-role fonts
286
+ and Architecture group fonts accept them. A font written into a style
287
+ attribute or stylesheet is written single-quoted; a `font-family`
288
+ attribute escapes the quotes. A quote that does not close, a name holding
289
+ the other quote character, and whitespace other than space and tab stay
290
+ refused.
291
+ - Paint inspection applies enclosing group opacity to inline connector labels,
292
+ including hidden labels, consistently with the SVG writer.
293
+
294
+ - Journey `taskFontFamily` and `titleFontFamily` config values are written
295
+ into CSS only when they are safe font-family lists; an unsafe value (one
296
+ that closes the rule or fetches with `url()`) is ignored with an
297
+ `INEFFECTIVE_CONFIG` warning instead of restyling the whole diagram.
298
+ - C4 relationships between facing cards of different heights run straight.
299
+ Ports spaced evenly along each face sat a few pixels apart, which drew a
300
+ small dogleg on each such relationship.
301
+ - Drawings that disagreed with their certified paint now draw it: a Pie
302
+ slice's role or semantic-slot border and its highlight emphasis, which
303
+ stylesheet rules overrode; abstract, static and non-ASCII Class members,
304
+ which painted in SVG's default black instead of the member ink; a Journey
305
+ `titleFontSize` in `em`/`ex`, which drew squashed. (A Journey title's letter
306
+ spacing is now on its `<text>` too, but its per-glyph spans already drew it.)
307
+ Sketch styles now draw Radar areas with the translucent fill and opaque
308
+ outline the default style draws, XYChart series lines with round caps and
309
+ joins, and a done Gantt bar's border. Under a sketch look stacked with a dark palette
310
+ (for example `watercolor` with `dusk`), Architecture labels, Journey task
311
+ text and Timeline event text take the sketch's legible ink instead of a
312
+ family stylesheet's dark ink.
313
+ - Context codecs preserve entity-derived tags, emphasis and backslash-n as
314
+ literal text beside authored formatting in Flowchart, ER, Sequence and Class.
315
+ Parsed aliases and labels retain their meaning through edits and reload;
316
+ typed entity-looking strings remain literal without caller pre-escaping.
317
+ - Sequence aliases, messages and notes share prepared display text with their
318
+ graphical and terminal projections. Physical message line breaks serialize
319
+ as Mermaid break markup. Class members and annotations share their display
320
+ formatter with layout and label metrics (CONS-46).
321
+ - Sequence text holding a character reference is text on every surface. The
322
+ renderer decodes references before reading statements, so `&#35;hash` hid
323
+ the rest of a message as a comment, `&#59;` split it and failed the render,
324
+ and `&nbsp;`, which that decode leaves as written, split it too. The typed
325
+ body read the undecoded source, so `A->>B: a &amp; b` became two statements
326
+ there and `verify` reported `RENDER_FAILED`. The SVG and terminal renderers,
327
+ the typed body and its lints now read one Sequence text: XML references
328
+ decode to their characters, except that `#` and `;` read as `#35;` and
329
+ `#59;`, and an HTML name such as `&nbsp;` reads as `#nbsp;`, so each draws its
330
+ character (`&amp;nbsp;` still draws `&nbsp;`, and `R&D;`, which names no
331
+ character, still ends its statement). Parsed diagrams and their
332
+ serialization draw what the source draws, and serialization writes text
333
+ Mermaid reads (`a & b`, `#35;`), escaping an `&` that would read back as a
334
+ reference. `verify` reports `UNSUPPORTED_SYNTAX` with
335
+ `sequence_named_reference_semicolon` where pinned Mermaid ends the statement
336
+ at a named reference's `;`.
337
+ - Class namespace labels use the same break and formatting rules in native and
338
+ typed rendering. ER attribute diagnostics measure rendered columns rather
339
+ than entity spellings or grammar delimiters. C4 relationship receipts retain
340
+ literal tags and untransformed text under graphical casing and tracking.
341
+ - Flowchart labels affected by upstream's quote preprocessor remain readable
342
+ and receive `UNSUPPORTED_SYNTAX` with `flowchart_preprocessor_quote_rewrite`;
343
+ canonical output uses a portable entity spelling (#372).
344
+ - State descriptions, aliases, transition labels and notes retain literal `%%`
345
+ in text contexts. Mindmap labels, icons and class payloads retain that text
346
+ too; actual comments still follow their grammar context. State block-note
347
+ lines beginning with `%%` intentionally remain note content (#372).
348
+ - ER edits retain entity order and group ownership through export and reload,
349
+ including removing the entity or relationship that first introduced them
350
+ (#372). The old BUG-10 estimate of about 0.6% of fuzzed edits is historical,
351
+ rather than a measurement of this candidate.
352
+ - Journey admits title, section and task labels made entirely of line breaks.
353
+ Intentional empty Pie, Architecture, Journey and XY edits succeed when their
354
+ emitted source renders; standalone verification still reports emptiness
355
+ (#367).
356
+ - Canonical YAML output preserves whitespace-only scalar lines and trailing
357
+ newlines. Frontmatter boundaries retain supported footer indentation without
358
+ consuming block-scalar content (#367).
359
+ - Class relationship markers keep their authored endpoint through unrelated
360
+ edits, serialization and reload (#406). Semantic facts now include marker
361
+ ownership, both-ended marker kinds and shaft style; existing fact strings
362
+ remain, but callers using `checkMermaid` with `exact: true` must include the
363
+ new facts. `docs/api.md` gives a complete-set migration example.
364
+ - Class dashed diamond relationships retain their shaft style independently
365
+ of endpoint markers. Native parsing, edits, serialization, SVG/Scene and
366
+ terminal output support two-ended and mixed lollipop relationships, including
367
+ escaped endpoint identities. Public relation operations accept endpoint and
368
+ shaft metadata and refuse contradictory combinations. Exports keep required
369
+ backticks on reserved endpoint identities, including attached notes and links,
370
+ and write relationship label/cardinality line breaks as Mermaid markup.
371
+ Both Code Mode SDK declarations accept parse → narrow → edit workflows;
372
+ the full declaration exposes the new relation fields.
373
+ - Checked and declarative Class edits accept the supported `lollipop`
374
+ relationship kind, matching direct typed mutation (#407).
375
+ - Class `add_member` and initial `add_class.members` reject LF/CRLF that
376
+ would split a member on reload; bare CR is also rejected under the
377
+ single-line member policy (#408). Literal backslash-n and ordinary
378
+ single-line member text remain supported. Blank/comment-form members,
379
+ accessibility directives and decoded line breaks are refused too; initial
380
+ member arrays are copied so a caller cannot change the returned diagram
381
+ through the supplied array.
382
+ - XY-chart titles wrap to the configured canvas width and reserve space above
383
+ the plot, keeping long titles visible in vertical and horizontal charts.
384
+ Verification names titles that cannot fit the configured title-space budget
385
+ with `LABELS_HIDDEN`, rather than omitting them silently.
386
+ - Timeline periods whose names begin with `Timeline` retain their labels and
387
+ events in SVG, terminal output and verified layout.
388
+ - State rendering rejects unknown statements with a named `RENDER_FAILED`
389
+ diagnostic instead of returning a partial diagram. Explicit `state Idle`
390
+ declarations retain isolated states in both the editable model and drawing.
391
+ Canonical labels write `<br/>` breaks so normalized multiline text survives
392
+ re-parsing and verification. Unmodeled statements and floating notes fail
393
+ explicitly rather than being silently omitted. Harmless slash comments
394
+ remain preserved; recognized legacy layout directives render known topology
395
+ and warn that their layout behavior is not applied.
396
+ - Class edits prune empty unlabeled namespaces and refuse to erase explicit
397
+ labels. Labeled parents retain surviving descendants in valid nested exports;
398
+ directly authored empty namespaces remain source-preserved and non-editable.
399
+ - Two labeled edges from a decision diamond to the same rectangle render on
400
+ separate, outline-anchored routes with readable labels.
401
+ - Flowchart and sequence `@{ … }` metadata is read as YAML, as Mermaid reads
402
+ it: escapes such as `\t`, `\x41` and `''` work, and metadata Mermaid rejects
403
+ (`'a}b;c'`, `\'`, unknown escapes, duplicate keys, an unquoted `^`, an empty
404
+ sequence `@{}`) is a syntax error. Keys are case-sensitive, and a multi-line
405
+ block is block YAML.
406
+ - `participant B@{ "alias": "Y" } as B` is labelled Y, as in Mermaid. A typed
407
+ sequence diagram keeps `actor A@{ "type": "participant" }`, and relabelling a
408
+ participant named by a metadata alias inside a block sticks.
409
+ - Frontmatter that is not valid YAML is rejected ("Mermaid frontmatter is not
410
+ valid YAML: …"; CLI exit 4) instead of being ignored. Frontmatter the old
411
+ reader dropped (a multi-line quoted value closed under its key) now applies.
412
+ - A label with an unknown tag (`A[a<c>d]`), or a Gantt, XYChart, GitGraph or
413
+ Radar label containing `<b>`, renders instead of failing with
414
+ `RENDER_FAILED`; unknown tags are drawn as text.
415
+ - Class notes, State block notes and Gantt section titles break at `<br>`, as
416
+ Mermaid does.
417
+ - ASCII and Unicode output no longer shows `<b>`, `**`, `*…*` or `~~` markup in
418
+ formatted labels, and the layout meta's `projectedText` is the text the cells
419
+ show. A Quadrant label with `<br>` no longer breaks the terminal frame, and
420
+ Quadrant axis labels render their formatting instead of showing tags.
421
+ - `LABEL_OVERFLOW` measures Pie, Timeline, Gantt, XYChart, GitGraph and Radar
422
+ labels as drawn, counting `<br>` and tags as characters.
423
+ - A gitGraph with no commits verifies as `EMPTY_DIAGRAM`, like every other
424
+ family's bare header.
425
+ - A blank diagram saved from `createMermaid` re-parses typed wherever Mermaid
426
+ 11.16 accepts the bare header. Bare `pie`, `journey` and `timeline` headers
427
+ render the empty chart Mermaid draws instead of failing, and a titled or
428
+ axis-only XY chart is typed and no longer reported as empty. A blank Sankey
429
+ still fails, as in Mermaid.
430
+ - A trailing `%%` comment is ignored where Mermaid's grammar ignores it: Pie,
431
+ XYChart, Quadrant (except titles), Radar, Architecture and GitGraph
432
+ statements, and Gantt headers and keyword statements. When typed
433
+ serialization drops such a comment, verify reports `COMMENT_DROPPED`.
434
+ - Source whose meaning is clear but which Mermaid 11.16 rejects is drawn, and
435
+ `verify` reports `UNSUPPORTED_SYNTAX` on its line, naming the construct and
436
+ the spelling Mermaid reads: a bare `classDiagram` header (what a blank
437
+ `createMermaid('class')` saves); a `%%` comment after a class declaration, in
438
+ a namespace or after `}`; unquoted Quadrant text Mermaid's lexer does not
439
+ read as text; Architecture titles, icons and ids outside Mermaid's terminals;
440
+ a trailing `%%`, or `\"`, `\`, `%` or an empty name, in ER quoted text; a
441
+ `linkStyle` index past the links above it; `A @{…}` spacing and mixed-stroke
442
+ text arrows (`A -- b ==> B`); a participant declared in a second `box`.
443
+ This records the original 11.16 compatibility pass. The current 12.2 grammar
444
+ accepts the previously rejected Architecture title punctuation. Remaining
445
+ writer limits and source-preserved extensions are distinguished in the #363
446
+ decision record; serialization does not repair every such extension. A
447
+ flowchart node id holding `--` or `-.` is still rejected when its meaning is
448
+ unclear.
449
+ - Flowchart: a `;` inside an asymmetric label (`A>x;y]`) is label text, and
450
+ `@{` inside a quoted label no longer turns the diagram opaque.
451
+ - ER relations written without spaces (`id1||--||id2 : label`) parse and draw.
452
+ - A sequence message whose text is only a `#…#` comment (`A->>B: #a#`) draws
453
+ an empty message instead of an empty SVG.
454
+ - A typed `add_participant` or indexed `add_message` no longer reorders
455
+ participants when the saved source is parsed again.
456
+ - The renderer and the typed body now read participant, node and group
457
+ creation the same way, and follow Mermaid 11.16 where the order was a
458
+ tie-break: `activate` creates no participant; `properties` and `details`
459
+ lines create theirs; a box does not list an actor created before it (the
460
+ frame still draws it); `style X` creates node X where it stands, so a
461
+ style-only node is drawn. Repeated node/entity mentions have one deterministic
462
+ subgraph owner and are drawn once; the mention-specific tie-break and other
463
+ decisions are documented in the #363 record.
464
+ - `examples/index.json` lists the 16 Style × Palette example cards as
465
+ `stylePaletteExamples`; they were the only rendered cards missing.
466
+ - `am batch --help` documents `--jsonl`.
467
+ - `llms.txt` lists `am serialize` among the CLI verbs.
468
+ - Radar's emphasized outer ring draws with `stroke-width: 2.1` instead of
469
+ `2.0999999999999996`.
470
+ - Flowchart labels read Mermaid's `#quot;` as `"`, and a `\` inside a quoted
471
+ label is literal, as upstream has no escapes there. The serializer writes
472
+ `"` as `#quot;`, so labels containing `"` or `\` round-trip and upstream
473
+ reads the output.
474
+ - An apostrophe in a flowchart label no longer hides the statement separators
475
+ after it (`A[it's];B[y]`).
476
+ - Serialized flowchart labels and subgraph titles are quoted wherever upstream
477
+ would reject the bare form (a bracket, `|`, `"`, `@` or `;`, or a leading
478
+ `/`, `\`, `-` or `~~~`); a rectangle labelled `/a/` no longer re-parses as a
479
+ lean shape.
480
+ - The ASCII render's layout data projects flowchart labels with their `*` and
481
+ `~`, as drawn.
482
+ - A later bare `participant X` or `actor X` no longer changes a sequence
483
+ participant that already exists; as upstream Mermaid does, only a naming
484
+ declaration (`as …` or a metadata alias) changes its label and type.
485
+ - Sequence participants that only a preserved block creates (`rect`,
486
+ `critical`, `break`, `box`, nested blocks, a note inside a `loop`, a
487
+ `create` line) are now part of the typed body, facts and structural counts,
488
+ in upstream's order; the blocks stay byte-for-byte.
489
+ - `set_participant_label` on a participant no declaration names now declares
490
+ it right after the statement that first names it, so re-parsing keeps the
491
+ participant order.
492
+ - Compositing a translucent colour over another no longer returns channel
493
+ values a rounding error above 255 (`#0F05` over white).
494
+ - ER entities keep their subgraph and position through serialization when the
495
+ relation that created or placed them is removed but another relation still
496
+ uses them; entities that must come before a subgraph's entities are declared
497
+ before it opens.
498
+ - An ER entity that only a `style` line creates keeps its `class` through
499
+ serialization.
500
+ - Flowchart plain labels keep `*`, `**` and `~~` as literal text, as upstream
501
+ Mermaid does; only markdown strings (`` "`…`" ``) format them. `LABEL_OVERFLOW`
502
+ counts those characters as drawn.
503
+ - Flowchart node, edge and subgraph labels trim leading and trailing
504
+ whitespace, as upstream does, and typed `add_node`, `set_label`, `add_edge`
505
+ and `add_subgraph` trim their labels the same way. Label whitespace is no
506
+ longer preserved.
507
+ - Serialized flowcharts quote a node label or subgraph title containing `;`,
508
+ and write a subgraph title's line break as `<br>`, so the output re-parses.
509
+ - Sequence participants that only a note names (`note left of A: …`,
510
+ `note over A,B: …`) are now part of the typed body, facts, describe output
511
+ and structural counts, in the order upstream Mermaid creates them.
512
+ - ER entities that only a relation declared no longer disappear from the
513
+ serialized source when that relation is removed; the serializer declares
514
+ them in place, inside their subgraph.
515
+ - Pie and Radar diagrams with a gapped palette theme variable (only `pie2`, or
516
+ only `cScale1`) now render instead of failing with an internal snapshot
517
+ error; the set slot uses the authored colour and the others keep their
518
+ defaults, as upstream Mermaid does.
519
+ - Bounded horizontal XYChart terminal allocation by output width and kept
520
+ target-subgraph frames disjoint from outside nodes and sibling containers.
521
+ - Preserved valid Unicode subgraph identifiers and rejected malformed explicit
522
+ identifiers instead of silently treating them as labels.
523
+ - Canonicalized IPv6 MCP origins, recognized loopback literals, and corrected
524
+ package-runner quickstarts to invoke the published package and `mcp` command.
525
+ - Fixed the local MCP server hanging at 100% CPU, or crashing, when a client
526
+ sent `render_png` alongside Code Mode `execute`. Bun releases before 1.4.0
527
+ left a `node:vm` `timeout` armed after the call returned, and it killed the
528
+ host code that ran next. On Bun, the MCP server now requires 1.4.0 or later
529
+ and exits with an explanation on older releases, and `execute` refuses to
530
+ run on them. The startup PNG warm-up, which only masked the same defect, is
531
+ removed.
532
+ - Updated React browser recipes to use the lazy browser entry, with asynchronous
533
+ loading, cancellation, and visible error handling.
534
+
535
+ ### Added
536
+
537
+ - Prepared-text reuse, certified forest layout and bounded positioned-result
538
+ reuse are enabled by default, with startup opt-outs. Their limits and selection are
539
+ documented in `docs/project/flagged-performance-experiments.md`.
540
+ - Added a `BELOW_READABLE_SIZE` raster-legibility warning: when `fitTo` or an
541
+ explicit `scale` rasterizes the smallest configured text below the new
542
+ portable `minLabelPx` floor (provisional product default 9px; `0` disables;
543
+ CLI `--min-label-px`), receipt-bearing PNG renders carry structured evidence
544
+ through library callbacks, CLI stderr and `--json`, local/hosted MCP
545
+ `render_png`, and browser diagnostics. Text-only agents can now detect when
546
+ measurable configured text falls below the selected floor; this bounded
547
+ warning does not certify whether an image is readable.
548
+ - Added Sankey as the 16th built-in diagram family, with Mermaid-compatible
549
+ `sankey` and `sankey-beta` CSV syntax, deterministic SVG, PNG, and ASCII
550
+ rendering, typed agent editing, and support across the library, CLI, MCP,
551
+ website, and full and lazy browser bundles.
552
+
553
+ ### Changed
554
+ - Extension core compatibility now follows the 0.5 release line. External
555
+ extensions declaring only `^0.4.0` must explicitly declare support for 0.5;
556
+ the Scene contract remains version 2. Bundled descriptors bind to their
557
+ shipped core version.
558
+ - Every built-in family's shapes, text and connectors are now written by one
559
+ SVG writer from the typed fields paint certification reads, so a render's
560
+ certificate describes the drawing it ships. Families no longer attach their
561
+ own SVG strings, and family stylesheets no longer paint marks (paint is
562
+ written on each element; hover and tooltip rules remain). SVG bytes change:
563
+ attribute order, inline paint and omitted SVG defaults. Default-style
564
+ rasters of the 562-input corpus are unchanged apart from Sankey link
565
+ opacity (at most 3/255 per channel) and the anti-aliasing of the Sequence
566
+ actor link-menu glyph. `verify` no longer compares each mark with its SVG,
567
+ which the writer makes hold by construction.
568
+ - `verify` no longer blames the diagram for a defect in Agentic Mermaid. A
569
+ render-path failure raised by one of the engine's own consistency checks or
570
+ by a runtime error such as a `TypeError` is the new Tier 1 error
571
+ `INTERNAL_ERROR`; its `defaultRender` says whether an ordinary render still
572
+ produces output (`succeeds-unchecked`, unchecked) or throws (`fails`).
573
+ `RENDER_FAILED` now covers faults in the source or its configuration only,
574
+ and its new `origin` field says which. `am verify`, `am mutate` and
575
+ `am describe` exit 4 when every error is `INTERNAL_ERROR`; a typed edit is
576
+ accepted when its only errors are the same `INTERNAL_ERROR` defects the
577
+ diagram already had; `am capabilities --json` lists each code's possible
578
+ `origins`. Authored values that reach the Scene's range, extent and
579
+ identity checks (a negative stroke width, an oversized canvas, a reused id)
580
+ stay `RENDER_FAILED`. Invalid render options, Style inputs and theme fonts,
581
+ and sources too long for the request receipt (with their configuration),
582
+ are now typed refusals rather than plain runtime errors.
583
+ - The npm package no longer ships `docs/mutation-testing.md`; mutation testing
584
+ and its CI jobs are gone. The repository no longer commits generated reports,
585
+ receipts, upstream-corpus hashes or eval evidence, and `CLAUDE.md` records
586
+ how contributors decide what is a bug, what to test and what to commit.
587
+ - Typed Quadrant and Architecture bodies quote titles and labels where
588
+ Mermaid needs the quotes, so a typed edit no longer writes source Mermaid
589
+ rejects. Typed Architecture labels are Mermaid's reading of the title
590
+ (`["API"]` gives `API`, not `"API"`). Architecture mutations validate ids and
591
+ icons with Mermaid's terminals and refuse a label with a backslash; Quadrant
592
+ mutations refuse a label that needs quoting and contains `"`.
593
+ - A whole-statement `id@{ … }` for an id that is not a declared edge declares
594
+ node `id`, as Mermaid does; it used to be dropped when it carried no node
595
+ keys. `@{ label/icon/img }` values are written as YAML double-quoted strings.
596
+ - The lazy browser renderer detects the family from the header line alone and
597
+ loads the source normalizer with the family. Its initial download falls from
598
+ 42.2 KB to 4.4 KB gzip. The HTML5 named-entity table (about 23 KB gzip) is
599
+ fetched only when a diagram displays a named entity other than `#amp;`,
600
+ `#lt;`, `#gt;`, `#quot;` or `#apos;`, so Pie's download shrinks by about
601
+ 21 KB and no family's grows by more than 1.6%.
602
+ - Internal rules that had several copies now have one: a body-utils module for
603
+ optional fields, insert positions and label overflow; one plain-record
604
+ check, deep-freeze and Scene walk; one set of Code Mode membrane traps; one
605
+ XY chart layout for both orientations; one WCAG luminance and contrast
606
+ implementation; one capability-report cache check; one SVG-hooks module per
607
+ family shared by the sync and lazy renderers; one Mermaid entity codec, one
608
+ YAML reader, one label display rule and one trailing-comment rule. Rendered
609
+ output is unchanged except where an entry above says otherwise.
610
+ - Docs that list every family, MCP tool, CLI verb, render format or warning
611
+ code are generated from the registry or marked `<!-- complete: <registry> -->`;
612
+ a marked list that misses any member fails the doc checks, so a change that
613
+ adds two members at once can no longer leave a list behind. A new doc check
614
+ fails on a relative link, backticked repository path, or `bun run`/`npm run`
615
+ script that does not exist. The MCP protocol-version lists are generated
616
+ from the server constants, and `AGENT_NATIVE.md` and the agent-usage runbook
617
+ now list `describe_sdk` among the hosted tools.
618
+ - Warning-code descriptions have one source, `src/agent/warning-catalog.ts`,
619
+ and a code without a description fails typecheck. The website's per-code
620
+ pages, the `AGENT_NATIVE.md` warning tables and the tier notes printed by
621
+ `am --agent-instructions` are generated from it. Descriptions that
622
+ contradicted `verify` are corrected: `RENDER_FAILED` also covers
623
+ unrecognized headers, invalid theme colors and layout errors;
624
+ `INEFFECTIVE_CONFIG` also covers unknown fields and invalid values;
625
+ `LABELS_HIDDEN` covers quadrant point labels; `ROUTE_UNEXPLAINED_BEND`
626
+ applies to flowchart and state, not class and ER; and `NODE_OVERLAP` is
627
+ listed for every family it checks.
628
+ - Agent guidance now says one thing everywhere: write Mermaid source directly for
629
+ a new diagram, then parse, verify, and render it; use `buildMermaid` /
630
+ `createMermaid` when generating a diagram programmatically, and typed
631
+ mutation for edits. `am --agent-instructions`, `llms.txt`, `am init-agent`,
632
+ the Code Mode SDK declaration, and the skills previously disagreed.
633
+ - `am verify --help` lists the warning codes from the runtime registry, grouped
634
+ by severity.
635
+ - Updated the `brace-expansion` development override to the first 5.x release
636
+ patched for GHSA-rgw5-rvv9-x895.
637
+ - Updated the transitive `fast-uri` override to 3.1.7 for GHSA-qw65-cvwx-89v3
638
+ and GHSA-58mr-gqgx-xq4g (first raised to 3.1.5 for GHSA-7p8r-x3mc-p8w7, then
639
+ 3.1.6) and pinned transitive `undici` to 7.29.1 for GHSA-rfgv-xxqx-mfg5 and
640
+ GHSA-w293-vg96-wgc3 (first pinned to 7.29.0 for GHSA-4cwx-7wf7-3272).
641
+ - Pinned transitive `ip-address` to 10.4.0 (first pinned to 10.3.1 for
642
+ GHSA-mwp4-54f8-5fhr).
643
+ - CI, release, and deploy now run on Bun 1.4.2 (was 1.3.13), and
644
+ `package.json` declares `engines.bun` `>=1.4.0`. At the switch, the only
645
+ website payload change was the editor bundle, 4,770 raw bytes smaller.
646
+ - `am capabilities --json` (and the site's `capabilities.json`) no longer
647
+ carries the `sectionA` audit summary. Building it pulled the repository-only
648
+ Section A report, upstream syntax manifest, and characterization index into
649
+ the published `am` bin: `dist/am.js` shrinks from 1.35 MB to 90 KB, the
650
+ packed tarball by 201 KB, and `am capabilities` runs about 40% faster. The
651
+ full report stays available in the repository (`bun run section-a-report`,
652
+ `docs/project/section-a-capability-report.md`).
653
+
654
+ ## 0.4.1 — 2026-07-30
655
+
656
+ Metadata release for MCP directory listings; no rendering changes.
657
+
7
658
  ### Added
8
659
  - Added human-readable titles to every MCP tool and published canonical directory-listing and hosted-service privacy documentation.
9
660