Skip to content

Chantier: post-audit reliability hardening #102

Description

@LeadcodeDev

Context

A full audit of the codebase (read-only, commit 452596e) targeted three areas: JSON scenario
generation quality, component overflow handling, and the engine's ability to produce the
"dark premium" marketing style of the reference videos.

It found 2 critical, 8 high and 9 medium issues. The headline conclusion: the render
engine is markedly stronger than its authoring surface. Real 3D (M44 with perspective divide),
keyframed camera, multi-plane parallax, both blur kinds and the spring/cubic-bezier easing solver
all work correctly. What is broken is the chain of trust around them — the validator green-lights
scenarios that render invisible text, column-less grids, and content spilling out of its card.

Every finding below was reproduced against a release build, not inferred from reading code.

Decisions taken at kickoff

Question Decision Rationale
grid component Wire tracks through to taffy taffy supports CSS Grid natively and the schema already models tracks; a KPI row is the single most common marketing layout
Unknown top-level attributes Error by default, and --strict-attrs made available to render This is the class of failure that produces a silently wrong video; all 7 repo examples must still validate
Delivery cadence Wave 1 (critical + high), review, then wave 2 (medium) Keeps each review sitting reviewable
Base branch origin/main All code findings exist there; the in-flight 1600-template branch lands separately

Frozen contracts

Read-only for every workstream. Changing one requires updating this issue first.

  1. Colour parsing entry pointcrates/rustmotion-core/src/engine/renderer/colors.rs exposes:
    pub fn parse_css_color(input: &str) -> Option<(u8, u8, u8, u8)>
    parse_hex_color stays as a thin infallible wrapper for existing call sites.
  2. The geometry validator never mutates schema types. cli/commands/geometry.rs reads the box
    tree and CSS; any schema change belongs to the schema workstream.
  3. File ownership is disjoint. No file is written by two workstreams. Reads may overlap freely.
  4. css/style.rs and schema/style.rs are different files owned by different workstreams.

Workstreams

Wave 1 — critical + high

  • L1 · Geometry validatorcli/commands/{geometry,validate}.rs — C1, H3, H4, H6, H7 + regression tests
  • L2 · Value parsingengine/renderer/colors.rs, engine/paint_pass.rs, css/units.rs — C2
  • L3 · Grid layoutcss/taffy_bridge.rs, css/style.rs — H1
  • L4 · Schema surfacecore/schema/**, cli/commands/{schema,validation}.rs — H2, H5 (fonts), dead LayerStyle
  • L6 · DocumentationCLAUDE.md, .claude/skills/rustmotion/** — H8, M7

Wave 2 — medium (after review of wave 1)

  • L5 · Dead features & componentscomponents/{box_builder,intrinsic,text}.rs, engine/animator.rs — M1, M2, M3
  • L4b · Diagnostics hardeningvalidate_attrs.rs, cli/lib.rs, render.rs, scenario.rs — M4, M5, M6

Findings index

ID Severity Summary Workstream
C1 Critical --fix writes style.wrap, a field CssStyle rejects — the component is dropped from the render and validation then reports clean L1
C2 Critical #fff, #FFF, white, rgb(...) all fall back to SColor::BLACK silently; unparseable lengths fall back to 0px L2
H1 High grid-template-columns never reaches taffy, yet validate_schema.rs:217 makes it mandatory L3
H2 High Exported JSON Schema types children as items: true — zero component coverage, no constrained generation possible L4
H3 High --fix indexes the post-filter child vector against raw JSON, patching the wrong node when a sibling fails to deserialize L1
H4 High _parent_clips is computed and never read: parent overflow is never detected, clipped subtrees are false positives L1
H5 High Geometry ignores static transform and scene.camera; custom fonts are never loaded before measuring L1 + L4
H6 High --strict-anim samples 7 fixed points, discards t=0 via an opacity guard, and forks the renderer's effect resolution L1
H7 High Deliberate frame-bleeding typography — the reference style's signature — is rejected as a viewport overflow L1
H8 High The authoring guide teaches a dead style model (LayerStyle); its canonical Example 1 produces a dropped component L4 + L6

Verification (applies to every workstream)

rtk cargo build --release
rtk cargo test --workspace
for f in examples/*.json; do ./target/release/rustmotion validate -f "$f"; done

All 7 example scenarios must still validate after every workstream.

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