You are a planning assistant. The user has proposed the following idea: Idea: Video…
- User
You are a planning assistant. The user has proposed the following idea:
codeIdea: Video editor developer platform Sprint 1: canonical timeline domain model.Context: The Reigh video editor under src/tools/video-editor has useful primitives, but it is not yet easy for developers or agents to build on top of. Current pain points include multiple timeline shapes (TimelineClip, ClipMeta, ResolvedTimelineClip, TimelineData rows/meta/clipOrder), inconsistent duration semantics across UI/render/agent paths, Reigh-specific dependencies mixed into editor provider/components, and mutation paths that require internal knowledge.
This sprint is the first two-week slice. It must preserve the current Reigh app behavior while establishing the domain foundation for later ports/adapters, headless core, clip-type plugins, command bus, render pipeline hooks, and UI slots.
Goal: Create a canonical timeline domain layer that all current editor paths can use without changing user-visible functionality.
Primary outcomes:
- Establish one documented canonical interpretation of persisted TimelineConfig + AssetRegistry.
- Centralize repair/migration/canonicalization, duration calculation, validation, serialization, and structured errors.
- Remove or reduce divergent duration/shape logic between UI, Remotion renderer, import, and ai-timeline-agent paths.
- Prepare for agent-safe editing by defining validation/dry-run-friendly primitives, even if the full command bus ships in a later sprint.
Important constraints:
- Do not rewrite the video editor.
- Do not change visible editor behavior except to fix clear inconsistencies.
- Keep the existing Reigh editor page and shell working.
- Keep current tests passing; add targeted tests for canonical domain behavior.
- Avoid broad UI refactors in this sprint unless required to route through the domain layer.
- Do not make plugin registries or UI slots yet; only shape the domain layer so those later sprints are easier.
Areas to inspect:
- src/tools/video-editor/types/index.ts
- src/tools/video-editor/lib/timeline-data.ts
- src/tools/video-editor/lib/config-utils.ts
- src/tools/video-editor/lib/serialize.ts
- src/tools/video-editor/lib/migrate.ts
- src/tools/video-editor/hooks/useTimelineCommit.ts
- src/tools/video-editor/hooks/useTimelinePersistence.ts
- src/tools/video-editor/hooks/usePollSync.ts
- src/tools/video-editor/compositions/TimelineRenderer.tsx
- src/tools/video-editor/hooks/useDerivedTimeline.ts
- Assistant
{"questions":[],"refined_idea":"","intent_summary":"I’ll inspect the named editor files just enough to ground the clarification in the actual shapes and call sites, then I’ll return only intent clarification: summary, ambiguities, and a refined idea."}
- Assistant
{"questions":[],"refined_idea":"","intent_summary":"I found the expected split between persisted config utilities, UI timeline data, renderer code, and Supabase agent/import functions. I’m narrowing in on type definitions and the current helper boundaries so the questions are about decisions that would actually alter the sprint scope."}
- Assistant
- User
- Assistant
I’ll refresh the repo context around existing tests and package scripts before writing the plan, so the plan is tied to what can actually be validated cheaply.
- Assistant
The repo already has a sizable regression surface for serialization, migration, save utilities, renderer sequences, import, agent tools, and poll sync. I also noticed unrelated dirty
.megaplanschema files; I’ll ignore them in the plan scope. - Assistant