Skip to content

Agent skill that turns natural language, code, Terraform/K8s, SQL, OpenAPI, AsyncAPI, Protobuf and GraphQL sources into editable, tested draw.io architecture diagrams: incremental sync, multi-view projection, drift diff, CI architecture tests, whiteboard derasterize, interactive HTML/PPTX/Mermaid exports.

release: v3.0.0 showcase, dogfood evidence, and v3.1 roadmap

Agents365-ai55de6aab8e13
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1f4d001..192a97b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,9 @@ semantic-ish versioning (the `metadata.version` field in
`skills/drawio-skill/SKILL.md`).
## [3.0.0] — 2026-09-01
+
### Added
+
- **Versioned Diagram IR** (`drawio-skill/diagram-ir/v1`) with a published JSON
Schema, stable semantic IDs, node/edge properties, provenance, multilingual
labels, and readers for JSON plus compressed/uncompressed `.drawio` pages.
@@ -37,8 +39,15 @@ semantic-ish versioning (the `metadata.version` field in
- **Codex UI metadata** in `agents/openai.yaml`, explicit `allowed-tools`
disclosure, offline/security guidance, and allowlisted hosts for optional AI
and Databricks icon fetching.
+- **Maintained Architecture Studio showcase** covering code-to-IR generation,
+ three-way sync conflicts, linked views, policy checks, what-if analysis, and
+ offline Story publishing, with semantic regression tests.
+- **Release evidence** from native draw.io E2E execution and a dogfood run
+ against the repository's own script toolbox; observed gaps are tracked in the
+ evidence-based 3.1 roadmap.
### Changed
+
- Reworked `SKILL.md` from a 355-line capability catalog into a 131-line
progressive-disclosure router. Detailed semantic, IR, and security workflows
now live in focused references.
@@ -51,7 +60,9 @@ semantic-ish versioning (the `metadata.version` field in
and CLI workflows.
## [2.3.0] — 2026-08-27
+
### Added
+
- **Structured diagnostics in `scripts/validate.py`** — findings render as
`error: [E-DANGLING-END] ... (fix: ...)` with 12 stable codes and a fix hint
per finding, so an agent can act on lint output mechanically; `--json` emits
@@ -68,7 +79,9 @@ semantic-ish versioning (the `metadata.version` field in
archify investigation, PR #107.)
## [2.2.0] — 2026-08-27
+
### Added
+
- **`scripts/dbxicons.py`** — Databricks product icon resolver, following the
`aiicons.py` pattern. draw.io has no Databricks shape set, so lakehouse
architectures rendered as generic boxes; only the bare Databricks logo
@@ -85,7 +98,9 @@ semantic-ish versioning (the `metadata.version` field in
accents, capability-node style) in `references/databricks.md`.
## [2.1.1] — 2026-08-23
+
### Fixed
+
- **Embed images in SVG exports** (`--embed-svg-images` in `scripts/svgflow.py`,
`scripts/drawiohtml.py`, and the documented export command in `SKILL.md`):
without the flag draw.io wrote `file:///` references into its app bundle, so
@@ -94,7 +109,9 @@ semantic-ish versioning (the `metadata.version` field in
the `argv` of both Python call sites. (Thanks to @rjain21, PR #104.)
## [2.1.0] — 2026-07-25
+
### Added
+
- **`scripts/edgeports.py`** — deterministic edge port assignment, the real
replacement for the `--layout libavoid` flag removed in 2.0.0. draw.io's
floating connections attach every edge to the middle of whichever side faces
@@ -113,7 +130,9 @@ semantic-ish versioning (the `metadata.version` field in
since it only scores edges carrying explicit waypoints.
## [2.0.0] — 2026-07-25
+
### Removed
+
- **`--layout libavoid` is gone from the documented interface.** It never
worked; anyone who copied it from `SKILL.md` or `references/autolayout.md`
hit a hang, not an error. There is **no CLI flag that reroutes edges without
@@ -122,6 +141,7 @@ semantic-ish versioning (the `metadata.version` field in
draw.io desktop and use its editor-side obstacle-avoiding router.
### Fixed
+
- **Removed the non-existent `--layout libavoid` CLI flag from the docs**
(regression from #95). draw.io desktop's `--layout` accepts only the ELK
presets `verticalFlow`, `horizontalFlow`, `verticalTree`, `horizontalTree`,
@@ -136,7 +156,9 @@ semantic-ish versioning (the `metadata.version` field in
`libavoidRouting=1` style-stamp claim was dropped. Reported in #96.
## [1.34.0] — 2026-07-14
+
### Added
+
- **`scripts/tubemap.py`** — Tube-Map Mode: restyle a graph as a London-
Underground-style metro map. From a metro JSON (coloured *lines* = ordered
stations on an integer grid, shared stations = interchanges) it draws thick
@@ -150,7 +172,9 @@ semantic-ish versioning (the `metadata.version` field in
table, toolbox (quick-guide + §1), and a README/README_CN example + demo image.
## [1.33.0] — 2026-07-14
+
### Added
+
- **`scripts/raster2drawio.py`** — image → editable `.drawio`. Converts a
vision-extracted image graph (JSON: nodes with `x`/`y`/`shape`/`fill`, edges with
`dashed`/`arrow`) — read off a whiteboard photo, legacy PNG, or Visio screenshot —
@@ -187,7 +211,9 @@ semantic-ish versioning (the `metadata.version` field in
`test_prdiff` 8, `test_compress` 9, `test_runbook` 6).
## [1.32.0] — 2026-07-14
+
### Added
+
- **`scripts/ciimports.py`** — CI pipelines as diagrams. Reads GitHub Actions
workflows (`.github/workflows/*.yml`, or a repo root) and/or `.gitlab-ci.yml`
(auto-detected) and emits an autolayout graph: job nodes labeled with runner,
@@ -201,7 +227,9 @@ semantic-ish versioning (the `metadata.version` field in
`docs/CI.md`/`CI_CN.md`, and 2 regression tests (81 total).
## [1.31.0] — 2026-07-13
+
### Added
+
- **`scripts/relabel.py`** — language variants / bulk text swaps of an existing
`.drawio` with layout, styles, and ids untouched. `--extract` dumps every label
(vertices, edges, UserObjects, page names) as an identity JSON map; translate the
@@ -217,7 +245,9 @@ semantic-ish versioning (the `metadata.version` field in
`style-presets.md`, and 6 new regression tests (79 total). Scripts: 28 → 30.
## [1.30.0] — 2026-07-13
+
### Added
+
- **Three new diagram-type presets** in `references/diagram-types.md`, filling gaps the
frontmatter description already promised (same pattern as the 1.29.0 SysML preset):
- **BPMN (Business Process)** — pools/lanes, `mxgraph.bpmn.task2` typed tasks
@@ -235,7 +265,9 @@ semantic-ish versioning (the `metadata.version` field in
three new rows in the diagram-type dispatch table. Presets: 8 → 11.
## [1.29.0] — 2026-07-13
+
### Added
+
- **SysML diagram preset** ([#83](https://github.com/Agents365-ai/drawio-skill/issues/83)) —
new SysML section in `references/diagram-types.md` covering the four SysML-unique
diagram kinds: Block Definition (bdd, «block» compartments + composite/reference
@@ -250,7 +282,9 @@ semantic-ish versioning (the `metadata.version` field in
"requirement diagram", "parametric diagram", "MBSE" requests route to the new preset.
## [1.28.1] — 2026-07-10
+
### Changed
+
- **Refreshed the `vs Other draw.io Skills & Tools` comparison** (README, README_CN,
`docs/COMPARISON.md`, `docs/COMPARISON_CN.md`) to match the current state of the
official [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp), which has grown
@@ -260,14 +294,18 @@ semantic-ish versioning (the `metadata.version` field in
and **Browser fallback** (its Claude Code plugin now emits a diagrams.net `url`, not
just an inline preview). Added a pointer to the official plugin's install command with
a one-line statement of how drawio-skill stays complementary. Bumped the audit date.
+
### Added
+
- **libavoid routing note** in `references/xml-authoring.md` — documents draw.io's newer
editor-side obstacle-avoiding connector router (`libavoidRouting=1`), clarifies it is
not a headless CLI `--layout` flag (those are ELK node layouts), and gives the practical
path for CLI-authored files. Also noted in the comparison's edge-routing row.
## [1.28.0] — 2026-07-04
+
### Added
+
- **Interactive HTML viewer** (`scripts/drawiohtml.py`) — publish a `.drawio` as
ONE self-contained `.html`: every page exported to SVG via the draw.io CLI and
inlined with page tabs, drag-pan, wheel-zoom (cursor-anchored), node search
@@ -283,7 +321,9 @@ semantic-ish versioning (the `metadata.version` field in
router + toolbox.md + READMEs updated; script count 27 → 28. Suite now 73.
## [1.27.0] — 2026-07-04
+
### Added
+
- **OpenAPI / Swagger → API diagram** (`scripts/openapiimports.py`) — turn an
OpenAPI 3 or Swagger 2 spec (JSON, or YAML with PyYAML) into a graph for
autolayout: one node per operation **coloured by HTTP method** (GET blue, POST
@@ -305,7 +345,9 @@ semantic-ish versioning (the `metadata.version` field in
updated; script count 25 → 27. Suite now 69.
## [1.26.1] — 2026-07-04
+
### Added
+
- **`references/toolbox.md`** — a use-case map of all 25 bundled scripts
(author / import code / import IaC / live infra / compare / reverse-export /
utilities) with an "I have X, I want Y → use Z" decision guide and the shared
@@ -313,7 +355,9 @@ semantic-ish versioning (the `metadata.version` field in
resource table points to it as the "not sure which script fits" entry.
## [1.26.0] — 2026-07-04
+
### Added
+
- **Diagram → Mermaid** (`scripts/drawio2mermaid.py`) — convert a `.drawio` into
a Mermaid `flowchart` you can paste into Markdown and have GitHub / GitLab /
docs render natively (diagrams-as-code). Containers become `subgraph`s, edge
@@ -327,7 +371,9 @@ semantic-ish versioning (the `metadata.version` field in
SKILL.md router + READMEs updated. Suite now 63.
## [1.25.0] — 2026-07-03
+
### Added
+
- **Animated data-flow SVG** (`scripts/svgflow.py`) — export a `.drawio` to SVG
and turn every edge into a marching-ants animation (dashes travel along each
connector in the arrow's direction), so the diagram shows data/flow moving
@@ -341,7 +387,9 @@ semantic-ish versioning (the `metadata.version` field in
Suite now 61.
## [1.24.0] — 2026-07-03
+
### Added
+
- **Diagram → PowerPoint** (`scripts/drawio2pptx.py`) — export a (multi-page)
`.drawio` to a 16:9 `.pptx`, one page per slide, the page name as the slide
title and the diagram centred + scaled to fit. A C4 model
@@ -353,7 +401,9 @@ semantic-ish versioning (the `metadata.version` field in
- SKILL.md router + READMEs updated. Suite now 59.
## [1.23.0] — 2026-07-03
+
### Added
+
- **Diagram → Markdown** (`scripts/explain.py`) — the inverse of the generators:
read a `.drawio` and describe it as structured Markdown. Lists components
grouped by their container / swimlane / tier, relations (`A —label→ B`, the
@@ -365,7 +415,9 @@ semantic-ish versioning (the `metadata.version` field in
- SKILL.md router + READMEs updated. Suite now 56.
## [1.22.0] — 2026-07-03
+
### Added
+
- **Architecture time-lapse** (`scripts/timelapse.py`) — animate how a codebase's
structure grew across git history. Walks a directory's commits, re-runs a
bundled importer at each sampled commit (tree pulled with `git archive`; the
@@ -382,7 +434,9 @@ semantic-ish versioning (the `metadata.version` field in
Suite now 54.
## [1.21.0] — 2026-07-03
+
### Added
+
- **Diagram diff** (`scripts/drawiodiff.py`) — compare two `.drawio` files into a
single colour-coded "what changed" graph for autolayout: nodes/edges **added**
(green), **removed** (red, dashed), **changed** (orange — a matched node whose
@@ -396,7 +450,9 @@ semantic-ish versioning (the `metadata.version` field in
Suite now 52.
## [1.20.0] — 2026-07-03
+
### Added
+
- **Live-infrastructure importers** — draw what's *actually running / deployed*,
not just the declared config:
- `scripts/tfstate.py` — `terraform show -json | tfstate.py -` renders the
@@ -416,7 +472,9 @@ semantic-ish versioning (the `metadata.version` field in
one-liners + caveats); router + autolayout reference updated. Suite now 50.
## [1.19.0] — 2026-07-03
+
### Added
+
- **Accessibility built-in presets**: `colorblind-safe` (Okabe-Ito palette —
all seven role colors distinguishable under color-vision deficiency, plus
`strokeWidth=2`) and `dark` (dark fills + dark page background, light
@@ -431,7 +489,9 @@ semantic-ish versioning (the `metadata.version` field in
- Built-in preset conformance test (suite now 46).
## [1.18.0] — 2026-07-03
+
### Added
+
- **Mermaid authoring path** (draw.io CLI ≥ 30, discovered via
jgraph/drawio-mcp): for standard diagram types with no custom styling/icon
needs, write Mermaid text and convert natively —
@@ -449,7 +509,9 @@ semantic-ish versioning (the `metadata.version` field in
argument parsing, so both paths are skipped (verified 29.7.8 vs 30.2.6).
## [1.17.0] — 2026-07-03
+
### Added
+
- **`c4.py` — C4 model diagrams with drill-down.** Levels JSON (System
Context → Containers → Components, any depth) in, one multi-page `.drawio`
out: official C4 shapes/colors (`mxgraph.c4.person2`, c4model.com
@@ -464,13 +526,17 @@ semantic-ish versioning (the `metadata.version` field in
hand-authored diagrams that use links/metadata).
- `references/diagram-types.md`: C4 Model section (styles, label format,
drill-down recipe); SKILL.md routes "C4", "container diagram", etc. to it.
+
### Fixed
+
- SKILL.md export flags: `--page-index` is **1-based** in current
drawio-desktop (verified on 29.7.8) — previously documented as 0-based.
- Tests: 45.
## [1.16.0] — 2026-07-02
+
### Added
+
- **`seqlayout.py` — deterministic sequence diagrams.** Participants +
messages JSON in, finished `.drawio` out: lifeline, activation-bar and
arrow geometry are computed (not hand-placed), with automatic activation
@@ -488,7 +554,9 @@ semantic-ish versioning (the `metadata.version` field in
readability score (through-vertex ×20, crossings ×10, overlaps ×5).
- `autolayout.py` honours per-edge `style` in the graph JSON (used by
sqlerd's ER edges).
+
### Changed
+
- **SKILL.md slimmed 488 → 313 lines**: the XML-authoring tutorial (skeleton,
shape/edge cells, containers, connection distribution, palette, layout
tips) moved to `references/xml-authoring.md`, read on demand before
@@ -497,7 +565,9 @@ semantic-ish versioning (the `metadata.version` field in
passthrough).
## [1.15.0] — 2026-07-02
+
### Added
+
- **IaC → architecture diagram.** Two new importers feed autolayout:
- `tfimports.py` parses Terraform `.tf` files (regex + brace matching, no
HCL dependency) into a resource-reference graph. Each resource type is
@@ -517,7 +587,9 @@ semantic-ish versioning (the `metadata.version` field in
- Test coverage for both importers and the autolayout additions (suite now 38).
## [1.14.0] — 2026-06-03
+
### Added
+
- `aiicons.py` resolves common RAG/LLM **data-store brands** (Qdrant, Redis,
Postgres, Mongo, Elasticsearch, Milvus, Supabase, Neo4j, … 18 total) via the
[simple-icons](https://simpleicons.org) (CC0) CDN when lobe-icons lacks them;
@@ -528,26 +600,36 @@ semantic-ish versioning (the `metadata.version` field in
search, and AI logos.
## [1.13.1] — 2026-06-03
+
### Added
+
- Dependency-free `unittest` regression suite (`tests/`) + GitHub Actions CI.
+
### Fixed
+
- Unclosed file handle in `autolayout.load_palette()`.
## [1.13.0] — 2026-06-03
+
### Added
+
- **Palette-based group colouring** in auto-layout: grouped code-visualization
diagrams now tint each top-level group with a distinct colour from the skill's
own palette (`styles/built-in/default.json`), with matching container borders —
so related modules read as a coloured cluster instead of monochrome boxes.
- `autolayout.py --mono` to opt out and keep the previous monochrome look.
- README example images for Shape Search and AI/LLM brand logos.
+
### Changed
+
- `pyclasses.py` no longer hard-codes a node colour; its grouped output is
coloured by module. Styleless nodes are tinted by group; an explicit node
`style` always wins. Ungrouped output is unchanged.
## [1.12.0] — 2026-06-03
+
### Added
+
- **AI / LLM brand logos** via `aiicons.py` — resolves a brand (OpenAI, Claude,
Gemini, Mistral, Llama, Ollama, LangChain, … 321 brands) to a draw.io image
style backed by [lobe-icons](https://github.com/lobehub/lobe-icons) (MIT).
@@ -555,95 +637,136 @@ semantic-ish versioning (the `metadata.version` field in
self-contained data URI for offline use. draw.io ships none of these logos.
## [1.11.1] — 2026-06-03
+
### Changed
+
- Shape search ranks **title-exact matches above tag-only neighbours** (e.g.
`dynamodb` now returns *DynamoDB*, not *Attribute*). Scoring/candidate set is
unchanged; only the within-score-tier order changes.
+
### Added
+
- READMEs document shape search, the editable browser URL, and WSL2 support.
## [1.11.0] — 2026-06-02
+
Ideas adapted from [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) (Apache-2.0).
+
### Added
+
- **Shape search** across 10,000+ official draw.io shapes (`shapesearch.py`) —
resolves the exact `style` for AWS/Azure/GCP/Cisco/Kubernetes/UML/BPMN/ER/
electrical/P&ID instead of guessing `shape=mxgraph.*` names.
- **WSL2 / Windows** CLI detection + browser-open guidance (the `.url`-file
fragment workaround).
- `encode_drawio_url.py --edit` for an editable `app.diagrams.net` URL.
+
### Fixed
+
- Browser-URL encoder now `encodeURIComponent`s before deflate, so URLs no
longer throw "URI malformed" on a literal `%` or non-ASCII (e.g. CJK) label.
## [1.10.0] — 2026-06-02
+
### Added
+
- **Rust** module-use importer (`rustimports.py`) — intra-crate `use` graph.
## [1.9.0] — 2026-06-02
+
### Added
+
- **Nested containers** in auto-layout (deep `/`-delimited group paths).
- **Python class-inheritance** graph (`pyclasses.py`) — one node per class,
edges from subclass to base, boxed by module with `--group`.
## [1.8.0] — 2026-06-02
+
### Added
+
- **Structural validator** (`validate.py`) — deterministic `.drawio` lint
(dangling edges, duplicate/reserved ids, broken parents, overlaps).
- **JS/TS** (`jsimports.py`) and **Go** (`goimports.py`) import-graph importers.
- Container / cluster layout (`--group`) in auto-layout.
## [1.7.0] — 2026-06-02
+
### Added
+
- **Python** import-graph importer (`pyimports.py`) — intra-project module graph,
transitive-reduced.
## [1.6.0] — 2026-06-02
+
### Added
+
- **Graphviz auto-layout** (`autolayout.py`) — places nodes and routes
orthogonal edges for medium/large graphs, removing the manual-coordinate
ceiling.
## [1.5.3] — 2026-06-02
+
### Changed
+
- Finalize the `drawio` binary rename and sync reference docs.
- Major docs/landing-page overhaul (comparison tables, hero, sub-doc split),
`sync-365-skills` CI, macOS sandbox-isolation notes.
## [1.5.2] — 2026-05-17
+
### Fixed
+
- Add a top-level `version` field for ClawHub compatibility.
## [1.5.1] — 2026-05-06
+
### Added
+
- Claude Code **plugin marketplace** support; restructure for the 365-skills
umbrella submodule.
## [1.5.0] — 2026-05-06
+
### Changed
+
- Split `SKILL.md` into modular references + scripts.
## [1.4.0] — 2026-04-23
+
### Added
+
- Custom output directory support.
+
### Fixed
+
- Browser fallback fix; repair truncated IEND chunk in `-e` PNG export (issues #8/#9).
## [1.3.0] — 2026-04-23
+
### Added
+
- **Style presets** — learn a visual style from a `.drawio`/image and reuse it.
## [1.2.0] — 2026-04-19
+
### Added
+
- Auto-update check; Opencode support.
## [1.1.1] — 2026-04-06
+
### Added
+
- GitHub Pages landing page.
+
### Fixed
+
- Security flag fixes.
## [1.1.0] — 2026-04-06
+
### Added
+
- Diagram-type presets, ML/Deep-Learning model support, and quality-of-life
enhancements.
diff --git a/README.md b/README.md
index 7f0f1b9..0df6757 100644
--- a/README.md
+++ b/README.md
@@ -52,6 +52,11 @@ A bird's-eye view of everything the skill does — diagram types, import sources
## 🖼️ Examples
+The maintained [Architecture Studio showcase](examples/architecture-studio/)
+covers code → IR → `.drawio`, conflict-aware synchronization that preserves a
+manually tuned layout, and architecture → policy/views/what-if/accessible Story.
+Every artifact is regenerated by one script and verified in the test suite.
+
> [!TIP]
> **The hero image above was generated from this single prompt:**
@@ -103,7 +108,7 @@ Full walkthrough in [docs/USAGE.md](docs/USAGE.md).
### 1. Install the draw.io desktop CLI
| Platform | Command |
-|----------|---------|
+| ---------- | --------- |
| **macOS** | `brew install --cask drawio` |
| **Windows** | [Download installer](https://github.com/jgraph/drawio-desktop/releases) |
| **Linux** | `.deb`/`.rpm` from [releases](https://github.com/jgraph/drawio-desktop/releases); `sudo apt install xvfb` for headless |
@@ -251,7 +256,7 @@ python3 scripts/tubemap.py metro.json -o metro.drawio
```
| Piece | What it does |
-|---|---|
+| --- | --- |
| **13 extractors** | import graphs for **Python · JS/TS · Go · Rust**, **Python class inheritance**, **Terraform / Kubernetes / docker-compose** resource graphs (official cloud icons), **SQL DDL → ERD**, **OpenAPI / Swagger → API diagram** (operations coloured by HTTP method + schemas), **CI pipelines → DAG** (GitHub Actions `needs:` graphs + GitLab stages, with triggers, matrix sizes, reusable-workflow calls), and **live** infra from `terraform show -json` / `docker inspect` / `kubectl get -o json` (draw what's actually deployed) |
| **Diagram diff** | `drawiodiff.py` compares two `.drawio` (or two live snapshots) into one colour-coded graph — added=green, removed=red, changed=orange — so you can see architecture / infra **drift** at a glance |
| **Language variants** | `relabel.py` swaps every label via a JSON map with layout/styles/ids untouched — `--extract` dumps all labels, translate the values, `--map` applies them. One diagram → EN + CN twins for bilingual docs |
@@ -274,7 +279,7 @@ Layout needs Graphviz (`brew install graphviz` / `apt install graphviz`) — opt
## 🧩 Supported Diagram Types
| Category | Examples | Notable features |
-|---|---|---|
+| --- | --- | --- |
| Architecture | microservices, cloud (AWS/GCP/Azure), network topology, deployment | Tier-based swimlanes, hub-center strategy |
| C4 model | system context, containers, components | Multi-page `.drawio`, click-to-drill-down links |
| ML / Deep Learning | Transformer, CNN, LSTM, GRU | Tensor shape annotations, layer-type color coding |
@@ -350,7 +355,7 @@ Behind the scenes: **check dependencies → plan layout → generate `.drawio` X
### vs Native Agent (no skill)
| Feature | Native agent | drawio-skill |
-|---|---|---|
+| --- | --- | --- |
| Self-check after export | ❌ | ✅ reads PNG, auto-fixes 6 issue types |
| Iterative review loop | ❌ manual re-prompt | ✅ targeted edits, 5-round safety valve |
| Diagram type presets | ❌ | ✅ 7 presets (ERD, UML, Seq, C4, Arch, ML, Flow) |
@@ -371,7 +376,7 @@ Behind the scenes: **check dependencies → plan layout → generate `.drawio` X
### vs Other draw.io Skills & Tools
| Feature | drawio-skill | [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) (official)<br>![stars](https://img.shields.io/github/stars/jgraph/drawio-mcp?style=flat-square&logo=github&v=2) | [bahayonghang/drawio-skills](https://github.com/bahayonghang/drawio-skills)<br>![stars](https://img.shields.io/github/stars/bahayonghang/drawio-skills?style=flat-square&logo=github) | [GBSOSS/ai-drawio](https://github.com/GBSOSS/ai-drawio)<br>![stars](https://img.shields.io/github/stars/GBSOSS/ai-drawio?style=flat-square&logo=github) |
-|---|---|---|---|---|
+| --- | --- | --- | --- | --- |
| **Approach** | Pure SKILL.md | MCP servers / Claude Code plugin / Project | YAML DSL + CLI (MCP optional) | Claude Code plugin |
| **Dependencies** | draw.io desktop only | draw.io desktop | draw.io desktop (MCP optional) | draw.io plugin + browser |
| **Multi-agent** | ✅ 6 platforms | ⚠️ MCP hosts (Claude, Cursor, VS Code) | ✅ Claude / Gemini / Codex | ❌ Claude Code only |
@@ -393,11 +398,13 @@ Full comparison + key-advantages summary in [docs/COMPARISON.md](docs/COMPARISON
## 🎯 When to use (and when not to)
**Good fit:**
+
- Polished, precise diagrams — stakeholder decks, architecture, network topology, strict UML, ER diagrams
- Solid opaque fills, 10,000+ official shapes, branded icons (AWS / Azure / GCP / Cisco / Kubernetes + AI/LLM logos), swimlanes, and custom geometry
- Anything you'll export to PNG / SVG / PDF and keep editable
**Reach for a sibling skill instead when you need:**
+
- **A casual, hand-drawn / whiteboard look** → [excalidraw-skill](https://github.com/Agents365-ai/excalidraw-skill) or [tldraw-skill](https://github.com/Agents365-ai/tldraw-skill)
- **Diagrams-as-code that live in git and render in Markdown** → [mermaid-skill](https://github.com/Agents365-ai/mermaid-skill) (general) or [plantuml-skill](https://github.com/Agents365-ai/plantuml-skill) (UML)
- **Freeform infinite-canvas sketching / freehand strokes** → [tldraw-skill](https://github.com/Agents365-ai/tldraw-skill)
@@ -407,7 +414,7 @@ Full comparison + key-advantages summary in [docs/COMPARISON.md](docs/COMPARISON
Part of the [Agents365-ai diagram-skill family](https://github.com/Agents365-ai) — pick the right tool for the job:
| Skill | Style | Best for |
-|---|---|---|
+| --- | --- | --- |
| [excalidraw-skill](https://github.com/Agents365-ai/excalidraw-skill) | Hand-drawn / sketchy | Whiteboard mockups, informal diagrams |
| [mermaid-skill](https://github.com/Agents365-ai/mermaid-skill) | Text-based, auto-layout | README-embeddable, version-control friendly |
| [plantuml-skill](https://github.com/Agents365-ai/plantuml-skill) | UML-focused | Class / sequence diagrams in CI pipelines |
@@ -446,8 +453,8 @@ If this skill helps you, consider supporting the author:
**Agents365-ai**
-- GitHub: https://github.com/Agents365-ai
-- Bilibili: https://space.bilibili.com/441831884
+- GitHub: <https://github.com/Agents365-ai>
+- Bilibili: <https://space.bilibili.com/441831884>
## 📄 License
diff --git a/README_CN.md b/README_CN.md
index 32a4d3c..bd2e1bd 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -52,6 +52,10 @@
## 🖼️ 示例
+可维护的 [Architecture Studio 演示](examples/architecture-studio/) 覆盖代码 →
+IR → `.drawio`、保留人工布局的冲突感知同步,以及架构模型 →
+规则/多视图/What-if/无障碍 Story。所有产物都由一条脚本重建并纳入测试。
+
> [!TIP]
> **页首那张图就是用下面这条提示词生成的:**
@@ -102,7 +106,7 @@ Skill 在多种图表拓扑中尽量保持线条清晰路由,避免穿越无
### 1. 安装 draw.io 桌面版 CLI
| 平台 | 命令 |
-|------|------|
+| ------ | ------ |
| **macOS** | `brew install --cask drawio` |
| **Windows** | [下载安装包](https://github.com/jgraph/drawio-desktop/releases) |
| **Linux** | 从 [releases](https://github.com/jgraph/drawio-desktop/releases) 下载 `.deb`/`.rpm`;无头导出需 `sudo apt install xvfb` |
@@ -249,7 +253,7 @@ python3 scripts/tubemap.py metro.json -o metro.drawio
```
| 组件 | 作用 |
-|---|---|
+| --- | --- |
| **13 个提取器** | **Python · JS/TS · Go · Rust** 的导入关系图、**Python 类继承**、**Terraform / Kubernetes / docker-compose** 资源图(自动配官方云图标)、**SQL DDL → ER 图**、**OpenAPI / Swagger → API 图**(按 HTTP 方法着色的接口 + schema),**CI 流水线 → DAG**(GitHub Actions `needs:` 依赖图 + GitLab 阶段,含触发器、matrix 规模、可复用工作流调用)、以及从 `terraform show -json` / `docker inspect` / `kubectl get -o json` 提取的**实时**基础设施(画出真正已部署的样子) |
| **图对比 (diff)** | `drawiodiff.py` 把两张 `.drawio`(或两个实时快照)对比成一张彩色图 —— 新增=绿、删除=红、变更=橙 —— 一眼看出架构 / 基础设施**漂移** |
| **语言变体** | `relabel.py` 按 JSON 映射批量换标签,布局/样式/id 全不动 —— `--extract` 导出全部标签,翻译值后 `--map` 应用。一张图 → 中英双胞胎,双语文档必备 |
@@ -272,7 +276,7 @@ python3 scripts/tubemap.py metro.json -o metro.drawio
## 🧩 支持的图表类型
| 类别 | 示例 | 特色 |
-|------|------|------|
+| ------ | ------ | ------ |
| 架构图 | 微服务、云(AWS/GCP/Azure)、网络拓扑、部署 | 分层泳道、hub 居中策略 |
| C4 模型 | 系统上下文、容器、组件 | 多页 `.drawio`、点击下钻链接 |
| ML / 深度学习 | Transformer、CNN、LSTM、GRU | 张量形状标注、层类型配色 |
@@ -348,7 +352,7 @@ Skill 会提取配色、形状、字体和连线风格,渲染预览图,**确
### 对比原生智能体(无 skill)
| 功能 | 原生智能体 | drawio-skill |
-|------|-----------|--------------|
+| ------ | ----------- | -------------- |
| 导出后自检 | ❌ | ✅ 读取 PNG 自动修复 6 类问题 |
| 迭代审查循环 | ❌ 需手动重新提问 | ✅ 定向编辑,5 轮安全阀 |
| 图表类型预设 | ❌ | ✅ 7 种(ERD、UML、序列、C4、架构、ML、流程) |
@@ -369,7 +373,7 @@ Skill 会提取配色、形状、字体和连线风格,渲染预览图,**确
### 对比其他 draw.io Skills 与工具
| 功能 | drawio-skill | [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp)(官方)<br>![stars](https://img.shields.io/github/stars/jgraph/drawio-mcp?style=flat-square&logo=github&v=2) | [bahayonghang/drawio-skills](https://github.com/bahayonghang/drawio-skills)<br>![stars](https://img.shields.io/github/stars/bahayonghang/drawio-skills?style=flat-square&logo=github) | [GBSOSS/ai-drawio](https://github.com/GBSOSS/ai-drawio)<br>![stars](https://img.shields.io/github/stars/GBSOSS/ai-drawio?style=flat-square&logo=github) |
-|------|------|------|------|------|
+| ------ | ------ | ------ | ------ | ------ |
| **方式** | 纯 SKILL.md | MCP 服务 / Claude Code 插件 / Project | YAML DSL + CLI(MCP 可选) | Claude Code 插件 |
| **依赖** | 仅 draw.io 桌面版 | draw.io 桌面版 | draw.io 桌面版(MCP 可选) | draw.io 插件 + 浏览器 |
| **多智能体支持** | ✅ 6 个平台 | ⚠️ MCP 宿主(Claude、Cursor、VS Code) | ✅ Claude / Gemini / Codex | ❌ 仅 Claude Code |
@@ -391,11 +395,13 @@ Skill 会提取配色、形状、字体和连线风格,渲染预览图,**确
## 🎯 何时用(以及何时别用)
**适合:**
+
- 精致、精确的图 —— 汇报/决策用图、架构图、网络拓扑、严格 UML、ER 图
- 不透明实色填充、10,000+ 官方图形、品牌图标(AWS / Azure / GCP / Cisco / Kubernetes + AI/LLM logo)、泳道、自定义几何
- 需要导出 PNG / SVG / PDF 且保持可编辑的场景
**这些情况请改用同系列的其它 skill:**
+
- **随性的手绘 / 白板观感** → [excalidraw-skill](https://github.com/Agents365-ai/excalidraw-skill) 或 [tldraw-skill](https://github.com/Agents365-ai/tldraw-skill)
- **以代码形式存进 git、在 Markdown 里渲染的图** → [mermaid-skill](https://github.com/Agents365-ai/mermaid-skill)(通用)或 [plantuml-skill](https://github.com/Agents365-ai/plantuml-skill)(UML)
- **无限画布自由涂鸦 / 自由笔迹** → [tldraw-skill](https://github.com/Agents365-ai/tldraw-skill)
@@ -405,7 +411,7 @@ Skill 会提取配色、形状、字体和连线风格,渲染预览图,**确
[Agents365-ai 图表 skill 家族](https://github.com/Agents365-ai) 一员 —— 按场景挑工具:
| Skill | 风格 | 适用场景 |
-|---|---|---|
+| --- | --- | --- |
| [excalidraw-skill](https://github.com/Agents365-ai/excalidraw-skill) | 手绘 / 草图 | 白板原型、非正式图 |
| [mermaid-skill](https://github.com/Agents365-ai/mermaid-skill) | 文本驱动、自动布局 | 可嵌入 README、易于版本管理 |
| [plantuml-skill](https://github.com/Agents365-ai/plantuml-skill) | UML 专精 | CI 流水线里的类图 / 序列图 |
@@ -444,8 +450,8 @@ Skill 会提取配色、形状、字体和连线风格,渲染预览图,**确
**Agents365-ai**
-- GitHub: https://github.com/Agents365-ai
-- Bilibili: https://space.bilibili.com/441831884
+- GitHub: <https://github.com/Agents365-ai>
+- Bilibili: <https://space.bilibili.com/441831884>
## 📄 许可证
diff --git a/docs/DOGFOOD_V3.md b/docs/DOGFOOD_V3.md
new file mode 100644
index 0000000..565e5e4
--- /dev/null
+++ b/docs/DOGFOOD_V3.md
@@ -0,0 +1,40 @@
+# Architecture Studio 3.0 dogfood report
+
+Date: 2026-09-01
+Target: `skills/drawio-skill/scripts/` in this repository
+
+## Workflow exercised
+
+```bash
+python3 skills/drawio-skill/scripts/diagramctl.py build \
+ skills/drawio-skill/scripts --from python --group \
+ --ir-output /tmp/drawio-skill.ir.json -o /tmp/drawio-skill.drawio
+python3 skills/drawio-skill/scripts/diagramctl.py inspect /tmp/drawio-skill.ir.json
+python3 skills/drawio-skill/scripts/diagramctl.py review /tmp/drawio-skill.ir.json --format json
+python3 skills/drawio-skill/scripts/diagramctl.py views /tmp/drawio-skill.ir.json \
+ --views executive,system,deployment,dataflow,security -o /tmp/drawio-skill.views.drawio
+python3 skills/drawio-skill/scripts/diagramctl.py story /tmp/drawio-skill.ir.json \
+ -o /tmp/drawio-skill.story.html
+```
+
+## Observed results
+
+- Import: 41 nodes and 1 intra-project edge.
+- Structural validation: zero errors, warnings, edge-through-node routes,
+ crossings, or overlaps for both the system diagram and five-view diagram.
+- Views: Executive selected 12 nodes; the other four views retained all 41.
+- Story: generated offline with 41 accessible components.
+- Review: 41 owner warnings and no errors.
+
+## What the run taught us
+
+The low edge count is plausible for this toolbox: most scripts are independent
+commands and only `diagramctl.py` imports `diagram_ir.py`. The importer therefore
+reflected the code, but assigning every module the semantic kind `service`
+made the ownership contract noisy. Likewise, deployment/data-flow/security
+views correctly fell back to the complete graph, but the result did not add
+information because code importers currently emit no runtime, boundary, or data
+metadata.
+
+These are modeling/profile gaps, not layout failures. They feed the v3.1
+roadmap rather than being hidden by example-specific rules.
diff --git a/docs/ROADMAP_V3_1.md b/docs/ROADMAP_V3_1.md
new file mode 100644
index 0000000..860107e
--- /dev/null
+++ b/docs/ROADMAP_V3_1.md
@@ -0,0 +1,39 @@
+# Roadmap: Architecture Studio 3.1
+
+This backlog is based on the 3.0 release gate, checked showcase, and dogfood run
+against this repository. It is intentionally ordered by observed usefulness.
+
+## P0 — semantic fidelity
+
+- Add source profiles so code modules use kinds such as `module`, `library`,
+ `adapter`, and `command` instead of defaulting to `service`.
+- Scope architecture contracts by kind/profile; ownership and production
+ observability rules should not fire on ordinary source modules.
+- Emit exact file-and-line provenance from language importers rather than only
+ the scanned root path.
+- Report when a projected view falls back to the entire model, including which
+ metadata would make that view distinctive.
+
+## P1 — richer analysis
+
+- Add policy parameters and per-rule severity overrides without introducing an
+ expression evaluator that executes user content.
+- Model dependency direction and failure semantics explicitly: caller/callee,
+ upstream/downstream, retry, circuit breaker, queue buffering, and redundancy.
+- Add a view-difference summary so CI can detect five nominal views that are
+ effectively identical.
+- Support deterministic timestamps through `SOURCE_DATE_EPOCH` for reproducible
+ checked artifacts.
+
+## P2 — release confidence and presentation
+
+- Add cross-platform visual golden tests for Graphviz and grid fallback layouts.
+- Export a small PNG/SVG gallery from the semantic showcase in release CI.
+- Track importer precision, policy signal-to-noise, manual-layout preservation,
+ view differentiation, and Story accessibility as release metrics.
+
+## Exit criteria
+
+3.1 is ready when a codebase dogfood run produces no architecture-only policy
+noise, provenance identifies source lines, fallback views explain themselves,
+and the showcase passes on macOS, Linux/Xvfb, and the pure-Python fallback.
diff --git a/docs/USAGE.md b/docs/USAGE.md
index 6282fa4..8c79869 100644
--- a/docs/USAGE.md
+++ b/docs/USAGE.md
@@ -27,6 +27,8 @@ python3 skills/drawio-skill/scripts/diagramctl.py story architecture.ir.json \
See `references/diagram-ir.md` and `references/semantic-workflows.md` for the
model, rule catalog, provenance, and accessibility behavior.
+The complete reproducible workflow is in
+[`examples/architecture-studio/`](../examples/architecture-studio/).
[中文](USAGE_CN.md)
diff --git a/docs/USAGE_CN.md b/docs/USAGE_CN.md
index 243ad1c..80b11da 100644
--- a/docs/USAGE_CN.md
+++ b/docs/USAGE_CN.md
@@ -27,6 +27,8 @@ python3 skills/drawio-skill/scripts/diagramctl.py story architecture.ir.json \
模型、规则、来源追溯和无障碍行为详见 `references/diagram-ir.md` 与
`references/semantic-workflows.md`。
+完整的可重建工作流见
+[`examples/architecture-studio/`](../examples/architecture-studio/)。
[English](USAGE.md)
diff --git a/examples/architecture-studio/README.md b/examples/architecture-studio/README.md
new file mode 100644
index 0000000..ea8b367
--- /dev/null
+++ b/examples/architecture-studio/README.md
@@ -0,0 +1,29 @@
+# Architecture Studio showcase
+
+These examples exercise the three workflows introduced in drawio-skill 3.0:
+
+1. `codebase/` → `generated/codebase.ir.json` → editable import graph.
+2. Baseline model → manually tuned diagram → three-way reconciliation with
+ explicit label/property conflicts.
+3. Semantic checkout architecture → linked views, policy result, failure
+ overlay, impact report, and accessible offline Story HTML.
+
+Regenerate every checked-in artifact from the repository root:
+
+```bash
+python3 examples/architecture-studio/generate.py
+```
+
+Or keep the repository untouched and write into a temporary directory:
+
+```bash
+python3 examples/architecture-studio/generate.py --output-dir /tmp/drawio-showcase
+```
+
+Open `generated/reconciled.drawio` to inspect the preserved manual geometry and
+`data-conflict` annotations. Open `generated/checkout-story.html` in any modern
+browser; it is self-contained and makes no external requests.
+
+Generated timestamps are evidence of the most recent regeneration and are not
+intended to be byte-for-byte reproducible. Tests assert semantic and structural
+invariants instead.
diff --git a/examples/architecture-studio/checkout.ir.json b/examples/architecture-studio/checkout.ir.json
new file mode 100644
index 0000000..66dfba1
--- /dev/null
+++ b/examples/architecture-studio/checkout.ir.json
@@ -0,0 +1,20 @@
+{
+ "schema": "drawio-skill/diagram-ir/v1",
+ "metadata": {"title": "Resilient checkout", "created": "2026-09-01T00:00:00+00:00"},
+ "nodes": [
+ {"id": "shopper", "label": "Shopper", "kind": "actor", "style": "rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;", "properties": {"trust_boundary": "public", "importance": 7}, "provenance": {"path": "examples/architecture-studio/checkout.ir.json"}, "labels": {"zh": "顾客"}},
+ {"id": "gateway", "label": "API Gateway", "kind": "gateway", "properties": {"owner": "platform", "environment": "production", "region": "eu-west-1", "runtime": "edge", "observability": "OpenTelemetry", "trust_boundary": "public", "importance": 10}, "provenance": {"path": "examples/architecture-studio/checkout.ir.json"}, "labels": {"zh": "API 网关"}},
+ {"id": "orders", "label": "Order Service", "kind": "service", "properties": {"owner": "checkout", "environment": "production", "region": "eu-west-1", "runtime": "Kubernetes", "observability": "OpenTelemetry", "trust_boundary": "private", "importance": 9}, "provenance": {"path": "services/orders.py", "line": 12}, "labels": {"zh": "订单服务"}},
+ {"id": "inventory", "label": "Inventory Service", "kind": "service", "properties": {"owner": "catalog", "environment": "production", "region": "eu-west-1", "runtime": "Kubernetes", "observability": "OpenTelemetry", "trust_boundary": "private", "importance": 6}, "provenance": {"path": "examples/architecture-studio/checkout.ir.json"}, "labels": {"zh": "库存服务"}},
+ {"id": "orders-db", "label": "Orders DB", "kind": "database", "properties": {"owner": "checkout", "environment": "production", "region": "eu-west-1", "observability": "database metrics", "trust_boundary": "data", "importance": 8}, "provenance": {"path": "examples/architecture-studio/checkout.ir.json"}, "labels": {"zh": "订单数据库"}},
+ {"id": "stripe", "label": "Stripe", "kind": "external", "properties": {"owner": "payments", "region": "global", "trust_boundary": "external", "importance": 5}, "provenance": {"path": "examples/architecture-studio/checkout.ir.json"}, "labels": {"zh": "支付平台"}}
+ ],
+ "edges": [
+ {"id": "shopper-gateway", "source": "shopper", "target": "gateway", "label": "HTTPS", "kind": "sync", "properties": {"protocol": "HTTPS"}},
+ {"id": "gateway-orders", "source": "gateway", "target": "orders", "label": "mTLS", "kind": "sync", "properties": {"protocol": "mTLS"}},
+ {"id": "orders-inventory", "source": "orders", "target": "inventory", "label": "gRPC", "kind": "sync", "properties": {"protocol": "mTLS", "timeout": "800ms", "isolates_failure": true}},
+ {"id": "orders-db", "source": "orders", "target": "orders-db", "label": "PostgreSQL/TLS", "kind": "sync", "properties": {"protocol": "TLS"}},
+ {"id": "orders-stripe", "source": "orders", "target": "stripe", "label": "HTTPS", "kind": "sync", "properties": {"protocol": "HTTPS", "timeout": "2s"}}
+ ],
+ "views": []
+}
diff --git a/examples/architecture-studio/codebase/checkout/__init__.py b/examples/architecture-studio/codebase/checkout/__init__.py
new file mode 100644
index 0000000..2281a92
--- /dev/null
+++ b/examples/architecture-studio/codebase/checkout/__init__.py
@@ -0,0 +1,5 @@
+"""Tiny checkout package used by the Architecture Studio showcase."""
+
+from checkout.gateway import handle_checkout
+
+__all__ = ["handle_checkout"]
diff --git a/examples/architecture-studio/codebase/checkout/gateway.py b/examples/architecture-studio/codebase/checkout/gateway.py
new file mode 100644
index 0000000..7270e78
--- /dev/null
+++ b/examples/architecture-studio/codebase/checkout/gateway.py
@@ -0,0 +1,7 @@
+"""HTTP-facing checkout entrypoint."""
+
+from checkout.orders import place_order
+
+
+def handle_checkout(cart):
+ return place_order(cart)
diff --git a/examples/architecture-studio/codebase/checkout/orders.py b/examples/architecture-studio/codebase/checkout/orders.py
new file mode 100644
index 0000000..aefc216
--- /dev/null
+++ b/examples/architecture-studio/codebase/checkout/orders.py
@@ -0,0 +1,9 @@
+"""Order orchestration."""
+
+from checkout.payments import authorize
+from checkout.persistence import save_order
+
+
+def place_order(cart):
+ authorization = authorize(cart)
+ return save_order(cart, authorization)
diff --git a/examples/architecture-studio/codebase/checkout/payments.py b/examples/architecture-studio/codebase/checkout/payments.py
new file mode 100644
index 0000000..f60667f
--- /dev/null
+++ b/examples/architecture-studio/codebase/checkout/payments.py
@@ -0,0 +1,5 @@
+"""Payment adapter."""
+
+
+def authorize(cart):
+ return {"status": "authorized", "total": len(cart)}
diff --git a/examples/architecture-studio/codebase/checkout/persistence.py b/examples/architecture-studio/codebase/checkout/persistence.py
new file mode 100644
index 0000000..f5055a5
--- /dev/null
+++ b/examples/architecture-studio/codebase/checkout/persistence.py
@@ -0,0 +1,5 @@
+"""Persistence adapter."""
+
+
+def save_order(cart, authorization):
+ return {"items": cart, "authorization": authorization}
diff --git a/examples/architecture-studio/generate.py b/examples/architecture-studio/generate.py
new file mode 100644
index 0000000..23c9a15
--- /dev/null
+++ b/examples/architecture-studio/generate.py
@@ -0,0 +1,173 @@
+#!/usr/bin/env python3
+"""Regenerate the drawio-skill 3.0 showcase artifacts."""
+
+from __future__ import annotations
+
+import argparse
+import json
+from pathlib import Path
+import subprocess
+import sys
+import xml.etree.ElementTree as ET
+
+
+HERE = Path(__file__).resolve().parent
+ROOT = HERE.parents[1]
+DIAGRAMCTL = ROOT / "skills" / "drawio-skill" / "scripts" / "diagramctl.py"
+VALIDATE = ROOT / "skills" / "drawio-skill" / "scripts" / "validate.py"
+
+
+def run(*args: object) -> subprocess.CompletedProcess[str]:
+ return subprocess.run(
+ [sys.executable, str(DIAGRAMCTL), *(str(arg) for arg in args)],
+ check=True,
+ text=True,
+ capture_output=True,
+ )
+
+
+def manually_tune(path: Path) -> None:
+ tree = ET.parse(path)
+ holder = next(
+ cell for cell in tree.getroot().iter() if cell.get("data-model-id") == "orders"
+ )
+ cell = holder.find("mxCell") if holder.tag == "UserObject" else holder
+ if cell is None:
+ raise RuntimeError("orders cell has no mxCell")
+ holder.set("value" if holder.tag == "mxCell" else "label", "Orders (manual)")
+ holder.set("data-properties", json.dumps({"owner": "platform-ops"}))
+ cell.set("style", (cell.get("style") or "") + "shadow=1;strokeWidth=3;")
+ geometry = cell.find("mxGeometry")
+ if geometry is None:
+ raise RuntimeError("orders cell has no geometry")
+ geometry.set("x", "720")
+ geometry.set("y", "210")
+ ET.indent(tree.getroot(), space=" ")
+ tree.write(path, encoding="unicode", xml_declaration=False)
+ with path.open("a", encoding="utf-8") as stream:
+ stream.write("\n")
+
+
+def validate(path: Path) -> None:
+ subprocess.run(
+ [sys.executable, str(VALIDATE), str(path), "--strict"],
+ check=True,
+ text=True,
+ capture_output=True,
+ )
+
+
+def write_json(path: Path, value: object) -> None:
+ path.write_text(
+ json.dumps(value, indent=2, ensure_ascii=False) + "\n", encoding="utf-8"
+ )
+
+
+def main() -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--output-dir", type=Path, default=HERE / "generated")
+ args = parser.parse_args()
+ out = args.output_dir.resolve()
+ out.mkdir(parents=True, exist_ok=True)
+
+ run(
+ "build",
+ HERE / "codebase",
+ "--from",
+ "python",
+ "--group",
+ "--title",
+ "Checkout codebase",
+ "--ir-output",
+ out / "codebase.ir.json",
+ "-o",
+ out / "codebase.drawio",
+ )
+ code_ir_path = out / "codebase.ir.json"
+ code_ir = json.loads(code_ir_path.read_text(encoding="utf-8"))
+ code_ir["metadata"]["created"] = "2026-09-01T00:00:00+00:00"
+ code_ir["metadata"]["source"] = "examples/architecture-studio/codebase"
+ for node in code_ir["nodes"]:
+ node.get("provenance", {})["path"] = "examples/architecture-studio/codebase"
+ write_json(code_ir_path, code_ir)
+ run(
+ "build",
+ code_ir_path,
+ "--from",
+ "ir",
+ "-o",
+ out / "codebase.drawio",
+ )
+
+ run(
+ "build",
+ HERE / "sync-baseline.ir.json",
+ "--from",
+ "ir",
+ "-o",
+ out / "manual-layout.drawio",
+ )
+ manually_tune(out / "manual-layout.drawio")
+ result = run(
+ "sync",
+ out / "manual-layout.drawio",
+ HERE / "sync-source-v2.ir.json",
+ "--from",
+ "ir",
+ "-o",
+ out / "reconciled.drawio",
+ )
+ sync_result = json.loads(result.stdout)
+ sync_result["output"] = "generated/reconciled.drawio"
+ write_json(out / "sync-result.json", sync_result)
+
+ model = HERE / "checkout.ir.json"
+ run(
+ "views",
+ model,
+ "--views",
+ "executive,system,deployment,dataflow,security",
+ "-o",
+ out / "checkout-views.drawio",
+ )
+ run(
+ "test",
+ model,
+ "--rules",
+ HERE / "policy.yml",
+ "-o",
+ out / "policy-result.json",
+ )
+ run(
+ "whatif",
+ model,
+ "--fail",
+ "orders",
+ "--drawio",
+ out / "checkout-failure.drawio",
+ "-o",
+ out / "impact.json",
+ )
+ impact_path = out / "impact.json"
+ impact = json.loads(impact_path.read_text(encoding="utf-8"))
+ impact["drawio"] = "generated/checkout-failure.drawio"
+ write_json(impact_path, impact)
+ run(
+ "story",
+ model,
+ "--fail",
+ "orders",
+ "--title",
+ "Checkout failure walkthrough",
+ "-o",
+ out / "checkout-story.html",
+ )
+
+ for path in out.glob("*.drawio"):
+ validate(path)
+ print(f"generated showcase in {out}")
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/examples/architecture-studio/generated/checkout-failure.drawio b/examples/architecture-studio/generated/checkout-failure.drawio
new file mode 100644
index 0000000..f193c44
--- /dev/null
+++ b/examples/architecture-studio/generated/checkout-failure.drawio
@@ -0,0 +1,74 @@
+<mxfile host="drawio-skill" agent="diagram-ir" version="3.0.0">
+ <diagram id="system" name="System">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <mxCell id="shopper" value="Shopper" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1" data-model-id="shopper" data-kind="actor" data-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-label="Shopper" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-boundary="public">
+ <mxGeometry x="180" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="gateway" value="API Gateway" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="platform" data-boundary="public">
+ <mxGeometry x="180" y="110" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="orders" value="Order Service" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;strokeWidth=3;" vertex="1" parent="1" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9,&quot;scenario_status&quot;:&quot;failed&quot;}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9,&quot;scenario_status&quot;:&quot;failed&quot;}" data-source-label="Order Service" data-provenance="{&quot;path&quot;:&quot;services/orders.py&quot;,&quot;line&quot;:12}" data-owner="checkout" data-boundary="private">
+ <mxGeometry x="180" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="inventory" value="Inventory Service" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1" data-model-id="inventory" data-kind="service" data-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-label="Inventory Service" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="catalog" data-boundary="private">
+ <mxGeometry x="0" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="orders-db" value="Orders DB" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1" data-model-id="orders-db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8,&quot;scenario_status&quot;:&quot;impacted&quot;}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8,&quot;scenario_status&quot;:&quot;impacted&quot;}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="checkout" data-boundary="data">
+ <mxGeometry x="180" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="stripe" value="Stripe" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1" data-model-id="stripe" data-kind="external" data-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5,&quot;scenario_status&quot;:&quot;impacted&quot;}" data-source-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5,&quot;scenario_status&quot;:&quot;impacted&quot;}" data-source-label="Stripe" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="payments" data-boundary="external">
+ <mxGeometry x="360" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="e0" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="shopper" target="gateway" data-model-id="shopper-gateway" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="70" />
+ <mxPoint x="260" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="mTLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="gateway" target="orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-label="mTLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="180" />
+ <mxPoint x="260" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e2" value="gRPC" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="orders" target="inventory" data-model-id="orders-inventory" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-label="gRPC">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="130" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e3" value="PostgreSQL/TLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="orders" target="orders-db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-label="PostgreSQL/TLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="280" />
+ <mxPoint x="260" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e4" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="orders" target="stripe" data-model-id="orders-stripe" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="390" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+</mxfile>
diff --git a/examples/architecture-studio/generated/checkout-story.html b/examples/architecture-studio/generated/checkout-story.html
new file mode 100644
index 0000000..b57a685
--- /dev/null
+++ b/examples/architecture-studio/generated/checkout-story.html
@@ -0,0 +1,5 @@
+<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Checkout failure walkthrough</title><style>
+body{font:16px system-ui;margin:0;background:#f7f8fa;color:#17202a}header,main{max-width:1200px;margin:auto;padding:18px}.toolbar{display:flex;gap:8px;align-items:center}button{padding:8px 14px}svg{background:white;border:1px solid #ccd2da;width:100%;height:auto}.node rect{fill:#dae8fc;stroke:#6c8ebf;stroke-width:2}.node.failed rect{fill:#f8cecc;stroke:#b85450}.node.impacted rect{fill:#ffe6cc;stroke:#d79b00}.node.active rect{stroke:#005fcc;stroke-width:5}.edge{stroke:#65717e;stroke-width:2}svg text{font:13px system-ui;fill:#17202a}#narration{padding:12px;background:#fff;border-left:4px solid #005fcc;margin:12px 0}.sr-only{position:absolute;left:-10000px}@media(prefers-reduced-motion:no-preference){.node{transition:opacity .2s}}</style></head><body>
+<header><h1>Checkout failure walkthrough</h1><p>Resilient checkout: 6 components (1 actor, 1 database, 1 external, 1 gateway, 2 service) and 5 relationships.</p><div class="toolbar"><button id="prev">Previous</button><button id="next">Next</button><button id="reset">Overview</button><label id="langWrap" hidden>Language <select id="language"><option value="">Default</option></select></label><span id="counter" aria-live="polite"></span></div><div id="narration" aria-live="polite">Use Next to walk through the architecture.</div></header><main><svg viewBox="0 0 840 400" role="img" aria-labelledby="diagram-title diagram-desc"><title id="diagram-title">Checkout failure walkthrough</title><desc id="diagram-desc">Resilient checkout: 6 components (1 actor, 1 database, 1 external, 1 gateway, 2 service) and 5 relationships.</desc><defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto"><path d="M0,0 L0,6 L9,3 z" fill="#65717e"/></marker></defs><line class="edge" data-source="shopper" data-target="gateway" x1="175" y1="115" x2="415" y2="115" marker-end="url(#arrow)"/><text x="295.0" y="108.0">HTTPS</text><line class="edge" data-source="gateway" data-target="orders" x1="415" y1="115" x2="655" y2="115" marker-end="url(#arrow)"/><text x="535.0" y="108.0">mTLS</text><line class="edge" data-source="orders" data-target="inventory" x1="655" y1="115" x2="175" y2="265" marker-end="url(#arrow)"/><text x="415.0" y="183.0">gRPC</text><line class="edge" data-source="orders" data-target="orders-db" x1="655" y1="115" x2="415" y2="265" marker-end="url(#arrow)"/><text x="535.0" y="183.0">PostgreSQL/TLS</text><line class="edge" data-source="orders" data-target="stripe" x1="655" y1="115" x2="655" y2="265" marker-end="url(#arrow)"/><text x="655.0" y="183.0">HTTPS</text><g class="node " id="node-shopper" data-id="shopper" tabindex="0" role="button" aria-label="Shopper, actor"><rect x="100" y="90" width="150" height="55" rx="10"/><text x="175" y="123" text-anchor="middle">Shopper</text></g><g class="node " id="node-gateway" data-id="gateway" tabindex="0" role="button" aria-label="API Gateway, gateway"><rect x="340" y="90" width="150" height="55" rx="10"/><text x="415" y="123" text-anchor="middle">API Gateway</text></g><g class="node failed" id="node-orders" data-id="orders" tabindex="0" role="button" aria-label="Order Service, service"><rect x="580" y="90" width="150" height="55" rx="10"/><text x="655" y="123" text-anchor="middle">Order Service</text></g><g class="node " id="node-inventory" data-id="inventory" tabindex="0" role="button" aria-label="Inventory Service, service"><rect x="100" y="240" width="150" height="55" rx="10"/><text x="175" y="273" text-anchor="middle">Inventory Service</text></g><g class="node impacted" id="node-orders-db" data-id="orders-db" tabindex="0" role="button" aria-label="Orders DB, database"><rect x="340" y="240" width="150" height="55" rx="10"/><text x="415" y="273" text-anchor="middle">Orders DB</text></g><g class="node impacted" id="node-stripe" data-id="stripe" tabindex="0" role="button" aria-label="Stripe, external"><rect x="580" y="240" width="150" height="55" rx="10"/><text x="655" y="273" text-anchor="middle">Stripe</text></g></svg><details><summary>Text alternative</summary><ol><li>Shopper — actor · boundary: public · source: examples/architecture-studio/checkout.ir.json</li><li>API Gateway — gateway · owner: platform · boundary: public · source: examples/architecture-studio/checkout.ir.json</li><li>Order Service — service · owner: checkout · boundary: private · source: services/orders.py:12</li><li>Inventory Service — service · owner: catalog · boundary: private · source: examples/architecture-studio/checkout.ir.json</li><li>Orders DB — database · owner: checkout · boundary: data · source: examples/architecture-studio/checkout.ir.json</li><li>Stripe — external · owner: payments · boundary: external · source: examples/architecture-studio/checkout.ir.json</li></ol></details></main><script>
+const DATA={"steps": [{"id": "shopper", "title": "Shopper", "detail": "actor · boundary: public · source: examples/architecture-studio/checkout.ir.json", "labels": {"zh": "顾客"}}, {"id": "gateway", "title": "API Gateway", "detail": "gateway · owner: platform · boundary: public · source: examples/architecture-studio/checkout.ir.json", "labels": {"zh": "API 网关"}}, {"id": "orders", "title": "Order Service", "detail": "service · owner: checkout · boundary: private · source: services/orders.py:12", "labels": {"zh": "订单服务"}}, {"id": "inventory", "title": "Inventory Service", "detail": "service · owner: catalog · boundary: private · source: examples/architecture-studio/checkout.ir.json", "labels": {"zh": "库存服务"}}, {"id": "orders-db", "title": "Orders DB", "detail": "database · owner: checkout · boundary: data · source: examples/architecture-studio/checkout.ir.json", "labels": {"zh": "订单数据库"}}, {"id": "stripe", "title": "Stripe", "detail": "external · owner: payments · boundary: external · source: examples/architecture-studio/checkout.ir.json", "labels": {"zh": "支付平台"}}], "scenario": {"failed": "orders", "impacted": ["orders-db", "stripe"]}, "languages": ["zh"]};let i=-1;const nodes=[...document.querySelectorAll('.node')];function titleOf(s){return (language.value&&s.labels&&s.labels[language.value])||s.title}function show(n){i=n;nodes.forEach(x=>x.classList.remove('active'));if(i>=0&&i<DATA.steps.length){const s=DATA.steps[i],el=nodes.find(x=>x.dataset.id===s.id);if(el)el.classList.add('active');narration.textContent=titleOf(s)+' — '+s.detail;counter.textContent=(i+1)+' / '+DATA.steps.length}else{narration.textContent='Overview: all components and relationships.';counter.textContent='Overview'}}function setLanguage(){DATA.steps.forEach(s=>{const el=nodes.find(x=>x.dataset.id===s.id);if(el)el.querySelector('text').textContent=titleOf(s)});show(i)}if(DATA.languages.length){langWrap.hidden=false;DATA.languages.forEach(x=>language.add(new Option(x,x)));language.onchange=setLanguage}nodes.forEach(el=>{el.onclick=()=>show(DATA.steps.findIndex(s=>s.id===el.dataset.id));el.onkeydown=e=>{if(e.key==='Enter'||e.key===' ')el.click()}});prev.onclick=()=>show(Math.max(-1,i-1));next.onclick=()=>show(Math.min(DATA.steps.length-1,i+1));reset.onclick=()=>show(-1);document.addEventListener('keydown',e=>{if(e.key==='ArrowRight')next.click();if(e.key==='ArrowLeft')prev.click()});show(-1);
+</script></body></html>
\ No newline at end of file
diff --git a/examples/architecture-studio/generated/checkout-views.drawio b/examples/architecture-studio/generated/checkout-views.drawio
new file mode 100644
index 0000000..3cfbad5
--- /dev/null
+++ b/examples/architecture-studio/generated/checkout-views.drawio
@@ -0,0 +1,409 @@
+<mxfile host="drawio-skill" agent="diagram-ir" version="3.0.0">
+ <diagram id="executive" name="Executive">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <UserObject label="Shopper" link="data:page/id,system" id="executive--shopper" data-model-id="shopper" data-kind="actor" data-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-label="Shopper" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
+ <mxGeometry x="180" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="API Gateway" link="data:page/id,system" id="executive--gateway" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="platform" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
+ <mxGeometry x="180" y="110" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Order Service" link="data:page/id,system" id="executive--orders" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-label="Order Service" data-provenance="{&quot;path&quot;:&quot;services/orders.py&quot;,&quot;line&quot;:12}" data-owner="checkout" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="180" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Inventory Service" link="data:page/id,system" id="executive--inventory" data-model-id="inventory" data-kind="service" data-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-label="Inventory Service" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="catalog" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="0" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Orders DB" link="data:page/id,system" id="executive--orders-db" data-model-id="orders-db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="checkout" data-boundary="data">
+ <mxCell style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
+ <mxGeometry x="180" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Stripe" link="data:page/id,system" id="executive--stripe" data-model-id="stripe" data-kind="external" data-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-label="Stripe" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="payments" data-boundary="external">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
+ <mxGeometry x="360" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <mxCell id="e0" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="executive--shopper" target="executive--gateway" data-model-id="shopper-gateway" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="70" />
+ <mxPoint x="260" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="mTLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="executive--gateway" target="executive--orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-label="mTLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="180" />
+ <mxPoint x="260" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e2" value="gRPC" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="executive--orders" target="executive--inventory" data-model-id="orders-inventory" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-label="gRPC">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="130" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e3" value="PostgreSQL/TLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="executive--orders" target="executive--orders-db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-label="PostgreSQL/TLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="280" />
+ <mxPoint x="260" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e4" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="executive--orders" target="executive--stripe" data-model-id="orders-stripe" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="390" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+ <diagram id="system" name="System">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <UserObject label="Shopper" link="data:page/id,dataflow" id="system--shopper" data-model-id="shopper" data-kind="actor" data-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-label="Shopper" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
+ <mxGeometry x="180" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="API Gateway" link="data:page/id,deployment" id="system--gateway" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="platform" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
+ <mxGeometry x="180" y="110" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Order Service" link="data:page/id,deployment" id="system--orders" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-label="Order Service" data-provenance="{&quot;path&quot;:&quot;services/orders.py&quot;,&quot;line&quot;:12}" data-owner="checkout" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="180" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Inventory Service" link="data:page/id,deployment" id="system--inventory" data-model-id="inventory" data-kind="service" data-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-label="Inventory Service" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="catalog" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="0" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Orders DB" link="data:page/id,deployment" id="system--orders-db" data-model-id="orders-db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="checkout" data-boundary="data">
+ <mxCell style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
+ <mxGeometry x="180" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Stripe" link="data:page/id,deployment" id="system--stripe" data-model-id="stripe" data-kind="external" data-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-label="Stripe" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="payments" data-boundary="external">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
+ <mxGeometry x="360" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <mxCell id="e0" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="system--shopper" target="system--gateway" data-model-id="shopper-gateway" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="70" />
+ <mxPoint x="260" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="mTLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="system--gateway" target="system--orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-label="mTLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="180" />
+ <mxPoint x="260" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e2" value="gRPC" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="system--orders" target="system--inventory" data-model-id="orders-inventory" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-label="gRPC">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="130" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e3" value="PostgreSQL/TLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="system--orders" target="system--orders-db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-label="PostgreSQL/TLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="280" />
+ <mxPoint x="260" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e4" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="system--orders" target="system--stripe" data-model-id="orders-stripe" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="390" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+ <diagram id="deployment" name="Deployment">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <UserObject label="API Gateway" link="data:page/id,dataflow" id="deployment--gateway" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="platform" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
+ <mxGeometry x="180" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Order Service" link="data:page/id,dataflow" id="deployment--orders" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-label="Order Service" data-provenance="{&quot;path&quot;:&quot;services/orders.py&quot;,&quot;line&quot;:12}" data-owner="checkout" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="180" y="110" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Inventory Service" link="data:page/id,dataflow" id="deployment--inventory" data-model-id="inventory" data-kind="service" data-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-label="Inventory Service" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="catalog" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="0" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Orders DB" link="data:page/id,dataflow" id="deployment--orders-db" data-model-id="orders-db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="checkout" data-boundary="data">
+ <mxCell style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
+ <mxGeometry x="180" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Stripe" link="data:page/id,dataflow" id="deployment--stripe" data-model-id="stripe" data-kind="external" data-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-label="Stripe" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="payments" data-boundary="external">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
+ <mxGeometry x="360" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <mxCell id="e0" value="mTLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="deployment--gateway" target="deployment--orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-label="mTLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="70" />
+ <mxPoint x="260" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="gRPC" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="deployment--orders" target="deployment--inventory" data-model-id="orders-inventory" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-label="gRPC">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="130" y="140" />
+ <mxPoint x="80" y="140" />
+ <mxPoint x="80" y="140" />
+ <mxPoint x="80" y="140" />
+ <mxPoint x="80" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e2" value="PostgreSQL/TLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="deployment--orders" target="deployment--orders-db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-label="PostgreSQL/TLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="180" />
+ <mxPoint x="260" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e3" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="deployment--orders" target="deployment--stripe" data-model-id="orders-stripe" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="390" y="140" />
+ <mxPoint x="440" y="140" />
+ <mxPoint x="440" y="140" />
+ <mxPoint x="440" y="140" />
+ <mxPoint x="440" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+ <diagram id="dataflow" name="Dataflow">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <UserObject label="Shopper" link="data:page/id,security" id="dataflow--shopper" data-model-id="shopper" data-kind="actor" data-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-label="Shopper" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
+ <mxGeometry x="180" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="API Gateway" link="data:page/id,security" id="dataflow--gateway" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="platform" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
+ <mxGeometry x="180" y="110" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Order Service" link="data:page/id,security" id="dataflow--orders" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-label="Order Service" data-provenance="{&quot;path&quot;:&quot;services/orders.py&quot;,&quot;line&quot;:12}" data-owner="checkout" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="180" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Inventory Service" link="data:page/id,security" id="dataflow--inventory" data-model-id="inventory" data-kind="service" data-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-label="Inventory Service" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="catalog" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="0" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Orders DB" link="data:page/id,security" id="dataflow--orders-db" data-model-id="orders-db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="checkout" data-boundary="data">
+ <mxCell style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
+ <mxGeometry x="180" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Stripe" link="data:page/id,security" id="dataflow--stripe" data-model-id="stripe" data-kind="external" data-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-label="Stripe" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="payments" data-boundary="external">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
+ <mxGeometry x="360" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <mxCell id="e0" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="dataflow--shopper" target="dataflow--gateway" data-model-id="shopper-gateway" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="70" />
+ <mxPoint x="260" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="mTLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="dataflow--gateway" target="dataflow--orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-label="mTLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="180" />
+ <mxPoint x="260" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e2" value="gRPC" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="dataflow--orders" target="dataflow--inventory" data-model-id="orders-inventory" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-label="gRPC">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="130" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e3" value="PostgreSQL/TLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="dataflow--orders" target="dataflow--orders-db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-label="PostgreSQL/TLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="280" />
+ <mxPoint x="260" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e4" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="dataflow--orders" target="dataflow--stripe" data-model-id="orders-stripe" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="390" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+ <diagram id="security" name="Security">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <UserObject label="Shopper" link="data:page/id,executive" id="security--shopper" data-model-id="shopper" data-kind="actor" data-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-properties="{&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:7}" data-source-label="Shopper" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
+ <mxGeometry x="180" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="API Gateway" link="data:page/id,executive" id="security--gateway" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;edge&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;public&quot;,&quot;importance&quot;:10}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="platform" data-boundary="public">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
+ <mxGeometry x="180" y="110" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Order Service" link="data:page/id,executive" id="security--orders" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:9}" data-source-label="Order Service" data-provenance="{&quot;path&quot;:&quot;services/orders.py&quot;,&quot;line&quot;:12}" data-owner="checkout" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="180" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Inventory Service" link="data:page/id,executive" id="security--inventory" data-model-id="inventory" data-kind="service" data-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-properties="{&quot;owner&quot;:&quot;catalog&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;runtime&quot;:&quot;Kubernetes&quot;,&quot;observability&quot;:&quot;OpenTelemetry&quot;,&quot;trust_boundary&quot;:&quot;private&quot;,&quot;importance&quot;:6}" data-source-label="Inventory Service" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="catalog" data-boundary="private">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
+ <mxGeometry x="0" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Orders DB" link="data:page/id,executive" id="security--orders-db" data-model-id="orders-db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-properties="{&quot;owner&quot;:&quot;checkout&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;region&quot;:&quot;eu-west-1&quot;,&quot;observability&quot;:&quot;database metrics&quot;,&quot;trust_boundary&quot;:&quot;data&quot;,&quot;importance&quot;:8}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="checkout" data-boundary="data">
+ <mxCell style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
+ <mxGeometry x="180" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <UserObject label="Stripe" link="data:page/id,executive" id="security--stripe" data-model-id="stripe" data-kind="external" data-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-properties="{&quot;owner&quot;:&quot;payments&quot;,&quot;region&quot;:&quot;global&quot;,&quot;trust_boundary&quot;:&quot;external&quot;,&quot;importance&quot;:5}" data-source-label="Stripe" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/checkout.ir.json&quot;}" data-owner="payments" data-boundary="external">
+ <mxCell style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#f5f5f5;strokeColor=#666666;" vertex="1" parent="1">
+ <mxGeometry x="360" y="320" width="160" height="70" as="geometry" />
+ </mxCell>
+ </UserObject>
+ <mxCell id="e0" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="security--shopper" target="security--gateway" data-model-id="shopper-gateway" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="70" />
+ <mxPoint x="260" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="mTLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="security--gateway" target="security--orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-label="mTLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="180" />
+ <mxPoint x="260" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e2" value="gRPC" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="security--orders" target="security--inventory" data-model-id="orders-inventory" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;,&quot;timeout&quot;:&quot;800ms&quot;,&quot;isolates_failure&quot;:true}" data-source-label="gRPC">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="130" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="250" />
+ <mxPoint x="80" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e3" value="PostgreSQL/TLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="security--orders" target="security--orders-db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-label="PostgreSQL/TLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="260" y="280" />
+ <mxPoint x="260" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e4" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="security--orders" target="security--stripe" data-model-id="orders-stripe" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;,&quot;timeout&quot;:&quot;2s&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="390" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="250" />
+ <mxPoint x="440" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+</mxfile>
diff --git a/examples/architecture-studio/generated/codebase.drawio b/examples/architecture-studio/generated/codebase.drawio
new file mode 100644
index 0000000..a3e3d1d
--- /dev/null
+++ b/examples/architecture-studio/generated/codebase.drawio
@@ -0,0 +1,60 @@
+<mxfile host="drawio-skill" agent="diagram-ir" version="3.0.0">
+ <diagram id="system" name="System">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <mxCell id="group_0" value="checkout" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#6c8ebf;fontColor=#6c8ebf;verticalAlign=top;fontStyle=2;dashed=1;" vertex="1" parent="1">
+ <mxGeometry x="6" y="86" width="388" height="328" as="geometry" />
+ </mxCell>
+ <mxCell id="checkout.gateway" value="checkout.gateway" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="group_0" data-model-id="checkout.gateway" data-kind="gateway" data-properties="{}" data-source-properties="{}" data-source-label="checkout.gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/codebase&quot;,&quot;importer&quot;:&quot;python&quot;}">
+ <mxGeometry x="114" y="24" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="checkout.persistence" value="checkout.persistence" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="group_0" data-model-id="checkout.persistence" data-kind="service" data-properties="{}" data-source-properties="{}" data-source-label="checkout.persistence" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/codebase&quot;,&quot;importer&quot;:&quot;python&quot;}">
+ <mxGeometry x="24" y="234" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="checkout.payments" value="checkout.payments" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="group_0" data-model-id="checkout.payments" data-kind="service" data-properties="{}" data-source-properties="{}" data-source-label="checkout.payments" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/codebase&quot;,&quot;importer&quot;:&quot;python&quot;}">
+ <mxGeometry x="204" y="234" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="checkout" value="checkout" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1" data-model-id="checkout" data-kind="service" data-properties="{}" data-source-properties="{}" data-source-label="checkout" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/codebase&quot;,&quot;importer&quot;:&quot;python&quot;}">
+ <mxGeometry x="120" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="checkout.orders" value="checkout.orders" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="group_0" data-model-id="checkout.orders" data-kind="service" data-properties="{}" data-source-properties="{}" data-source-label="checkout.orders" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/codebase&quot;,&quot;importer&quot;:&quot;python&quot;}">
+ <mxGeometry x="114" y="124" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="e0" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="checkout" target="checkout.gateway" data-model-id="checkout--checkout.gateway" data-kind="relation" data-properties="{}" data-source-properties="{}" data-source-label="">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="200" y="70" />
+ <mxPoint x="200" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="checkout.gateway" target="checkout.orders" data-model-id="checkout.gateway--checkout.orders" data-kind="relation" data-properties="{}" data-source-properties="{}" data-source-label="">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="200" y="180" />
+ <mxPoint x="200" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e2" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="checkout.orders" target="checkout.payments" data-model-id="checkout.orders--checkout.payments" data-kind="relation" data-properties="{}" data-source-properties="{}" data-source-label="">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="250" y="280" />
+ <mxPoint x="250" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e3" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="checkout.orders" target="checkout.persistence" data-model-id="checkout.orders--checkout.persistence" data-kind="relation" data-properties="{}" data-source-properties="{}" data-source-label="">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="160" y="280" />
+ <mxPoint x="160" y="310" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+</mxfile>
diff --git a/examples/architecture-studio/generated/codebase.ir.json b/examples/architecture-studio/generated/codebase.ir.json
new file mode 100644
index 0000000..216a62f
--- /dev/null
+++ b/examples/architecture-studio/generated/codebase.ir.json
@@ -0,0 +1,100 @@
+{
+ "schema": "drawio-skill/diagram-ir/v1",
+ "metadata": {
+ "title": "Checkout codebase",
+ "created": "2026-09-01T00:00:00+00:00",
+ "source": "examples/architecture-studio/codebase",
+ "importer": "python"
+ },
+ "nodes": [
+ {
+ "id": "checkout.gateway",
+ "label": "checkout.gateway",
+ "kind": "gateway",
+ "properties": {},
+ "group": "checkout",
+ "provenance": {
+ "path": "examples/architecture-studio/codebase",
+ "importer": "python"
+ }
+ },
+ {
+ "id": "checkout.persistence",
+ "label": "checkout.persistence",
+ "kind": "service",
+ "properties": {},
+ "group": "checkout",
+ "provenance": {
+ "path": "examples/architecture-studio/codebase",
+ "importer": "python"
+ }
+ },
+ {
+ "id": "checkout.payments",
+ "label": "checkout.payments",
+ "kind": "service",
+ "properties": {},
+ "group": "checkout",
+ "provenance": {
+ "path": "examples/architecture-studio/codebase",
+ "importer": "python"
+ }
+ },
+ {
+ "id": "checkout",
+ "label": "checkout",
+ "kind": "service",
+ "properties": {},
+ "provenance": {
+ "path": "examples/architecture-studio/codebase",
+ "importer": "python"
+ }
+ },
+ {
+ "id": "checkout.orders",
+ "label": "checkout.orders",
+ "kind": "service",
+ "properties": {},
+ "group": "checkout",
+ "provenance": {
+ "path": "examples/architecture-studio/codebase",
+ "importer": "python"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "id": "checkout--checkout.gateway",
+ "source": "checkout",
+ "target": "checkout.gateway",
+ "label": "",
+ "kind": "relation",
+ "properties": {}
+ },
+ {
+ "id": "checkout.gateway--checkout.orders",
+ "source": "checkout.gateway",
+ "target": "checkout.orders",
+ "label": "",
+ "kind": "relation",
+ "properties": {}
+ },
+ {
+ "id": "checkout.orders--checkout.payments",
+ "source": "checkout.orders",
+ "target": "checkout.payments",
+ "label": "",
+ "kind": "relation",
+ "properties": {}
+ },
+ {
+ "id": "checkout.orders--checkout.persistence",
+ "source": "checkout.orders",
+ "target": "checkout.persistence",
+ "label": "",
+ "kind": "relation",
+ "properties": {}
+ }
+ ],
+ "views": []
+}
diff --git a/examples/architecture-studio/generated/impact.json b/examples/architecture-studio/generated/impact.json
new file mode 100644
index 0000000..4a1ba70
--- /dev/null
+++ b/examples/architecture-studio/generated/impact.json
@@ -0,0 +1,21 @@
+{
+ "failed": "orders",
+ "impacted": [
+ "orders-db",
+ "stripe"
+ ],
+ "paths": {
+ "orders": [
+ "orders"
+ ],
+ "orders-db": [
+ "orders",
+ "orders-db"
+ ],
+ "stripe": [
+ "orders",
+ "stripe"
+ ]
+ },
+ "drawio": "generated/checkout-failure.drawio"
+}
diff --git a/examples/architecture-studio/generated/manual-layout.drawio b/examples/architecture-studio/generated/manual-layout.drawio
new file mode 100644
index 0000000..972d11e
--- /dev/null
+++ b/examples/architecture-studio/generated/manual-layout.drawio
@@ -0,0 +1,35 @@
+<mxfile host="drawio-skill" agent="diagram-ir" version="3.0.0">
+ <diagram id="system" name="System">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <mxCell id="gateway" value="API Gateway" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/sync-baseline.ir.json&quot;}" data-owner="platform">
+ <mxGeometry x="0" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="orders" value="Orders (manual)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;shadow=1;strokeWidth=3;" vertex="1" parent="1" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;: &quot;platform-ops&quot;}" data-source-properties="{&quot;owner&quot;:&quot;checkout-team&quot;}" data-source-label="Orders API" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/sync-baseline.ir.json&quot;}" data-owner="checkout-team">
+ <mxGeometry x="720" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="db" value="Orders DB" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1" data-model-id="db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;checkout-team&quot;}" data-source-properties="{&quot;owner&quot;:&quot;checkout-team&quot;}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/sync-baseline.ir.json&quot;}" data-owner="checkout-team">
+ <mxGeometry x="0" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="e0" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="gateway" target="orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="80" y="70" />
+ <mxPoint x="80" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="TLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="orders" target="db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;TLS&quot;}" data-source-label="TLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="80" y="180" />
+ <mxPoint x="80" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+</mxfile>
diff --git a/examples/architecture-studio/generated/policy-result.json b/examples/architecture-studio/generated/policy-result.json
new file mode 100644
index 0000000..413f7b5
--- /dev/null
+++ b/examples/architecture-studio/generated/policy-result.json
@@ -0,0 +1,5 @@
+{
+ "errors": 0,
+ "warnings": 0,
+ "findings": []
+}
diff --git a/examples/architecture-studio/generated/reconciled.drawio b/examples/architecture-studio/generated/reconciled.drawio
new file mode 100644
index 0000000..2211010
--- /dev/null
+++ b/examples/architecture-studio/generated/reconciled.drawio
@@ -0,0 +1,41 @@
+<mxfile host="drawio-skill" agent="diagram-ir" version="3.0.0" modified="2026-09-01T06:57:30+00:00">
+ <diagram id="system" name="System">
+ <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
+ <root>
+ <mxCell id="0" />
+ <mxCell id="1" parent="0" />
+ <mxCell id="gateway" value="API Gateway" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1" data-model-id="gateway" data-kind="gateway" data-properties="{&quot;owner&quot;:&quot;platform&quot;}" data-source-properties="{&quot;owner&quot;:&quot;platform&quot;}" data-source-label="API Gateway" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/sync-source-v2.ir.json&quot;}" data-owner="platform">
+ <mxGeometry x="0" y="0" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="orders" value="Orders (manual)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;shadow=1;strokeWidth=3;" vertex="1" parent="1" data-model-id="orders" data-kind="service" data-properties="{&quot;owner&quot;:&quot;platform-ops&quot;}" data-source-properties="{&quot;owner&quot;:&quot;commerce-team&quot;}" data-source-label="Order Service v2" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/sync-source-v2.ir.json&quot;}" data-owner="checkout-team" data-conflict="label" data-conflict-properties="owner">
+ <mxGeometry x="720" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="db" value="Orders DB" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1" data-model-id="db" data-kind="database" data-properties="{&quot;owner&quot;:&quot;commerce-team&quot;}" data-source-properties="{&quot;owner&quot;:&quot;commerce-team&quot;}" data-source-label="Orders DB" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/sync-source-v2.ir.json&quot;}" data-owner="checkout-team">
+ <mxGeometry x="0" y="210" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="e0" value="HTTPS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="gateway" target="orders" data-model-id="gateway-orders" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;HTTPS&quot;}" data-source-label="HTTPS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="80" y="70" />
+ <mxPoint x="80" y="90" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="e1" value="mTLS" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="orders" target="db" data-model-id="orders-db" data-kind="sync" data-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;mTLS&quot;}" data-source-label="mTLS">
+ <mxGeometry relative="1" as="geometry">
+ <Array as="points">
+ <mxPoint x="80" y="180" />
+ <mxPoint x="80" y="200" />
+ </Array>
+ </mxGeometry>
+ </mxCell>
+ <mxCell id="events" value="Order Events" vertex="1" parent="1" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" data-model-id="events" data-kind="queue" data-status="added" data-properties="{&quot;owner&quot;:&quot;commerce-team&quot;}" data-source-properties="{&quot;owner&quot;:&quot;commerce-team&quot;}" data-source-label="Order Events" data-provenance="{&quot;path&quot;:&quot;examples/architecture-studio/sync-source-v2.ir.json&quot;}">
+ <mxGeometry x="720" y="380.0" width="160" height="70" as="geometry" />
+ </mxCell>
+ <mxCell id="edge-orders-events" value="publish" edge="1" parent="1" source="orders" target="events" style="endArrow=classic;html=1;rounded=0;" data-model-id="orders-events" data-kind="async" data-status="added" data-properties="{&quot;protocol&quot;:&quot;Kafka&quot;}" data-source-properties="{&quot;protocol&quot;:&quot;Kafka&quot;}" data-source-label="publish">
+ <mxGeometry relative="1" as="geometry" />
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+</mxfile>
diff --git a/examples/architecture-studio/generated/sync-result.json b/examples/architecture-studio/generated/sync-result.json
new file mode 100644
index 0000000..9504566
--- /dev/null
+++ b/examples/architecture-studio/generated/sync-result.json
@@ -0,0 +1,29 @@
+{
+ "added": [
+ "events"
+ ],
+ "changed": [
+ "orders"
+ ],
+ "removed": [],
+ "changed_edges": [
+ "orders-db"
+ ],
+ "conflicts": [
+ {
+ "id": "orders",
+ "field": "label",
+ "manual": "Orders (manual)",
+ "incoming": "Order Service v2"
+ },
+ {
+ "id": "orders",
+ "field": "properties",
+ "keys": [
+ "owner"
+ ]
+ }
+ ],
+ "output": "generated/reconciled.drawio",
+ "source_type": "ir"
+}
diff --git a/examples/architecture-studio/policy.yml b/examples/architecture-studio/policy.yml
new file mode 100644
index 0000000..79b0209
--- /dev/null
+++ b/examples/architecture-studio/policy.yml
@@ -0,0 +1,7 @@
+rules:
+ - no-direct-internet-to-database
+ - every-service-has-owner
+ - production-has-observability
+ - external-dependencies-have-timeouts
+ - trust-boundaries-use-protocol
+ - accessible-contrast
diff --git a/examples/architecture-studio/sync-baseline.ir.json b/examples/architecture-studio/sync-baseline.ir.json
new file mode 100644
index 0000000..2124316
--- /dev/null
+++ b/examples/architecture-studio/sync-baseline.ir.json
@@ -0,0 +1,14 @@
+{
+ "schema": "drawio-skill/diagram-ir/v1",
+ "metadata": {"title": "Checkout sync", "created": "2026-09-01T00:00:00+00:00"},
+ "nodes": [
+ {"id": "gateway", "label": "API Gateway", "kind": "gateway", "properties": {"owner": "platform"}, "provenance": {"path": "examples/architecture-studio/sync-baseline.ir.json"}},
+ {"id": "orders", "label": "Orders API", "kind": "service", "properties": {"owner": "checkout-team"}, "provenance": {"path": "examples/architecture-studio/sync-baseline.ir.json"}},
+ {"id": "db", "label": "Orders DB", "kind": "database", "properties": {"owner": "checkout-team"}, "provenance": {"path": "examples/architecture-studio/sync-baseline.ir.json"}}
+ ],
+ "edges": [
+ {"id": "gateway-orders", "source": "gateway", "target": "orders", "label": "HTTPS", "kind": "sync", "properties": {"protocol": "HTTPS"}},
+ {"id": "orders-db", "source": "orders", "target": "db", "label": "TLS", "kind": "sync", "properties": {"protocol": "TLS"}}
+ ],
+ "views": []
+}
diff --git a/examples/architecture-studio/sync-source-v2.ir.json b/examples/architecture-studio/sync-source-v2.ir.json
new file mode 100644
index 0000000..694281d
--- /dev/null
+++ b/examples/architecture-studio/sync-source-v2.ir.json
@@ -0,0 +1,16 @@
+{
+ "schema": "drawio-skill/diagram-ir/v1",
+ "metadata": {"title": "Checkout sync v2", "created": "2026-09-01T00:00:00+00:00"},
+ "nodes": [
+ {"id": "gateway", "label": "API Gateway", "kind": "gateway", "properties": {"owner": "platform"}, "provenance": {"path": "examples/architecture-studio/sync-source-v2.ir.json"}},
+ {"id": "orders", "label": "Order Service v2", "kind": "service", "properties": {"owner": "commerce-team"}, "provenance": {"path": "examples/architecture-studio/sync-source-v2.ir.json"}},
+ {"id": "db", "label": "Orders DB", "kind": "database", "properties": {"owner": "commerce-team"}, "provenance": {"path": "examples/architecture-studio/sync-source-v2.ir.json"}},
+ {"id": "events", "label": "Order Events", "kind": "queue", "properties": {"owner": "commerce-team"}, "provenance": {"path": "examples/architecture-studio/sync-source-v2.ir.json"}}
+ ],
+ "edges": [
+ {"id": "gateway-orders", "source": "gateway", "target": "orders", "label": "HTTPS", "kind": "sync", "properties": {"protocol": "HTTPS"}},
+ {"id": "orders-db", "source": "orders", "target": "db", "label": "mTLS", "kind": "sync", "properties": {"protocol": "mTLS"}},
+ {"id": "orders-events", "source": "orders", "target": "events", "label": "publish", "kind": "async", "properties": {"protocol": "Kafka"}}
+ ],
+ "views": []
+}
diff --git a/tests/test_examples.py b/tests/test_examples.py
new file mode 100644
index 0000000..0fc71ea
--- /dev/null
+++ b/tests/test_examples.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python3
+"""Regression tests for the checked Architecture Studio showcase."""
+
+import json
+import os
+import subprocess
+import sys
+import tempfile
+import unittest
+import xml.etree.ElementTree as ET
+
+
+ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+EXAMPLE = os.path.join(ROOT, "examples", "architecture-studio")
+
+
+class TestArchitectureStudioExamples(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls.temp = tempfile.TemporaryDirectory()
+ cls.out = cls.temp.name
+ result = subprocess.run(
+ [
+ sys.executable,
+ os.path.join(EXAMPLE, "generate.py"),
+ "--output-dir",
+ cls.out,
+ ],
+ text=True,
+ capture_output=True,
+ )
+ if result.returncode:
+ raise AssertionError(result.stderr or result.stdout)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.temp.cleanup()
+
+ def load(self, name):
+ with open(os.path.join(self.out, name), encoding="utf-8") as stream:
+ return json.load(stream)
+
+ def test_code_to_ir_to_drawio(self):
+ ir = self.load("codebase.ir.json")
+ self.assertEqual(5, len(ir["nodes"]))
+ self.assertGreaterEqual(len(ir["edges"]), 4)
+ self.assertEqual("python", ir["metadata"]["importer"])
+ root = ET.parse(os.path.join(self.out, "codebase.drawio")).getroot()
+ self.assertEqual("mxfile", root.tag)
+
+ def test_three_way_sync_preserves_manual_changes(self):
+ result = self.load("sync-result.json")
+ self.assertEqual(["events"], result["added"])
+ fields = {conflict["field"] for conflict in result["conflicts"]}
+ self.assertEqual({"label", "properties"}, fields)
+ orders = next(
+ cell
+ for cell in ET.parse(os.path.join(self.out, "reconciled.drawio"))
+ .getroot()
+ .iter()
+ if cell.get("data-model-id") == "orders"
+ )
+ self.assertEqual("Orders (manual)", orders.get("value"))
+ self.assertEqual("720", orders.find("mxGeometry").get("x"))
+ self.assertIn("shadow=1", orders.get("style"))
+
+ def test_views_policy_failure_and_story(self):
+ pages = (
+ ET.parse(os.path.join(self.out, "checkout-views.drawio"))
+ .getroot()
+ .findall("diagram")
+ )
+ self.assertEqual(5, len(pages))
+ policy = self.load("policy-result.json")
+ self.assertEqual((0, 0), (policy["errors"], policy["warnings"]))
+ impact = self.load("impact.json")
+ self.assertEqual("orders", impact["failed"])
+ self.assertIn("orders-db", impact["impacted"])
+ self.assertNotIn("inventory", impact["impacted"])
+ with open(
+ os.path.join(self.out, "checkout-story.html"), encoding="utf-8"
+ ) as stream:
+ story = stream.read()
+ self.assertIn('role="img"', story)
+ self.assertIn("Text alternative", story)
+ self.assertNotIn("https://", story)
+
+
+if __name__ == "__main__":
+ unittest.main()