Skip to content

rereel validate

Static checks for a bundle. It does not need FFmpeg or network access, and without --check-media it does not need any media on disk, which makes it safe for CI and pre-commit hooks.

Terminal window
rereel validate <reel_dir> [--check-media]
  1. rereel.json must exist (SPEC_MISSING) and parse (SPEC_INVALID). If either check fails, validation stops here.
  2. schemaVersion must be 1 (SCHEMA_VERSION). video.width, video.height, video.fps must be positive numbers (VIDEO_SPEC_INVALID).
  3. Lockfile (lockFile, default rereel.lock.json) must exist (LOCK_MISSING) and parse (LOCK_INVALID).
  4. Media references are collected:
    • For kind other than composite_merge: props.json (propsFile) must exist (PROPS_MISSING) and parse (PROPS_INVALID). All strings ending in a media extension (excluding http(s)://, data:, and anything under output / layoutReport / log keys) are collected.
    • For composite_merge: parts must be non-empty (PARTS_MISSING). media parts contribute mediaPath. chapter parts must have <reelDir>/rereel.json on disk (CHAPTER_MISSING).
  5. Mix plan (only when audioMode is mix_plan): a missing file is a warning (MIX_PLAN_MISSING, since build can derive one from props). An unparseable file is MIX_PLAN_INVALID. Media references are collected, and each narration[i] is checked: negative start_sec or src_start_sec → NEGATIVE_TIME, and duration_sec <= 0 → INVALID_DURATION.
  6. Each reference: starting with / → ABSOLUTE_PATH. Neither a lock key nor present at <reel_dir>/<ref> → UNLOCKED_ASSET.
  7. Each lock item: source: "storage" without uri → MISSING_URI. vfr: true → warning VFR_MEDIA. With --check-media, storage items must exist on disk (MEDIA_NOT_HYDRATED) and match their SHA-256 (MEDIA_SHA_MISMATCH).

valid is true when there are zero errors. Warnings do not affect validity.

Flag Type Default Description
<reel_dir> path (positional) — (required) Bundle directory.
--check-media flag off Also verify that every storage item is hydrated and its SHA-256 matches.
--storage-config path — Accepted (global) but unused by validation itself.
Code Level Path example
SPEC_MISSING error rereel.json
SPEC_INVALID error rereel.json
SCHEMA_VERSION error rereel.json.schemaVersion
VIDEO_SPEC_INVALID error rereel.json.video
LOCK_MISSING / LOCK_INVALID error rereel.lock.json
PROPS_MISSING / PROPS_INVALID error props.json
PARTS_MISSING error rereel.json.parts
CHAPTER_MISSING error rereel.json.parts[0].reelDir
MIX_PLAN_MISSING warning mix_plan.json
MIX_PLAN_INVALID error mix_plan.json
NEGATIVE_TIME / INVALID_DURATION error mix_plan.json.narration[2]
ABSOLUTE_PATH error props.json.scenes[0].image_path
UNLOCKED_ASSET error props.json.scenes[1].image_path
MISSING_URI error rereel.lock.json.items["media/bg_1a2b3c4d.png"]
VFR_MEDIA warning rereel.lock.json.items["media/clip_9f8e7d6c.mp4"]
MEDIA_NOT_HYDRATED / MEDIA_SHA_MISMATCH error media/bg_1a2b3c4d.png
{
"valid": false,
"reelDir": "/abs/path/reels/ep01",
"errors": [
{
"level": "error",
"code": "UNLOCKED_ASSET",
"path": "props.json.scenes[1].image_path",
"message": "Asset \"raw/new_shot.png\" is not in rereel.lock.json and not present on disk"
}
],
"warnings": []
}

Note that there is no status key on success. Validation problems are reported in the body, not as an error object.

Code When
0 valid: true (warnings allowed).
1 valid: false. The full report is still printed.
2 Missing <reel_dir> argument, or an unparseable storage config (loaded globally before the command runs).
Terminal window
rereel validate ./reels/ep01

Gate a commit on full media integrity:

Terminal window
rereel validate ./reels/ep01 --check-media | jq -e '.valid'