feat(script): cinematography agents + asset library + hook composer#9
Merged
cuio merged 1 commit intofeat/visual-sota-stop-the-slideshowfrom Apr 25, 2026
Conversation
Three things in one PR — the planner stops being template-only and
starts directing cinematography, scenes get a much richer kit of
visual presets to draw on, and a cheap second-pass critic protects
the cold-open.
Asset library:
- Four new atmosphere presets bringing the registry from 5 → 9:
- radial-pulse: concentric ring pulses from canvas centre. Magnetises
the eye for centred hero elements (hook-statreveal).
- cosmic-dust: sparse twinkling stars + two drifting halos. Cosmic
scale feel for hooks/outros.
- geometric-grid: drifting + pulsing isometric grid lines.
Engineering aesthetic for chart-scene and comparison.
- flow-lines: wavy horizontal SVG paths drifting across the canvas.
Audio-waveform vibe for quote scenes and time-series charts.
- New icons/ registry — 20 hand-drawn 24x24 stroke SVGs (lock, network,
bolt, dollar, globe, target, shield, etc). Pure geometric primitives,
no third-party paths. Renders at any size, picks up token colours via
currentColor.
- concept-callout items can now carry an icon that REPLACES the number
badge: { text, icon } per item, mixed with plain strings allowed.
Backwards-compatible with existing scripts that pass plain strings.
Slice 8 — planner cinematography:
- New "Cinematography" section in playbook teaches the AI when to pick
each atmosphere preset, which transition fits which moment, and
which icon belongs on which list item.
- Planner tool schema gains optional background and transition fields
per scene, both as enums of registered ids. Unknown values fall back
to defaults so a hallucination can't break assembly.
- After the first planner pass, schema validation walks every scene
and flags missing required props or chart-scene without chart.type /
chart.props matching the chart's required fields. Issues are sent
back as a corrective system prompt for ONE retry — turns ~90% first-
pass success into ~99% at the cost of one extra round-trip on the
failing case. Lingering issues land in meta.warnings so the UI can
surface them.
Slice 9 — hook composer pass:
- New improveHook(script, opts) that critiques s01 against the hook
quality checklist and either keeps it or proposes a swap with a
stronger sentence later in the script. Cheap (~1k input + 200 output
tokens, ~$0.01/video on Sonnet 4.6).
- Verbatim fidelity skips by contract — strict mode never swaps.
Refine and split-merge run the critic.
- Wired into POST /projects/:id/script/plan as an optional second pass,
default on. Body flag improveHook=false skips. Decision and reasoning
surface in meta.warnings.
- Failures are non-fatal: a failed critic call returns the original
script with a reasoning string instead of bubbling.
Verified: assembled the existing my-first-video with explicit overrides
to props.background = radial-pulse / cosmic-dust / geometric-grid /
flow-lines on different scenes. All four new presets reach the
assembler and render correctly. Concept-callout with mixed string and
{text, icon} items renders icon SVGs inside badges where set, plain
two-digit numbers elsewhere.
4 tasks
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
Three things in one PR — the planner stops being template-only and starts directing cinematography, scenes get a much richer visual kit to draw on, and a cheap second-pass critic protects the cold-open.
Stacked on PR #7 — branch off it because slice 8 needs the atmosphere/transition registries it adds.
Asset library
radial-pulse— concentric ring pulses from canvas centre. Magnetises the eye for centred hero elements (hook-statreveal).cosmic-dust— sparse twinkling stars + two drifting halos. Cosmic scale feel for hooks/outros.geometric-grid— drifting + pulsing isometric grid lines. Engineering aesthetic for chart-scene and comparison.flow-lines— wavy horizontal SVG paths drifting across the canvas. Audio-waveform vibe for quote scenes and time-series charts.packages/core/src/script/icons/with 20 hand-drawn 24×24 stroke SVGs (lock, network, bolt, dollar, globe, target, shield, etc). Pure geometric primitives, no third-party paths. Renders at any size, picks up token colours viacurrentColor.concept-calloutitems can now carry aniconthat replaces the number badge:{ text, icon }per item, mixed with plain strings allowed. Backwards-compatible.Slice 8 — planner cinematography
backgroundandtransitionfields per scene, both as enums of registered ids. Unknown values fall back to defaults so a hallucination can't break assembly.chart.type/chart.propsmatching the chart's required fields. Issues are sent back as a corrective system prompt for ONE retry — turns ~90% first-pass success into ~99% at the cost of one extra round-trip on the failing case. Lingering issues land inmeta.warningsso the UI can surface them.Slice 9 — hook composer pass
improveHook(script, opts)that critiques s01 against the hook quality checklist and either keeps it or proposes a swap with a stronger sentence later in the script. Cheap (~1k input + 200 output tokens, ~$0.01/video on Sonnet 4.6).POST /projects/:id/script/planas an optional second pass, default on. Body flagimproveHook=falseskips. Decision and reasoning surface inmeta.warnings.Test plan
renderIconproduces inline SVG with stroke colour appliedconcept-callouttemplate emits SVG inside.co-badgewhen items pass{text, icon}, two-digit number when items pass plain stringmy-first-videowith explicitprops.backgroundoverrides on different scenes —geometric-gridrenders crisp diagonal accent lines with vignette;cosmic-dustshows dual halos driftingNotes on cost
Stack