pub fn validate_bytes(
bytes: &[u8],
mode: Mode,
) -> Result<Vec<ValidationIssue>, String>Expand description
Validate an ATIF trajectory from
its RAW BYTES. This is the correct entry point for every path
that receives operator/attacker-supplied ATIF content (CLI
avctl atif-validate, reconciler recovery + promotion). Unlike
serde_json::from_slice::<Trajectory>() + validate_trajectory,
the bytes path:
- Refuses duplicate JSON keys anywhere in the payload
(parallel to
av_receipts::Receipt::from_json_slice’s strict pre-scan), so the auditor cannot be shown a document whose “last wins” reading differs from the “first wins” reading. - Runs
validate_valueon the parsedserde_json::Value— the untyped path exercisescheck_unknown_fields, which the typedTrajectory(nodeny_unknown_fields) silently drops.
Returns Err(reason) on duplicate-key or parse failure; returns
Ok(issues) on successful parse (issues may be empty).