Validation
Validation returns a ValidationReport — a structured result with issues sorted into four severity buckets: critical, error, warning, and info.
What gets checked
Section titled “What gets checked”Structural validation — referential integrity and file presence (no MXF content reads):
- All assets in the PKL exist on disk
- Declared file sizes match
- CPL UUIDs resolve to known assets
- No duplicate UUIDs
- CPL structure conforms to ST 2067-2 and ST 2067-3 Core Constraints
Application profile validation — ST 2067-21 App2E, ST 2067-201 IAB, ST 2067-202 ISXD
Hash validation — SHA-1/SHA-256 against PKL declarations (slow; not available in WASM)
Compliance flags
Section titled “Compliance flags”is_compliant—falsewhencriticalorerrorsis non-emptyis_playable—falsewhencriticalis non-empty
# Structural validation, human-readableimferno validate /path/to/your.imp
# With hash verificationimferno validate /path/to/your.imp --verify-hashes
# JSON output (full ValidationReport)imferno validate /path/to/your.imp --format json
# CI mode — always exit 0imferno validate /path/to/your.imp --format json --exit-zeroSee the CLI Reference for all options.
Structural validation
Section titled “Structural validation”use imferno_core::package::{Imferno, ValidationOptions, read_dir};
let files = read_dir("/path/to/your.imp")?;let report = Imferno::parse_and_validate(files, &ValidationOptions::default());
println!("{}", report.summary());// "Validation Report: 0 critical, 1 errors, 2 warnings, 0 info"Hash validation
Section titled “Hash validation”let files = read_dir("/path/to/your.imp")?;let pkg = Imferno::parse(files)?;let report = pkg.validate_hashes(&ValidationOptions::default());See the Rust API Reference for the full API surface.
import { buildReport } from '@imferno/wasm';
const report = await buildReport({ 'ASSETMAP.xml': assetmapXml, 'PKL_abc.xml': pklXml, 'CPL_def.xml': cplXml,});
console.log(report.validation.is_compliant);console.log(report.validation.errors);See the WASM API Reference for the full API surface.
Validate on disk
Section titled “Validate on disk”import { buildReportFromPath } from '@imferno/node';
const report = buildReportFromPath('./my-imp');console.log(report.validation.is_compliant);Validate from strings
Section titled “Validate from strings”import { buildReport } from '@imferno/node';
const report = buildReport({ 'ASSETMAP.xml': assetmapXml, 'PKL_abc.xml': pklXml, 'CPL_def.xml': cplXml,});See the Node.js API Reference for the full API surface.
Validation codes
Section titled “Validation codes”Each issue carries a typed code string (e.g. ST2067-2:2020:8.3/FileNotFound), a human-readable message, severity, category, and optional location.
See the Validation Codes reference for the full catalogue.