Commit Graph

4 Commits

Author SHA1 Message Date
root
82d09aeee6 PPTX icon resolver: 50+ proactive aliases + menu-mode 'no code edits' rule
Diego flagged two patterns from the Codex session:

1. Aliases for natural-language slugs were missing — Codex authored
   ``type: refreshable_clone`` and ``type: oci_goldengate`` and the
   resolver returned None for both. Beyond fixing those two, expand
   the table proactively: 50+ slugs an SA / agent might naturally
   reach for (atp, alb, nlb, apigw, lambda, kms, secret, kafka,
   alarm, email, identity, iam, iac, terraform, oac, oic, language /
   speech / vision, rpc / lpg / cpe, health_check, tags, etc.) all
   mapped to canonical icon entries that exist in
   kb/diagram/oci-pptx-icons-index.json.

2. Codex was editing tools/oci_deck_gen.py and the deck-spec while
   fulfilling a menu-driven option-2 request — going off the
   procedure to "fix" perceived bugs in the renderer. New rule in
   SKILL.md § What You Do NOT Do: when the user is in menu mode
   (options 1–14), the agent USES the existing tools, never modifies
   them. Tool gaps (missing aliases, broken paths) get surfaced as
   end-of-reply follow-ups for a separate developer-mode session.
   Two narrow exceptions kept: kb/field-findings/tracker.yaml via
   option 11, and writing customer spec/output YAML under examples/.

Codex copy auto-synced via the pre-commit hook.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 23:18:22 -03:00
root
3fb832e578 PPTX connectors: emit native bentConnector2/3/5 instead of disjoint lines
Spec authors hand the renderer a polyline like
``points: [[210,280],[400,280],[700,130]]``. The previous code emitted
one ``prst="line"`` shape per segment, so the elbow was two separate
straight lines that PowerPoint cannot recognise as a connected path.

The OCI template (kb/diagram/assets/OCI_Icons.pptx) uses native
PowerPoint bent connectors instead — 98 ``straightConnector1`` plus
22 ``bentConnector2/3/5`` plus 15 ``line`` across 48 slides. Match
that convention:

  • 2 points  → straightConnector1 (one segment, unchanged)
  • 3 points  → bentConnector2     (one elbow)
  • 4 points  → bentConnector3     (S-shape, two elbows)
  • 5+ points → bentConnector5     (four elbows)

The rasterizer (oci_pptx_render.py) now also understands bentConnectorN
so the local PNG preview matches what real PowerPoint draws — without
this it rendered every connector as one straight diagonal regardless of
the prst.

Persistent: applies to every absolute_layout connector for every spec,
not a per-case patch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 21:49:39 -03:00
root
e384e627d1 PPTX icon resolver: prefer full icon group over text-strip variant
OCI_Icons.pptx ships both a full icon group (tag=grpSp, ~0.7" tall)
and a tiny "label strip" (tag=sp, ~0.2" tall) under the same slug for
many services. The previous resolver picked whichever came first in
the index, which for 'mysql' returned the text strip — so the PPTX
diagram showed a label-only shape instead of the dolphin/HeatWave
icon, while drawio rendered the proper stencil.

Two fixes, both persistent (apply to every icon family, not just MySQL):

- TYPE_TO_ICON for mysql/heatwave now lists 'mysql_heatwave' (the
  grpSp) before 'mysql' (the strip).
- _select_preferred_ref now filters viable refs to those that are
  either grpSp/pic OR have a bbox ≥0.4"x0.4" — text strips fall out
  before the scoring function runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 21:42:21 -03:00
root
b30a4f0d32 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>
2026-04-25 21:15:21 -03:00