Sandwich Architecture

Workshop's architecture is a sandwich: LLM reasoning on the outside, a deterministic compiler in the middle. Neither layer alone is sufficient. Together, they solve problems that neither can solve independently.

Why Neither Layer Works Alone

LLMs alone generate creative content but cannot guarantee structural correctness. An LLM asked to produce a video specification will hallucinate invalid properties, generate inconsistent timing, and produce different output on every run. There is no way to enforce brand constraints, validate syntax, or ensure deterministic reproduction.

Compilers alone enforce rules perfectly but cannot make creative decisions. A compiler cannot look at a business prompt and decide how many scenes to use, what text to write, which mood fits the content, or how to structure a narrative arc.

The Sandwich

Workshop puts the LLM at the authoring layer and the compiler at the execution layer:

text
User Prompt
  → LLM (Creative Reasoning)
    → .ws Script
      → Compiler (Deterministic)
        → RenderGraph
          → Renderer (Deterministic)
            → MP4 Video

The LLM generates a .ws script — making creative decisions about scene structure, text content, mood selection, entrance choices, and narrative pacing. The compiler validates, resolves all design parameters deterministically, and produces a RenderGraph rendered identically every time.

The Validation Gate

The critical mechanism connecting the two layers is the validation gate. When the LLM generates a .ws script, the compiler attempts a headless compilation before the script reaches the user.

If the LLM produces invalid syntax — a hallucinated entrance name, an impossible timing value, a nonexistent mood — the compiler emits a precise error trace. This trace is fed back to the LLM, which self-corrects. The loop continues until compilation succeeds or a maximum retry count is reached.

This self-healing loop is why the /api/author endpoint returns syntactically valid .ws scripts. The compiler is the validation oracle; the LLM is the creative generator.

What Each Layer Owns

Concern Owned By
Scene count, structure, narrative arc LLM
Text content, copywriting LLM
Mood selection LLM
Entrance and emphasis choices LLM
Syntax correctness Compiler
Brand constraint enforcement Compiler
Timing calculation Compiler
Layout positioning Compiler
Spring physics Compiler
Deterministic output Compiler
Frame-level precision Renderer
Video encoding Renderer

Platform Adapters Extend the Sandwich

The sandwich extends to AI video generation tools. Workshop compiles the deterministic foreground (text, data, logos, charts) and generates structured prompts for AI video platforms (Sora, Runway, Kling, Veo) to create atmospheric backgrounds.

Workshop owns what must be exact. AI video tools contribute what benefits from generative creativity. The .ws script is the single source of truth for both.

Why This Matters for Production

In production, you need to change a headline and re-render without the entire video changing. You need every video in a campaign to use the same visual identity. You need legal to approve a system once, not review every output.

The sandwich architecture provides all of this. The LLM gets you from zero to a working script quickly. The compiler ensures the script meets structural and brand requirements. The renderer produces identical output on every run. Editing is changing text in the .ws file, not re-prompting and hoping.

Next Steps