Extractor: drawio → absolute_layout YAML scaffold (107/132 cached)

Closes the procedural hole that kept making Codex sessions fall back
to ``examples/`` for YAML scaffolding even after the SKILL forbade it.

The lookup tool returns a canonical Oracle ``.drawio`` as the geometry
source, but the agent had no YAML version of that geometry to copy —
the .drawio is XML with stencil-encoded icons. Without a scaffold,
agents reverse-engineered or fell back to ``examples/`` (which is
forbidden but happened anyway because the alternative was painful).

New tool ``tools/archcenter_drawio_to_template.py`` extracts:
  • canvas dimensions
  • containers (region / vcn / ad / subnet) classified by stroke /
    fill style markers
  • service bounding boxes with ``type: TODO_identify`` (the icon
    type is encoded in stencil bytes — agent fills it from the
    renderer's TYPE_TO_ICON aliases when authoring the spec)
  • edge waypoints (source, target, points)

Output lands at ``kb/diagram/assets/archcenter-refs/<slug>/_template.yaml``
next to the .drawio. Lookup now surfaces it as
``cached: yaml=<path>`` so the agent has a one-step "copy this YAML
and adapt" path.

Ran across all 132 cached folders: 107 templates emitted, 24 had no
.drawio (zip didn't ship one), 1 already cached.

Other persistent guardrails added in this commit:

- SKILL.md option 2 step 3: explicit reminder that valid ``type:``
  values come from ``TYPE_TO_ICON`` / ``ICON_TYPE_ALIASES`` in the
  renderer source plus the icon-index JSON files. Do NOT grep
  ``examples/`` for ``type:`` — that's where the previous Codex
  session was looking, against the rule.

- ``make archcenter-templates-refresh`` Makefile target.

- The lookup index now also indexes ``_template.yaml`` per slug.

- Auto-extracted templates committed under
  ``kb/diagram/assets/archcenter-refs/*/_template.yaml`` so a fresh
  clone has them on first lookup (no extraction step needed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
root
2026-04-25 23:56:29 -03:00
parent 5b8a6ad5ec
commit b77a855a3e
114 changed files with 82215 additions and 121 deletions

View File

@@ -0,0 +1,198 @@
# Auto-extracted absolute_layout template from
# kb/diagram/assets/archcenter-refs/ai-fraud-detection/ai-fraud-detection-flow-oracle/ai-fraud-detection-flow.drawio
# Source: Oracle Architecture Center reference (canonical geometry).
# Use this as the starting scaffold for a new spec — copy, rename ids,
# and replace `type: TODO_identify` on services with the right OCI
# type alias (adb_s, drg, fastconnect, etc.). Container coords and
# edge waypoints are Oracle's canonical layout; preserve unless the
# customer's topology requires a change.
absolute_layout:
canvas:
width: 850
height: 1100
containers:
- id: c5
type: region
label: ''
x: 330
y: 381
w: 252
h: 125
- id: c1
type: region
label: ''
x: 330
y: 0
w: 252
h: 49
- id: c2
type: region
label: ''
x: 330
y: 136
w: 252
h: 49
- id: c3
type: region
label: ''
x: 0
y: 247
w: 252
h: 49
- id: c4
type: region
label: ''
x: 0
y: 382
w: 252
h: 49
- id: c6
type: region
label: ''
x: 660
y: 247
w: 252
h: 49
services:
- id: s9
type: TODO_identify
label: ''
x: 584
y: 159
w: 211
h: 87
- id: s10
type: TODO_identify
label: ''
x: 219
y: 169
w: 112
h: 75
- id: s11
type: TODO_identify
label: ''
x: 254
y: 270
w: 117
h: 111
- id: s12
type: TODO_identify
label: ''
x: 542
y: 270
w: 117
h: 111
- id: s23
type: TODO_identify
label: ''
x: 425
y: 416
w: 63
h: 63
- id: s22
type: TODO_identify
label: ''
x: 426
y: 417
w: 61
h: 61
- id: s24
type: TODO_identify
label: ''
x: 426
y: 417
w: 60
h: 60
- id: s25
type: TODO_identify
label: ''
x: 452
y: 423
w: 30
h: 24
- id: s26
type: TODO_identify
label: ''
x: 431
y: 424
w: 51
h: 30
- id: s7
type: TODO_identify
label: ''
x: 119
y: 475
w: 212
h: 67
- id: s8
type: TODO_identify
label: ''
x: 584
y: 475
w: 212
h: 61
- id: s17
type: TODO_identify
label: ''
x: 429
y: 539
w: 58
h: 63
- id: s20
type: TODO_identify
label: ''
x: 768
y: 539
w: 40
h: 63
- id: s16
type: TODO_identify
label: ''
x: 430
y: 540
w: 56
h: 61
- id: s19
type: TODO_identify
label: ''
x: 769
y: 540
w: 38
h: 62
- id: s18
type: TODO_identify
label: ''
x: 430
y: 541
w: 55
h: 59
- id: s21
type: TODO_identify
label: ''
x: 769
y: 541
w: 37
h: 60
- id: s13
type: TODO_identify
label: ''
x: 95
y: 548
w: 61
h: 53
- id: s14
type: TODO_identify
label: ''
x: 95
y: 548
w: 63
h: 55
- id: s15
type: TODO_identify
label: ''
x: 96
y: 549
w: 60
h: 52
labels: []
connections: []