Add template render type with per-section model resolution#14
Merged
nicpottier merged 4 commits intomainfrom Feb 11, 2026
Merged
Add template render type with per-section model resolution#14nicpottier merged 4 commits intomainfrom
nicpottier merged 4 commits intomainfrom
Conversation
Introduce a render strategy system that maps section types to named strategies, each combining a render type with its configuration. Two render types are supported: "html" (LLM-based, existing behavior) and "template" (deterministic Liquid templates, no LLM call). - Add RenderType, RenderStrategyConfig to AppConfig schema - Split rendering into render-html.ts and render-template.ts - Refactor web-rendering.ts with SectionPart union type, resolveParts, and dispatcher that routes to html or template renderer - Add createTemplateEngine (plain Liquid, no custom tags) - Template output validated with same validateSectionHtml as LLM output - Update config.yaml with render_strategies and two_column template - Add two_column_render.liquid template - 266 tests passing
…mprovements - Support per-section LLM model resolution with cached model instances - Add XSS escaping (| escape filters) to all template outputs - Improve HTML validation with stricter section tag checks - Update callers (cli, pipeline-runner, page-edit-service) for model resolver pattern - Add tests for strategy fallback, per-section models, XSS escaping, and validation
All render types produce HTML, so "html" was misleading. Renamed to "llm" to clearly distinguish LLM-based rendering from template-based rendering.
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.
Summary
Implement a config-driven render strategy system with support for both LLM-based and deterministic Liquid template rendering. Each section type can be mapped to a named strategy with its own render type and configuration.
Key Changes
render_strategies) withrender_type("llm" or "template") and type-specific config. Section types map to strategies viasection_render_strategies, withdefault_render_strategyas fallback.templaterender type using Liquid templates from/templates/for fast, deterministic rendering without LLM calls.render-llm.ts(LLM-based) andrender-template.ts(Liquid templates), orchestrated byweb-rendering.ts.| escapefilters to prevent HTML injection.Test Plan
two_column_render.liquid(single text, two columns, two images, XSS)