1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
use clap::{Parser, Subcommand};
use std::path::PathBuf;
use super::ValidateOutputFormat;
#[derive(clap::Args, Debug, Clone)]
pub struct ValidateArgs {
/// Path to config (same as --config)
#[arg(value_name = "CONFIG", conflicts_with = "config")]
pub config_path: Option<std::path::PathBuf>,
#[arg(long, default_value = "assay.yaml")]
pub config: std::path::PathBuf,
#[arg(long)]
pub trace_file: Option<std::path::PathBuf>,
#[arg(long)]
pub baseline: Option<std::path::PathBuf>,
#[arg(long, default_value = "false")]
pub replay_strict: bool,
#[arg(long, value_enum, default_value_t = ValidateOutputFormat::Text)]
pub format: ValidateOutputFormat,
#[arg(long)]
pub output: Option<std::path::PathBuf>,
/// Fail if deprecated v1 policy format is detected
#[arg(long)]
pub deny_deprecations: bool,
}
impl ValidateArgs {
pub fn resolved_config(&self) -> &std::path::PathBuf {
self.config_path.as_ref().unwrap_or(&self.config)
}
}
#[derive(Parser, Clone)]
pub struct QuarantineArgs {
#[command(subcommand)]
pub cmd: QuarantineSub,
#[arg(long, default_value = ".eval/eval.db")]
pub db: PathBuf,
#[arg(long, default_value = "demo")]
pub suite: String,
}
#[derive(Subcommand, Clone)]
pub enum QuarantineSub {
Add {
#[arg(long)]
test_id: String,
#[arg(long)]
reason: String,
},
Remove {
#[arg(long)]
test_id: String,
},
List,
}
#[derive(Parser, Clone)]
pub struct TraceArgs {
#[command(subcommand)]
pub cmd: TraceSub,
}
#[derive(Subcommand, Clone)]
pub enum TraceSub {
/// Ingest a raw JSONL log file and normalize to a trace dataset; when --output ends in .db or .sqlite, write the store
Ingest {
#[arg(long)]
input: PathBuf,
#[arg(long)]
output: PathBuf,
},
/// Ingest OpenTelemetry JSONL traces (GenAI SemConv)
IngestOtel {
#[arg(long)]
input: PathBuf,
#[arg(long)]
db: PathBuf,
/// Optional: Link ingested traces to a new run in this suite
#[arg(long)]
suite: Option<String>,
/// Optional: Write converted trace events to this JSONL file (V2 format) for replay
#[arg(long)]
out_trace: Option<PathBuf>,
},
/// Verify a trace dataset covers all prompts in eval config
Verify {
#[arg(long)]
trace: PathBuf,
#[arg(long)]
config: PathBuf,
/// Stage whose clean truncation observation may read `measured_clean`.
/// Repeat once per stage. Nothing is trusted by default; reported loss
/// reads `lossy` regardless. The ingest stage is `assay.trace.upgrader`.
#[arg(long = "trust-stage", value_name = "STAGE")]
trust_stage: Vec<String>,
},
/// Precompute embeddings for trace entries
PrecomputeEmbeddings {
#[arg(long)]
trace: PathBuf,
#[arg(long)]
config: PathBuf, // Needed to know which model/embedder to use? Or explicitly pass embedder?
// Plan says: --trace dataset.jsonl --embedder openai
// But we also need model info potentially. Let's start with explicit args.
#[arg(long)]
embedder: String,
#[arg(long, default_value = "text-embedding-3-small")]
model: String,
#[arg(long)]
output: Option<PathBuf>,
},
/// Precompute judge scores for trace entries
PrecomputeJudge {
#[arg(long)]
trace: PathBuf,
#[arg(long)]
config: PathBuf, // Judge config usually in eval.yaml or separate args?
// Plan says: --judge openai
#[arg(long)]
judge: String,
#[arg(long)]
judge_model: Option<String>,
#[arg(long)]
output: Option<PathBuf>,
},
/// Import an MCP transcript and convert to Assay V2 trace
ImportMcp {
#[arg(long)]
input: PathBuf,
#[arg(long)]
out_trace: PathBuf,
/// Input format for the transcript.
#[arg(long, value_enum, default_value_t = crate::cli::args::common::McpTranscriptFormat::Inspector)]
format: crate::cli::args::common::McpTranscriptFormat,
#[arg(long)]
episode_id: Option<String>,
#[arg(long)]
test_id: Option<String>,
/// User prompt text (strongly recommended for replay strictness)
#[arg(long)]
prompt: Option<String>,
},
}