The 'graveyard' of architecture diagrams that were accurate for two weeks is painfully familiar, and the reason given is right: the diagram cannot read the compose file or manifests that are the real source of truth. Rendering EXPLAIN (FORMAT JSON) plans as a heat-mapped tree is a clever extra, since query plans are hard to read as raw JSON. Round-tripping with Mermaid and D2 also means the diagram can live in the repo next to the code it describes.
Thanks, that graveyard is exactly where this started.
One thing I did not stress enough in the post: none of the "diagram from code" part needs AI. LetDraw has its own built-in parsers for Docker Compose, Kubernetes YAML, Helm, Terraform, SQL DDL, Graphviz DOT and PlantUML. They read the relationships that are already written down in your code: depends_on in a compose file, the label selectors that tie a Service to its Deployment in Kubernetes, the resource references in Terraform, the foreign keys in a schema. Each of those becomes an arrow, and the layout follows from them.
That has a few nice side effects. It is deterministic, so the same file always gives the same diagram, which is what you want when it lives next to the code. There is no API key, no prompt and no waiting for a model; the parsing runs right in the browser. And the output is ordinary shapes, so the second it lands on the canvas you can drag a box, rename a service, add the external API your YAML knows nothing about, or circle the risky dependency.
AI is there when you want to start from a sentence or a whiteboard photo, but for the systems you already describe in code, the code is a better source than any prompt.
Curious which format you would want it to read next?
Deterministic output is the right call for something that lives in the repo. GitHub Actions workflow files could be a good next format, since job dependencies in needs: are written down the same way depends_on is.
StackShortlist
Proof Over Promises.
The 'graveyard' of architecture diagrams that were accurate for two weeks is painfully familiar, and the reason given is right: the diagram cannot read the compose file or manifests that are the real source of truth. Rendering EXPLAIN (FORMAT JSON) plans as a heat-mapped tree is a clever extra, since query plans are hard to read as raw JSON. Round-tripping with Mermaid and D2 also means the diagram can live in the repo next to the code it describes.