# Streetcast Runtime Parity ## Covered - Manifest polling: covered by `/player/[screenId]` lightweight runtime refresh loop. - Sequential creative playback: covered by runtime rotation over active manifest creatives. - Local media cache: covered by screen-scoped browser cache with cached blob playback preference. - Background preload: covered by manifest-driven media warming after each runtime refresh. - Offline continuity: covered by last-good-manifest retention plus cached blob playback fallback. - Impression retry queue: covered by bounded browser queue flushed on interval and `online` events. - Browser automation parity: covered by Playwright cached-blob/offline checks on `/player/[screenId]`. ## Intentionally Different - Ballbox runtime uses Ballbox-owned manifest/impression APIs instead of Streetcast endpoints. - The production TV runtime path is `/player/[screenId]`. - Playback source of truth is Ballbox Postgres scheduling, not legacy Streetcast ownership data. ## Still Pending - Real-device verification is still required before calling Streetcast migration complete. - The missing proof is hardware/browser behavior for CacheStorage plus object-URL playback outside local desktop automation. - The runtime now ships an on-screen `Export parity snapshot` action that downloads a JSON snapshot (screen id, manifest/playback/cache/network/reporting state, user agent, capture time) to standardize evidence capture. - Seeded local evidence now has active TV programming again after the TV seed campaign windows were extended in `prisma/seed-data.ts`, so parity runs can use stock `screen_001` after `pnpm db:seed`. ## Local Validation Update (2026-04-19) - Machine-local Playwright harness is now installed outside the repo at `/mnt/rpi/repos/browser-harness` and verified separately for Chromium, CacheStorage, and object-URL baseline support. - Ballbox repo Playwright now uses a production-style built-in `webServer` flow on this Pi (`pnpm build:e2e && pnpm start:e2e` on port `3020`) instead of the unstable `pnpm dev` path. - Stock seed data now provides active TV programming for `screen_001` after `pnpm db:seed`, so local cached-blob playback, first impression write, queued-impression recovery, and manifest-refresh-failure continuity can be validated without manual TV fixture repair first. ## Manual Real-Device Check 1. Open `/player/screen_001` on the target TV/browser with Ballbox pointed at the real/shared DB. 2. Wait for the runtime diagnostics card to show: - `Playback: cached` - `Active source: blob` - `Cache API: available` - `Cached creatives: 1` or higher - `Network: online` 3. Confirm the video starts and loops without a visible reload gap while the diagnostics stay on `blob`. 4. Disconnect network on the device or gateway after the blob source is active. 5. Confirm the runtime keeps playing and the diagnostics switch to: - `Network: offline` - `Playback: cached` - `Active source: blob` 6. Keep the device offline past one manifest refresh interval and verify `Manifest refresh: failed` appears without playback stopping. 7. Reconnect network and confirm: - `Network: online` - queued impressions eventually return to `0` - heartbeat timestamp advances again 8. Capture evidence: - photo/video of the runtime while online and offline - browser version / device model - exact screen id used - JSON file exported from `Export parity snapshot` in both online and offline moments - any deviation from the expected diagnostics ## Exit Criteria - One real device shows cached blob playback before and during an offline window. - Runtime keeps playing through at least one failed manifest refresh while offline. - Heartbeat and impression reporting recover after reconnect. - This doc should be updated with the device/browser/date/result once the run happens.