Skip to main content

eval_magic/pipeline/grade/
mod.rs

1//! Stage 4 — `grade`.
2//!
3//! Decomposed into focused units:
4//!
5//! - [`transcript_check`] — grade a `transcript_check` assertion (regex over the
6//!   run's tool invocations).
7//! - [`judge_tasks`] — emit LLM judge tasks + the skill-invocation meta-check
8//!   (`emit_judge_tasks`), the default mode.
9//! - [`finalize`] — fold judge responses + transcript checks into `grading.json`
10//!   (`--finalize` mode).
11//!
12//! Both modes operate over a shared [`GradeContext`] assembled by the CLI.
13
14pub mod finalize;
15pub mod judge_tasks;
16pub mod transcript_check;
17
18use std::path::Path;
19
20use crate::core::{ConditionsRecord, EvalsConfig};
21
22pub use finalize::{FinalizeSummary, finalize};
23pub use judge_tasks::{EmitSummary, check_skill_invoked_from_transcript, emit_judge_tasks};
24pub use transcript_check::grade_transcript_check;
25
26/// The resolved inputs both grade modes read: the iteration directory, the
27/// conditions manifest, and the validated evals config (its `skill_name` is the
28/// one used in meta-check rubrics).
29pub struct GradeContext<'a> {
30    pub iteration_dir: &'a Path,
31    pub conditions: &'a ConditionsRecord,
32    pub evals: &'a EvalsConfig,
33}