Repository navigation
GVC Phase 0: VideoSpec, note importer and compiler, proven against segment() - #206
Merged
Merged
Conversation
Phase 0 of docs/gecko-video-creator.md: the structure the segmenter infers on every render becomes a document. spec.py defines it in Pydantic; importer.py walks a note exactly as segment() does but records beats, overlays and provenance; compiler.py turns a spec back into the Shot list and RenderOptions today's renderer consumes, refusing anything it cannot draw. segment() and the renderer are untouched. tests/test_video_spec.py holds the spec path to today's output: every segmenter test case, 3,000 generated notes and real render() runs (ffmpeg faked) produce identical shots, warnings and ffmpeg commands. The design doc's worked example is validated against the models. The doc also gets the corrections from the repo review: GAM has no origin_* columns yet, read-aloud export keeps some speech code in Notes, inserting a render back into a note needs designing, and where GVC's code lives is recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwaujUokXQAxnebBArpZuj
davior
marked this pull request as ready for review
October 15, 2026 00:36
This was referenced Oct 15, 2026
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
This is Phase 0 of
docs/gecko-video-creator.md. The video structure thatsegment()works out from a note on every render becomes a document: the VideoSpec. The new code runs alongside the existing code.segment()andrenderer.pyare untouched, and nothing a user sees changes.backend/app/video/spec.py: the VideoSpec as Pydantic models. A video is segments (scene/card/clip); the narration beats inside a segment (one per note block, each recording itsblock_id); overlays tied to beats; audio tracks tied to segments; and a registry of the media files they point at. It validates its own structure: unique ids, references to files that exist in the registry, and clips and cards that are well formed. Extra fields are rejected.backend/app/video/importer.py:import_note()walks a note step for step assegment()does, but records beats, overlays and which blocks each part came from. A quote or code block becomes an overlay on its own beat instead of a separate shot.segment_via_spec()has exactlysegment()'s signature. The planned follow-up PR switchessegment()to it.backend/app/video/compiler.py:compile_spec()turns a spec back into theShotlist andRenderOptionstoday's renderer uses. It refuses (UnsupportedSpec) anything that renderer can't draw:docs/gecko-video-creator.md:origin_*columns yet.backendon the sharedwebnetwork.The proof (
backend/tests/test_video_spec.py, 93 tests, about 8s, no real encodes)test_video_segmenter.py(68) is re-run withsegmentwrapped so both paths must return identical shots and warnings, field by field.render()runs use the existingFakeFFmpegstub and issue identical ffmpeg commands through both paths.RenderOptionssurvive a round trip on every setting the renderer reads.Two deliberate exceptions, both tested:
title_card,chapter_screens, …) are recorded as structure, not as settings.Existing quirks, reproduced on purpose for now
The spec path keeps today's output identical, quirks included. These are worth fixing once the spec path is the only one:
segmenter.py:461).[pause:…]markers typed into a heading end up in the MP4's chapter list and the "title + chapter" overlay (segmenter.py:365,:384).Next, as separate PRs
segment()tosegment_via_spec()and exposeGET /api/video/spec?note_id=.worker.py:81).Test plan
pytest -qfrombackend/, as CI runs it: 1,282 passed, 1 skipped (that skip was already there).🤖 Generated with Claude Code
https://claude.ai/code/session_01PwaujUokXQAxnebBArpZuj
Generated by Claude Code