//! Offline AST-style validation of a recorded tool-call trace (,
//! extended with trajectory match modes and path-efficiency scoring in
//! ).
//!
//! Why this module exists: once an agent run is recorded into a cassette
//! (see `crate::cassette`), CI wants a cheap deterministic check that the
//! model called the right functions with the right argument shapes,
//! without re-running the model. This is the "abstract syntax tree"
//! checking pattern from the Berkeley Function-Calling Leaderboard (BFCL,
//! ICML 2025): match the recorded call structure (function name plus
//! argument shape) against an expected structure, not the model's prose
//! and not a live execution. See `docs/offline-trace-validation.md` for
//! the provenance write-up.
//!
//! The validator is pure: it takes the `tool_calls` array pulled out of a
//! trace envelope (a `serde_json::Value`) and an [`ExpectedTrace`], and
//! returns a [`TraceValidation`] carrying per-position diffs. No provider,
//! no transport, no I/O, so it is unit-testable and reusable by the SDK
//! hosts and the enterprise audit chain the same way the rest of `eval` is.
//!
//! Argument shapes reuse the existing matchers rather than reimplementing
//! JSON comparison: [`ExpectedArgs::Subset`] runs `crate::matchers::contains`
//! (object subset, multiset arrays) and [`ExpectedArgs::Schema`] runs
//! `crate::matchers::schema` (JSON Schema validation).
//!
//! ## Trajectory match modes
//!
//! The five [`MatchMode`] variants form a named, deterministic
//! trajectory-assertion vocabulary over the recorded trajectory, the
//! cross-tool consensus feature (agentevals, lastmile, DeepEval, Ragas).
//! [`MatchMode`]'s own documentation lays out how the five relate.
//!
//! ## Golden-path scoring
//!
//! Beyond pass/fail matching, [`GoldenPath`] scores a trajectory for
//! efficiency against an ideal call sequence. [`score_golden_path`] returns
//! a [`PathScore`] that counts wasted work (backtracking, repeated tools,
//! extra steps) and folds the counts into a single `0.0..=1.0` penalty.

mod engine;
mod expected;
mod golden_path;
mod trajectory_axes;

pub use expected::{
    tool_calls_from_envelope, validate_trace, ExpectedArgs, ExpectedCall, ExpectedTrace, MatchMode,
    TraceMismatch, TraceValidation,
};
pub use golden_path::{score_golden_path, GoldenPath, PathScore};
pub use trajectory_axes::{
    score_trajectory_axes, trajectory_axes_metrics, AxesScore, DependencyEdge,
};
