Export the map as architecture-as-code models (LikeC4, Structurizr, Backstage catalog, Mermaid preview)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
Línea de trabajo
Start with the saved-map input and the proposed dircue map export command, then review related issue #103 for shared exporter concerns. Define the model mappings and evidence handling for LikeC4, Structurizr, Backstage, and Mermaid, including unresolved C4 levels and stable identities. Done means deterministic output for each format without rescanning or overwriting human-authored content.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
User outcome
dircue map export --format likec4 map.json > repo.c4 writes an architecture-as-code model of what the map observed, and does the same for the formats below. People then render, extend and navigate it with the tools they already use. dircue supplies the facts; it doesn't draw.
Why
-
Architecture diagrams are usually hand-drawn or generated by a model, and both drift. A recent public discussion of agent-drawn architecture canvases (https://news.ycombinator.com/item?id=49833867) kept returning to the same three worries:
- the diagram diverging from the code;
- "N+1 sources of truth";
- hallucinated arrows.
One of that project's own authors described a maintained "software map" of the codebase as the backbone that should power every diagram. The map is that backbone: deterministic, derived from declarations, with evidence for every node and edge, and regenerable at every commit.
-
The ecosystem already has good modeling languages and renderers, so dircue shouldn't build its own (FFmpeg philosophy: emit formats others consume).
- LikeC4 (MIT) is a model DSL with user-defined element kinds and
metadata {}key-value blocks. Elements canlinkto source files with line ranges (link ../src/index.ts#L1-L10). It has a CLI that renders and exports (JSON, Draw.io, PNG, among others), an MCP server, and it is the format that drift tools such as erode read. - Structurizr DSL and workspace JSON are the original C4 tooling, with
properties {}per element. - Backstage
catalog-info.yaml(Component, API, Resource, System;dependsOn,providesApis,consumesApis; annotations) is widely used as a service catalog. - Mermaid (
architecture-beta, C4 still experimental) and C4-PlantUML render almost anywhere, but carry no evidence.
- LikeC4 (MIT) is a model DSL with user-defined element kinds and
Proposal
-
Input: a saved map, optionally with attached-report nodes. The source is never rescanned.
-
Output: deterministic, byte-identical text for the same map, in stable order.
-
Formats, in order:
- LikeC4 (richest evidence carriage);
- Structurizr DSL or workspace JSON;
- Backstage
catalog-info.yamlentities; - Mermaid, and optionally C4-PlantUML, as lossy previews that state they carry no evidence.
-
Mapping (to be designed; a first cut):
- the root or forest is a software system;
- deployables and primary-role components are containers. Workloads, Compose services and functions deploy components via
builds/runs. - Capabilities (datastores, queues, caches) become container or external-system elements, with
uses_capabilityas relationships. - Declared interfaces (ports, gRPC and OpenAPI documents) become element properties or API entities.
depends_on_localandmember_ofgive structural relationships. Runtime "uses" arrows between services wait forconnects_to(#103), and each format states that they're absent until then.- Test, fixture, example, vendored and docs roles are excluded by default and selectable.
-
Evidence and uncertainty travel with every element:
- dircue node and edge IDs;
- evidence file and span (as LikeC4
linkor Structurizr/Backstage properties and annotations); - basis, coverage status and reasons.
partialandunknownare never rendered as settled facts. A header records the map's source identity, dircue version and the questions whose coverage was notcomplete. -
Round trip: a generated model is a starting point a team can extend. Keep generated and hand-written parts separable (LikeC4 multi-file projects, Structurizr
workspace extends), so regenerating never clobbers human edits.
Non-goals
- No layout or rendering engine, diagram server, or hosted service.
- No LLM involvement.
- No inferred runtime behavior beyond what the map records.
- No quality, risk or conformance verdicts (see #153).
Open questions
- C4's container/component levels don't map one-to-one onto dircue's component/deployable split, especially for monorepos and libraries. Decide this with real repositories (the golden corpus) before freezing a mapping.
- Where the map is silent, should element identity be stable across map revisions (for diff-friendly exports)? Reuse map node IDs.
Related
- #103:
connects_toand Mermaid/DOT diagram export. This issue covers architecture model formats; #103's simple exporters can share the same export command. - #104: offline HTML report.
- #25:
map queryand MCP. - #10:
map compare.
- Lenguaje dominante
- Go
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 11 h 3 min
- PR fusionados (30 d)
- 5
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de war-and-code/dircue
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
war-and-code/dircue#200 ·
-
enhancement follow-up
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
war-and-code/dircue#201 ·
-
follow-up
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
war-and-code/dircue#179 ·
-
follow-up
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
war-and-code/dircue#178 ·
-
enhancement follow-up
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
war-and-code/dircue#172 ·
Todos los issues de war-and-code/dircue
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
[Bug] K8s reconcile still resets explicit 0 to defaults for response_api, memory and flow statePosiblemente ocupada @Bevisy la tomó hoy. Abiertoneeds-acceptance
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
vllm-project/semantic-router#5998 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
devantler-tech/ksail#8256 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
desktop v3 windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
esengine/DeepSeek-Reasonix#15016 · 1 comentario ·
Los mantenedores suelen responder en 1 día