Part of #102 — wave 1.
Mini-spec
Goal: make the schema surface honest — export a schema that actually describes components, measure text with the fonts the render will use, and delete the dead style model that keeps stale vocabulary alive.
Invariants
rustmotion schema output fully describes every Component variant.
- Validation and render resolve the same typeface for the same text.
- No public type remains that contradicts the live CSS types on casing or shape.
Out of scope: validate_attrs hardening and SceneEntry diagnostics (wave 2, L4b); the colour parser itself (L2).
Acceptance
H2 — cmd_schema emits schemars::schema_for!(Component) (already built internally at validate_attrs.rs:40) so Scene.children is no longer typed items: true. The output must contain a oneOf over component variants.
H5 (fonts) — load_custom_fonts runs inside validation::run_checks, before any measurement. Today it is only called on the render path (render.rs:47), so validation measures through the Helvetica/Arial fallback while the render uses the declared face.
H8 (code) — LayerStyle (schema/style.rs:317+) and its orphaned siblings that shadow live CSS types (schema::BlendMode, schema::Overflow, schema::GridTrack, CardDisplay, schema::Size) are removed, along with their pub use re-exports. Verify each is genuinely unreferenced before deleting.
Files: crates/rustmotion-core/src/schema/**, crates/rustmotion-cli/src/commands/schema.rs, crates/rustmotion-cli/src/commands/validation.rs
Note: crates/rustmotion-core/src/css/style.rs is a different file owned by L3 — do not touch it.
Verify
rtk cargo test --workspace
rtk cargo build --release
./target/release/rustmotion schema | jq '.definitions | keys | length'
for f in examples/*.json; do ./target/release/rustmotion validate -f "$f"; done
Part of #102 — wave 1.
Mini-spec
Goal: make the schema surface honest — export a schema that actually describes components, measure text with the fonts the render will use, and delete the dead style model that keeps stale vocabulary alive.
Invariants
rustmotion schemaoutput fully describes everyComponentvariant.Out of scope:
validate_attrshardening andSceneEntrydiagnostics (wave 2, L4b); the colour parser itself (L2).Acceptance
H2—cmd_schemaemitsschemars::schema_for!(Component)(already built internally atvalidate_attrs.rs:40) soScene.childrenis no longer typeditems: true. The output must contain aoneOfover component variants.H5 (fonts)—load_custom_fontsruns insidevalidation::run_checks, before any measurement. Today it is only called on the render path (render.rs:47), so validation measures through the Helvetica/Arial fallback while the render uses the declared face.H8 (code)—LayerStyle(schema/style.rs:317+) and its orphaned siblings that shadow live CSS types (schema::BlendMode,schema::Overflow,schema::GridTrack,CardDisplay,schema::Size) are removed, along with theirpub usere-exports. Verify each is genuinely unreferenced before deleting.Files:
crates/rustmotion-core/src/schema/**,crates/rustmotion-cli/src/commands/schema.rs,crates/rustmotion-cli/src/commands/validation.rsNote:
crates/rustmotion-core/src/css/style.rsis a different file owned by L3 — do not touch it.Verify