PRD: K-TV Post-Restructure Roadmap — Playout Service, Interstitials, Worker Integration #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
K-TV's backend has been restructured into a proper DDD hexagonal architecture (13 crates, 3 ADRs, domain glossary). The domain model now describes concepts — Playout Service, Interstitials, Mid-Roll Breaks, Chapters, Gap Filler, Overlays, 6 FillStrategies — that have data structures in the code but no runtime behavior. The system still streams via provider-proxied URLs rather than owning the stream, background tasks exist in a Worker binary but the Playout Service binary doesn't exist yet, and the frontend assumes the old API shape.
The Operator has 120 movies and 12 TV shows. They want an agent (via MCP) to act as a creative programming director — designing thematic channels, scheduling marathons, inserting bumpers — but the engine can't do most of that yet.
Solution
Build the remaining runtime components in priority order: wire the schedule engine's new concepts (interstitials, mid-roll breaks, new fill strategies), build the Playout Service binary (HLS via FFmpeg, SCTE-35, shared broadcast), update the frontend and deployment for the 3-binary architecture, and add iCalendar import/export.
User Stories
Implementation Decisions
Architecture (established)
Phase 1: Schedule Engine Wiring
Phase 2: Chapter Extraction
Phase 3: Playout Service Binary
crates/playout/— binaryk-tv-playout..m3u8playlist +.tssegments.Phase 4: Frontend + Deployment
/api/docsendpoint.Phase 5: iCalendar Import/Export
Testing Decisions
What makes a good test
Tests verify behavior through the module's public interface (the seam), not implementation details. A test should break only when behavior changes, not when internals are refactored.
Testing seams
Prior art
domain/src/services/schedule/tests/fill.rs— fill strategy tests with synthetic candidate poolsdomain/src/services/schedule/tests/rotation.rs— rotation policy testsapplication/src/auth/tests/— use case tests with InMemory reposdomain/src/services/tests/iptv.rs— pure function output testsOut of Scope
Further Notes
crates/CONTEXT.mdis the source of truth for terminology. All implementation should use glossary terms.