Add a source¶
Add a source when existing visual values cannot express the content. Decide whether it is asset-backed, procedural, or a nested composition: that determines what preflight prepares and which timing rules core must own. Read project to plan before changing those boundaries.
Follow Spectrum2D's canonical model and CPU implementation for a procedural source. Use an existing Image/Video variant in visual.rs for an asset-backed source; Spectrum2D's audio-analysis requirements are not a default for other sources.
Find the owners¶
| Responsibility | Location |
|---|---|
| Canonical values and semantic rules | crates/vestra-core/src/project/model/, validation/visual/ |
| Compilation, timing and evaluated sources | crates/vestra-core/src/plan/; see the core source map |
| External paths, probing and preparation | crates/vestra/src/, crates/vestra-media/src/; shared prepared rendering assets in vestra-render-common |
| Pixel execution and capability decisions | crates/vestra-render-cpu/src/cpu/, crates/vestra-render-wgpu/src/wgpu/ and src/shaders/ |
| Python value, lowering and exports | python/vestra/sources/, python/vestra/lowering.py, package exports; native methods/stubs only when needed |
Implement in order¶
- Add the tagged canonical representation and source-specific values in core. Update schema serialization/template support and semantic validation. Keep path resolution and media probing out of core.
- Extend compilation and evaluated source data. Put source-local timing, transition endpoint eligibility and nested composition rules here. A renderer receives resolved/evaluated values, not raw public JSON.
- Extend preflight and preparation for external files, dimensions, decoded
resources or analysis. Resolve asset paths from the
Projectbase directory at the SDK/media boundary and share immutable prepared assets where possible. - Implement CPU dispatch/resource reuse, then WGPU dispatch, uploads and readback-compatible output. Add only the capability each backend really has.
- Add the high-level
vestra.sourcesvalue and lowering. Add advancedProjectBuildersupport if it belongs in canonical authoring. Export the public name and update_native.pyionly for native binding changes.
Verify and document¶
Use focused model/schema-validation and high-level lowering tests, then actual CPU and WGPU frames. Test nested compositions where relevant and effect/transition attachments for each claimed capability. Follow Testing for commands and GPU validation for separate software and hardware evidence. Update the source reference and feature support.
The change is ready when:
- The canonical tag, schema, serialization and semantic diagnostics agree.
- Compilation/evaluation and all external-resource ownership are covered.
- Python authoring, lowering, native stubs where changed, and exports agree.
- Each backend has tested support or an explicit limitation.
- The reference states only demonstrated capabilities. A source that renders does not thereby support direct transforms or transition endpoints.