feat: WP-0005 — diagram renderer integration (Mermaid, Graphviz, PlantUML)

Add pluggable DiagramRenderer protocol and RendererResult type to diagrams.py.
Implement MermaidRenderer (mmdc), GraphvizRenderer (dot), PlantUMLRenderer
backends with graceful source-only fallback and WarningRecord on missing tool
(FR-533, FR-534, FR-538). Builder detects renderers at build time and embeds
PNG with alt-text source marker for round-trip. Extend regression corpus with
rendered_diagrams_document.md and skipif-gated integration tests. All 272 tests
pass; ruff and mypy clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 12:16:09 +00:00
parent 0ff234b93f
commit 5564747060
6 changed files with 615 additions and 99 deletions

View File

@@ -3,10 +3,10 @@ id: MRKD-WP-0005
type: workplan
domain: markitect
repo: marki-docx
status: active
status: done
state_hub_workstream_id: 2ef47f11-d828-436d-8955-c58e13c50752
created: 2026-03-16
updated: 2026-03-16
updated: 2026-03-17
---
# MRKD-WP-0005 — Diagram Renderer Integration
@@ -28,7 +28,7 @@ FR-538 (processor-dependency disclosure)
```task
id: MRKD-WP-0005-T01
status: todo
status: done
priority: high
state_hub_task_id: c4911ecc-1e3c-4d22-a6fb-92d1ed319274
```
@@ -56,7 +56,7 @@ in place and tested.
```task
id: MRKD-WP-0005-T02
status: todo
status: done
priority: high
state_hub_task_id: 87caa295-f466-4e2e-ba06-4b1a801ca976
```
@@ -84,7 +84,7 @@ round-trip restores source. When absent, source-only fallback with warning.
```task
id: MRKD-WP-0005-T03
status: todo
status: done
priority: medium
state_hub_task_id: 8ceb771d-0b16-452d-b1cc-c5c2c40fe723
```
@@ -109,7 +109,7 @@ source-only fallback.
```task
id: MRKD-WP-0005-T04
status: todo
status: done
priority: medium
state_hub_task_id: ab0da6e4-a0f2-4a57-baac-5727b741c74f
```
@@ -134,7 +134,7 @@ Deliverable: When `plantuml` is on PATH, PlantUML diagrams render and embed.
```task
id: MRKD-WP-0005-T05
status: todo
status: done
priority: medium
state_hub_task_id: 65b67ed9-5862-4322-acfb-5d39dab7e8d5
```
@@ -166,7 +166,7 @@ source-only tests pass on all systems.
## Updating Task Status
```
status: todo → status: in_progress (when you start it)
status: done → status: in_progress (when you start it)
status: in_progress → status: done (when verified complete)
```