feat(emit): corporate theming as data — palette/typography tokens in YAML (#64)#81
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (#64)
Corporate identity was hardcoded three times over:
emit_pptxRGB constants +font.name = "Calibri",emit_docxre-declaring the same palette,emit_svgcarrying a thirdTHEMESdict. 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
os/themes/<name>.yaml— design tokens (font +accent/body/muted/card/background), one file per theme.professional.yamlis byte-for-byte the old constants (default output unchanged);scientific.yamlmoves the emit_svg variant to data. Adding a corporate theme = adding one YAML file.tools/themes.py— cached loader +rgbhelper. 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 thepresentation/mindmap/architectureregistries — validated by the existinggate_registry_paramsmachinery, zero new gate code. The deck / graph / topology IRs carry the resolved theme name, so emitters stay IR-driven. The infographic keepsvisual_styleas its selector; its palette now loads from the same theme files.emit_pptx/emit_docx/emit_svgread tokens instead of constants; the pptx typeface comes from the theme'sfonttoken.Verification
diff'd clean.0B3D5Cverified inside the emitted .pptx binary and in the SVG; amberB86B00present in both themes.neon) rejected by the registry gate; deck-IRthemestamp covered;os/deck-ir/_schema.mdupdated.The
--template corporate.pptxslide-master inheritance is the issue's stretch goal — left for a separate PR as suggested.Closes #64
🤖 Generated with Claude Code