> ## Documentation Index
> Fetch the complete documentation index at: https://iso-topology.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Keep multiple architecture diagrams consistent

> Use one authored inventory to generate request and ownership diagrams, detect model drift, and update both SVGs in GitHub Actions. Includes a runnable example.

When two diagrams describe the same components, keep their shared IDs and labels in one authored inventory, then generate each view's diagram document. Give each view its own relationship rules. This avoids renaming a component in one picture while leaving another picture behind. [中文](https://iso-topology.mintlify.site/zh/guides/keep-diagram-views-consistent.md).

The [runnable shared-inventory example](https://github.com/NexusFox88/iso-topology-diagrams-example/tree/main/multi-view) implements this pattern with a Kubernetes request view and an ownership view. Its small Python generator belongs to the example repository; iso-topology itself does not provide automatic synchronization between arbitrary diagram files or import a live cluster.

## Separate shared identity from view-specific relationships

The [Kubernetes tutorial](https://iso-topology.mintlify.site/examples/kubernetes-architecture.md) explains why a Service-to-Pod request edge differs from a ReplicaSet-to-Pod ownership edge. The two views share the same conceptual Pods but answer different questions.

The example's `inventory.json` owns the Pod IDs, labels, scope and state. `scripts/views.py` supplies the fixed objects, edges and placement for each view. It generates two JSON diagram documents and a scope note; the renderer then produces two SVGs.

| Authoritative input | Derived output | What an edit changes |
| - | - | - |
| Pod ID and label in the inventory | Pod objects in both JSON documents | Shared identity in both views |
| Replica list in the inventory | Both node lists and their appropriate edges | Which conceptual replicas appear |
| View rules in the generator | Service or ReplicaSet connections | The meaning of each diagram |
| Renderer revision | SVG output | Rendering behavior and layout details |

The inventory is an example-specific format. The generated files are diagram documents, not Kubernetes manifests. Keep scope notes separate from DSL fields that the renderer does not recognize.

## Run the example

Clone the [example repository](https://github.com/NexusFox88/iso-topology-diagrams-example). Use Python 3.10 or later and the renderer revision pinned in its shared-inventory workflow. Then run:

```bash theme={"system"}
python3 -m unittest discover -s scripts -p test_views.py -v
python3 scripts/views.py
python3 scripts/views.py --check
ISOTOPO_BIN=/absolute/path/to/isotopo bash scripts/render-views.sh
```

The generator uses only Python's standard library. `--check` detects missing or changed generated models without writing. The render script regenerates the models, validates both, and redraws the SVGs.

Rename a Pod label in `multi-view/inventory.json`, keeping its ID. Re-run the render script and review the inventory, both generated documents, and both SVGs together. If there are fewer than three Pods, add another with a unique ID. The compact example deliberately accepts one to three Pods; this is a limit of its teaching layout, not the renderer.

## Review the CI artifact before merging

The example's [workflow](https://github.com/NexusFox88/iso-topology-diagrams-example/blob/main/.github/workflows/multi-view.yml) tests identity propagation, stale-file detection and invalid IDs. It builds a pinned renderer and publishes a `shared-inventory-views` artifact with the inventory, generated models, scope note and images.

Pull requests do not push generated changes. After a source-only inventory change reaches main, the workflow can commit both updated models and images. Branch protection may reject that bot commit; use the artifact through the repository's normal review process in that case.

This pipeline synchronizes **authored inventory → diagram documents → images**. It does not synchronize application code or cluster state into the inventory. See [diagrams from code](https://iso-topology.mintlify.site/guides/architecture-diagrams-from-code.md) for that separate evidence-gathering step.

## Choose where the next edit belongs

Editing a generated JSON document directly creates a change the generator will overwrite. If a view needs a reusable rule, change the generator. If you want an independent drawing, copy the document outside the generated directory, then edit the copy in Studio. That copy becomes a new source of truth and no longer follows this inventory automatically.

Consistency is also narrower than correctness. The views can agree on a Pod that does not exist in your system. Review actual selectors, ownership and state separately; tests for shared labels cannot establish them.

[Edit an AI-generated diagram](https://iso-topology.mintlify.site/guides/edit-ai-generated-diagrams.md) · [Choose a diagram format](https://iso-topology.mintlify.site/guides/choose-format.md) · [Publish diagrams](https://iso-topology.mintlify.site/getting-started/05-publishing.md)

If the views describe different points in time, keep their states explicit: [current and target architecture](https://iso-topology.mintlify.site/guides/current-and-target-architecture.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.