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
use clap::{Parser, Subcommand};
use std::path::PathBuf;
use super::ValidateOutputFormat;
#[derive(clap::Args, Debug, Clone)]
pub struct ValidateArgs {
#[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,
}
#[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 trace dataset
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,
},
/// 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: inspector | jsonrpc | streamable-http | http-sse | sse-legacy (alias for http-sse)
#[arg(long, default_value = "inspector")]
format: String,
#[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>,
},
}