# K-TV Parallel Execution Plan ## Strategy 3 parallel worktree tracks (zero file overlap), then a sequential tail after merging. ## Parallel Tracks ### Track A: Schedule Engine (`feat/schedule-engine`) **Files:** `domain/src/services/schedule/`, `domain/src/value_objects/scheduling.rs` 1. **#3** — Wire Alternating, Weighted, Marathon into schedule engine dispatch 2. **#4** — Interstitial insertion in schedule engine 3. **#8** — Gap filler logic 4. **#6** — Mid-roll break logic (blocked by #4 and #5, but #5 is Track C — merge C first or stub chapters) ### Track B: Playout Service (`feat/playout`) **Files:** `crates/playout/` (entirely new crate — zero overlap) 1. **#9** — Core HLS streaming (single channel, FFmpeg, SegmentStore port) 2. **#11** — Multi-channel + shared broadcast loop 3. **#10** — SCTE-35 markers + overlay metadata (blocked by #6, so merge Track A first) ### Track C: Library Sync (`feat/library-sync`) **Files:** `adapters/*/src/` (sync logic only) 1. **#5** — Chapter extraction during library sync (ffprobe) 2. **#7** — MediaRole auto-detection during library sync ## Merge Order ``` ┌─ Track A (schedule engine) ──────────┐ master ──────┤ Track B (playout) ──────────────────┤── merge A ── merge C ── merge B ── sequential tail └─ Track C (library sync) ─────────────┘ ``` 1. Merge **Track C** first (library sync — smallest, no downstream deps) 2. Merge **Track A** second (schedule engine — #6 needs chapters from Track C) 3. Merge **Track B** third (playout — #10 needs mid-roll from Track A) Track B can merge whenever since it's a new crate, but #10 and #11 depend on other tracks, so practically it merges last. ## Sequential Tail (after all tracks merge) On master, in order: 5. **#14** — OpenAPI: wire utoipa in presentation 6. **#15** — iCalendar export 7. **#16** — iCalendar import (blocked by #15) 8. **#17** — MCP: expand tools for creative scheduling (blocked by #3, #4) ## Conflict Prevention Rules - Each track works on its own feature branch - No two tracks edit the same file - `domain/src/services/mod.rs` — only Track A adds to it during parallel phase; iCal (#15) adds to it during the sequential tail after Track A is merged - `domain/src/lib.rs` — re-exports may need updating at merge time; resolve in merge commit - Run `cargo check --workspace` after each merge before starting the next ## Worktree Setup ```bash git worktree add .worktrees/schedule-engine -b feat/schedule-engine git worktree add .worktrees/playout -b feat/playout git worktree add .worktrees/library-sync -b feat/library-sync ``` Each worktree starts from the same master commit. Work independently. Merge back to master one at a time.