Skip to main content

kaizen/eval/
rubric.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2
3#[derive(Debug, Clone)]
4pub struct Rubric {
5    pub id: &'static str,
6    pub name: &'static str,
7    pub prompt_template: &'static str,
8}
9
10const TOOL_EFFICIENCY_V1: Rubric = Rubric {
11    id: "tool-efficiency-v1",
12    name: "Tool Efficiency",
13    prompt_template: "You are an expert code-agent evaluator.\n\
14        Score the following agent session on tool efficiency (0.0 = very poor, 1.0 = excellent).\n\
15        Penalise redundant tool calls, excessive retries, and ignored errors.\n\
16        Reward sessions that reach the goal with minimal steps.\n\n\
17        Session summary:\n{summary}\n\n\
18        Reply with JSON only: {\"score\": <float 0-1>, \"rationale\": \"<one sentence>\"}",
19};
20
21pub fn by_id(id: &str) -> Option<&'static Rubric> {
22    match id {
23        "tool-efficiency-v1" => Some(&TOOL_EFFICIENCY_V1),
24        _ => None,
25    }
26}