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,289 @@
# Auto-extracted absolute_layout template from
# kb/diagram/assets/archcenter-refs/oracle-db-at-azure-migration/oracle-db-at-azure-zdm-oracle/oracle-db-at-azure-zdm.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: c1
type: region
label: ''
x: 1280
y: 0
w: 327
h: 447
- id: c21
type: region
label: ''
x: 0
y: 0
w: 269
h: 447
- id: c7
type: region
label: ''
x: 1366
y: 230
w: 78
h: 14
- id: c9
type: region
label: ''
x: 1372
y: 260
w: 66
h: 14
- id: c8
type: region
label: ''
x: 1376
y: 245
w: 58
h: 14
services:
- id: s3
type: TODO_identify
label: ''
x: 1285
y: 27
w: 42
h: 40
- id: s2
type: TODO_identify
label: ''
x: 1286
y: 27
w: 41
h: 39
- id: s4
type: TODO_identify
label: ''
x: 1286
y: 28
w: 40
h: 38
- id: s6
type: TODO_identify
label: ''
x: 1144
y: 76
w: 39
h: 28
- id: s5
type: TODO_identify
label: ''
x: 1164
y: 92
w: 43
h: 47
- id: s23
type: TODO_identify
label: ''
x: 143
y: 100
w: 63
h: 60
- id: s22
type: TODO_identify
label: ''
x: 144
y: 100
w: 61
h: 59
- id: s24
type: TODO_identify
label: ''
x: 144
y: 101
w: 60
h: 58
- id: s32
type: TODO_identify
label: ''
x: 562
y: 108
w: 47
h: 63
- id: s36
type: TODO_identify
label: ''
x: 319
y: 132
w: 42
h: 42
- id: s35
type: TODO_identify
label: ''
x: 320
y: 133
w: 41
h: 41
- id: s37
type: TODO_identify
label: ''
x: 320
y: 133
w: 40
h: 41
- id: s34
type: TODO_identify
label: ''
x: 562
y: 138
w: 46
h: 32
- id: s33
type: TODO_identify
label: ''
x: 563
y: 138
w: 46
h: 32
- id: s11
type: TODO_identify
label: ''
x: 1162
y: 218
w: 48
h: 63
- id: s10
type: TODO_identify
label: ''
x: 1163
y: 218
w: 46
h: 62
- id: s19
type: TODO_identify
label: ''
x: 1501
y: 218
w: 55
h: 63
- id: s20
type: TODO_identify
label: ''
x: 1503
y: 219
w: 34
h: 25
- id: s30
type: TODO_identify
label: ''
x: 148
y: 221
w: 56
h: 63
- id: s16
type: TODO_identify
label: ''
x: 863
y: 221
w: 63
h: 63
- id: s29
type: TODO_identify
label: ''
x: 148
y: 222
w: 55
h: 61
- id: s31
type: TODO_identify
label: ''
x: 149
y: 222
w: 53
h: 60
- id: s15
type: TODO_identify
label: ''
x: 864
y: 222
w: 61
h: 61
- id: s17
type: TODO_identify
label: ''
x: 864
y: 222
w: 60
h: 60
- id: s18
type: TODO_identify
label: ''
x: 885
y: 229
w: 36
h: 41
- id: s13
type: TODO_identify
label: ''
x: 1172
y: 231
w: 29
h: 48
- id: s14
type: TODO_identify
label: ''
x: 1172
y: 231
w: 29
h: 48
- id: s12
type: TODO_identify
label: ''
x: 1173
y: 232
w: 27
h: 46
- id: s38
type: TODO_identify
label: ''
x: 697
y: 322
w: 55
h: 63
- id: s39
type: TODO_identify
label: ''
x: 699
y: 324
w: 34
h: 25
- id: s26
type: TODO_identify
label: ''
x: 165
y: 340
w: 36
h: 34
- id: s25
type: TODO_identify
label: ''
x: 166
y: 341
w: 35
h: 32
- id: s28
type: TODO_identify
label: ''
x: 146
y: 378
w: 32
h: 25
- id: s27
type: TODO_identify
label: ''
x: 147
y: 378
w: 30
h: 24
labels: []
connections: []