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>
This commit is contained in:
root
2026-04-25 21:15:21 -03:00
parent 2491c38d4b
commit b30a4f0d32
635 changed files with 365317 additions and 1014 deletions

View File

@@ -83,9 +83,9 @@ Present these options as a compact numbered list. Each option has a bold title f
```
DESIGN & PROPOSE
─────────────────
1. 📋 Full proposal — *notes → architecture + deck + diagram + costs*
2. 📐 Architecture diagram — *YAML or description → .drawio*
3. 📊 Slide deck — *architecture → .pptx*
1. 📋 Full proposal — *notes → architecture + deck + native PPTX diagram + costs*
2. 📐 Architecture diagram — *description → .drawio or native PPTX*
3. 📊 Slide deck — *architecture → .pptx with native OCI diagram*
4. 💰 Cost estimate — *services + sizing → PAYG vs BYOL*
VALIDATE & CHECK
@@ -120,8 +120,8 @@ Pick a number, or just describe what you need.
### Behavior Rules
- If the user picks **1**, ask: "Paste your discovery notes (meeting notes, emails, whatever you have)."
- If the user picks **2**, ask: "Describe the architecture you want to diagram, or paste a YAML spec if you have one."
- If the user picks **3**, ask: "Describe the architecture or paste the spec. I'll generate the deck."
- If the user picks **2**, ask: "Describe the architecture you want to diagram, or paste a YAML spec if you have one. If you want an editable technical diagram I'll generate `.drawio`; if you want presentation-ready Oracle-style visuals I'll generate a native `.pptx` diagram/slide." Then **follow the standard diagram-generation procedure in `docs/skill/output-formats.md` § Standard diagram-generation procedure (MANDATORY)** — reference-architecture lookup → pre-generation review → spec authoring → automatic spec validator → render → visual verification. Do not skip the lookup step; deriving geometry from a similar Oracle ref arch prevents the subnet-collapse / label-overflow regressions the spec validator now blocks.
- If the user picks **3**, ask: "Describe the architecture or paste the spec. I'll generate the deck with a native OCI PowerPoint diagram when the architecture is structured enough."
- If the user picks **4**, ask: "What services and sizing? (e.g., 'ADB-S 8 OCPU + 2 VMs + FastConnect')"
- If the user picks **5**, ask: "Describe your architecture or paste the spec. I'll run the 5-pillar review." Then follow the WA review flow:
1. Parse input to build a workload profile YAML (flags) and architecture YAML
@@ -146,7 +146,7 @@ Pick a number, or just describe what you need.
6. Assess migration risks from `kb/field-knowledge/gotchas.yaml` and do-nothing risks
7. Compare with alternatives using `kb/competitive/*`
8. Generate implementation roadmap based on engagement tier
9. Produce a 8-10 slide deck using Oracle FY26 template (`config/oracle-pptx-layouts.yaml` → `business_case` type)
9. Produce a 8-10 slide deck using Oracle FY26 template (`config/oracle-pptx-layouts.yaml` → `business_case` type), using a native OCI PowerPoint diagram when the architecture is structured enough
10. Output: business-case.pptx + business-case.yaml (reusable spec)
- If the user picks **9**, ask: "What topic? (e.g., 'DEP', 'TAC', 'maintenance window', 'vector search')"
- If the user picks **10**, ask: "What kind of architecture? (e.g., 'ADB + APEX', 'cross-region DR', 'data lakehouse')"