agentic-mermaid 0.1.1 → 0.2.0

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 (340) hide show
  1. package/AGENT_NATIVE.md +155 -91
  2. package/CHANGELOG.md +163 -4
  3. package/Instructions_for_agents.md +10 -10
  4. package/LICENSES/Apache-2.0.txt +202 -0
  5. package/README.md +31 -38
  6. package/THIRD_PARTY_NOTICES.md +29 -0
  7. package/assets/hero.png +0 -0
  8. package/dist/agent-core.d.ts +463 -0
  9. package/dist/agent-core.js +397 -0
  10. package/dist/agent.d.ts +73 -1868
  11. package/dist/agent.js +336 -37325
  12. package/dist/agentic-mermaid-mcp.js +7 -38399
  13. package/dist/am.js +33626 -40446
  14. package/dist/chunk-2P5FKUQC.js +3485 -0
  15. package/dist/chunk-2S3VSS6I.js +149 -0
  16. package/dist/chunk-2SILJDW2.js +37 -0
  17. package/dist/chunk-BJYMBT4I.js +61963 -0
  18. package/dist/chunk-FDM43XU7.js +615 -0
  19. package/dist/chunk-MYPDVZCO.js +4702 -0
  20. package/dist/index-DWPa2MJs.d.ts +6780 -0
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +310 -33014
  23. package/dist/mcp-cli-5J47WEY3.js +17 -0
  24. package/docs/README.md +39 -31
  25. package/docs/agent-api-cookbook.md +44 -35
  26. package/docs/agent-mutation-policy.md +1 -1
  27. package/docs/agent-workflow-examples.md +2 -2
  28. package/docs/api.md +284 -77
  29. package/docs/ascii.md +26 -16
  30. package/docs/code-mode-impact.md +214 -0
  31. package/docs/comparison.md +23 -11
  32. package/docs/computational-aesthetics-prototype-plan.md +252 -0
  33. package/docs/config.md +26 -10
  34. package/docs/custom-fonts.md +265 -0
  35. package/docs/custom-style-cookbook.md +130 -9
  36. package/docs/diagram-families.md +48 -23
  37. package/docs/features.md +59 -52
  38. package/docs/fork-differences.md +6 -3
  39. package/docs/getting-started.md +23 -16
  40. package/docs/issue-derived-test-cases.md +29 -22
  41. package/docs/mcp-code-mode-rationale.md +13 -6
  42. package/docs/mcp-http-transport.md +20 -13
  43. package/docs/mermaid-layout-complaints.md +66 -52
  44. package/docs/mutation-testing.md +145 -66
  45. package/docs/quality.md +23 -14
  46. package/docs/react.md +2 -2
  47. package/docs/schemas/style-spec.schema.json +1221 -30
  48. package/docs/style-authoring.md +241 -38
  49. package/docs/svg-semantic-contract.md +49 -0
  50. package/docs/testing-strategy.md +166 -58
  51. package/docs/theming.md +19 -32
  52. package/examples/styles/catalog.json +54 -0
  53. package/examples/styles/cloudflare-workers-inspired-prototype.mmd +9 -0
  54. package/examples/styles/cloudflare-workers-inspired-prototype.style.json +110 -0
  55. package/examples/styles/cupertino-prototype.mmd +10 -0
  56. package/examples/styles/cupertino-prototype.style.json +63 -0
  57. package/examples/styles/mid-century-report.style.json +2 -2
  58. package/examples/styles/star-chart-atlas.style.json +2 -1
  59. package/examples/styles/transit-route-map.style.json +2 -2
  60. package/examples/styles/vercel-inspired-prototype.mmd +6 -0
  61. package/examples/styles/vercel-inspired-prototype.style.json +87 -0
  62. package/package.json +85 -45
  63. package/server.json +2 -2
  64. package/skills/agentic-mermaid-diagram-workflow/SKILL.md +17 -36
  65. package/skills/agentic-mermaid-diagram-workflow/references/cli.md +4 -5
  66. package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +15 -31
  67. package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +10 -14
  68. package/skills/agentic-mermaid-live-editor/SKILL.md +100 -206
  69. package/TODO.md +0 -684
  70. package/dist/index-wjRjbsP-.d.ts +0 -1102
  71. package/docs/assets/improvements/box-start-connector.png +0 -0
  72. package/docs/assets/improvements/comment-dropped-lint.png +0 -0
  73. package/docs/assets/improvements/er-content-loss.png +0 -0
  74. package/docs/assets/improvements/fan-in-trunks.png +0 -0
  75. package/docs/assets/improvements/gantt-family.png +0 -0
  76. package/docs/assets/improvements/gantt-milestone-clamp.png +0 -0
  77. package/docs/assets/improvements/gantt-verify-seam.png +0 -0
  78. package/docs/assets/improvements/subgraph-container-edges.png +0 -0
  79. package/docs/assets/improvements/wrapper-frontmatter.png +0 -0
  80. package/docs/assets/improvements/wrapper-init-directive.png +0 -0
  81. package/docs/assets/improvements/wrapper-leading-comment.png +0 -0
  82. package/docs/assets/style-cookbook/mid-century-report.png +0 -0
  83. package/docs/assets/style-cookbook/star-chart-atlas.png +0 -0
  84. package/docs/assets/style-cookbook/transit-route-map.png +0 -0
  85. package/docs/contributing/adding-diagram-types.md +0 -144
  86. package/docs/contributing/diagram-family-citizenship.matrix.json +0 -2127
  87. package/docs/contributing/diagram-family-citizenship.md +0 -82
  88. package/docs/contributing/harvesting-upstream-tests.md +0 -126
  89. package/docs/contributing/lessons-learned.md +0 -276
  90. package/docs/contributing/releasing.md +0 -82
  91. package/docs/contributing/visual-review-evidence.md +0 -53
  92. package/docs/design/families/README.md +0 -26
  93. package/docs/design/families/architecture-beta.md +0 -48
  94. package/docs/design/families/flowchart-parser-conformance.md +0 -22
  95. package/docs/design/families/gantt-research.md +0 -137
  96. package/docs/design/families/gantt.md +0 -329
  97. package/docs/design/families/journey-agentic-cards-before.png +0 -0
  98. package/docs/design/families/journey-experience-curve-implementation.png +0 -0
  99. package/docs/design/families/journey-mermaid-classic-implementation.png +0 -0
  100. package/docs/design/families/journey-mermaid-classic-prototype.png +0 -0
  101. package/docs/design/families/journey-mermaid-classic-prototype.svg +0 -163
  102. package/docs/design/families/journey-mermaid-classic-prototype.svg.png +0 -0
  103. package/docs/design/families/journey-migration-parity.md +0 -439
  104. package/docs/design/families/journey-section-overlap-after.png +0 -0
  105. package/docs/design/families/journey-section-overlap-before.png +0 -0
  106. package/docs/design/families/journey-usage-research.md +0 -423
  107. package/docs/design/families/journey.md +0 -153
  108. package/docs/design/families/xychart.md +0 -85
  109. package/docs/design/system/README.md +0 -45
  110. package/docs/design/system/abstraction-audit.md +0 -224
  111. package/docs/design/system/abstraction-recommendations.md +0 -655
  112. package/docs/design/system/architecture.mmd +0 -29
  113. package/docs/design/system/architecture.svg +0 -137
  114. package/docs/design/system/layout-guarantees-and-robustness.md +0 -351
  115. package/docs/design/system/layout-rubric.md +0 -138
  116. package/docs/design/system/route-contracts.md +0 -848
  117. package/docs/design/system/source-preservation-ladder.md +0 -52
  118. package/docs/design/system/styles-rollout.md +0 -216
  119. package/docs/design/system/ugly-layouts.md +0 -119
  120. package/docs/layout-characterization/README.md +0 -245
  121. package/docs/layout-characterization/contact-sheet-families.md +0 -498
  122. package/docs/layout-characterization/contact-sheet.md +0 -638
  123. package/docs/layout-characterization/properties.md +0 -281
  124. package/docs/layout-characterization/visual-quality.md +0 -160
  125. package/docs/layout-characterization/visual-snapshots/architecture.svg +0 -79
  126. package/docs/layout-characterization/visual-snapshots/class.svg +0 -60
  127. package/docs/layout-characterization/visual-snapshots/er.svg +0 -61
  128. package/docs/layout-characterization/visual-snapshots/flowchart.svg +0 -58
  129. package/docs/layout-characterization/visual-snapshots/gantt.svg +0 -52
  130. package/docs/layout-characterization/visual-snapshots/journey.svg +0 -98
  131. package/docs/layout-characterization/visual-snapshots/pie.svg +0 -36
  132. package/docs/layout-characterization/visual-snapshots/quadrant.svg +0 -47
  133. package/docs/layout-characterization/visual-snapshots/sequence.svg +0 -59
  134. package/docs/layout-characterization/visual-snapshots/state.svg +0 -52
  135. package/docs/layout-characterization/visual-snapshots/timeline.svg +0 -64
  136. package/docs/layout-characterization/visual-snapshots/xychart.svg +0 -97
  137. package/docs/project/divergences.md +0 -98
  138. package/docs/project/dogfooding-docs-strategy.md +0 -66
  139. package/docs/project/hosted-mcp-cloudflare-plan.md +0 -338
  140. package/docs/project/lessons-learned.md +0 -1019
  141. package/docs/project/remove-role-styling-plan.md +0 -176
  142. package/examples/agent-improve-auth-flow.ts +0 -206
  143. package/examples/agent-loop.ts +0 -53
  144. package/examples/mcp-vs-cli-complex-diagrams.ts +0 -133
  145. package/llms.txt +0 -104
  146. package/skill-evals/README.md +0 -77
  147. package/skill-evals/fixtures/architecture-cache/input.mmd +0 -5
  148. package/skill-evals/fixtures/class-payment/input.mmd +0 -4
  149. package/skill-evals/fixtures/er-orders/input.mmd +0 -10
  150. package/skill-evals/fixtures/flowchart-cache/input.mmd +0 -3
  151. package/skill-evals/fixtures/gantt-release/input.mmd +0 -7
  152. package/skill-evals/fixtures/journey-checkout/input.mmd +0 -6
  153. package/skill-evals/fixtures/pie-exports/input.mmd +0 -5
  154. package/skill-evals/fixtures/quadrant-priorities/input.mmd +0 -11
  155. package/skill-evals/fixtures/sequence-retry/input.mmd +0 -8
  156. package/skill-evals/fixtures/state-lifecycle/input.mmd +0 -5
  157. package/skill-evals/fixtures/timeline-release/input.mmd +0 -6
  158. package/skill-evals/fixtures/xychart-growth/input.mmd +0 -5
  159. package/skill-evals/shared-benchmark.json +0 -510
  160. package/src/agent/analyze.ts +0 -157
  161. package/src/agent/apply.ts +0 -146
  162. package/src/agent/architecture-body.ts +0 -458
  163. package/src/agent/certificates.ts +0 -110
  164. package/src/agent/class-body.ts +0 -319
  165. package/src/agent/core.ts +0 -207
  166. package/src/agent/create.ts +0 -106
  167. package/src/agent/describe.ts +0 -368
  168. package/src/agent/er-body.ts +0 -224
  169. package/src/agent/facts.ts +0 -360
  170. package/src/agent/families-builtin.ts +0 -920
  171. package/src/agent/families.ts +0 -232
  172. package/src/agent/family-layouts.ts +0 -832
  173. package/src/agent/flowchart-body.ts +0 -372
  174. package/src/agent/flowchart-unsupported.ts +0 -243
  175. package/src/agent/font-coverage.ts +0 -288
  176. package/src/agent/gantt-body.ts +0 -495
  177. package/src/agent/index.ts +0 -10
  178. package/src/agent/journey-body.ts +0 -374
  179. package/src/agent/label-metrics.ts +0 -28
  180. package/src/agent/layout-to-rendered.ts +0 -63
  181. package/src/agent/mutate.ts +0 -97
  182. package/src/agent/mutation-ops.ts +0 -51
  183. package/src/agent/op-schema.ts +0 -443
  184. package/src/agent/parse.ts +0 -223
  185. package/src/agent/pie-body.ts +0 -270
  186. package/src/agent/png.ts +0 -171
  187. package/src/agent/quadrant-body.ts +0 -336
  188. package/src/agent/quality.ts +0 -363
  189. package/src/agent/readability-audit.ts +0 -92
  190. package/src/agent/rendered-route-audit.ts +0 -61
  191. package/src/agent/sequence-body.ts +0 -345
  192. package/src/agent/serialize.ts +0 -214
  193. package/src/agent/state-body.ts +0 -589
  194. package/src/agent/structural-count.ts +0 -150
  195. package/src/agent/timeline-body.ts +0 -280
  196. package/src/agent/trace-log.ts +0 -43
  197. package/src/agent/types.ts +0 -995
  198. package/src/agent/verify.ts +0 -603
  199. package/src/agent/xychart-body.ts +0 -472
  200. package/src/architecture/config.ts +0 -282
  201. package/src/architecture/layout.ts +0 -496
  202. package/src/architecture/parser.ts +0 -375
  203. package/src/architecture/renderer.ts +0 -611
  204. package/src/architecture/types.ts +0 -113
  205. package/src/ascii/ansi.ts +0 -423
  206. package/src/ascii/architecture.ts +0 -210
  207. package/src/ascii/canvas.ts +0 -443
  208. package/src/ascii/class-diagram.ts +0 -697
  209. package/src/ascii/converter.ts +0 -475
  210. package/src/ascii/draw.ts +0 -1693
  211. package/src/ascii/edge-bundling.ts +0 -328
  212. package/src/ascii/edge-routing.ts +0 -330
  213. package/src/ascii/er-diagram.ts +0 -439
  214. package/src/ascii/gantt.ts +0 -276
  215. package/src/ascii/grid.ts +0 -747
  216. package/src/ascii/index.ts +0 -196
  217. package/src/ascii/journey.ts +0 -169
  218. package/src/ascii/meta.ts +0 -244
  219. package/src/ascii/multiline-utils.ts +0 -80
  220. package/src/ascii/pathfinder.ts +0 -301
  221. package/src/ascii/pie.ts +0 -67
  222. package/src/ascii/quadrant.ts +0 -158
  223. package/src/ascii/reverse.ts +0 -216
  224. package/src/ascii/sequence.ts +0 -499
  225. package/src/ascii/shapes/circle.ts +0 -27
  226. package/src/ascii/shapes/corners.ts +0 -143
  227. package/src/ascii/shapes/diamond.ts +0 -27
  228. package/src/ascii/shapes/hexagon.ts +0 -27
  229. package/src/ascii/shapes/index.ts +0 -106
  230. package/src/ascii/shapes/rectangle.ts +0 -168
  231. package/src/ascii/shapes/rounded.ts +0 -27
  232. package/src/ascii/shapes/special.ts +0 -332
  233. package/src/ascii/shapes/stadium.ts +0 -110
  234. package/src/ascii/shapes/state.ts +0 -192
  235. package/src/ascii/shapes/types.ts +0 -73
  236. package/src/ascii/timeline.ts +0 -141
  237. package/src/ascii/types.ts +0 -312
  238. package/src/ascii/validate.ts +0 -120
  239. package/src/ascii/width.ts +0 -81
  240. package/src/ascii/wrap.ts +0 -131
  241. package/src/ascii/xychart.ts +0 -919
  242. package/src/browser.ts +0 -29
  243. package/src/class/layout.ts +0 -240
  244. package/src/class/parser.ts +0 -332
  245. package/src/class/renderer.ts +0 -638
  246. package/src/class/types.ts +0 -129
  247. package/src/cli/agent-instructions.ts +0 -1
  248. package/src/cli/am-bin.ts +0 -6
  249. package/src/cli/exit-codes.ts +0 -18
  250. package/src/cli/index.ts +0 -1132
  251. package/src/cli/init-agent.ts +0 -147
  252. package/src/cli/run-entrypoint.ts +0 -10
  253. package/src/color-resolver.ts +0 -152
  254. package/src/elk-instance.ts +0 -114
  255. package/src/er/layout.ts +0 -187
  256. package/src/er/parser.ts +0 -226
  257. package/src/er/renderer.ts +0 -792
  258. package/src/er/types.ts +0 -99
  259. package/src/family-rubric.ts +0 -425
  260. package/src/font-manifest.ts +0 -31
  261. package/src/gantt/layout.ts +0 -365
  262. package/src/gantt/parser.ts +0 -282
  263. package/src/gantt/pipeline.ts +0 -27
  264. package/src/gantt/renderer.ts +0 -414
  265. package/src/gantt/schedule.ts +0 -513
  266. package/src/gantt/types.ts +0 -255
  267. package/src/index.ts +0 -368
  268. package/src/journey/layout.ts +0 -554
  269. package/src/journey/parse-core.ts +0 -251
  270. package/src/journey/parser.ts +0 -101
  271. package/src/journey/renderer.ts +0 -917
  272. package/src/journey/types.ts +0 -144
  273. package/src/layout/geometry.ts +0 -182
  274. package/src/layout/pass.ts +0 -142
  275. package/src/layout/passes/index.ts +0 -3916
  276. package/src/layout-engine.ts +0 -1565
  277. package/src/layout-rubric.ts +0 -659
  278. package/src/mcp/artifacts.ts +0 -137
  279. package/src/mcp/dynamic-harness.ts +0 -31
  280. package/src/mcp/dynamic-modules.d.ts +0 -7
  281. package/src/mcp/facade.ts +0 -608
  282. package/src/mcp/harness-runtime.ts +0 -203
  283. package/src/mcp/hosted-server.ts +0 -468
  284. package/src/mcp/mcp-bin.ts +0 -3
  285. package/src/mcp/mcp-cli.ts +0 -82
  286. package/src/mcp/protocol.ts +0 -13
  287. package/src/mcp/sandbox.ts +0 -195
  288. package/src/mcp/sdk-decl.ts +0 -391
  289. package/src/mcp/server.ts +0 -362
  290. package/src/mcp/tool-surface.ts +0 -146
  291. package/src/mermaid-source.ts +0 -655
  292. package/src/multiline-utils.ts +0 -228
  293. package/src/parser.ts +0 -1031
  294. package/src/pie/layout.ts +0 -168
  295. package/src/pie/parser.ts +0 -136
  296. package/src/pie/renderer.ts +0 -234
  297. package/src/pie/types.ts +0 -82
  298. package/src/quadrant/layout.ts +0 -191
  299. package/src/quadrant/parser.ts +0 -183
  300. package/src/quadrant/renderer.ts +0 -322
  301. package/src/quadrant/types.ts +0 -113
  302. package/src/render-family-hooks.ts +0 -244
  303. package/src/renderer.ts +0 -1099
  304. package/src/route-contracts.ts +0 -2723
  305. package/src/scene/backend.ts +0 -76
  306. package/src/scene/fidelity.ts +0 -183
  307. package/src/scene/hybrid-backend.ts +0 -174
  308. package/src/scene/ir.ts +0 -181
  309. package/src/scene/marks.ts +0 -127
  310. package/src/scene/rough-backend.ts +0 -378
  311. package/src/scene/seed.ts +0 -46
  312. package/src/scene/style-registry.ts +0 -556
  313. package/src/sequence/layout.ts +0 -456
  314. package/src/sequence/parser.ts +0 -255
  315. package/src/sequence/renderer.ts +0 -604
  316. package/src/sequence/types.ts +0 -154
  317. package/src/shape-clipping.ts +0 -351
  318. package/src/shared/accessibility-directives.ts +0 -22
  319. package/src/shared/batched.ts +0 -61
  320. package/src/shared/color-math.ts +0 -93
  321. package/src/shared/svg-a11y.ts +0 -29
  322. package/src/shared/syntax-error.ts +0 -17
  323. package/src/shared/unicode-ranges.ts +0 -135
  324. package/src/styles.ts +0 -318
  325. package/src/svg-paths.ts +0 -28
  326. package/src/text-metrics.ts +0 -248
  327. package/src/theme.ts +0 -710
  328. package/src/timeline/layout.ts +0 -381
  329. package/src/timeline/parser.ts +0 -215
  330. package/src/timeline/renderer.ts +0 -538
  331. package/src/timeline/types.ts +0 -105
  332. package/src/types.ts +0 -462
  333. package/src/website-worker-modules.d.ts +0 -18
  334. package/src/xychart/axis-utils.ts +0 -109
  335. package/src/xychart/colors.ts +0 -124
  336. package/src/xychart/config.ts +0 -88
  337. package/src/xychart/layout.ts +0 -656
  338. package/src/xychart/parser.ts +0 -504
  339. package/src/xychart/renderer.ts +0 -640
  340. package/src/xychart/types.ts +0 -282
@@ -1,26 +0,0 @@
1
- # Per-family design notes
2
-
3
- Design notes for individual diagram families. A family's full picture is deliberately spread
4
- across several surfaces; this hub points at each.
5
-
6
- ## Families with a dedicated design note
7
-
8
- | Family | Design note | Notable cross-cutting surface |
9
- |---|---|---|
10
- | Architecture (`architecture-beta`) | [`architecture-beta.md`](./architecture-beta.md) | ops in `AGENT_NATIVE.md`; level in [`source-preservation-ladder.md`](../system/source-preservation-ladder.md) |
11
- | Gantt | [`gantt.md`](./gantt.md) (+ [`gantt-research.md`](./gantt-research.md)) | schedule resolver; citizenship worked example |
12
- | Journey | [`journey.md`](./journey.md) (+ [`journey-migration-parity.md`](./journey-migration-parity.md), [`journey-usage-research.md`](./journey-usage-research.md)) | migration parity; classic visual mode; usage research |
13
- | XY chart | [`xychart.md`](./xychart.md) | — |
14
- | Flowchart | [`flowchart-parser-conformance.md`](./flowchart-parser-conformance.md) (conformance) | routing in [`route-contracts.md`](../system/route-contracts.md) |
15
-
16
- Families **without** a dedicated design note — sequence, class, ER, pie, quadrant, timeline,
17
- state — are documented entirely through the cross-cutting surfaces below.
18
-
19
- ## Where every family is documented (all 12)
20
-
21
- - **Canonical registry:** `BUILTIN_FAMILY_METADATA` in `src/agent/families.ts` — and its generated roster table in [`abstraction-audit.md`](../system/abstraction-audit.md) §2.
22
- - **User-facing catalogue:** [`diagram-families.md`](../../diagram-families.md).
23
- - **Mutation ops + structured/opaque scope:** [`AGENT_NATIVE.md`](../../../AGENT_NATIVE.md).
24
- - **Source-preservation level (L0–L4):** [`source-preservation-ladder.md`](../system/source-preservation-ladder.md).
25
- - **Cross-surface citizenship matrix:** [`diagram-family-citizenship.md`](../../contributing/diagram-family-citizenship.md).
26
- - **Mermaid syntax references:** `skills/agentic-mermaid-diagram-workflow/references/`.
@@ -1,48 +0,0 @@
1
- # Architecture Diagrams (`architecture-beta`) Design Notes
2
-
3
- ## Overview
4
-
5
- Architecture support follows the same parse -> layout -> render split used by the other specialized diagram families, while intentionally reusing the shared graph layout engine for node and group placement.
6
-
7
- Current scope covers:
8
-
9
- - `group`, `service`, and `junction`
10
- - side-anchored edges (`L`, `R`, `T`, `B`)
11
- - `{group}` boundary routing for services inside groups
12
- - multi-line labels via `<br>` / `\n`
13
- - SVG, PNG, and ASCII output (PNG via the shared SVG rasterization pipeline)
14
-
15
- ## Pipeline
16
-
17
- ### Parse
18
-
19
- `src/architecture/parser.ts` builds a typed architecture model from Mermaid source and then converts it into the shared `MermaidGraph` shape for placement. The parser keeps Mermaid-oriented field names (`group`, `service`, `junction`, boundary anchors) and validates boundary edges up front so unsupported forms fail clearly.
20
-
21
- ### Layout
22
-
23
- `src/architecture/layout.ts` delegates node and group placement to `layoutGraphSync()` through `architectureToMermaidGraph()`, then projects the positioned graph back into architecture-specific primitives.
24
-
25
- Architecture-specific work happens after shared placement:
26
-
27
- - services keep their card bounds from the graph layout
28
- - junctions reuse the graph point-node placement
29
- - group-boundary edges are rerouted against the enclosing group frame
30
- - edge labels use the orthogonal polyline midpoint so labels stay on-path
31
-
32
- ### Render
33
-
34
- `src/architecture/renderer.ts` renders architecture-specific SVG primitives rather than generic flowchart boxes:
35
-
36
- - framed groups with header bands
37
- - service cards with accent rails
38
- - junction rings
39
- - architecture-specific arrow markers and semantic `data-*` hooks
40
- - lightweight icon badges with a fallback glyph path
41
-
42
- ## Compatibility Notes
43
-
44
- - Mermaid's current public header for this diagram family is `architecture-beta`, so that is the supported header.
45
- - Leading Mermaid comments (`%% ...`), YAML frontmatter, and Mermaid init directives before the header are stripped by the public SVG/PNG/ASCII/agent entrypoints before they call `parseArchitectureDiagram()`.
46
- - The public architecture renderers interpret the merged wrapper config for a focused subset of Mermaid semantics:
47
- `theme`, `themeVariables`, `fontFamily`, `fontSize`, and `architecture.padding` / `architecture.iconSize` / `architecture.fontSize`.
48
- - `parseArchitectureDiagram()` expects preprocessed `architecture-beta` body lines; wrapper config is intentionally handled outside the parser because the parser returns only the diagram model.
@@ -1,22 +0,0 @@
1
- # Flowchart parser conformance catalogue
2
-
3
- Issue: #36. Last updated: 2026-06-16.
4
-
5
- Agentic Mermaid's flowchart parser should never silently drop Mermaid source meaning. Each known syntax-range gap below is either supported directly, preserved as opaque source with an `UNSUPPORTED_SYNTAX` verify warning, or tracked as a narrower feature follow-up.
6
-
7
- | Construct | Status | Local behavior |
8
- |---|---|---|
9
- | Compact edge syntax: `A-->B`, `A-->|x|B`, `A-- text -->B`, `A-.->B;`, `A---oB` | Supported | Parses nodes/edges without phantom shaft nodes; renders/layouts normally; structured serialization canonicalizes spacing. |
10
- | Compact `&` chains: `A & B--> C & D` | Supported | Parses the documented Cartesian fanout/fanin topology. |
11
- | Same-line semicolon statements: `A-->B; B-->C` | Supported | Splits top-level semicolons outside labels/metadata and parses every statement. |
12
- | Variable-length and invisible links: `---->`, `-..->`, `====>`, `~~~` | Supported | Fixed by PR #30 and pinned in `src/__tests__/link-grammar.test.ts`. |
13
- | Flowchart node metadata: `A@{ shape: ..., label: ... }` | Safety-supported | Agent parse is opaque/source-preserving; legacy render/layout preserves topology and label with rectangle fallback. Full shape vocabulary is #44. |
14
- | Edge IDs: `A e1@--> B` | Preserved + warned | Legacy parser ignores the ID for layout but preserves topology. Agent parse is opaque/source-preserving. `verifyMermaid` emits `UNSUPPORTED_SYNTAX` with `syntax: flowchart_edge_id`. |
15
- | Edge metadata: `e1@{ animate: true }`, `e1@{ curve: natural }` | Preserved + warned | Legacy parser ignores metadata and never creates a phantom `e1` node. Agent parse is opaque/source-preserving. `verifyMermaid` emits `UNSUPPORTED_SYNTAX` with `syntax: flowchart_edge_metadata`. |
16
- | Interaction directives: `click A ...`, `click A href ...`, `href` | Preserved + warned | Ignored by local render/layout for security and geometry; never creates a phantom `click` node. Agent parse is opaque/source-preserving. `verifyMermaid` emits `syntax: flowchart_interaction_directive`. |
17
- | Mermaid markdown strings / multiline markdown labels | Preserved + warned | Backtick-marked flowchart source falls back to opaque and emits `syntax: flowchart_markdown_string`; full markdown label modeling is not implemented. |
18
- | Multiple `classDef` names and escaped commas: `classDef a,b stroke-dasharray: 9\,5` | Supported | Class definitions are expanded per name and escaped commas stay inside style values. |
19
- | Edge class styling / animation via `class e1 animate` | Preserved when paired with edge IDs | The source remains opaque when edge IDs are present. Local layout does not model edge classes/animation yet. |
20
- | Full Mermaid v11 typed-shape vocabulary | Follow-up | Tracked in #44; this issue only ensures no silent loss/phantom nodes. |
21
-
22
- Primary regression coverage: `src/__tests__/flowchart-parser-conformance.test.ts`, `src/__tests__/flowchart-metadata.test.ts`, and `src/__tests__/link-grammar.test.ts`.
@@ -1,137 +0,0 @@
1
- # Gantt research appendix
2
-
3
- Status: evidence appendix for [`gantt.md`](./gantt.md). Snapshot date: 2026-06-11.
4
-
5
- This appendix records the wider research requested after the initial Gantt spec: a broad academic search, a commercial/product UX survey, and the changes those sources imply for Agentic Mermaid. The implementation contract remains Mermaid-compatible; this appendix identifies internal hooks and future UI features that should not leak into Mermaid syntax.
6
-
7
- ## Method
8
-
9
- Search channels:
10
-
11
- - GitHub issue/PR searches across `mermaid-js/mermaid`, `lukilabs/beautiful-mermaid`, `adewale/agentic-mermaid`, and Mermaid ASCII forks.
12
- - Crossref DOI search for Gantt, task schedules, project scheduling, timeline visualization, critical path, uncertainty, and resource-constrained scheduling.
13
- - Official product docs and feature pages for commercial Gantt/timeline tools.
14
- - Local source inspection of `upstream/phase1-charts`, `pgavlin/mermaid-ascii`, `kais-radwan/ascii-mermaid`, `razor-ai/ascii-mermaid`, and `mermaid-ast`.
15
-
16
- Representative academic queries:
17
-
18
- - `Gantt chart project management visualization`
19
- - `Gantt chart limitations project scheduling visualization`
20
- - `Gantt charts dependencies resource leveling visualization`
21
- - `A Literature-based Visualization Task Taxonomy for Gantt Charts`
22
- - `Comparing Static Gantt and Mosaic Charts for Visualization of Task Schedules`
23
- - `Visualization of Task Time Schedule Uncertainty in Project Management`
24
- - `Project management under uncertainty resource flexibility visualization in the schedule`
25
- - `timeline visualization survey temporal data`
26
- - `visualizing temporal data survey time-oriented data`
27
- - `critical path method project scheduling Gantt chart`
28
- - `resource constrained project scheduling survey visualization`
29
-
30
- Exclusions:
31
-
32
- - SEO tutorials that explain what a Gantt chart is but do not add syntax, layout, or testing requirements.
33
- - Tools that only call Mermaid or Mermaid CLI and return an SVG screenshot.
34
- - Vendor pages without enough detail to infer an interaction or scheduling feature.
35
-
36
- Limit: this is Google-Scholar-style breadth using Crossref and web-accessible metadata, not a formal systematic review with database-specific inclusion scoring. The implementation decisions below rely only on stable, cited claims.
37
-
38
- ## Academic literature
39
-
40
- ### Gantt-specific visualization and schedule displays
41
-
42
- | Source | Finding | Spec implication |
43
- |---|---|---|
44
- | Sakin and Isaacs, [“A Literature-based Visualization Task Taxonomy for Gantt Charts”](https://doi.org/10.1109/VIS55277.2024.00055), IEEE VIS 2024 | Gantt charts have enough distinct visualization tasks to merit their own task taxonomy. | Add Gantt-specific `describe` and quality checks instead of treating Gantt as generic bars. Test tasks such as locate task, compare durations, find dependencies, find critical tasks, inspect schedule range, and detect overlap/crowding. |
45
- | Luz and Masoodian, [“Comparing Static Gantt and Mosaic Charts for Visualization of Task Schedules”](https://doi.org/10.1109/IV.2011.53), IV 2011 | Static Gantt is not always the best representation for dense task schedules; alternatives can make different comparisons easier. | Keep first release to Mermaid Gantt, but separate schedule model from renderer so future ASCII/SVG modes can add condensed or grouped views without changing parser semantics. |
46
- | Maravas and Pantouvakis, [“Schedula Anima: Dynamic Visualization of Gantt Charts and Resource Usage Graphs in Project Scheduling”](https://doi.org/10.3390/buildings15030393), Buildings 2025 | The paper animates schedule states between early and late dates and pairs Gantt bars with resource graphs; the abstract notes earlier delays have larger downstream effects. | The resolver should compute earliest/latest dates and slack internally when dependencies are available. Do not draw the critical path in v1 unless the computation is explicit and tested. |
47
- | Lu, Mao, and Chai, [“Visualization of Task Time Schedule Uncertainty in Project Management”](https://doi.org/10.3724/SP.J.1089.2018.16718), Journal of CAD & Computer Graphics 2018 | Schedule uncertainty is a first-class visualization problem, not a styling detail. | Do not invent uncertainty syntax. Leave room in the model for optional intervals or confidence bands if Mermaid or a future Agentic extension adds them. |
48
- | Lima, Tereso, and Faria, [“Project management under uncertainty: resource flexibility visualization in the schedule”](https://doi.org/10.1016/j.procs.2019.12.197), Procedia Computer Science 2019 | Resource flexibility and schedule uncertainty interact; useful displays combine schedule and resource information. | Resource capacity belongs in a future analysis/UI layer unless Mermaid standardizes resource fields. The v1 parser should not infer resources from labels or assignees. |
49
- | Ong, Wang, and Zainon, [“Integrated Earned Value Gantt Chart (EV-Gantt) Tool for Project Portfolio Planning and Monitoring Optimization”](https://doi.org/10.1080/10429247.2015.1135033), Engineering Management Journal 2016 | Portfolio monitoring benefits from planned-vs-actual and earned-value information layered onto schedules. | Baselines and planned-vs-actual are common product features, but Mermaid Gantt lacks native baseline syntax. Keep them out of syntax; possible future: `describe` can report plan/actual only if the source model gains explicit fields. |
50
- | Scully-Allison and Isaacs, [“Evaluating Communication Pattern Representations in Execution Trace Gantt Charts”](https://doi.org/10.1109/VISSOFT64034.2024.00011), VISSOFT 2024 | Gantt-like timelines appear outside project management, including execution traces where communication patterns matter. | Keep renderer primitives generic enough for intervals, lanes, markers, and links. Do not bake project-management-only assumptions into layout code. |
51
-
52
- ### Timeline and temporal-data visualization
53
-
54
- | Source | Finding | Spec implication |
55
- |---|---|---|
56
- | Shneiderman, [“The Eyes Have It: A Task by Data Type Taxonomy for Information Visualizations”](https://doi.org/10.1109/VL.1996.545307), IEEE VL 1996 | The useful interaction sequence is “overview first, zoom and filter, then details-on-demand.” | The live editor should eventually add zoom/filter/details for large Gantts. ASCII should preserve overview by keeping labels and dates visible outside bars. |
57
- | Brehmer et al., [“Timelines Revisited: A Design Space and Considerations for Expressive Storytelling”](https://doi.org/10.1109/TVCG.2016.2614803), TVCG 2017 | Timeline design separates scale, layout, representation, and annotation choices. | Keep parser, scheduler, layout, and renderer as separate modules. `vert` markers are annotations; they should never be parsed as tasks. |
58
- | Plaisant et al., [“LifeLines: Visualizing Personal Histories”](https://doi.org/10.1145/238386.238493), CHI 1996 | Temporal records benefit from overview plus drill-down and from aligning events across categories. | Section grouping and row alignment are not cosmetic. They should be part of layout tests and AX-tree output. |
59
- | Aigner et al., [“Visualization of Time-Oriented Data”](https://doi.org/10.1007/978-0-85729-079-3), 2011 | Time-oriented data visualization has recurring design decisions: time primitives, scale, calendar, granularity, and interaction. | Model date-only and date-time diagrams explicitly. Avoid raw JavaScript `Date` arithmetic at renderer call sites. |
60
- | Heer and Shneiderman, [“Interactive Dynamics for Visual Analysis”](https://doi.org/10.1145/2133806.2133821), CACM 2012 | Interaction primitives include selection, filtering, navigation, coordination, and history. | Renderer v1 should emit stable task IDs and regions so future UI selection and details panels do not require SVG scraping. |
61
- | Munzner, [“A Nested Model for Visualization Design and Validation”](https://doi.org/10.1109/TVCG.2009.111), TVCG 2009 | Visualization work should validate domain problem, data/task abstraction, visual encoding, and algorithms separately. | Testing should mirror the model: parser fixtures, scheduler properties, layout assertions, SVG/ASCII goldens, and E2E editor checks. |
62
-
63
- ### Scheduling theory and project-management analysis
64
-
65
- | Source | Finding | Spec implication |
66
- |---|---|---|
67
- | Kelley and Walker, [“Critical-Path Planning and Scheduling”](https://doi.org/10.1145/1460299.1460318), 1959 | CPM derives project duration from dependency paths. | Critical path is computable from dependencies/durations; it should be an analysis output, not a syntax extension. |
68
- | Kelley, [“Critical-Path Planning and Scheduling: Mathematical Basis”](https://doi.org/10.1287/opre.9.3.296), Operations Research 1961 | CPM uses earliest/latest times and slack. | If Gantt `describe` adds critical-path evidence, it should report slack and the assumptions used. |
69
- | Hartmann and Briskorn, [“A survey of variants and extensions of the resource-constrained project scheduling problem”](https://doi.org/10.1016/j.ejor.2009.11.005), EJOR 2010; updated survey [doi:10.1016/j.ejor.2021.05.004](https://doi.org/10.1016/j.ejor.2021.05.004) | Resource-constrained scheduling has many variants and constraints. | Do not implement resource leveling by inference. The parser should reject or preserve non-Mermaid resource syntax rather than pretending to schedule resources. |
70
-
71
- ## Commercial and library UX survey
72
-
73
- Commercial tools converge on a small set of Gantt affordances. These are useful product references, but they should not change the Mermaid parser unless Mermaid core adds syntax.
74
-
75
- | Tool / source | Observed features | What Agentic Mermaid should do |
76
- |---|---|---|
77
- | Microsoft Project, [critical path support](https://support.microsoft.com/en-us/office/show-the-critical-path-of-your-project-in-project-desktop-ad6e3b08-7748-4231-afc4-a2046207fd86) | Critical path, slack, dependencies, milestones, baselines, progress, resource concepts. | Compute critical path/slack only as optional analysis once the scheduler is reliable. Do not expose Microsoft-specific concepts in syntax. |
78
- | Smartsheet, [Gantt/project settings](https://help.smartsheet.com/articles/765755-working-with-gantt-charts) and [dependencies/predecessors](https://help.smartsheet.com/articles/765727-enabling-dependencies-using-predecessors) | Grid + Gantt pairing, predecessors, dependencies, duration, milestones, critical path. | Agentic editor should keep source and rendered view side-by-side. CLI should keep source as the edit format, not introduce a grid file format. |
79
- | Asana, [Gantt chart basics](https://asana.com/resources/gantt-chart-basics) | Dependencies, milestones, owners, critical path, progress, drag-style planning concepts. | Owner/resource metadata is outside Mermaid Gantt. The AX tree can still make dependencies and milestones explicit. |
80
- | TeamGantt, [features](https://www.teamgantt.com/features) and [Gantt chart software](https://www.teamgantt.com/gantt-chart-software) | Lead/lag dependencies, planned-vs-actual baselines, critical path, workload, exports, sharing. | Lead/lag belongs on the watchlist because Mermaid users request delay syntax in [#818](https://github.com/mermaid-js/mermaid/issues/818). Baselines/workload stay future UI-only unless syntax emerges. |
81
- | ClickUp, [Gantt view](https://help.clickup.com/hc/en-us/articles/6310249474967-Gantt-view) | Dependencies, resources, progress, delays, critical path, baselines, milestones, zoom, drag, filters, exports. | Live editor follow-up: zoom/filter/details controls. Spec v1 should only guarantee deterministic static output. |
82
- | monday.com, [Gantt](https://monday.com/features/gantt) | Drag timelines, baselines, task dependencies, critical paths, milestones, bottleneck spotting. | “Bottleneck” can map to future warnings once critical path/slack exists. It is not a parse requirement. |
83
- | Instagantt, [product page](https://instagantt.com/) | Drag-and-drop scheduling, dependencies, milestones, workload, baselines, dashboards, exports, read-only sharing. | Sharing/export maps to existing SVG/PNG/MCP artifacts. Workload/baseline remain out of syntax. |
84
- | Zoho Projects, [Gantt charts](https://www.zoho.com/projects/gantt-charts.html) | Dependencies, drag rescheduling, critical path, baselines, milestones, progress, bottlenecks. | Reinforces critical-path/slack as useful analysis. No syntax change. |
85
- | OpenProject, [Gantt docs](https://www.openproject.org/docs/user-guide/gantt-chart/) | Add predecessors/successors in Gantt, drag dates, dependencies, baseline comparison, filters, exports, collapse/expand, progress. | Future editor UX could let users inspect dependency references, but source remains authoritative. Collapse/expand is a UI concern unless Mermaid adds syntax. |
86
- | DHTMLX Gantt, [library page](https://dhtmlx.com/docs/products/dhtmlxGantt/) | Auto-scheduling, critical path, resources, baselines, deadlines, calendars, exports, split tasks, live updates. | JS Gantt libraries separate a scheduling engine from rendering. Agentic Mermaid should do the same: `schedule.ts` should be tested independently. |
87
- | Bryntum Gantt, [library page](https://bryntum.com/products/gantt/) | Scheduling engine, dependencies, constraints, scheduling modes, baselines, progress, critical paths, resource calendars, server-side engine. | Keep the Gantt resolver DOM-free and pure so it can run in CLI/MCP without browser APIs. |
88
- | Highcharts Gantt, [docs](https://www.highcharts.com/docs/gantt/getting-started-gantt) | Tasks/events/resources along a timeline, dependencies, drag, zoom, tooltips, exporting. | Task regions should be stable so future browser layers can attach tooltips without changing SVG structure. |
89
- | Google Charts Gantt, [docs](https://developers.google.com/chart/interactive/docs/gallery/ganttchart) | Start/end/duration, dependencies, resources, tooltip, critical path colored red by default, dependency arrow styling. | Critical path should be opt-in or theme-aware, not a hard-coded red default. Strict security must still hold. |
90
- | Frappe Gantt, [repository](https://github.com/frappe/gantt) | Open-source JS Gantt with dependencies, progress, drag interactions, view modes, popup/details, holidays/weekend handling. | View modes and popups are good editor ideas. Parser syntax remains Mermaid. |
91
- | Airtable Timeline, [docs](https://support.airtable.com/docs/timeline-view) | Timeline grouping/filtering/sharing, more database timeline than scheduling engine. | Useful contrast: not every timeline is a Gantt scheduler. Agentic Mermaid should not degrade Gantt into a generic timeline. |
92
-
93
- ## Requirements added by the wider research
94
-
95
- These requirements refine the base spec.
96
-
97
- 1. **Keep scheduling pure.** `src/gantt/schedule.ts` should have no SVG, no canvas, no DOM, and no wall-clock calls. This matches scheduling-engine practice in commercial Gantt libraries and makes property tests possible.
98
- 2. **Expose analysis without inventing syntax.** Critical path, slack, schedule range, entry tasks, terminal tasks, and dependency cycles can be computed from standard Mermaid source. They belong in `describe`, `verify`, optional overlays, or future editor UI.
99
- 3. **Leave resource and baseline features out of v1 syntax.** Commercial tools rely heavily on baselines, workload, and resource calendars, but Mermaid Gantt does not define portable source syntax for them. Preserve unknown syntax if Mermaid accepts it; otherwise error clearly.
100
- 4. **Design for large schedules.** Labels, zoom/filter affordances, bounded tick generation, compact layout, and top-axis support are not polish. They address known Mermaid issues and commercial-product expectations.
101
- 5. **Make uncertainty future-safe.** The model should not preclude optional intervals or planned-vs-actual bands, but first release must render one deterministic interval per task.
102
- 6. **Test by task, not by file only.** Gantt-specific tasks from the VIS taxonomy and commercial survey should become named fixtures: locate milestone, compare durations, inspect dependency chain, find critical path, detect crowded compact layout, inspect excluded weekend, verify top axis.
103
- 7. **Keep accessibility semantic.** The AX tree should expose section/task/dependency/date-range information even when SVG bars are visually dense.
104
-
105
- ## Proposed spec amendments
106
-
107
- The base [`gantt.md`](./gantt.md) should keep its syntax matrix unchanged, but implementation planning should add these follow-up hooks:
108
-
109
- - `GanttScheduleAnalysis`: `{ criticalPathTaskIds, slackByTaskId, projectStart, projectEnd, entryTaskIds, sinkTaskIds }`, computed only when the dependency graph is valid.
110
- - `GanttRenderedRegion`: stable regions for sections, task bars, milestones, vertical markers, axis ticks, and dependency references. This supports future TUI/editor click mapping.
111
- - `GanttRenderMode`: an internal option, not syntax, for `standard | compact | overview`. First release implements `standard` and Mermaid `displayMode: compact`; future overview mode may serve large schedules.
112
- - `GanttClock`: explicit `today`, never implicit wall-clock.
113
- - `GanttCompatibilityReport`: optional debug output listing parsed-but-ignored directives and unsupported proposals.
114
-
115
- ## Research-backed non-goals
116
-
117
- - Do not add baselines, resources, owners, or workload syntax unless Mermaid core standardizes it.
118
- - Do not infer critical path when dependencies are missing or cyclic.
119
- - Do not render dependency arrows in v1 unless they are separately tested for label/tick overlap.
120
- - Do not use a browser Gantt library as the implementation; it would violate Agentic Mermaid’s synchronous, DOM-free core.
121
- - Do not optimize for interactive drag editing in v1. Source remains the edit format.
122
-
123
- ## Search artifacts to repeat before implementation
124
-
125
- Before coding Gantt, repeat these checks because Mermaid Gantt is active:
126
-
127
- ```bash
128
- gh search issues "gantt repo:mermaid-js/mermaid" --limit 100
129
- gh search prs "gantt" --repo mermaid-js/mermaid --limit 100
130
- gh search code "gantt mermaid-ascii fork:true" --limit 100
131
- ```
132
-
133
- Also re-check Mermaid docs and grammar:
134
-
135
- - <https://mermaid.js.org/syntax/gantt.html>
136
- - <https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/docs/syntax/gantt.md>
137
- - <https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/diagrams/gantt/parser/gantt.jison>
@@ -1,329 +0,0 @@
1
- # Gantt support specification
2
-
3
- Status: design spec. Target implementation branch: after [PR #22](https://github.com/adewale/agentic-mermaid/pull/22) or any equivalent merge of the family-plugin/quality-adapter work. This document is a contract for the first Gantt implementation and for follow-up work. It is not a backlog.
4
-
5
- ## Scope
6
-
7
- Agentic Mermaid should render Mermaid-compatible `gantt` diagrams to SVG, PNG, ASCII, Unicode text, and layout JSON without breaking the agent safety contract:
8
-
9
- - existing Mermaid Gantt source should parse or fail with a named, structured error;
10
- - source that parses but uses syntax outside the first render subset should round-trip byte-for-byte through the agent API;
11
- - renderers must be deterministic unless the caller explicitly supplies a clock value;
12
- - unsupported Mermaid proposals must be called out rather than approximated.
13
-
14
- The first implementation ships **typed mutation via `asGantt`**, using the segment-preserving structured body pattern established for sequence diagrams (`src/agent/sequence-body.ts`): typed ops cover the modeled statements (title, sections, tasks), while calendar directives, comments, click/link statements, and markers ride along verbatim as opaque segments — never dropped, never requiring a full-fidelity IR. Typed mutation is the enforced default for every registered family (`every registered renderable family ships typed mutation (default-by-default enforcement)` in `src/__tests__/agent-doc-sync.test.ts`; see `docs/contributing/adding-diagram-types.md` §7), so a source-level-only registration does not pass CI.
15
-
16
- ## Evidence base
17
-
18
- ### Mermaid core discussions
19
-
20
- Mermaid core has the syntax authority. The current docs and grammar define the accepted language:
21
-
22
- - [Mermaid Gantt syntax docs](https://mermaid.js.org/syntax/gantt.html)
23
- - [`gantt.md` docs source](https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/docs/syntax/gantt.md)
24
- - [`gantt.jison` grammar](https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/diagrams/gantt/parser/gantt.jison)
25
- - Gantt implementation directory: [`packages/mermaid/src/diagrams/gantt`](https://github.com/mermaid-js/mermaid/tree/develop/packages/mermaid/src/diagrams/gantt)
26
-
27
- Recurring user pressure in Mermaid core:
28
-
29
- | Theme | Discussions | Requirement pulled into this spec |
30
- |---|---|---|
31
- | Task dependency math | [#818](https://github.com/mermaid-js/mermaid/issues/818), [#7407](https://github.com/mermaid-js/mermaid/issues/7407), [#7714](https://github.com/mermaid-js/mermaid/issues/7714), [PR #5224](https://github.com/mermaid-js/mermaid/pull/5224), [PR #6376](https://github.com/mermaid-js/mermaid/pull/6376), [PR #7409](https://github.com/mermaid-js/mermaid/pull/7409) | Parse `after` and `until` as first-class dependency expressions. Resolve them in a scheduler layer, not inside the renderer. |
32
- | Calendars, weekends, excludes | [#2424](https://github.com/mermaid-js/mermaid/issues/2424), [#5867](https://github.com/mermaid-js/mermaid/issues/5867), [#6884](https://github.com/mermaid-js/mermaid/issues/6884), [#7062](https://github.com/mermaid-js/mermaid/issues/7062), [#6421](https://github.com/mermaid-js/mermaid/issues/6421), [PR #5358](https://github.com/mermaid-js/mermaid/pull/5358), [PR #6734](https://github.com/mermaid-js/mermaid/pull/6734), [PR #7038](https://github.com/mermaid-js/mermaid/pull/7038), [PR #7772](https://github.com/mermaid-js/mermaid/pull/7772) | Calendar rules are semantic input. Multiple `excludes`/`includes`, `weekend`, and `weekday` must be parsed before durations are resolved. |
33
- | Working-day hours | [#4060](https://github.com/mermaid-js/mermaid/issues/4060), [PR #7733](https://github.com/mermaid-js/mermaid/pull/7733), closed attempts [PR #5403](https://github.com/mermaid-js/mermaid/pull/5403) and [PR #6149](https://github.com/mermaid-js/mermaid/pull/6149) | Do not invent work-hour syntax. Support only after Mermaid core stabilizes it. Keep the calendar engine injectable enough to add it later. |
34
- | Layout/readability | [#3794](https://github.com/mermaid-js/mermaid/issues/3794), [#5140](https://github.com/mermaid-js/mermaid/issues/5140), [#7602](https://github.com/mermaid-js/mermaid/issues/7602), [#7603](https://github.com/mermaid-js/mermaid/issues/7603), [#6260](https://github.com/mermaid-js/mermaid/issues/6260), [PR #7284](https://github.com/mermaid-js/mermaid/pull/7284) | Labels, ticks, compact rows, top axis, and `vert` markers need explicit layout tests. `vert` markers must not allocate a task row. |
35
- | Styling and theme scaling | [#3020](https://github.com/mermaid-js/mermaid/issues/3020), [#5915](https://github.com/mermaid-js/mermaid/issues/5915), [#7471](https://github.com/mermaid-js/mermaid/issues/7471), [#5710](https://github.com/mermaid-js/mermaid/issues/5710), [PR #7432](https://github.com/mermaid-js/mermaid/pull/7432), [PR #7456](https://github.com/mermaid-js/mermaid/pull/7456), [PR #7498](https://github.com/mermaid-js/mermaid/pull/7498), [PR #7537](https://github.com/mermaid-js/mermaid/pull/7537) | Bar colors, task text contrast, and font-size scaling are part of renderer behavior. Role-style options must resize rows and bars, not only text. |
36
- | Syntax/documentation drift | [#2848](https://github.com/mermaid-js/mermaid/issues/2848), [#5655](https://github.com/mermaid-js/mermaid/issues/5655), [PR #5194](https://github.com/mermaid-js/mermaid/pull/5194), [PR #5192](https://github.com/mermaid-js/mermaid/pull/5192), [PR #7443](https://github.com/mermaid-js/mermaid/pull/7443), [PR #5095](https://github.com/mermaid-js/mermaid/pull/5095) | Treat docs examples as fixtures. Document duration tokens. Allow `#` and `;` where Mermaid now allows them. |
37
- | Interactivity and security | [#771](https://github.com/mermaid-js/mermaid/issues/771), [#2152](https://github.com/mermaid-js/mermaid/issues/2152), [#2077](https://github.com/mermaid-js/mermaid/issues/2077) | Parse click/link lines. Never execute callbacks. Sanitize links under the existing strict-security model. |
38
-
39
- ### Beautiful Mermaid and Agentic Mermaid forks
40
-
41
- - [`lukilabs/beautiful-mermaid#59`](https://github.com/lukilabs/beautiful-mermaid/issues/59) requests “All Mermaid v11 diagrams” and includes a concrete Gantt sample with `interactive: true`.
42
- - [`lukilabs/beautiful-mermaid` `phase1-charts`](https://github.com/lukilabs/beautiful-mermaid/tree/phase1-charts) contains branch-only Gantt code: `src/gantt/parser.ts`, `src/gantt/layout.ts`, `src/gantt/renderer.ts`, `src/ascii/gantt.ts`, and `src/__tests__/gantt.test.ts`. It is useful prior art, but it predates Agentic Mermaid’s current source normalization, strict-security pass, agent surface, golden fixtures, and deterministic-output requirements.
43
- - Agentic Mermaid’s current [`TODO.md`](../../../TODO.md) lists Gantt under BUILD-5 alongside pie, mindmap, and gitgraph. [PR #22](https://github.com/adewale/agentic-mermaid/pull/22) adds the family-plugin consolidation, opaque fallback pattern, layout-quality adapters, and family-usage counter that Gantt should build on.
44
-
45
- ### Mermaid ASCII and terminal-renderer forks
46
-
47
- - `AlexanderGrooff/mermaid-ascii` has no native Gantt support found in upstream issues, PRs, or code.
48
- - [`pgavlin/mermaid-ascii`](https://github.com/pgavlin/mermaid-ascii) adds Gantt in Go under `pkg/gantt/`. Its README claims support for 22 diagram types and lists `gantt`; the implementation renders fixed-width horizontal bars, section headers, date markers, status glyphs, `after`, and durations.
49
- - [`Chronostasys/mermaid-ascii`](https://github.com/Chronostasys/mermaid-ascii) inherits the pgavlin Gantt code and layers CJK/Unicode alignment fixes elsewhere.
50
- - [`kais-radwan/ascii-mermaid`](https://github.com/kais-radwan/ascii-mermaid) and [`razor-ai/ascii-mermaid`](https://github.com/razor-ai/ascii-mermaid) implement a TypeScript Gantt ASCII renderer for Neovim virtual text. They support sections, bars, `after`, `done`/`active`/`crit`/`milestone`, and tests. They parse `excludes` but do not apply it to date arithmetic.
51
-
52
- These terminal renderers converge on the same useful display shape: a left label column, section rows, a fixed-width timeline plot, and status-specific glyphs. Agentic Mermaid should keep that shape but use the current ASCII infrastructure: Unicode-width handling, `useAscii`, color modes, golden fixtures, and deterministic wrapping.
53
-
54
- ### Libraries already in this repo
55
-
56
- `mermaid-ast@0.8.2` exposes `parseGantt`, `GanttAST`, and `renderGantt`. It models title, `dateFormat`, `axisFormat`, `tickInterval`, `inclusiveEndDates`, `topAxis`, `excludes`, `includes`, `todayMarker`, `weekday`, `weekend`, sections, tasks, click events, and accessibility. It is not a layout engine and keeps task data shallow, but it is a useful compatibility oracle and source-preservation aid.
57
-
58
- ## Compatibility target
59
-
60
- Target Mermaid Gantt syntax as documented on Mermaid `develop` on 2026-06-11. Host renderers such as GitHub, GitLab, Obsidian, and Markdown plugins pin different Mermaid versions; Agentic Mermaid should not claim host parity. It should claim a pinned Mermaid-core syntax target and expose syntax support in `am capabilities --json` once Gantt lands.
61
-
62
- The renderer must accept Mermaid source wrappers already supported by Agentic Mermaid:
63
-
64
- - YAML frontmatter;
65
- - `%%{init: ...}%%` and `%%{initialize: ...}%%` directives;
66
- - Mermaid comments before the header;
67
- - `accTitle:` and `accDescr:` inline or block directives.
68
-
69
- ## First-release syntax matrix
70
-
71
- Legend: “parse” means recognized and preserved by the family parser. “render” means it affects SVG/ASCII output in the first Gantt release. “preserve” means source-level round-trip keeps the text even when the renderer ignores the semantic effect.
72
-
73
- | Syntax / behavior | First release | Notes |
74
- |---|---|---|
75
- | `gantt` header | parse + render | Add `gantt` to `RoutedDiagramType`, loose detection, CLI/MCP capabilities, docs, gallery, and editor examples. |
76
- | `title ...` | parse + render | Also included in label extraction and accessibility summary. |
77
- | `accTitle`, `accDescr` | parse + render | Use existing SVG accessibility injection. Do not duplicate family-owned ARIA. |
78
- | `dateFormat ...` | parse + render | Required for date parsing. Default is `YYYY-MM-DD`; test the docs claim behind [#5655](https://github.com/mermaid-js/mermaid/issues/5655). |
79
- | `axisFormat ...` | parse + render | SVG and ASCII may format differently when terminal space is constrained; both must use the same resolved tick instants. |
80
- | `tickInterval ...` | parse + render, bounded | Must validate interval count before generating ticks. Regression source: [PR #7197](https://github.com/mermaid-js/mermaid/pull/7197). |
81
- | `inclusiveEndDates` | parse + render | Apply at scheduling boundary, not by stretching bars in renderer code. |
82
- | `topAxis` | parse + render in SVG; parse + preserve in ASCII | SVG should draw top axis. ASCII may choose a single top/bottom axis according to width, but must document the choice. |
83
- | `excludes ...` | parse + render | Support multiple lines per [PR #7772](https://github.com/mermaid-js/mermaid/pull/7772). Accept weekdays, `weekends`, and explicit dates. Do not support date ranges until Mermaid core does. |
84
- | `includes ...` | parse + render | Multiple lines. Includes override excludes for explicitly listed dates. |
85
- | `weekend friday|saturday` | parse + render | Mirrors [PR #5358](https://github.com/mermaid-js/mermaid/pull/5358). |
86
- | `weekday <day>` | parse + render for weekly tick alignment | Do not let tick alignment affect task duration. |
87
- | `todayMarker ...` / `todayMarker off` | parse + render only with supplied clock | Agentic Mermaid must not read wall-clock time by default. Draw the marker only when the caller passes `options.gantt.today` or equivalent; `off` always disables it. |
88
- | `section ...` | parse + render | Section labels get their own row/band. Multiline HTML section labels are preserved; first release may render them as plain text with `<br>` normalized to a line break only if the renderer can size the row. See [#7602](https://github.com/mermaid-js/mermaid/issues/7602). |
89
- | Task row: `Label : metadata` | parse + render | Preserve label text exactly enough for round-trip; render plain text after sanitization. |
90
- | Task ids | parse + render | IDs are used by `after`, `until`, and `click`. Duplicate IDs are a structured parse error. |
91
- | Status tags `done`, `active`, `crit` | parse + render | SVG classes and ASCII glyphs must distinguish states. Text contrast is tested in light/dark themes. |
92
- | `milestone` | parse + render | Render as diamond/marker, zero-width task. |
93
- | `vert` marker | parse + render | Render vertical marker without consuming a task row, per [PR #7284](https://github.com/mermaid-js/mermaid/pull/7284). |
94
- | `after <id...>` | parse + render | Multiple IDs resolve to the latest referenced end date, matching Mermaid docs. Unknown IDs are structured errors, not silent fallbacks. |
95
- | `until <date|id...>` | parse + render | Match Mermaid’s current semantics with differential fixtures. Duration + `until` backward scheduling is accepted only after Mermaid core merges stable syntax; track [#7407](https://github.com/mermaid-js/mermaid/issues/7407), [#7714](https://github.com/mermaid-js/mermaid/issues/7714), [PR #7409](https://github.com/mermaid-js/mermaid/pull/7409). |
96
- | Duration tokens | parse + render | Support the documented Mermaid token set from [PR #7443](https://github.com/mermaid-js/mermaid/pull/7443): `ms`, `s`, `m`, `h`, `d`, `w`, `M`, `y`, including decimals where Mermaid accepts them. Invalid duration tokens are parse errors; see [#6586](https://github.com/mermaid-js/mermaid/issues/6586). |
97
- | `click <id> href ...` | parse + sanitized render | Strict mode strips unsafe external refs as today. Loose mode may emit safe links if the existing renderer policy allows it. |
98
- | `click <id> call ...` | parse + preserve only | Never execute JavaScript callbacks in Agentic Mermaid. No callback output in strict mode. |
99
- | Frontmatter `config.gantt` / top-level Gantt config | parse + render where supported | `displayMode`, `barHeight`, padding, `topAxis`, `axisFormat`, `tickInterval`, and `todayMarker` should flow through the same normalized config path as xychart/timeline. |
100
- | `displayMode: compact` | parse + SVG render; ASCII best effort | Compact layout uses deterministic interval packing inside each section. It must not overlap labels, bars, or ticks. See [#7603](https://github.com/mermaid-js/mermaid/issues/7603). |
101
- | Comments and `#`/`;` in titles/task text | parse + preserve + render text | Mermaid changed parser behavior in [PR #5095](https://github.com/mermaid-js/mermaid/pull/5095). Fixtures must cover this. |
102
-
103
- ## Not supported in the first release
104
-
105
- These are deliberate boundaries, not hidden gaps:
106
-
107
- - **No typed ops for directives, click events, markers, or comments.** `asGantt` exposes ops on sections and tasks only (`set_title`, `add_section`/`rename_section`/`remove_section`, `add_task`/`remove_task`/`rename_task`, `set_task_status`, `set_task_dates`; exact list finalized against the other families' conventions). `dateFormat`, `excludes`/`includes`, `weekend`/`weekday`, `todayMarker`, `click`, and comment lines are preserved verbatim as opaque segments and are edited at the source level. Promoting any of them to typed ops is future work gated on the scheduler being able to re-resolve them.
108
- - **No JavaScript callback execution.** `click id call fn(args)` is parsed and preserved; it is not executed or emitted as executable script.
109
- - **No non-Mermaid proposed syntax.** This excludes date ranges in `excludes` ([#2424](https://github.com/mermaid-js/mermaid/issues/2424)), custom task states ([#3539](https://github.com/mermaid-js/mermaid/issues/3539)), relative symbolic dates such as `m1` ([#2850](https://github.com/mermaid-js/mermaid/issues/2850)), dynamic `now` / `getdate` task values ([#3532](https://github.com/mermaid-js/mermaid/issues/3532)), and vertical Gantt charts ([#6773](https://github.com/mermaid-js/mermaid/issues/6773)).
110
- - **No dependency arrows beyond Mermaid syntax.** Users have asked for arrows in [#7300](https://github.com/mermaid-js/mermaid/issues/7300) and vertical dependency lines in [#3290](https://github.com/mermaid-js/mermaid/issues/3290). First release may compute dependency data for scheduling and accessibility, but the visual arrows are future work.
111
- - **No WBS/subtask syntax.** Subtasks and work-breakdown hierarchies are requested in [#3295](https://github.com/mermaid-js/mermaid/issues/3295) and [#6449](https://github.com/mermaid-js/mermaid/issues/6449). Do not invent syntax.
112
- - **No work-hour calendar syntax until Mermaid stabilizes it.** Track [#4060](https://github.com/mermaid-js/mermaid/issues/4060) and [PR #7733](https://github.com/mermaid-js/mermaid/pull/7733).
113
- - **No BC/inverted time axis in first release.** Track [#4437](https://github.com/mermaid-js/mermaid/issues/4437).
114
- - **No host-specific fallback behavior.** If GitHub’s pinned Mermaid version lacks a feature, Agentic Mermaid may still support it if the pinned syntax target does.
115
-
116
- ## Architecture
117
-
118
- Build Gantt as a five-stage family pipeline.
119
-
120
- ### 1. Routing and family registration
121
-
122
- Files to touch after PR #22:
123
-
124
- - `src/mermaid-source.ts`: add `gantt` to strict and loose detection.
125
- - `src/index.ts`: route SVG rendering to `src/gantt/*`.
126
- - `src/ascii/index.ts`: route ASCII/Unicode rendering to `src/ascii/gantt.ts`.
127
- - `src/agent/types.ts`: add `DiagramKind = 'gantt'`.
128
- - `src/agent/families-builtin.ts`: register `id: 'gantt'`, detect `gantt`, and implement `extractGanttLabels`.
129
- - `src/agent/family-layouts.ts`: add `ganttToRendered` so `measureQuality`, `checkQuality`, `verify.layout`, and layout-compare see Gantt geometry.
130
- - `src/mcp/sdk-decl.ts`, `src/mcp/server.ts`, `src/cli/index.ts`, `Instructions_for_agents.md`, `llms.txt`, and skills: sync capability docs through the existing doc-sync tests.
131
-
132
- The `FamilyPlugin` registers with `mutate` and `serialize` hooks from the start (the enforcement test fails CI otherwise): detect, label extraction, and a segment-preserving structured body whose serialization re-emits opaque segments verbatim. Unmodeled or unparseable bodies fall back whole-opaque, preserving source byte-for-byte.
133
-
134
- ### 2. Syntax parser
135
-
136
- Create `src/gantt/parser.ts` and `src/gantt/types.ts`.
137
-
138
- The parser should produce two related values:
139
-
140
- - `GanttAst`: source-faithful syntax representation with raw text spans for directives, sections, tasks, markers, click events, and unknown-but-preserved lines where Mermaid accepts them.
141
- - `GanttSemanticModel`: normalized values needed for scheduling and rendering: task IDs, status tags, dependency expressions, date/duration expressions, calendar directives, display options, accessibility text.
142
-
143
- Use `mermaid-ast` as an oracle, not as the only implementation boundary. It can help detect syntax drift and preserve source, but Agentic Mermaid still needs its own resolver, validation, layout, SVG, ASCII, and security behavior.
144
-
145
- Parser rules:
146
-
147
- - never silently drop a line;
148
- - duplicate task IDs are errors;
149
- - references to unknown task IDs are errors in render mode;
150
- - invalid dates/durations are errors with line/column where possible;
151
- - labels are text, not HTML execution targets;
152
- - task labels may contain words such as `gantt`, `section`, `title`, `#`, and `;` when Mermaid grammar allows them.
153
-
154
- ### 3. Calendar and dependency resolver
155
-
156
- Create `src/gantt/schedule.ts`.
157
-
158
- Do not let renderers compute dates. Renderers receive resolved task intervals and markers.
159
-
160
- Core types:
161
-
162
- ```ts
163
- interface GanttCalendar {
164
- dateFormat: string
165
- inclusiveEndDates: boolean
166
- excludes: CalendarExclusion[]
167
- includes: CalendarInclusion[]
168
- weekendStart: 'friday' | 'saturday'
169
- weekStart: 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'
170
- }
171
-
172
- interface GanttClock {
173
- today?: PlainDateLike
174
- }
175
- ```
176
-
177
- The resolver should avoid JavaScript wall-clock APIs. Use date-only values for date-only diagrams and explicit time values for time-bearing diagrams. This avoids DST and timezone bugs like [#7026](https://github.com/mermaid-js/mermaid/issues/7026). If a future implementation uses `Date`, the zone must be fixed and tested.
178
-
179
- Scheduling rules:
180
-
181
- - source order remains the tie-breaker;
182
- - `after id1 id2` starts after the latest resolved end among references;
183
- - `until id` ends at the referenced task’s start;
184
- - fixed end dates are respected unless a calendar directive says working-duration tasks should extend over excluded dates;
185
- - `includes` overrides `excludes` for explicit dates;
186
- - the resolver enforces a bounded tick count and bounded scheduling iteration count;
187
- - any cycle in dependency expressions returns a structured error naming the cycle.
188
-
189
- ### 4. SVG layout and renderer
190
-
191
- Create:
192
-
193
- - `src/gantt/layout.ts`
194
- - `src/gantt/renderer.ts`
195
- - `src/gantt/colors.ts` if status colors need family-local helpers
196
-
197
- The `phase1-charts` branch is a starting point for the visual shape: left section/task columns, plot area, row lines, grid lines, bars, milestones, and optional hover overlays. Port the idea, not the code wholesale.
198
-
199
- SVG requirements:
200
-
201
- - deterministic output for the same source/options;
202
- - no default wall-clock `todayMarker`;
203
- - stable IDs namespaced through the existing `idPrefix` pass;
204
- - strict security removes executable callbacks, unsafe hrefs, scripts, images, and external refs;
205
- - Style + Palette rendering routes Gantt marks through the internal style face:
206
- task labels, bars, grid lines, markers, and section bands should respond to named styles and palette stacks;
207
- - status classes: `gantt-bar`, `gantt-bar-done`, `gantt-bar-active`, `gantt-bar-crit`, `gantt-milestone`, `gantt-vert-marker`;
208
- - text contrast tests for status bars in light and dark themes;
209
- - `displayMode: compact` uses deterministic interval packing and has a fixture where dense rows would overlap under naive spacing.
210
-
211
- ### 5. ASCII and Unicode renderer
212
-
213
- Create `src/ascii/gantt.ts` using current Agentic Mermaid ASCII infrastructure.
214
-
215
- The terminal shape should combine the pgavlin and kais-radwan patterns:
216
-
217
- ```text
218
- Project Plan
219
- Planning
220
- Requirements ███████────────────── 01-01 → 01-14
221
- Design ───────████████────── 01-15 → 02-04
222
- Development
223
- Backend ─────────────████████ 02-05 → 03-06
224
- ─────────────────────────
225
- Jan 1 Jan 15 Feb 1
226
- ```
227
-
228
- ASCII/Unicode requirements:
229
-
230
- - respect `useAscii`;
231
- - preserve CJK/emoji display width when sizing the label column;
232
- - use deterministic axis ticks from the same layout model as SVG;
233
- - distinguish `done`, `active`, `crit`, `milestone`, and `vert` with glyphs that degrade in 7-bit ASCII;
234
- - keep labels outside bars by default; terminal bars should not hide task names;
235
- - support `maxWidth` by shrinking plot width before truncating labels;
236
- - produce golden files under `src/__tests__/testdata/{ascii,unicode}/`.
237
-
238
- ## Verification and accessibility
239
-
240
- Gantt verification should start source-level and structural:
241
-
242
- - `EMPTY_DIAGRAM`: no renderable tasks or markers;
243
- - `LABEL_OVERFLOW`: title, section names, task labels, axis labels, marker labels;
244
- - `EDGE_MISANCHORED`: dependency/click reference points at an unknown task ID;
245
- - `OFF_CANVAS`: resolved bars or markers outside plot bounds;
246
- - `GROUP_BREACH`: section-owned rows outside the section band;
247
- - `DUPLICATE_EDGE` is not relevant unless visual dependency edges are added later;
248
- - `UNREACHABLE_NODE` is not relevant to Gantt.
249
-
250
- `describeMermaid(..., {format:'json'})` should expose an AX tree with:
251
-
252
- - chart title and date range;
253
- - sections as groups;
254
- - tasks with label, status, start, end, duration, dependencies;
255
- - milestones and vertical markers;
256
- - entry tasks with no dependencies;
257
- - sinks/tasks that no later task depends on.
258
-
259
- This AX tree is the non-visual fallback for terminal users and agent review.
260
-
261
- ## Testing strategy
262
-
263
- Use the `testing-best-practices` approach: public contracts first, real parser/layout objects over mocks, golden fixtures for complex text/SVG output, property tests for scheduler invariants, and targeted mutation runs for the date resolver.
264
-
265
- ### Test tiers
266
-
267
- | Tier | Files | Required coverage |
268
- |---|---|---|
269
- | Parser unit tests | `src/__tests__/gantt-parser.test.ts` | Mermaid docs examples; malformed headers; duplicate IDs; task labels with `#`, `;`, `gantt`; click/href/call; multiple excludes/includes; unsupported proposed syntax errors. |
270
- | Scheduler property tests | `src/__tests__/property-gantt-schedule.test.ts` | No crashes for generated valid task DAGs; `after` starts after refs; cycle detection; excludes extend working-duration tasks but never shrink them; includes override excludes; tick generation bounded. |
271
- | Layout tests | `src/__tests__/gantt-layout.test.ts` | Bars stay in plot area; labels stay in label column; compact rows do not overlap; `vert` consumes no row; `topAxis` geometry. |
272
- | SVG integration/snapshots | `src/__tests__/gantt-svg-snapshot.test.ts` | Deterministic SVG; accessibility IDs; strict security; status classes; theme contrast; supplied-clock today marker. |
273
- | ASCII/Unicode golden tests | existing `ascii.test.ts` fixture flow | Basic project, sections, dependencies, excludes, milestone, vert marker, compact dense chart, CJK labels, 7-bit ASCII. |
274
- | Agent surface tests | `src/__tests__/agent-gantt.test.ts` | `parseMermaid` detects `kind:'gantt'`; serialize preserves opaque segments verbatim and is serialize-idempotent for structured bodies; `capabilities` reports structured mutation with the `asGantt` op list; each op round-trips through `am mutate`; fast-check round-trip property; label overflow works. |
275
- | Corpus/differential tests | Mermaid docs corpus + `mermaid-ast`/Mermaid-core oracle | Docs examples parse; supported examples render; parse/render decisions match the pinned compatibility target. |
276
- | E2E/editor tests | browser/editor suite | Gallery/editor can load a Gantt example, export SVG/PNG, and show ASCII. |
277
-
278
- ### Golden fixture policy
279
-
280
- Use the existing promote/check workflow from `scripts/update-ascii-goldens.ts`:
281
-
282
- - add the Mermaid source and expected output in the same fixture file;
283
- - regenerate with `bun run goldens:ascii`;
284
- - review the diff before commit;
285
- - gate with `bun run goldens:ascii:check`.
286
-
287
- Snapshot/golden files must not contain wall-clock dates. Fixtures that test `todayMarker` pass an explicit date through render options.
288
-
289
- ### Property invariants
290
-
291
- Scheduler properties should use finite generated DAGs, not arbitrary line strings only:
292
-
293
- - every resolved task has finite start/end;
294
- - non-milestone tasks have positive visual width after layout;
295
- - a task with `after refs` starts at or after the latest referenced end;
296
- - a task with fixed duration has the same working-duration count after excludes/includes are applied;
297
- - adding an excluded non-working day inside a working-duration task cannot make the task end earlier;
298
- - changing `axisFormat` cannot change task geometry;
299
- - increasing font size changes row metrics but not resolved dates;
300
- - generated tick count stays under a fixed cap.
301
-
302
- ### Mutation testing
303
-
304
- Add a targeted Stryker config once Gantt lands:
305
-
306
- - include `src/gantt/parser.ts`, `src/gantt/schedule.ts`, `src/gantt/layout.ts`, `src/ascii/gantt.ts`;
307
- - run manually or on a scheduled workflow, not in normal PR CI;
308
- - treat surviving mutants in `schedule.ts` dependency resolution, exclusions, and duration parsing as release blockers.
309
-
310
- ## Rollout plan
311
-
312
- 1. **Gantt detection and agent surface.** Add `gantt` kind, plugin registration with mutate/serialize hooks, label extractor, docs, and tests. The body parser lands here with its segmentation (typed ops on sections/tasks, opaque segments for everything else), since the parser is where segmentation lives anyway. `am render` may still error until the renderer lands, but parse/mutate/serialize work from this step.
313
- 2. **Parser + scheduler with docs fixtures.** Implement syntax parser and deterministic resolver for supported Mermaid syntax. Differential-check against `mermaid-ast` and Mermaid docs examples.
314
- 3. **ASCII renderer + goldens.** Land terminal output first because it makes date/layout regressions easy to review in diffs.
315
- 4. **SVG renderer + PNG path.** Add role styling, accessibility, strict-security handling, status classes, and snapshots.
316
- 5. **Quality/layout adapter.** Add `ganttToRendered` through PR #22’s `family-layouts.ts` and include Gantt in layout-compare fixtures.
317
- 6. **Editor/showcase/docs.** Add one minimal example, one dense/compact example, and one milestone/vert example.
318
- 7. **Release notes and capability sync.** Update `README`, `docs/features.md`, `docs/diagram-families.md`, `CHANGELOG.md`, `llms.txt`, skills, and MCP SDK declarations. Let doc-sync tests catch drift.
319
-
320
- ## Research-driven improvements beyond parity
321
-
322
- The wider literature and commercial-product survey lives in [`gantt-research.md`](./gantt-research.md). It adds four implementation requirements without changing the first-release syntax target:
323
-
324
- - Keep scheduling pure: `src/gantt/schedule.ts` should own date, dependency, calendar, critical-path, and slack computation, with no DOM/SVG/canvas or wall-clock calls.
325
- - Expose analysis without inventing syntax: critical path, slack, schedule range, dependency cycles, and entry/sink tasks belong in `describe`, `verify`, optional overlays, or future editor UI.
326
- - Leave resource, baseline, owner, workload, and uncertainty syntax out of v1: commercial Gantt tools use those features heavily, but Mermaid does not define portable source syntax for them.
327
- - Design for large schedules: overview/detail, zoom/filter, top axis, compact layout, bounded tick generation, and stable task regions should be planned from the first implementation even when only static SVG/ASCII is shipped.
328
-
329
- The strongest improvement is not more syntax. It is a clean internal dependency/calendar model that can later power `describe`, critical-path overlays, row compaction, and editor details without changing Mermaid source.