Skip to content

Programme Manager: Channel tap → live AI radio #46

Description

@zeevenn

Parent

#39 — PRD: AI Radio — Host-driven Channel experience with chat timeline

What to build

Implement the Programme Manager — the coordinator that connects Channel selection, the Host Service, and the Player into a live radio loop.

Interface:

loadChannel(channel: Channel)  Promise<void>
handleIntervention(intervention: Intervention)  Promise<void>
onSegmentEnd(segmentId: string)  void  // called by Player

Behaviour:

loadChannel(channel):

  1. Call queryCandidateSet(channel.style) to get the CandidateSet
  2. Call Host.generateProgramme(channel.style, candidates) to get the first Programme
  3. Call Player.loadProgramme(programme) — playback starts

onSegmentEnd(segmentId):

  • When the Programme is 2 Segments from exhaustion, trigger a background generateProgramme call for the next Programme (pre-generation)
  • When the last Segment ends, swap in the pre-generated Programme via Player.loadProgramme
  • This ensures continuous playback with no gap between Programmes

handleIntervention(intervention):

  1. Store the Intervention
  2. Call Host.generateProgramme(channel.style, candidates, intervention)
  3. When the current TrackSegment ends (not mid-Segment), swap in the new Programme

The Programme Manager holds the active Channel and current CandidateSet in memory. On loadChannel, it resets state.

Write tests against injected Host and Player stubs: verify that the Host is called at the right moment (near-exhaustion trigger), and that the Player receives the correct Programme after an Intervention.

Acceptance criteria

  • Tapping a Channel on the selection screen starts real AI-generated playback (Tracks + Interludes)
  • The next Programme is pre-generated before the current one exhausts — no audible gap between Programmes
  • After an Intervention, the current Track finishes before the new Programme begins
  • Programme Manager tests pass: near-exhaustion pre-generation and Intervention swap are verified with stubbed Host and Player

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentReady for an AI agent to implement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions