# Error Codes

Every validation code, with a scene that triggers it and the exact message and fix the validator returns.

Every issue has a stable `code`, a JSON Pointer `path`, a `message` and a `suggested_fix`. The fix is often a JSON Patch an agent can apply as is. Errors stop a scene from rendering. Warnings don't.

The examples below are real. A Rust test runs each scene through the validator and fails CI if the message changes or a new code has no entry here.

```json title="motion-sdk validate scene.json --json"
{
  "issues": [
    {
      "severity": "error",
      "code": "unknown_field",
      "path": "/nodes/orb/transform/postion",
      "message": "unknown field `postion`, expected one of `position`, `rotation`, `scale`",
      "suggested_fix": "did you mean `position`? rename the key: {\"op\":\"move\",\"from\":\"/nodes/orb/transform/postion\",\"path\":\"/nodes/orb/transform/position\"}"
    }
  ]
}
```

## Modes

`streaming` is the default. A reference to an id that isn't written yet is a warning, because the next patch may add it. `final` (`motion-sdk validate --final`, or `Mode::Final`) makes it an error. Run final mode before you export.

See [Validation](/docs/concepts/validation) for how agents use the report, and the [debugging skill](/docs/agents/skills) for a fix loop.

## Parsing

The document doesn't fit the schema. These come from the parser, with a JSON Pointer to the bad value.

### `invalid_json`

**error.** The document isn't valid JSON.

```json title="Scene (final mode)"
{"nodes": {"a": {},}}
```

- Path: `""`
- Message: not valid JSON: trailing comma at line 1 column 20
- Fix: send a single complete JSON object; check for trailing commas, unquoted keys or truncated output

### `unknown_field`

**error.** A key that isn't part of the spec, usually a typo.

```json title="Scene (final mode)"
{ "nodes": { "orb": { "transform": { "postion": [0, 1, 0] } } } }
```

- Path: `/nodes/orb/transform/postion`
- Message: unknown field `postion`, expected one of `position`, `rotation`, `scale`
- Fix: did you mean `position`? rename the key: {"op":"move","from":"/nodes/orb/transform/postion","path":"/nodes/orb/transform/position"}

### `unknown_variant`

**error.** A variant or preset name that doesn't exist.

```json title="Scene (final mode)"
{ "nodes": { "orb": { "mesh": { "geometry": { "sphre": {} } } } } }
```

- Path: `/nodes/orb/mesh/geometry`
- Message: unknown variant `sphre`, expected one of `box`, `rounded_box`, `sphere`, `plane`, `cylinder`, `cone`, `capsule`, `torus`, `torus_knot`, `icosahedron`, `terrain`, `shape`, `model`
- Fix: did you mean `sphere`?

### `invalid_type`

**error.** A value of the wrong JSON type.

```json title="Scene (final mode)"
{ "nodes": { "orb": { "transform": { "position": "up" } } } }
```

- Path: `/nodes/orb/transform/position`
- Message: invalid type: string "up", expected an array of length 3
- Fix: replace the value with an array of length 3

### `invalid_length`

**error.** An array with the wrong number of items.

```json title="Scene (final mode)"
{ "nodes": { "orb": { "transform": { "position": [0, 1] } } } }
```

- Path: `/nodes/orb/transform/position`
- Message: invalid length 2, expected an array of length 3
- Fix: use an array of length 3, e.g. [0, 1, 0] for a vector

### `missing_field`

**error.** A required field is missing.

```json title="Scene (final mode)"
{
  "nodes": { "orb": {} },
  "timeline": { "tracks": { "spin": { "target": "orb", "keyframes": [] } } }
}
```

- Path: `/timeline/tracks/spin`
- Message: missing field `property`
- Fix: add the required field `property` at /timeline/tracks/spin/property

### `invalid_color`

**error.** A colour that isn't sRGB hex.

```json title="Scene (final mode)"
{ "materials": { "m": { "color": "red" } } }
```

- Path: `/materials/m/color`
- Message: invalid color: expected a hex string like "#ff3366" or "#ff336680"
- Fix: use a hex string like "#ff3366" (or "#ff336680" with alpha)

### `invalid_value`

**error.** A value the field doesn't accept, like a texture repeat of 0.

```json title="Scene (final mode)"
{
  "textures": { "t": { "src": "t.png" } },
  "materials": { "m": { "map": { "texture": "t", "repeat": [0, 1] } } },
  "nodes": { "a": { "mesh": { "geometry": { "plane": {} }, "material": "m" } } }
}
```

- Path: `/materials/m/map/repeat/0`
- Message: repeat must be a finite, non-zero tile count
- Fix: use 1 for one copy of the image across the surface

### `invalid_scene`

**error.** The lean player build couldn't parse the document as a scene. It has no JSON Pointer path; the authoring build reports the precise issue instead. Only the lean player build reports this.

- Path: `""`
- Message: <the parser's message>
- Fix: validate with the authoring build or `motion-sdk validate` for the exact path

### `patch_failed`

**error.** A JSON Patch op couldn't be applied, like replacing a path that doesn't exist. The scene is left unchanged.

```json title="Patch"
[{ "op": "replace", "path": "/nodes/ghost/transform", "value": {} }]
```

- Path: `/nodes/ghost/transform`
- Message: op 0: `/nodes/ghost` does not exist
- Fix: add it first with {"op":"add","path":"/nodes/ghost","value":...}

## References

Ids that point at something missing or the wrong kind of thing.

### `dangling_ref`

**warning.** A reference to an id that isn't defined. A warning while streaming, since it may arrive in a later patch, and an error in final mode.

```json title="Scene (streaming mode)"
{ "nodes": { "a": { "parent": "later" } } }
```

- Path: `/nodes/a/parent`
- Message: parent node `later` does not exist (rendered as a root node meanwhile)
- Fix: add the node first: {"op":"add","path":"/nodes/later","value":{}}

### `invalid_ref`

**error.** A reference that points at the wrong kind of thing, like scatter on a node that isn't a terrain.

```json title="Scene (final mode)"
{
  "nodes": {
    "g": { "mesh": { "geometry": { "sphere": {} } } },
    "r": {
      "mesh": {
        "geometry": { "sphere": {} },
        "instances": { "on_terrain": { "terrain": "g", "count": 10 } }
      }
    }
  }
}
```

- Path: `/nodes/r/mesh/instances/on_terrain/terrain`
- Message: node `g` is not a terrain mesh
- Fix: point at a node whose geometry is `{"terrain": {...}}`

### `invalid_id`

**error.** An id with characters outside `[A-Za-z0-9_-]`.

```json title="Scene (final mode)"
{ "nodes": { "my node": {} } }
```

- Path: `/nodes/my node`
- Message: node id `my node` must be 1-64 chars of [A-Za-z0-9_-] (ids are used in JSON Pointer paths); expanded scenes may join such ids with `.` or `#`
- Fix: rename it to `my_node`

### `cycle`

**error.** Parents form a loop.

```json title="Scene (final mode)"
{ "nodes": { "a": { "parent": "b" }, "b": { "parent": "a" } } }
```

- Path: `/nodes/a/parent`
- Message: parent chain of `a` loops back on itself
- Fix: {"op":"remove","path":"/nodes/a/parent"}

### `unused`

**warning.** Something defined but never used, like a prefab nobody places.

```json title="Scene (final mode)"
{ "prefabs": { "car": { "nodes": { "body": {} } } } }
```

- Path: `/prefabs/car`
- Message: prefab `car` is not placed anywhere
- Fix: place it with {"op":"add","path":"/nodes/car_1","value":{"use":"car"}} or remove it

### `missing_clip`

**error.** A state scrubs a clip but names none.

```json title="Scene (final mode)"
{
  "state_machines": {
    "m": { "initial": "a", "states": { "a": { "scrub": "scroll" } } }
  }
}
```

- Path: `/state_machines/m/states/a/scrub`
- Message: `scrub` needs a `clip` to scrub
- Fix: add "clip" to state `a`

### `missing_beats`

**error.** A track uses in_beats or pulse, but timeline.beats has no bpm or fewer than two ascending times.

```json title="Scene (final mode)"
{
  "nodes": { "a": {} },
  "timeline": {
    "duration": 2,
    "tracks": {
      "p": {
        "target": "a",
        "property": "opacity",
        "pulse": { "from": 0.5, "to": 1 }
      }
    }
  }
}
```

- Path: `/timeline/tracks/p`
- Message: this track is timed in beats, but timeline.beats has no tempo (bpm) or at least two ascending times
- Fix: {"op":"add","path":"/timeline/beats","value":{"bpm":120}}

### `invalid_audio`

**error.** An audio clip's src is neither a .wav path nor silence, tone(hz) or clicks, or one of its times is negative.

```json title="Scene (final mode)"
{ "audio": [{ "src": "song.mp3" }] }
```

- Path: `/audio/0/src`
- Message: "song.mp3" is not a WAV file (only .wav audio is read)
- Fix: use a .wav file path, or silence, tone(440) or clicks

### `unknown_preset`

**error.** A material preset name that doesn't exist.

```json title="Scene (final mode)"
{
  "nodes": {
    "a": {
      "mesh": { "geometry": { "sphere": {} }, "material": "preset:shiny" }
    }
  }
}
```

- Path: `/nodes/a/mesh/material`
- Message: unknown material preset `shiny`
- Fix: use one of: preset:matte_clay, preset:glossy_plastic, preset:chrome, preset:brushed_metal, preset:gold, preset:glass, preset:frosted_glass, preset:ceramic, preset:velvet, preset:neon, preset:holographic, preset:toon, preset:gravel, preset:rock, preset:weathered_paint, preset:stucco

### `needs_authoring`

**error.** A scene with prefabs, repeats or shatter was loaded by the lean player, which can't expand them. Only the lean player build reports this.

- Path: `/nodes/<id>`
- Message: this player build cannot expand prefabs, repeats or shatter
- Fix: load it with the authoring bundle (createPlayer(..., { authoring: true })), or expand it first: motion-sdk expand scene.json -o scene.player.json

## Rigs

### `bend_without_joints`

**error.** A `bend` track targets a node that is not a bone with more bones after it in a mesh's `skin.bones` (or an `svg` part without `joints`).

```json title="Scene (final mode)"
{
  "nodes": { "arm": {} },
  "timeline": {
    "duration": 1,
    "tracks": {
      "curl": {
        "target": "arm",
        "property": "bend",
        "keyframes": [{ "t": 0, "value": 0 }, { "t": 1, "value": 30 }]
      }
    }
  }
}
```

- Path: `/nodes/arm`
- Message: a `bend` track targets `arm`, which is not a bone with more bones after it in any mesh's skin.bones
- Fix: bend the first bone of a skin chain (e.g. the shoulder), or give the svg part `joints` in svg.bones

### `ik_chain_too_long`

**error.** An `ik` chain is longer than the bones above the node (a `chain` of 2 needs a parent and a grandparent).

```json title="Scene (final mode)"
{ "nodes": { "hand": { "ik": { "target": "goal" } }, "goal": {} } }
```

- Path: `/nodes/hand/ik/chain`
- Message: `ik.chain` is 2, but `hand` has no parent bones to turn
- Fix: {"op":"remove","path":"/nodes/hand/ik"}

### `rig_bad_target`

**error.** An `ik` target or pole, or an `attach`/`aim` node, is the node itself or moves with the bones it would turn, so the solve would chase itself.

```json title="Scene (final mode)"
{
  "nodes": {
    "arm": {},
    "hand": { "parent": "arm", "ik": { "target": "arm", "chain": 1 } }
  }
}
```

- Path: `/nodes/hand/ik/target`
- Message: IK target `arm` moves with `hand`, so it could never be reached
- Fix: use a separate goal node that is not a child of the chain (a root-level empty node keyed on the timeline)

### `plant_not_root`

**error.** `plant` is on a node with a parent; planted goals must be top-level so holding their keyed position holds them still in the world.

```json title="Scene (final mode)"
{ "nodes": { "body": {}, "goal": { "parent": "body", "plant": [[0, 0.5]] } } }
```

- Path: `/nodes/goal/plant`
- Message: `goal` has a parent, so holding its keyed position would not hold it still in the world
- Fix: {"op":"remove","path":"/nodes/goal/parent"}

## Physics

### `cloth_pin_empty`

**error.** A cloth pin has neither `edge` nor `uv` set.

```json title="Scene (final mode)"
{ "nodes": { "flag": { "cloth": { "pins": [{}] } } } }
```

- Path: `/nodes/flag/cloth/pins/0`
- Message: a cloth pin needs either `edge` or `uv`
- Fix: {"op":"add","path":"/nodes/flag/cloth/pins/0/edge","value":"top_edge"}

### `wind_direction_zero`

**error.** A cloth wind has non-zero `strength` with a zero `direction` vector.

```json title="Scene (final mode)"
{
  "nodes": {
    "flag": { "cloth": { "wind": { "direction": [0, 0, 0], "strength": 5 } } }
  }
}
```

- Path: `/nodes/flag/cloth/wind/direction`
- Message: wind direction must be non-zero when wind strength > 0
- Fix: {"op":"replace","path":"/nodes/flag/cloth/wind/direction","value":[1,0,0]}

### `joint_needs_body`

**error.** A node with a `joint` must also have a `body`.

```json title="Scene (final mode)"
{
  "nodes": {
    "p": { "body": { "type": "kinematic" } },
    "c": { "joint": { "parent": "p" } }
  }
}
```

- Path: `/nodes/c/joint`
- Message: node `c` has a `joint` but no `body`
- Fix: {"op":"add","path":"/nodes/c/body","value":{"type":"dynamic"}}

### `joint_parent_needs_body`

**error.** A joint's parent node must also have a `body`.

```json title="Scene (final mode)"
{
  "nodes": {
    "p": {},
    "c": { "body": { "type": "dynamic" }, "joint": { "parent": "p" } }
  }
}
```

- Path: `/nodes/c/joint/parent`
- Message: joint parent `p` must also have a `body`
- Fix: {"op":"add","path":"/nodes/p/body","value":{"type":"kinematic"}}

### `joint_self_parent`

**error.** A joint cannot attach a node to itself.

```json title="Scene (final mode)"
{
  "nodes": {
    "c": { "body": { "type": "dynamic" }, "joint": { "parent": "c" } }
  }
}
```

- Path: `/nodes/c/joint/parent`
- Message: joint on `c` cannot attach to itself
- Fix: {"op":"remove","path":"/nodes/c/joint"}

### `joint_cycle`

**error.** Joint parent links form a cycle.

```json title="Scene (final mode)"
{
  "nodes": {
    "a": { "body": { "type": "dynamic" }, "joint": { "parent": "b" } },
    "b": { "body": { "type": "dynamic" }, "joint": { "parent": "a" } }
  }
}
```

- Path: `/nodes/a/joint/parent`
- Message: joint chain through `a` forms a cycle
- Fix: {"op":"remove","path":"/nodes/a/joint"}

### `joint_axis_zero`

**error.** A joint rotation axis is the zero vector.

```json title="Scene (final mode)"
{
  "nodes": {
    "p": { "body": { "type": "kinematic" } },
    "c": {
      "body": { "type": "dynamic" },
      "joint": { "parent": "p", "axis": [0, 0, 0] }
    }
  }
}
```

- Path: `/nodes/c/joint/axis`
- Message: joint `axis` must be a non-zero vector
- Fix: {"op":"replace","path":"/nodes/c/joint/axis","value":[1,0,0]}

### `joint_limits_inverted`

**error.** A joint's minimum angle limit is greater than its maximum.

```json title="Scene (final mode)"
{
  "nodes": {
    "p": { "body": { "type": "kinematic" } },
    "c": {
      "body": { "type": "dynamic" },
      "joint": { "parent": "p", "limits": [90, 10] }
    }
  }
}
```

- Path: `/nodes/c/joint/limits`
- Message: joint `limits` min (90) must be <= max (10)
- Fix: {"op":"replace","path":"/nodes/c/joint/limits","value":[10,90]}

### `joint_couple_no_joint`

**error.** A coupled joint references a node that has no `joint`.

```json title="Scene (final mode)"
{
  "nodes": {
    "p": { "body": { "type": "kinematic" } },
    "c": {
      "body": { "type": "dynamic" },
      "joint": { "parent": "p", "couple": { "from": "p" } }
    }
  }
}
```

- Path: `/nodes/c/joint/couple/from`
- Message: coupled source node `p` does not have a `joint`
- Fix: add a `joint` to `p` or remove `couple`

### `joint_couple_self`

**error.** A joint cannot couple to itself.

```json title="Scene (final mode)"
{
  "nodes": {
    "p": { "body": { "type": "kinematic" } },
    "c": {
      "body": { "type": "dynamic" },
      "joint": { "parent": "p", "couple": { "from": "c" } }
    }
  }
}
```

- Path: `/nodes/c/joint/couple/from`
- Message: joint on `c` cannot couple to itself
- Fix: {"op":"remove","path":"/nodes/c/joint/couple"}

## SVG drawings

### `svg_parse`

**error.** An `svg` node's `src` is not SVG markup the parser can read (a file path left in a browser scene, or broken XML).

```json title="Scene (final mode)"
{ "nodes": { "drawing": { "svg": { "src": "hero.svg" } } } }
```

- Path: `/nodes/drawing/svg`
- Message: `svg.src` is not SVG markup (`hero.svg`)
- Fix: inline the markup (<svg viewBox=...>...</svg>): the CLI reads file paths relative to the scene, and the TypeScript svg(file("x.svg")) helper inlines them

### `svg_unsupported`

**warning.** The SVG uses elements `svg` skips (text, images, masks, filters, patterns, clip paths other than one rectangle), or a `morph` it can't do (outlines with holes, groups with different shape counts).

```json title="Scene (final mode)"
{
  "nodes": {
    "drawing": {
      "svg": {
        "src": "<svg viewBox='0 0 10 10'><text>hi</text><rect width='5' height='5'/></svg>"
      }
    }
  }
}
```

- Path: `/nodes/drawing/svg`
- Message: skipped <text>: not supported in `svg`
- Fix: draw it with paths, basic shapes and gradients instead

### `svg_unknown_id`

**error.** `bones`, `morph` or `with` on an `svg` node names an id the SVG does not have.

```json title="Scene (final mode)"
{
  "nodes": {
    "drawing": {
      "svg": {
        "src": "<svg viewBox='0 0 10 10'><rect id='arm' width='5' height='5'/></svg>",
        "bones": { "amr": {} }
      }
    }
  }
}
```

- Path: `/nodes/drawing/svg`
- Message: `bones` names `amr`, which is not an id in the SVG
- Fix: did you mean `arm`?

### `svg_bad_pivot`

**error.** A bone of an `svg` node has a pivot that is not a finite point, or hangs from its own child.

```json title="Scene (final mode)"
{
  "nodes": {
    "drawing": {
      "svg": {
        "src": "<svg viewBox='0 0 10 10'><rect id='a' width='5' height='5'/><rect id='b' x='5' width='5' height='5'/></svg>",
        "bones": { "a": { "parent": "b" }, "b": { "parent": "a" } }
      }
    }
  }
}
```

- Path: `/nodes/drawing/svg`
- Message: bone `b` would hang from its own child `a`
- Fix: pick a parent above it in the rig

## Values

Numbers and shapes the engine can't use.

### `out_of_range`

**error.** A number outside its allowed range.

```json title="Scene (final mode)"
{ "materials": { "m": { "roughness": 3 } } }
```

- Path: `/materials/m/roughness`
- Message: roughness is 3, must be between 0 and 1
- Fix: {"op":"replace","path":"/materials/m/roughness","value":1}

### `zero_scale`

**warning.** A zero scale hides the node.

```json title="Scene (final mode)"
{
  "nodes": {
    "a": {
      "transform": { "scale": [0, 1, 1] },
      "mesh": { "geometry": { "sphere": {} } }
    }
  }
}
```

- Path: `/nodes/a/transform/scale`
- Message: a zero scale component makes the node invisible
- Fix: use a small positive value such as 0.001 if you want to animate it in

### `fill_empty`

**error.** A flood `fill` block whose `to` corner isn't past `from` on both axes, so it holds no water.

```json title="Scene (final mode)"
{
  "nodes": {
    "water": {
      "flood": {
        "size": [20, 10],
        "fill": [{ "from": [-5, -5], "to": [-8, 5], "height": 2 }]
      }
    }
  }
}
```

- Path: `/nodes/water/flood/fill/0/to/0`
- Message: a fill block needs `to` past `from` on both axes
- Fix: swap the corners or widen the block

### `multiple_content`

**error.** A node has more than one of `mesh`, `text` and `particles`.

```json title="Scene (final mode)"
{
  "nodes": {
    "a": {
      "mesh": { "geometry": { "sphere": {} } },
      "text": { "content": "hi" }
    }
  }
}
```

- Path: `/nodes/a`
- Message: a node can carry only one of `mesh`, `text`, `particles`
- Fix: keep one and move the others into child nodes with "parent": "<this id>"

### `empty_text`

**warning.** Text with no content.

```json title="Scene (final mode)"
{ "nodes": { "t": { "text": { "content": "" } } } }
```

- Path: `/nodes/t/text/content`
- Message: text content is empty
- Fix: set "content" to the words to display

### `over_budget`

**error.** More than the engine's per-scene limit, like a million instances.

```json title="Scene (final mode)"
{
  "nodes": {
    "f": {
      "mesh": {
        "geometry": { "box": {} },
        "instances": { "grid": { "count": [2000, 1000, 1] } }
      }
    }
  }
}
```

- Path: `/nodes/f/mesh/instances`
- Message: 2000000 instances exceeds the limit of 1000000
- Fix: reduce the count, or use particles for very large point clouds

### `invalid_texture`

**error.** A texture source that can't be used.

```json title="Scene (final mode)"
{ "textures": { "t": { "src": "" } } }
```

- Path: `/textures/t/src`
- Message: texture `t`: `src` is empty
- Fix: embed a PNG or JPEG as data:image/png;base64,<data>, or give a path next to the scene

### `invalid_shape`

**error.** A 2D shape with no kind or several, a polygon under 3 points, or a Bézier chain that is not 3k+1 points.

```json title="Scene (final mode)"
{
  "nodes": {
    "s": {
      "mesh": { "geometry": { "shape": { "rect": [2, 1], "circle": 1 } } }
    }
  }
}
```

- Path: `/nodes/s/mesh/geometry/shape`
- Message: a shape needs exactly one of rect, circle, ellipse, polygon, bezier, line (has 2)
- Fix: e.g. {"shape": {"rect": [4, 2], "radius": 0.3}}

### `invalid_gradient`

**error.** A `linear-gradient(...)` or `radial-gradient(...)` texture source that doesn't parse.

```json title="Scene (final mode)"
{
  "textures": { "fade": { "src": "linear-gradient(90deg, blue, #fff)" } },
  "materials": { "m": { "map": { "texture": "fade" } } },
  "nodes": {
    "card": { "mesh": { "geometry": { "plane": {} }, "material": "m" } }
  }
}
```

- Path: `/textures/fade/src`
- Message: texture `fade`: `blue`: stops are hex colours like #0a84ff
- Fix: write it like CSS: linear-gradient(90deg, #0a84ff, #ffffff00 80%) or radial-gradient(at 50% 50%, #fff, #0a84ff)

### `invalid_pattern`

**error.** A `paper(...)`, `watercolor(...)` or `bristle(...)` texture source that doesn't parse (the amount must be a number from 0 to 1, and the optional seed a whole number).

```json title="Scene (final mode)"
{
  "textures": { "grain": { "src": "paper(heavy)" } },
  "materials": { "m": { "map": { "texture": "grain" } } },
  "nodes": {
    "card": { "mesh": { "geometry": { "plane": {} }, "material": "m" } }
  }
}
```

- Path: `/textures/grain/src`
- Message: texture `grain`: `heavy` is not a number (the amount, 0..1)
- Fix: write it as paper(0.2), watercolor(0.35) or bristle(0.5), with an optional seed: paper(0.2, 7)

### `emissive_map_dark`

**warning.** An emissive map on a material with no emissive colour shows nothing.

```json title="Scene (final mode)"
{
  "textures": { "t": { "src": "t.png" } },
  "materials": { "m": { "emissive_map": { "texture": "t" } } }
}
```

- Path: `/materials/m/emissive_map`
- Message: `emissive_map` is multiplied by `emissive`, which is black here
- Fix: {"op":"add","path":"/materials/m/emissive","value":"#ffffff"}

### `bands_ignored`

**warning.** `bands` only applies to toon shading.

```json title="Scene (final mode)"
{ "materials": { "m": { "bands": 3 } } }
```

- Path: `/materials/m/bands`
- Message: `bands` only affects `toon` shading
- Fix: {"op":"add","path":"/materials/m/shading","value":"toon"}

### `no_lights`

**warning.** Nothing lights the scene, so lit materials render black.

```json title="Scene (final mode)"
{
  "lighting": { "rig": null },
  "nodes": { "orb": { "mesh": { "geometry": { "sphere": {} } } } }
}
```

- Path: `/lighting`
- Message: the scene has no lights; lit materials will render black
- Fix: {"op":"replace","path":"/lighting/rig","value":"studio_soft"}

### `version_mismatch`

**warning.** The document targets a different spec version.

```json title="Scene (final mode)"
{ "version": "9.0" }
```

- Path: `/version`
- Message: document targets spec 9.0, this runtime implements 0.1
- Fix: {"op":"replace","path":"/version","value":"0.1"}

## Prefabs And Instancing

### `repeat_layout`

**error.** `repeat` needs exactly one of `count`, `grid` or `each`.

```json title="Scene (final mode)"
{
  "prefabs": { "p": { "nodes": { "a": {} } } },
  "nodes": { "r": { "use": "p", "repeat": {} } }
}
```

- Path: `/nodes/r/repeat`
- Message: `repeat` needs exactly one of `count`, `grid` or `each`
- Fix: e.g. {"op":"replace","path":"/nodes/r/repeat","value":{"count":3,"step":[2,0,0]}}

### `empty_instances`

**warning.** A repeat or instance layout that makes no copies.

```json title="Scene (final mode)"
{
  "prefabs": { "p": { "nodes": { "a": {} } } },
  "nodes": { "r": { "use": "p", "repeat": { "count": 0 } } }
}
```

- Path: `/nodes/r/repeat`
- Message: `repeat` creates no copies, so nothing is drawn
- Fix: use a count of at least 1

## Camera And Shots

### `degenerate_camera`

**error.** The camera's position and target are the same point.

```json title="Scene (final mode)"
{ "camera": { "position": [0, 0, 0], "target": [0, 0, 0] } }
```

- Path: `/camera/target`
- Message: camera position and target are the same point, so the view direction is undefined
- Fix: move the camera back, e.g. {"op":"replace","path":"/camera/position","value":[0,0,6]}

### `shots_length`

**warning.** The shots' total differs from the timeline's duration.

```json title="Scene (final mode)"
{
  "timeline": { "duration": 5 },
  "shots": [{ "duration": 2, "camera": { "position": [0, 0, 6] } }]
}
```

- Path: `/shots/0/duration`
- Message: shots last 2.000s but the timeline is 5s (the last shot holds its end frame)
- Fix: {"op":"replace","path":"/shots/0/duration","value":5}

### `cut_between_frames`

**warning.** A shot cut that doesn't land on a frame.

```json title="Scene (final mode)"
{
  "canvas": { "fps": 30 },
  "timeline": { "duration": 2 },
  "shots": [
    { "duration": 1.01, "camera": { "position": [0, 0, 6] } },
    { "duration": 0.99, "camera": { "position": [0, 1, 6] } }
  ]
}
```

- Path: `/shots/0/duration`
- Message: the cut after shot 0 falls between frames (30.300 at 30 fps), so exports would show it a frame early or late
- Fix: {"op":"replace","path":"/shots/0/duration","value":1}

### `camera_move_ignored`

**warning.** `camera.move` does nothing when there are shots.

```json title="Scene (final mode)"
{
  "timeline": { "duration": 2 },
  "camera": { "move": { "preset": "orbit" } },
  "shots": [{ "duration": 2, "camera": { "position": [0, 0, 6] } }]
}
```

- Path: `/camera/move`
- Message: with `shots`, the camera follows the shots and `camera.move` is ignored
- Fix: move it into a shot: {"op":"move","from":"/camera/move","path":"/shots/0/move"}

### `camera_tracks_overridden`

**warning.** Camera tracks do nothing when there are shots.

```json title="Scene (final mode)"
{
  "timeline": {
    "duration": 2,
    "tracks": {
      "c": {
        "target": "$camera",
        "property": "fov",
        "keyframes": [{ "t": 0, "value": 40 }, { "t": 2, "value": 30 }]
      }
    }
  },
  "shots": [{ "duration": 2, "camera": { "position": [0, 0, 6] } }]
}
```

- Path: `/timeline/tracks/c`
- Message: with `shots`, shots set the camera and camera tracks have no effect
- Fix: use a shot's `to` for moves, or remove the track: {"op":"remove","path":"/timeline/tracks/c"}

## Timeline

### `invalid_property`

**error.** A property the target can't animate.

```json title="Scene (final mode)"
{
  "nodes": { "a": {} },
  "timeline": {
    "tracks": {
      "t": {
        "target": "$camera",
        "property": "color",
        "keyframes": [{ "t": 0, "value": "#fff" }]
      }
    }
  }
}
```

- Path: `/timeline/tracks/t/property`
- Message: `color` cannot be animated on the camera
- Fix: camera supports position, look_at and fov

### `type_mismatch`

**error.** A keyframe value of the wrong shape for its property.

```json title="Scene (final mode)"
{
  "nodes": { "a": {} },
  "timeline": {
    "tracks": {
      "t": {
        "target": "a",
        "property": "position",
        "keyframes": [{ "t": 0, "value": 1 }]
      }
    }
  }
}
```

- Path: `/timeline/tracks/t/keyframes/0/value`
- Message: `position` needs an [x, y, z] array but got a number
- Fix: write the value as an [x, y, z] array

### `empty_track`

**warning.** A track with no keyframes.

```json title="Scene (final mode)"
{
  "nodes": { "a": {} },
  "timeline": {
    "tracks": {
      "t": { "target": "a", "property": "position", "keyframes": [] }
    }
  }
}
```

- Path: `/timeline/tracks/t/keyframes`
- Message: track has no keyframes and is ignored
- Fix: add keyframes: {"op":"add","path":"/timeline/tracks/t/keyframes/-","value":{"t":0,"value":...}}

### `unsorted_keyframes`

**error.** Keyframes out of time order.

```json title="Scene (final mode)"
{
  "nodes": { "a": {} },
  "timeline": {
    "tracks": {
      "t": {
        "target": "a",
        "property": "opacity",
        "keyframes": [{ "t": 2, "value": 1 }, { "t": 1, "value": 0 }]
      }
    }
  }
}
```

- Path: `/timeline/tracks/t/keyframes/1/t`
- Message: keyframe at t=1 comes after t=2; keyframes must be sorted by time
- Fix: reorder keyframes so `t` increases

### `beyond_duration`

**warning.** A keyframe or caption after the end.

```json title="Scene (final mode)"
{
  "nodes": { "a": {} },
  "timeline": {
    "duration": 2,
    "loop": "once",
    "tracks": {
      "t": {
        "target": "a",
        "property": "opacity",
        "keyframes": [{ "t": 0, "value": 0 }, { "t": 5, "value": 1 }]
      }
    }
  }
}
```

- Path: `/timeline/tracks/t/keyframes/1/t`
- Message: keyframe at t=5 is after the timeline end (2s) and never plays
- Fix: {"op":"replace","path":"/timeline/duration","value":5}

### `unreachable_state`

**warning.** A state no transition leads to.

```json title="Scene (final mode)"
{
  "state_machines": { "m": { "initial": "a", "states": { "a": {}, "b": {} } } }
}
```

- Path: `/state_machines/m/states/b`
- Message: state `b` can never be entered
- Fix: add a transition with "to": "b"

## Paths And Signals

### `invalid_path`

**error.** A path with too few points, or a reference to a missing path.

```json title="Scene (final mode)"
{ "paths": { "p": { "polyline": { "points": [[0, 0, 0]] } } } }
```

- Path: `/paths/p`
- Message: path `p`: a polyline needs at least 2 points
- Fix: fix the point count, e.g. {"polyline":{"points":[[0,0,0],[10,0,0]]}}

### `unused_path`

**warning.** A path nothing follows.

```json title="Scene (final mode)"
{ "paths": { "p": { "polyline": { "points": [[0, 0, 0], [1, 0, 0]] } } } }
```

- Path: `/paths/p`
- Message: path `p` is not used by any `follow` or path instances
- Fix: use it with "follow": {"path": "p"} or remove it: {"op":"remove","path":"/paths/p"}

### `stops_ignored`

**warning.** Stop lines only work in speed mode.

```json title="Scene (final mode)"
{
  "paths": { "p": { "polyline": { "points": [[0, 0, 0], [10, 0, 0]] } } },
  "signals": { "s": { "phases": [{ "state": "go", "duration": 1 }] } },
  "nodes": {
    "a": {
      "follow": {
        "path": "p",
        "duration": 3,
        "stops": [{ "at": 5, "signal": "s" }]
      }
    }
  }
}
```

- Path: `/nodes/a/follow/stops`
- Message: stops only apply when following at a `speed`, not over a `duration`
- Fix: {"op":"remove","path":"/nodes/a/follow/duration"}

### `invalid_signal`

**error.** A signal with no phases, or a reference to a missing signal.

```json title="Scene (final mode)"
{ "signals": { "s": { "phases": [] } } }
```

- Path: `/signals/s/phases`
- Message: signal `s` needs at least one phase with a positive duration
- Fix: {"op":"replace","path":"/signals/s/phases","value":[{"state":"go","duration":5},{"state":"stop","duration":5}]}

### `never_go`

**warning.** A signal that never turns `go`, so followers wait forever.

```json title="Scene (final mode)"
{
  "signals": { "s": { "phases": [{ "state": "stop", "duration": 1 }] } },
  "nodes": { "a": { "show_when": { "signal": "s", "states": ["stop"] } } }
}
```

- Path: `/signals/s/phases`
- Message: signal `s` never shows `go`, so followers would wait forever (they pass instead)
- Fix: add a {"state":"go","duration":5} phase

### `unused_signal`

**warning.** A signal nothing uses.

```json title="Scene (final mode)"
{ "signals": { "s": { "phases": [{ "state": "go", "duration": 1 }] } } }
```

- Path: `/signals/s`
- Message: signal `s` is not used by any stop or `show_when`
- Fix: remove it: {"op":"remove","path":"/signals/s"}

### `never_visible`

**warning.** A `show_when` with no states, so the node never shows.

```json title="Scene (final mode)"
{
  "signals": { "s": { "phases": [{ "state": "go", "duration": 1 }] } },
  "nodes": { "a": { "show_when": { "signal": "s", "states": [] } } }
}
```

- Path: `/nodes/a/show_when/states`
- Message: with no states the node is never shown
- Fix: {"op":"replace","path":"/nodes/a/show_when/states","value":["go"]}

## Export

### `platform_limit`

**warning.** An export longer than the platform allows.

```json title="Scene (final mode)"
{
  "timeline": { "duration": 200 },
  "exports": { "x": { "preset": "x_gif", "duration": 200 } }
}
```

- Path: `/exports/x/duration`
- Message: 200s exceeds the 15s limit for this preset
- Fix: {"op":"replace","path":"/exports/x/duration","value":15}

### `odd_dimensions`

**error.** An MP4 with an odd width or height.

```json title="Scene (final mode)"
{ "exports": { "x": { "preset": "x_16x9", "width": 1001, "height": 563 } } }
```

- Path: `/exports/x`
- Message: video size 1001x563 must have even width and height
- Fix: use 1002x564

### `loop_seam`

**warning.** A looping export that would visibly jump.

```json title="Scene (final mode)"
{
  "nodes": { "a": {} },
  "timeline": {
    "duration": 2,
    "loop": "loop",
    "tracks": {
      "t": {
        "target": "a",
        "property": "opacity",
        "keyframes": [{ "t": 0, "value": 0 }, { "t": 2, "value": 1 }]
      }
    }
  },
  "exports": { "x": { "preset": "x_1x1" } }
}
```

- Path: `/timeline/tracks/t`
- Message: track `t` ends at a different value than it starts, so the loop visibly jumps
- Fix: add a final keyframe equal to the first: {"op":"add","path":"/timeline/tracks/t/keyframes/-","value":{"t":2,"value":0.0}}
