See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
Assume the trade-off is settled
The choice between a committed binary, a text DSL, and a hosted canvas is worked through in the limits of diagrams as code, including where the node count stops being kind to an auto-layout engine. That page argues the trade; this one starts after it, from the position most teams land on: text formats for the small and disposable, a maintained canvas for the diagram the whole team navigates by.
Taking that position feels like leaving the pipeline. It reads as though the picture has moved to a website, review no longer applies to it, and the docs for version 3 will show whatever the canvas looks like today. Each of those is addressable, and the rest of this page is how.
What actually goes in the page: one markdown line
A live embed is a single markdown image line pointing at a URL that renders the current state of the canvas. It behaves like a committed image in the docs page (any markdown renderer shows it, viewers need no account) and like generated content underneath (the canvas moves, the page follows). Every static site generator already handles it, because to the build it is an image with an absolute address.
That moves the review question from is this picture stale, which a human cannot answer from a diff, to is the source correct, which is a question the pipeline was already good at. The docs page carries no binary, no build-time renderer dependency, and no expiring third-party link.
When a frozen still is genuinely needed, a slide or an attachment, the canvas exports as PNG or JPEG. Freezing becomes a deliberate act with a date attached rather than the default state of every picture in the docs.
## Architecture  The image above renders the current diagram. It updates when the canvas does.
Keeping the docs-as-code properties you actually wanted
Versioning by release is preserved. One repository connection can back several diagrams, so a diagram tracking a release tag sits alongside one tracking main, and the docs for v3 embed the v3 picture while the docs for main embed main.
Generated prose stays plain markdown you can commit, so the architecture doc lives in the repository like every other page and goes through the same review. The diagram section inside it is composed deterministically rather than written by a model, so the embed URL in a committed doc is real or explicitly absent.
And regeneration is scriptable. The MCP server exposes two repository tools, repo_status and repo_refresh, so a coding agent or a CI step can trigger a re-sync once an infrastructure change merges instead of waiting for the next daily pass.
Triggering the refresh from the pipeline
The daily pass is a floor rather than a ceiling. When an infrastructure change merges at ten in the morning, waiting until tomorrow for the docs site to agree is a choice, and it is an avoidable one. Both repository tools take a single project_id, and the endpoint speaks plain JSON-RPC over HTTPS, so the caller does not have to be an agent: a curl step in a workflow does the job.
Three properties make this cheap enough to run on every merge to main. A refresh whose tracked commit has not moved answers in a couple of seconds and changes nothing. A refresh whose commit did move but whose structure did not is stopped by the fingerprint check before any generation happens. What is left is the case you actually wanted, where the structure changed, the diagram and the architecture document are rebuilt, and the page embedding them is right before the next person opens it.
Two limits are worth knowing before wiring up the workflow below. Refreshes are capped at ten per ten minutes per account, which is generous for a merge hook and deliberately not generous for a loop across every repository you own. And repo_refresh regenerates from the repository, so it is the same operation as the daily sync rather than a gentler one: nodes moved by hand keep their positions, but content derived from the source is rebuilt.
# .github/workflows/architecture-docs.yml
name: refresh architecture docs
on:
push:
branches: [main]
paths: ["infra/**", "charts/**", ".github/workflows/**"]
jobs:
refresh:
runs-on: ubuntu-latest
env:
DATADEF_KEY: ${{ secrets.DATADEF_KEY }}
PROJECT_ID: ${{ vars.DATADEF_PROJECT_ID }}
steps:
- name: re-sync the diagram and the architecture doc
run: |
curl -sS https://datadef.io/mcp \
-H "Authorization: Bearer $DATADEF_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d @- <<JSON
{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"repo_refresh",
"arguments":{"project_id":"$PROJECT_ID"}}}
JSONFAQ
If the diagram is not in the repository, what does review cover?
What still lives in the repository under this arrangement?
How does a live embed work in a static docs site?
Can different documentation versions show different diagrams?
Can regeneration be triggered from CI instead of waiting a day?