# V3 Broadcast

The automated 3D broadcast of the Team Racing World Championship — **V3 Phase 1**. Built greenfield
as a read-through over V2 data; design + status in [`../../docs/V3-broadcast.md`](../../docs/V3-broadcast.md).

**Status (verified 2026-08-15):** the full live data path — scoring → **AI-assisted director**
(bounded LLM editor) → the IAM-private single-instance Cloud Run producer → authenticated loopback
relay → renderer that follows the live edge — is implemented. OBS safety scenes are installed; a hidden
Windows cache follows camera slot A and preserves verified, visibly stale-labelled footage across
race handovers. The director is
**engine-authoritative, AI-assisted**: the AI selects commentary pacing + camera shot among engine
options (offline Opus, live Haiku, deterministic fallback). What's left to go live and to make the
director *more* AI-driven: see [`../../docs/V3-broadcast.md` § 0](../../docs/V3-broadcast.md).

Anonymous producer requests are `403`; raw scene/SSE is available only to explicitly authorised
Cloud Run invokers and never directly to OBS, a LAN address, or a public browser. The current producer
is independent of the OBS workstation. The local technical card is independent
of the producer and application. Full public-output redundancy is **not** yet claimed: the protected
cloud standby VM is stopped and has no backup distribution destination. Operational authority:
[`../../docs/trwc-emergency-broadcast-runbook.md`](../../docs/trwc-emergency-broadcast-runbook.md).

Three parts, one contract:

| Folder | What it is | Depends on |
|---|---|---|
| [`core/`](core/) | The **shared** engine + renderer + the `BroadcastFeed` contract — reused verbatim by demo and live. `v3/scoring/` (scoring + commentary engine), `core/web/` (Three.js scene, overlays, director, the file feed, the config seam; 3D-model API: [`core/web/MODELS.md`](core/web/MODELS.md); optional SpaceMouse operator camera: [`core/web/SPACEMOUSE.md`](core/web/SPACEMOUSE.md)). | — |
| [`demo/`](demo/) | The **dev/test harness**: file-backed feed, the real-race export + synthetic-race generators, and the data. Fast, local, zero-infra sandbox + golden-file test bed. | `core/` |
| [`live/`](live/) | The live V3 service. **Data path implemented & tested** (streaming scorer, SSE LiveFeed server + client, the live bounded-AI editor, neural TTS); the two external-I/O seams (V2 input, OBS→RTMP) are implemented **to-spec** pending live verification. Status table in [`live/README.md`](live/README.md). | `core/` |

## Run the demo
The renderer defaults to the demo (`core/web/config.js` → `feed: 'file'`). See
[`demo/README.md`](demo/README.md) for export + serve instructions. In short: serve **this folder**
(`v3/broadcast/`) over HTTP and open `core/web/index.html`; it reads `demo/data/races/manifest.json`.

## The seam
`core/web/config.js` selects the data source without touching the renderer: `feed: 'file'` →
`FileFeed` (demo) or `feed: 'live'` → `LiveFeed` (the `live/` stub). Same `BroadcastFeed` interface
either way — that is what keeps production a swap-of-seams rather than a rewrite.
