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,457 @@
# Auto-extracted absolute_layout template from
# kb/diagram/assets/archcenter-refs/cloud-native-dicom-on-oci/oci-dicom-store-oracle/oci-dicom-store.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: c2
type: region
label: ''
x: 380
y: 0
w: 644
h: 498
- id: c1
type: region
label: ''
x: 0
y: 0
w: 234
h: 498
- id: c4
type: region
label: ''
x: 930
y: 383
w: 32
h: 60
services:
- id: s3
type: TODO_identify
label: ''
x: 407
y: 40
w: 153
h: 175
- id: s41
type: TODO_identify
label: ''
x: 786
y: 40
w: 171
h: 167
- id: s50
type: TODO_identify
label: ''
x: 43
y: 80
w: 43
h: 60
- id: s9
type: TODO_identify
label: ''
x: 139
y: 85
w: 63
h: 46
- id: s8
type: TODO_identify
label: ''
x: 140
y: 85
w: 62
h: 45
- id: s43
type: TODO_identify
label: ''
x: 840
y: 88
w: 63
h: 63
- id: s42
type: TODO_identify
label: ''
x: 841
y: 89
w: 62
h: 62
- id: s44
type: TODO_identify
label: ''
x: 841
y: 90
w: 60
h: 60
- id: s47
type: TODO_identify
label: ''
x: 450
y: 91
w: 63
h: 63
- id: s46
type: TODO_identify
label: ''
x: 451
y: 91
w: 62
h: 62
- id: s53
type: TODO_identify
label: ''
x: 640
y: 91
w: 63
h: 63
- id: s52
type: TODO_identify
label: ''
x: 641
y: 91
w: 61
h: 62
- id: s48
type: TODO_identify
label: ''
x: 451
y: 92
w: 60
h: 60
- id: s54
type: TODO_identify
label: ''
x: 642
y: 98
w: 60
h: 54
- id: s51
type: TODO_identify
label: ''
x: 44
y: 99
w: 40
h: 26
- id: s10
type: TODO_identify
label: ''
x: 140
y: 106
w: 61
h: 25
- id: s45
type: TODO_identify
label: ''
x: 848
y: 118
w: 47
h: 25
- id: s49
type: TODO_identify
label: ''
x: 458
y: 120
w: 47
h: 25
- id: s26
type: TODO_identify
label: ''
x: 799
y: 236
w: 63
h: 59
- id: s14
type: TODO_identify
label: ''
x: 136
y: 237
w: 63
h: 62
- id: s25
type: TODO_identify
label: ''
x: 800
y: 237
w: 62
h: 58
- id: s27
type: TODO_identify
label: ''
x: 800
y: 237
w: 48
h: 33
- id: s18
type: TODO_identify
label: ''
x: 467
y: 238
w: 32
h: 61
- id: s15
type: TODO_identify
label: ''
x: 138
y: 239
w: 60
h: 27
- id: s17
type: TODO_identify
label: ''
x: 468
y: 239
w: 30
h: 60
- id: s20
type: TODO_identify
label: ''
x: 469
y: 240
w: 29
h: 58
- id: s30
type: TODO_identify
label: ''
x: 926
y: 240
w: 65
h: 57
- id: s29
type: TODO_identify
label: ''
x: 927
y: 240
w: 63
h: 56
- id: s12
type: TODO_identify
label: ''
x: 36
y: 241
w: 54
h: 60
- id: s31
type: TODO_identify
label: ''
x: 927
y: 241
w: 62
h: 30
- id: s11
type: TODO_identify
label: ''
x: 36
y: 242
w: 52
h: 58
- id: s13
type: TODO_identify
label: ''
x: 37
y: 242
w: 51
h: 57
- id: s19
type: TODO_identify
label: ''
x: 472
y: 242
w: 24
h: 54
- id: s57
type: TODO_identify
label: ''
x: 649
y: 244
w: 60
h: 54
- id: s56
type: TODO_identify
label: ''
x: 650
y: 245
w: 59
h: 53
- id: s58
type: TODO_identify
label: ''
x: 651
y: 245
w: 29
h: 52
- id: s55
type: TODO_identify
label: ''
x: 650
y: 249
w: 49
h: 62
- id: s5
type: TODO_identify
label: ''
x: 291
y: 255
w: 41
h: 28
- id: s6
type: TODO_identify
label: ''
x: 291
y: 255
w: 42
h: 29
- id: s7
type: TODO_identify
label: ''
x: 297
y: 255
w: 28
h: 28
- id: s32
type: TODO_identify
label: ''
x: 942
y: 255
w: 31
h: 40
- id: s28
type: TODO_identify
label: ''
x: 834
y: 259
w: 26
h: 35
- id: s59
type: TODO_identify
label: ''
x: 677
y: 263
w: 30
h: 34
- id: s16
type: TODO_identify
label: ''
x: 138
y: 270
w: 60
h: 27
- id: s21
type: TODO_identify
label: ''
x: 460
y: 364
w: 55
h: 61
- id: s22
type: TODO_identify
label: ''
x: 460
y: 364
w: 57
h: 63
- id: s61
type: TODO_identify
label: ''
x: 639
y: 364
w: 62
h: 63
- id: s60
type: TODO_identify
label: ''
x: 640
y: 364
w: 61
h: 61
- id: s62
type: TODO_identify
label: ''
x: 646
y: 365
w: 48
h: 45
- id: s23
type: TODO_identify
label: ''
x: 464
y: 373
w: 50
h: 50
- id: s24
type: TODO_identify
label: ''
x: 478
y: 377
w: 34
h: 31
- id: s34
type: TODO_identify
label: ''
x: 799
y: 379
w: 63
h: 63
- id: s33
type: TODO_identify
label: ''
x: 800
y: 380
w: 61
h: 62
- id: s37
type: TODO_identify
label: ''
x: 926
y: 380
w: 65
h: 62
- id: s35
type: TODO_identify
label: ''
x: 801
y: 381
w: 60
h: 60
- id: s36
type: TODO_identify
label: ''
x: 926
y: 381
w: 63
h: 60
- id: s38
type: TODO_identify
label: ''
x: 927
y: 381
w: 55
h: 55
- id: s39
type: TODO_identify
label: ''
x: 949
y: 390
w: 40
h: 38
- id: s63
type: TODO_identify
label: ''
x: 670
y: 392
w: 30
h: 34
- id: s40
type: TODO_identify
label: ''
x: 954
y: 394
w: 30
h: 30
labels: []
connections: []