# Live-play playback subsystem The live-play surface (`POST /v1/interactive/play/sessions/{sid}/chat` + `GET /pending`) runs the real-time scene-generation loop: chat arrives, the planner composes a scene, a render job goes to the video backend, and the clip streams back to the `InteractivePlayer` in the frontend. ## Module map | File | Responsibility | |---|---| | `scene_memory.py` | Rolling context snapshot (persona, mood, last N turns, synopsis). Pure, synchronous. | | `scene_planner.py` | `plan_next_scene` (sync heuristic) + `plan_next_scene_async` (LLM first, heuristic fallback). | | `llm_composer.py` | LLM-backed composer — `app.llm.chat_ollama` with strict JSON mode. | | `video_job.py` | `ix_scene_queue` CRUD + `render_now` (sync stub) + `render_now_async` (real-first, stub fallback). | | `render_adapter.py` | Thin async wrapper over `app.comfy.run_workflow` + `app.asset_registry.register_asset`. | | `asset_urls.py` | `resolve_asset_url` — registry lookup for the frontend `