# Recoil visual engine — overview (AUTO-GENERATED, phase-level)

The engine spans 27 capabilities. Mapped so far: 16 capabilities, 21 entrypoints, 17 feedback loops, 19 architectural divergences.

## Pipeline spine

`script_breakdown → asset_prep → scene_assembly → storyboard → payload_dispatch → generation → review_reroll`

### Script Breakdown
Episode script (ep_NNN.md) is broken down into the per-episode mention ledger — the scene→ location/sublocation/prop/wardrobe/character mentions that downstream ref resolution reads.
- produces: {project}/prep/ep_NNN/breakdown/mention_ledger.json
- next: scene_assembly

### Asset Prep
Reference assets are produced + promoted: character angle sheets, composite ref SHEETS, and the sublocation/location registry. Feeds both board and video ref resolution. (Currently fragmented across three promotion writers — see ref_promotion_three_writers divergence.)
- produces: per-kind via ProjectPaths.sheet_path — char {project}/assets/char/<subject>/base/sheets/, loc {project}/assets/loc/<subject>/sheets/, prop {project}/assets/prop/<subject>/ (loc/prop do NOT use base/sheets/), {project}/assets/loc/{location_id}/base/location.json, {project}/assets/{cls}/{subject}/{role|hero}.{ext}, {project}/assets/{cls}/{subject}/base/pool/{kind}/
- next: storyboard → payload_dispatch

### Scene Assembly
Shots are clustered into scenes/beats/takes by the grouping strategy and persisted as the scene SSOT (BATCH/ONER ids). Board + video both re-read these persisted scenes.
- produces: _pipeline/state/orchestration/scenes/{episode}_{scene_id}.json   (e.g. ep_001_BATCH_004.json, ep_001_ONER_002.json, ep_001_<pass_id>.json)
- next: storyboard → payload_dispatch

### Storyboard
Storyboard generation: a pencil-tier strip is proposed + story-gated, then (on approval) a full-size photoreal finish. Board CHAR/prop refs are per-kind individual; the LOCATION ref is the composite SHEET when locked + use_composite_sheets on (REC-213 C3, same resolve_sheet_asset route as video — ref_system_split).
- produces: <project_root>/prep/ep_NNN/storyboards/{batch_id}_vNN.png, <project_root>/prep/ep_NNN/storyboards/{batch_id}_vNN.finish.png, <project_root>/prep/ep_NNN/storyboards/{batch_stem}.verdict.json, manifest.execution.boards[shotset_hash]
- next: payload_dispatch

### Payload Dispatch
Typed payload assembly + the single dispatch entry point: refs collected (composite sheets for video), prompt authored, payload validated, modality runner resolved. Emits the receipt log.
- produces: $RECOIL_ROOT/_dispatch_logs/receipts.jsonl, in-memory {logical_key: 1-based ImageN index} returned to prompt builders
- next: generation

### Generation
Generation execution: StepRunner drives the provider adapters (Flora primary / fal / atlas) to render video takes + keyframes; polls to terminal; writes takes + sidecars.
- produces: renders/ep_NNN/*.mp4, renders/ep_NNN/*.mp4.json, prep/ep_NNN/*.png, _pipeline/state/visual/ (provider call rows)
- next: review_reroll

### Review Reroll
Takes are story-gated / human-reviewed; failures re-enter via the reroll surface + the strategy engine (structured retry under the budget guard) until approved or exhausted.
- produces: {project}/prep/ep_NNN/storyboards/board_comments.json
- next: (terminal)
