Files
oci-deal-accelerator/kb/diagram/reference-layouts/oci-toolkit-import.yaml
root b30a4f0d32 Diagram generation: ref-arch-driven procedure + spec validator + KB enrichment
The diagram path now follows a documented standard procedure (lookup
the closest Oracle Architecture Center reference → confirm components
→ author absolute_layout → spec validator → render → visually verify)
and ships persistent guardrails so layout regressions can't recur.

Persistent procedure changes (apply to all users, all sessions):
- tools/diagram_spec_validator.py — geometry checks (CONTAINER_TOO_THIN,
  CONTAINER_PADDING_VIOLATION, LABEL_OVERFLOW_PARENT) run BEFORE either
  renderer (drawio + PPTX). Catches the subnet-collapse / label-overflow
  bugs that the post-render drawio validator missed.
- tools/oci_diagram_gen.py + tools/oci_pptx_diagram_gen.py — call the
  spec validator before emitting any output. Adds mysql / mysql_heatwave
  type aliases.
- tools/archcenter_pattern_lookup.py — scores against cached page
  descriptions (not just the 1-line summary), supports --queries for
  multi-fragment composition, and applies synonym expansion via
  kb/architecture-center/synonyms.yaml so "LB HA cross AD" matches
  "load balancer high availability availability domain".
- kb/architecture-center/synonyms.yaml — canonical synonym table
  (load balancer, autonomous database, data guard, …) used by the
  lookup scorer.

KB enrichment:
- tools/archcenter_description_fetcher.py + 121 cached _description.md
  under kb/diagram/assets/archcenter-refs/<slug>/. Removes the runtime
  dependency on docs.oracle.com when authoring specs and feeds the
  pattern-lookup scorer.
- 110+ cached .drawio / .svg / .png references for offline reuse,
  plus the OCI Toolkit v24.2 import (kb/diagram/assets/oci-toolkit-drawio).

Documentation:
- docs/skill/output-formats.md — new "Standard diagram-generation
  procedure (MANDATORY)" + geometry rules + the new validator entry.
- SKILL.md option 2 — references the mandatory procedure.
- README.md — describes the spec validator, archcenter_pattern_lookup
  and description fetcher, and updates the KB-health table.

Tooling that backs the procedure (cumulative across recent sessions):
tools/archcenter_case_runner.py, archcenter_batch_driver.py,
archcenter_zip_downloader.py, drawio_visual_validator.py,
drawio_fidelity_eval.py, harvest_drawio_icon.py, import_oci_library.py,
oci_pptx_diagram_gen.py, oci_pptx_render.py, refresh_pptx_icon_index.py.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 21:15:21 -03:00

46 lines
2.2 KiB
YAML

---
last_verified: 2026-04-25
source_zip: https://docs.oracle.com/iaas/Content/Resources/Assets/OCI-Style-Guide-for-Drawio.zip
toolkit_version: v24.2
toolkit_path: kb/diagram/assets/oci-toolkit-drawio/
indexer: tools/import_oci_library.py
refresh: tools/refresh_oci_drawio_toolkit.py
---
audit_2026_04_25:
finding: |
The hand-curated kb/diagram/oci-icons.json had 67 entries, mostly
harvested ad-hoc from a few Architecture Center exports. The official
OCI Library.xml (Oracle Style Guide for Drawio v24.2) ships 223 shapes
spread across 20 categories. Without a bulk importer, whole product
families silently rendered as fallback rectangles in user diagrams.
category_breakdown:
Logical: 34
Identity_and_Security: 27
Physical: 26
Database: 25
Applications: 20
Networking: 18
Developer_Services: 15
Analytics_and_AI: 14
Observability_and_Management: 13
Storage: 10
Compute: 7
Governance_and_Administration: 5
Migration: 2
Container: 1
Marketplace: 1
Cloud: 1
other: 9
fix:
- "tools/import_oci_library.py decodes every entry (zlib + base64 + URL-encoded XML), normalises geometry so the wrapper sits at (0, 0, w, h), and writes oci-icons.json."
- "tools/refresh_oci_drawio_toolkit.py fetches the Style Guide zip and stages it under kb/diagram/assets/oci-toolkit-drawio/."
- "After import: 67 → 302 entries (223 canonical + 79 short aliases like 'adb' → 'database_autonomous_database')."
operating_procedure:
- "When Oracle ships a new toolkit version, run `python tools/refresh_oci_drawio_toolkit.py` then `python tools/import_oci_library.py` (the importer overwrites; pass --keep-existing to preserve hand-curated entries)."
- "When a service type appears as a fallback colored rectangle in generated diagrams, first check oci-icons.json for the canonical key, then add a new alias to import_oci_library.py::SHORT_ALIASES if the user's spec uses a friendly short name."
- "Container-corner markers (per OCI Toolkit slide 18 'Grouping'): VCN gets vcn_icon, Subnet gets route_table_and_security_list, both at half-size in the top-right. OPTIONAL but standard — see oci-toolkit-styles.yaml § design_rules."