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,499 @@
# Auto-extracted absolute_layout template from
# kb/diagram/assets/archcenter-refs/rep-fusion-saas-third-party-dw/fusion-saas-to-snowflake-arch-oracle/fusion-saas-to-snowflake-arch.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: 0
y: 0
w: 738
h: 498
- id: c19
type: region
label: ''
x: 98
y: 387
w: 41
h: 14
- id: c6
type: region
label: ''
x: 685
y: 182
w: 2
h: 63
services:
- id: '11'
type: TODO_identify
label: ''
x: 0
y: 0
w: 41
h: 39
- id: '12'
type: TODO_identify
label: ''
x: 0
y: 0
w: 42
h: 40
- id: '16'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 60
- id: '37'
type: TODO_identify
label: ''
x: 0
y: 0
w: 42
h: 42
- id: '38'
type: TODO_identify
label: ''
x: 0
y: 0
w: 41
h: 41
- id: '39'
type: TODO_identify
label: ''
x: 0
y: 0
w: 42
h: 42
- id: '59'
type: TODO_identify
label: ''
x: 0
y: 0
w: 42
h: 42
- id: '60'
type: TODO_identify
label: ''
x: 0
y: 0
w: 41
h: 41
- id: '61'
type: TODO_identify
label: ''
x: 0
y: 0
w: 42
h: 42
- id: '79'
type: TODO_identify
label: ''
x: 0
y: 0
w: 42
h: 42
- id: '80'
type: TODO_identify
label: ''
x: 0
y: 0
w: 41
h: 41
- id: '81'
type: TODO_identify
label: ''
x: 0
y: 0
w: 42
h: 42
- id: '88'
type: TODO_identify
label: ''
x: 0
y: 0
w: 62
h: 48
- id: '89'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 50
- id: '100'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 63
- id: '101'
type: TODO_identify
label: ''
x: 0
y: 0
w: 61
h: 62
- id: '102'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 63
- id: '113'
type: TODO_identify
label: ''
x: 0
y: 0
w: 58
h: 61
- id: '114'
type: TODO_identify
label: ''
x: 0
y: 0
w: 59
h: 63
- id: '128'
type: TODO_identify
label: ''
x: 0
y: 0
w: 62
h: 58
- id: '129'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 60
- id: '136'
type: TODO_identify
label: ''
x: 0
y: 0
w: 62
h: 58
- id: '137'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 60
- id: '144'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 48
- id: '145'
type: TODO_identify
label: ''
x: 0
y: 0
w: 61
h: 46
- id: '146'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 48
- id: '157'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 63
- id: '158'
type: TODO_identify
label: ''
x: 0
y: 0
w: 62
h: 62
- id: '159'
type: TODO_identify
label: ''
x: 0
y: 0
w: 63
h: 63
- id: '13'
type: TODO_identify
label: ''
x: 1
y: 0
w: 40
h: 38
- id: '40'
type: TODO_identify
label: ''
x: 1
y: 1
w: 40
h: 40
- id: '62'
type: TODO_identify
label: ''
x: 1
y: 1
w: 40
h: 40
- id: '82'
type: TODO_identify
label: ''
x: 1
y: 1
w: 40
h: 40
- id: '95'
type: TODO_identify
label: ''
x: 1
y: 1
w: 60
h: 30
- id: '115'
type: TODO_identify
label: ''
x: 1
y: 1
w: 39
h: 26
- id: '147'
type: TODO_identify
label: ''
x: 1
y: 1
w: 60
h: 45
- id: '160'
type: TODO_identify
label: ''
x: 1
y: 1
w: 60
h: 60
- id: '161'
type: TODO_identify
label: ''
x: 1
y: 1
w: 60
h: 60
- id: '17'
type: TODO_identify
label: ''
x: 2
y: 1
w: 59
h: 29
- id: '130'
type: TODO_identify
label: ''
x: 9
y: 1
w: 53
h: 47
- id: '138'
type: TODO_identify
label: ''
x: 9
y: 1
w: 53
h: 47
- id: '107'
type: TODO_identify
label: ''
x: 1
y: 7
w: 60
h: 54
- id: '41'
type: TODO_identify
label: ''
x: 1
y: 14
w: 29
h: 26
- id: '63'
type: TODO_identify
label: ''
x: 1
y: 14
w: 29
h: 26
- id: '103'
type: TODO_identify
label: ''
x: 10
y: 14
w: 42
h: 40
- id: '26'
type: TODO_identify
label: ''
x: 17
y: 30
w: 35
h: 30
- id: '133'
type: TODO_identify
label: ''
x: 1
y: 32
w: 26
h: 26
- id: '141'
type: TODO_identify
label: ''
x: 1
y: 32
w: 26
h: 26
- id: s13
type: TODO_identify
label: ''
x: 786
y: 38
w: 63
h: 60
- id: s2
type: TODO_identify
label: ''
x: 677
y: 52
w: 42
h: 40
- id: s20
type: TODO_identify
label: ''
x: 708
y: 61
w: 77
h: 130
- id: s4
type: TODO_identify
label: ''
x: 635
y: 93
w: 42
h: 42
- id: s12
type: TODO_identify
label: ''
x: 404
y: 165
w: 59
h: 63
- id: s3
type: TODO_identify
label: ''
x: 782
y: 167
w: 63
h: 60
- id: s15
type: TODO_identify
label: ''
x: 536
y: 180
w: 63
h: 48
- id: s7
type: TODO_identify
label: ''
x: 665
y: 182
w: 55
h: 66
- id: s21
type: TODO_identify
label: ''
x: 708
y: 212
w: 77
h: 190
- id: s16
type: TODO_identify
label: ''
x: 523
y: 232
w: 169
h: 37
- id: s5
type: TODO_identify
label: ''
x: 635
y: 288
w: 42
h: 42
- id: s10
type: TODO_identify
label: ''
x: 184
y: 360
w: 63
h: 63
- id: s17
type: TODO_identify
label: ''
x: 403
y: 360
w: 63
h: 63
- id: s14
type: TODO_identify
label: ''
x: 786
y: 364
w: 63
h: 60
- id: s8
type: TODO_identify
label: ''
x: 17
y: 373
w: 63
h: 50
- id: s9
type: TODO_identify
label: ''
x: 24
y: 428
w: 102
h: 37
- id: s11
type: TODO_identify
label: ''
x: 186
y: 428
w: 118
h: 37
- id: s18
type: TODO_identify
label: ''
x: 393
y: 428
w: 186
h: 37
labels: []
connections: []