The content model
Module snapshots, typed scenes, the layout union, and the draft/publishable contract.
A Vidext module is typed, validated data — not opaque media. Understanding the shape pays off whenever you build, edit, or interpret modules programmatically. (For the product-level view, start with Scenes and layouts.)
The snapshot envelope
A module's renderable content is a module snapshot: a versioned JSON envelope (schema version, creation time, the use case it was planned with) wrapping the module itself:
ModuleSnapshot
└── Module { id, title, description? }
└── Chapter[] { id, title, description? }
└── Scene[]Snapshots are validated on read and write — a malformed snapshot is rejected, never half-served.
Scenes: a discriminated union
Each scene is:
Scene { id, layoutId, background?, content, audioNarration?, sourceRefs? }layoutId is the discriminant: it selects which content schema applies. The ten layout ids:
start · chapter-intro · bullet-points · bullet-media-points · stack-cards
content-avatar · image-avatar · video · quizzes · outroEach layout also carries metadata the system plans with — its teaching role (opening / core / closing / assessment), its presentation family, and its image requirements.
sourceRefs? is scene-level provenance: an optional array of references the builder records at write time, each pointing to the evidence that grounded the scene — a documentId (an uploaded source) or a url (a web finding), plus an excerpt and a relevance note. It survives through publish, so built modules carry traceability back to their sources.
Components: the shared atoms
Layout content composes reusable component schemas — headers, bodies, bullets, cards, video players — plus two worth special attention:
- Narration — spoken text with a reveal duration. Narration is both the teaching script and the timing source for audio, subtitles, and auto-advance. A separate hidden audio-narration track (segments anchored to content) drives generated speech without altering visible copy.
- Quizzes —
quiz-select(3–4 answers, exactly one correct, with an explanation) andquiz-boolean(true/false with explanation). A quiz scene holds one to three of them.
Draft vs publishable: two strictness levels
Every schema has two variants:
- Draft — permissive: fields may be empty mid-generation.
- Publishable — strict: non-empty strings, positive narration durations, at least one chapter and scene.
Generated content must pass the publishable contract before it can be published. This is the type-level expression of the product's draft and published gate.
Why this matters for editModuleContent
Programmatic edits are validated against these schemas — which is why an edit can never produce a structurally broken module, and why edits express as structured operations rather than freeform patches.
Last updated on