graphrt-eval 0.6.1

Evaluation harness for graphrt workflows: datasets, deterministic, trajectory, retrieval and LLM-judge assertions, trials, baselines, CI gates, JSON and JUnit reports.
Documentation
//! # graphrt-eval
//!
//! Evaluate graphrt workflows against test cases, in CI or from `cargo test`.
//!
//! - [`EvalSuite`]: an eval file (`*.eval.yaml`, Promptfoo-shaped `tests` /
//!   `assert` / `defaultTest`) plus an optional JSONL dataset.
//! - [`Runner`]: runs every case against a [`Target`] (usually an
//!   [`EngineTarget`] around one compiled graph), concurrently, and scores it.
//! - [`assertion`]: deterministic output checks, latency and token budgets,
//!   agent trajectory checks and retrieval metrics, behind the [`Assertion`]
//!   trait so other crates can add types.
//! - [`judge`]: LLM judges written as graphrt workflows (`type: judge`),
//!   compiled once through a [`judge::JudgeLoader`] and versioned by fingerprint.
//! - [`stats`]: unbiased pass@k / pass^k over trials, and judge agreement
//!   (TPR, TNR, Cohen's kappa) for [`calibration`] suites.
//! - [`online`]: evaluators that score a sample of production runs in
//!   `graphrt serve` (no expected answers: judges, regexes, schemas, budgets,
//!   trajectories), with deterministic per-run sampling and filters.
//! - [`EvalReport`]: the summary, the gate verdict, the [`baseline`]
//!   comparison, and JSON / JUnit output.
//!
//! The harness is not part of the engine: it only consumes the run's event
//! stream, so runs evaluated here behave exactly like production runs.
//!
//! ```no_run
//! # async fn demo(engine: graphrt_core::Engine) -> Result<(), graphrt_eval::EvalError> {
//! use graphrt_eval::{EngineTarget, EvalSuite, Runner, RunnerOptions};
//!
//! let suite = EvalSuite::load(std::path::Path::new("evals/hello.eval.yaml"))?;
//! let report = Runner::new(RunnerOptions::default())
//!     .run(&suite, &EngineTarget::new(engine), |result| eprintln!("{}", graphrt_eval::report::format_result_line(result)))
//!     .await?;
//! assert!(report.gate_passed(), "{}", graphrt_eval::report::format_summary(&report));
//! # Ok(())
//! # }
//! ```

pub mod assertion;
pub mod baseline;
pub mod calibration;
pub mod capture;
pub mod config;
pub mod error;
mod glob;
pub mod judge;
pub mod online;
pub mod path;
pub mod report;
pub mod runner;
pub mod schema;
pub mod stats;

pub use assertion::{Assertion, AssertionContext, AssertionRegistry, AssertionResult, Outcome};
pub use capture::{RetrievalHit, RunCapture, RunStatus, ToolCallRecord};
pub use config::{AssertionSpec, Calibration, EvalSuite, Gate, TestCase, Tolerance};
pub use error::EvalError;
pub use judge::{JudgeLoader, Verdict};
pub use report::{EvalReport, Summary, TestResult, TestStatus};
pub use runner::{EngineTarget, Runner, RunnerOptions, Target};