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 command_check;
15pub mod diff_scope;
16pub mod finalize;
17pub mod judge_tasks;
18pub mod transcript_check;
19
20use std::path::Path;
21
22use crate::core::{ConditionsRecord, EvalsConfig};
23
24pub use command_check::{CommandCheckSummary, grade_command_checks};
25pub use finalize::{FinalizeSummary, finalize};
26pub use judge_tasks::{EmitSummary, check_skill_invoked_from_transcript, emit_judge_tasks};
27pub use transcript_check::{grade_transcript_check, grade_transcript_check_with_context};
28
29/// The resolved inputs both grade modes read: the iteration directory, the
30/// conditions manifest, and the validated evals config (its `skill_name` is the
31/// one used in meta-check rubrics).
32pub struct GradeContext<'a> {
33 pub iteration_dir: &'a Path,
34 pub conditions: &'a ConditionsRecord,
35 pub evals: &'a EvalsConfig,
36}