Skip to content

Continuous video orchestrator: coordinate chained episode clip generation #6227

Description

@atomantic

Context

Part of the continuous-video-episode feature (see parent epic). Depends on the beat compiler (#6225) and prompt linter (#6226) — this slice wires them into an end-to-end generation pipeline across PortOS's existing video backends.

Scope

Add server/services/videoGen/continuousVideo.js:

  • Take a script + bible, run it through scriptVideoCompiler (Script-to-Beats Compiler for continuous video episodes #6225) to get beat/clip specs, then videoPromptLinter (Deterministic video-prompt linter for continuous episode clips #6226) to validate each clip prompt before submission.
  • Coordinate sequential generation across supported video backends (Reactor fast-h3, fal.ai, local LTX) using the existing backend modules in server/services/videoGen/.
  • Thread previous-clip identifiers (continue_from_clip_id, or last-frame still extraction) into dependent beats so continuation clips reference their predecessor.
  • Fall back to a fresh re-establish if an upstream clip in the chain fails or is evicted, so one failed clip doesn't stall the whole episode.
  • Stitch completed clips into a final episode video using the existing stitchVideos (server/services/videoGen/stitchVideos.js), reusing chainedVideo.js's stitching path rather than re-implementing it.
  • Expose this via a route (server/routes/) so a client can submit a script and track episode-generation progress (SSE or socket progress, matching the existing video-gen progress pattern).

Acceptance criteria

  • server/services/videoGen/continuousVideo.js composes the compiler + linter + backend submission + stitching into one orchestrated flow.
  • A lint failure on any clip is surfaced to the caller before submission (no silent generation of a rule-violating prompt).
  • An upstream clip failure triggers the fresh re-establish fallback rather than aborting the whole episode.
  • New route registered per server/AGENTS.md conventions (Zod validation, no try/catch in the handler) and reflected in the generated API route catalog.
  • Integration-level tests cover: full happy-path beat-to-stitched-video flow (with backends mocked), a lint-failure short-circuit, and the fresh-re-establish fallback on a mid-chain backend failure.

Files

  • server/services/videoGen/continuousVideo.js (new)
  • server/routes/ (new route for episode submission/progress)
  • server/services/videoGen/index.js / README if present

Part of #6217


When this ships, check its box in the "Decomposed into" list on #6217. If it was the LAST open child, close #6217 with a summarizing comment.

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

    area:mediaarea:pipelineComic/story production pipelineeffort:highDispatch reasoning effort: highmodel:heavyDispatch capability: strongest available coding modelplanTracked by /do:replanplanner:sonnet-5Plan authored by the sonnet-5 model

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions