Skip to content

feat(emit): corporate theming as data — palette/typography tokens in YAML (#64)#81

Merged
danielPoloWork merged 1 commit into
mainfrom
feat/theme-tokens-as-data
Jul 2, 2026
Merged

feat(emit): corporate theming as data — palette/typography tokens in YAML (#64)#81
danielPoloWork merged 1 commit into
mainfrom
feat/theme-tokens-as-data

Conversation

@danielPoloWork

Copy link
Copy Markdown
Owner

Problem (#64)

Corporate identity was hardcoded three times over: emit_pptx RGB constants + font.name = "Calibri", emit_docx re-declaring the same palette, emit_svg carrying a third THEMES dict. An enterprise consumer could not render a board deck in their corporate palette/typeface without editing three tools — violating "adding … is editing a validated YAML file, never a special case in code", and blocking the realistic GTM ask: "make it look like our template."

Fix — theme tokens as data

  • New os/themes/<name>.yaml — design tokens (font + accent/body/muted/card/background), one file per theme. professional.yaml is byte-for-byte the old constants (default output unchanged); scientific.yaml moves the emit_svg variant to data. Adding a corporate theme = adding one YAML file.
  • New tools/themes.py — cached loader + rgb helper. The amber "to verify" color is deliberately NOT a token: it is the grounding signal (RFC-0001 §6), reserved in code and identical across themes — a theme that camouflages assumptions defeats the safety model.
  • theme: param on the presentation / mindmap / architecture registries — validated by the existing gate_registry_params machinery, zero new gate code. The deck / graph / topology IRs carry the resolved theme name, so emitters stay IR-driven. The infographic keeps visual_style as its selector; its palette now loads from the same theme files.
  • emit_pptx / emit_docx / emit_svg read tokens instead of constants; the pptx typeface comes from the theme's font token.

Verification

  • Default output byte-identical on 33 SVG baselines (all 11 refs × infographic/mindmap/topology), diff'd clean.
  • A second theme demonstrably restyles from one YAML file: scientific accent 0B3D5C verified inside the emitted .pptx binary and in the SVG; amber B86B00 present in both themes.
  • Unknown theme (neon) rejected by the registry gate; deck-IR theme stamp covered; os/deck-ir/_schema.md updated.
  • 97/97 tests green.

The --template corporate.pptx slide-master inheritance is the issue's stretch goal — left for a separate PR as suggested.

Closes #64

🤖 Generated with Claude Code

…YAML (#64)

Corporate identity was hardcoded three times over: emit_pptx RGB
constants + 'Calibri', emit_docx re-declared the same palette, and
emit_svg carried a third THEMES dict. An enterprise consumer could not
render a board deck in their palette without editing three tools.

- New os/themes/<name>.yaml: design tokens (font + accent/body/muted/
  card/background), one file per theme. professional.yaml is byte-for-
  byte the old constants; scientific.yaml moves the emit_svg variant
  to data. Adding a corporate theme = adding one YAML file.
- New tools/themes.py: cached loader + rgb helper. The amber
  'to verify' color is deliberately NOT a token — it is the grounding
  signal (RFC-0001 §6), reserved in code and identical across themes;
  a theme that camouflages assumptions defeats the safety model.
- theme param on presentation / mindmap / architecture registries
  (validated by the existing gate machinery, zero new gate code); the
  deck / graph / topology IRs carry the resolved theme NAME so the
  emitters stay IR-driven. The infographic keeps visual_style as its
  selector — its palette now loads from the same theme files.
- emit_pptx / emit_docx / emit_svg read tokens instead of constants;
  the pptx typeface comes from the theme's font token.

Default output verified byte-identical on 33 SVG baselines (all refs ×
infographic/mindmap/topology); scientific accents verified inside the
emitted pptx binary; unknown theme rejected by the registry gate.
97/97 green. The --template corporate.pptx inheritance is left as the
issue's stretch goal for a separate PR.

Closes #64

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@danielPoloWork danielPoloWork added the enhancement New feature or request label Jul 2, 2026
@danielPoloWork danielPoloWork self-assigned this Jul 2, 2026
@danielPoloWork danielPoloWork marked this pull request as ready for review July 2, 2026 21:00
@danielPoloWork danielPoloWork merged commit 3c7ac19 into main Jul 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(emit): corporate theming as data — palette/typography tokens in YAML + optional .pptx template

1 participant