Skip to content

fix(validate): error on unknown attributes, name scene-level parse failures, guard legibility #110

Closed

Description

@LeadcodeDev

Part of #102 — wave 2.

Mini-spec

Goal: make the diagnostics honest — no silently-ignored attribute, no unusable parse error, no scenario that validates clean while being unreadable on screen.

Invariants

  • A scenario that validates clean renders what its author wrote, or names precisely what it could not honour.
  • All 7 repo examples keep validating.

Acceptance

  • M5 — unknown attributes error by default (decided at kickoff). A misplaced color/font_size at component root is currently a warning, and render exits 0 with the wrong styling. Make it an error by default in validate, and make --strict-attrs available to render. The attribute checker also only inspects the top level of each component and never Scenario/Scene/View/VideoConfig — extend it, or state precisely what stays uncovered. If any repo example fails once this is strict, report before weakening the check.
  • M6 — SceneEntry is #[serde(untagged)], so every scene-level error collapses to data did not match any variant of untagged enum SceneEntry with no line, no scene index, no field name. This is the worst diagnostic in the product. Restructure so a missing duration or a misspelled transition.type names itself.
  • M4 — no legibility floor. A 12-column table in 1800px renders text at ~11px on a 1080p frame and validates clean. "Fits in the frame" is not "readable in a video". Add a check on effective rendered font size relative to output height, as a warning. Pick the threshold from evidence and justify it in the issue.
  • C2 completion — unresolved colours must fail validation. Wave 1 made them loud at render (magenta + stderr) via parse_css_color. Wire a validation-time error so the failure is caught before rendering.

Files: crates/rustmotion-cli/src/commands/{validate_attrs,geometry,render,validation,validate_schema}.rs, crates/rustmotion-cli/src/lib.rs, crates/rustmotion-core/src/schema/scenario.rs

Verify

rtk cargo test --workspace
rtk cargo build --release
for f in examples/*.json; do ./target/release/rustmotion validate -f "$f"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions