Skip to main content

Module engine

Module engine 

Source
Expand description

Pipeline orchestrator.

Pure function resolve_theme(ThemeInput) -> ThemeTokens: every stage’s input is the previous stage’s output, no I/O, no globals. That purity is what makes the golden-file tests stable and what lets the CLI report each case’s effect deterministically.

Stage order matters. See §10 of the implementation brief.

Structs§

ResolveReport
Per-case effects recorded during a pipeline run, intended for the CLI to surface to the developer. Building this alongside the tokens means the engine’s reasoning is transparent — no separate “explain” pass that could diverge.
ThemeInput
The client’s raw theme request.
ThemeTokens
The fully-resolved, safe set of tokens the UI consumes. Field names match the --rio-* custom properties emitted by emit.rs.

Constants§

DEFAULT_BRAND
Safe default brand color used when the client supplies none (Case 7). A quiet blue-gray that passes contrast against white automatically and sits in a mid lightness band so it survives a future dark mode without adjustment.

Functions§

resolve_theme
Top-level pipeline. Pure; same input always yields the same output.
resolve_theme_with_report
Pipeline plus per-case effect log. The CLI uses this; tests use the report fields to assert which stages fired.