Add script-to-beats compiler for continuous video episodes - #6229
Merged
Conversation
Pure module that partitions a scene script into beat-level video clip specs: word-count-driven duration snapped to a target frame grid (uniform or the MiniMax H3 family's 17n+5 grid), byte-stable bible descriptor injection for cast/locations/style, explicit speaker-clause dialogue formatting, and a max-chain-length rule that forces a fresh re-establish cut every N clips. First slice of the continuous-video episode feature (#6217); the prompt linter (#6226) and orchestrator (#6227) build on this.
Copy the beat speaker array before handing it out on a clip spec (the source array is shared with partitionLinesIntoBeats' internal beat object), and replace the O(n^2) per-line beatWordCount rescan with a running word counter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server/lib/scriptVideoCompiler.js: a pure module that partitions a scene script into beat-level clip specs for chained/continuous video generation.S1 (Speaker, voice): "..."clauses.server/libbarrel + README per the module-organization convention.First slice of the continuous-video-episode epic (#6217) — the prompt linter (#6226) and orchestrator (#6227) build on this.
Test plan
cd server && npx vitest run lib/scriptVideoCompiler.test.js— 16 new unit tests covering beat partitioning, frame-grid snapping (both grids), dialogue formatting, byte-identical descriptor reuse, and the chain-length/scene-boundary fresh-cut rules.cd server && npx vitest run lib/index.test.js— barrel/README registration guard.cd server && npx vitest run lib/— fullserver/libsuite (467 files, 10522 tests) green.opencodeagainst the branch diff; findings applied (cloned the shared speaker array before returning it on a clip spec, replaced an O(n²) per-line word rescan with a running counter).Closes #6225