Expand description
ATIF validator, mirroring Harbor’s trajectory-validator semantics:
validates required fields, types and constraints, sequential step ids
(starting from 1), tool-call references in observations, ISO-8601
timestamps, agent-only field placement — and collects errors as it goes
(not just the first), up to MAX_VALIDATION_ISSUES, after which a
truncation notice is appended.
Two modes (Mode): Strict additionally rejects unknown fields outside
the spec’s extra escape hatches (outbound gate for files we produce);
Compat tolerates unknown fields (inbound tolerance for files produced by
newer or third-party writers).
Structs§
- Validation
Issue - One validation problem, with a Harbor-style dotted path.
Enums§
- Mode
- Validation mode.
Constants§
- MAX_
COST_ USD - Upper bound for USD-denominated cost fields
(
total_cost_usdinfinal_metrics,cost_usdper step). Aligned with the downstream recovery scaling inav_harness::session::cost_from_atif_total: recovery converts dollars → micros viacost * USD_MICROS_PER_DOLLAR (1_000_000)and refuses results exceedingJCS_SAFE_MAX = 2^53. Setting the strict-validator cap at9e9(nine billion USD) fits comfortably belowJCS_SAFE_MAX / USD_MICROS_PER_DOLLAR (~9.007e9)and ensures every trajectory that passes strict validation can also pass recovery — before this alignment the validator accepted up to1e12(one trillion USD) while recovery capped at ~9e9, so hypothetical mid-range trajectories became unrecoverable with an explicit “recovered cost exceeds JCS-safe bounds” error. - MAX_
VALIDATION_ ISSUES - Cap on the number of issues collected by
validate_value.
Functions§
- validate_
bytes - 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). Unlikeserde_json::from_slice::<Trajectory>()+validate_trajectory, the bytes path: - validate_
trajectory - Validate a typed trajectory (serializes then defers to
validate_value). - validate_
value - Validate a raw JSON value as an ATIF trajectory.