From 27caa0fcf6cc87aa8acf20f0a600f7212af8ceb5 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Thu, 19 Nov 2026 12:20:29 -0800 Subject: [PATCH] Update collect to be execute --- README.md | 8 ++++---- core/PROTOCOL.md | 8 ++++---- core/README.md | 10 +++++----- core/src/cli/args.rs | 12 +++++------ core/src/cli/mod.rs | 4 ++-- core/src/commands/compare.rs | 4 ++-- core/src/commands/offline.rs | 20 +++++++++---------- core/src/commands/online.rs | 18 ++++++++--------- core/src/commands/runs.rs | 8 ++++---- core/src/eac/phases/credentials.rs | 6 +++--- .../src/eac/phases/{collect.rs => execute.rs} | 14 ++++++------- core/src/eac/phases/judge.rs | 2 +- core/src/eac/phases/mod.rs | 4 ++-- core/src/eac/run/manifest.rs | 2 +- core/src/schema/document.rs | 4 ++-- core/src/schema/protocol.schema.json | 12 +++++------ core/src/schema/worker_methods.rs | 4 ++-- core/tests/cli.rs | 20 +++++++++---------- core/tests/fixtures/project/eac/worker.py | 2 +- docs/app/cli/page.mdx | 6 +++--- docs/app/concepts/page.mdx | 6 +++--- docs/app/page.mdx | 2 +- docs/app/protocol/page.mdx | 2 +- docs/app/quick-start/page.mdx | 2 +- examples/basic-example-python/README.md | 2 +- sdks/python/README.md | 6 +++--- sdks/python/eac/protocol.py | 6 +++--- sdks/python/eac/runner/runner.py | 2 +- sdks/python/eac/worker.py | 4 ++-- 29 files changed, 100 insertions(+), 100 deletions(-) rename core/src/eac/phases/{collect.rs => execute.rs} (89%) diff --git a/README.md b/README.md index 9a55d0c..3fd1bd8 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,12 @@ You write the runner that calls your system, the cases, and the judges that scor ```sh eac list # the datasets and cases eac found - eac offline run --dataset chat # seed, collect and judge every case in the chat dataset + eac offline run --dataset chat # seed, execute and judge every case in the chat dataset # Alternatively, run each step separately eac offline seed --dataset chat # seed (create fixtures) into a new run - eac offline collect # collect (run each case) for the latest run - eac offline judge # judge (judge output of collect) for the latest run + eac offline execute # execute (run each case) for the latest run + eac offline judge # judge (judge output of execute) for the latest run ``` [`examples/basic-example-python`](examples/basic-example-python) is a fuller @@ -112,7 +112,7 @@ Online evals judge what your system already did in production, so nothing is re- eac online run --dataset chat --judge greets --since 24h # collect the last 24h of production runs and judge them # Alternatively, run each step separately - eac online collect --dataset chat --since 24h # collect production runs as cases into a new run + eac online execute --dataset chat --since 24h # execute (collect production runs as cases) into a new run eac online judge --judge greets # judge the latest collected run ``` diff --git a/core/PROTOCOL.md b/core/PROTOCOL.md index 9e4bc15..14333ce 100644 --- a/core/PROTOCOL.md +++ b/core/PROTOCOL.md @@ -52,11 +52,11 @@ Each phase sends its own methods, so a worker only needs to answer the ones for ``` offline seed discover → args.validate → seed.setup -offline collect case.run +offline execute case.run offline judge case.judge offline run all three phases, then seed.teardown for uncached seeds (compare does the same for each arm) offline prune discover → seed.teardown -online collect discover → args.validate → online.collect +online execute discover → args.validate → online.execute online judge args.validate → online.judge list, catalog discover auth discover → args.validate → credentials.check → credentials.login @@ -71,7 +71,7 @@ These types show up in the params and results of many methods: ```jsonc // Case: an offline case, or a production run collected for online judging {"name": "get_dsn", "input": {}, "expected_output": {}, - "output": {}, "conversation_id": "abc", // what the system produced: set by online.collect, and by eac when judging + "output": {}, "conversation_id": "abc", // what the system produced: set by online.execute, and by eac when judging "splits": ["smoke"], "enabled": true, // disabled cases run only when picked by name or split "seeds": [Seed], "judges": ["regex"]} // judge names are for display; judges run in the worker @@ -164,7 +164,7 @@ Scores one case's output and returns `{"scores": [Score]}`. **Agent traces.** Without a `trace`, the judges may fetch the agent run's trace, looking it up by the case's `conversation_id`, the dataset's `agent` and when the case ran (`started_at` and `ended_at`, RFC 3339). Give every judge the same trace, and return it as `"trace"`, with the LLM usage it records as `"trace_metrics"` (a Metrics). eac saves it under `traces/` in the run and sends it back as `trace` when the run is judged again. Its metrics replace the ones `case.run` returned. A failed fetch should only warn, since judges can run without a trace. -### `online.collect` +### `online.execute` Params: `{"dataset", "since", "until", "limit", "args"}`. diff --git a/core/README.md b/core/README.md index b53f7fc..0649793 100644 --- a/core/README.md +++ b/core/README.md @@ -20,7 +20,7 @@ The CLI drives every run, but your code runs in separate SDK processes. The CLI ┌────────────────────────┐ ┌──────────────────────────────────┐ │ eac CLI │ ── requests ─► │ workers python -m eac.worker │ │ │ ◄─ responses ─ │ your runners, judges and seeds │ -│ seed → collect → judge │ └──────────────────────────────────┘ +│ seed → execute → judge │ └──────────────────────────────────┘ └────────────┬───────────┘ │ each phase's results ▼ @@ -65,7 +65,7 @@ Offline evals run evals on cases you wrote, in three phases: ``` eac offline seed pick the cases, create a run, set up its seeds -> seeds.json -eac offline collect run the system under test on each case & collect results -> outputs/ +eac offline execute run the system under test on each case & save its output -> outputs/ eac offline judge score each output -> scores/ traces/ results/ summary.json ``` @@ -73,7 +73,7 @@ eac offline judge score each output Picks the cases, creates the run and sets up each case's seeds (fixtures like a project or a database). Cases that share a seed share one setup, and cached seeds are reused from earlier runs, or loaded from the seed's own cache. The run id is printed to stdout so CI can pass it to the later phases. -**Collect** +**Execute** Sends each case to a worker along with its seeds and a conversation id for tagging the agent's run. The worker calls the dataset's runner and eac saves whatever it returns as the case's output. @@ -88,11 +88,11 @@ Runs the case's judges on its output, and saves the scores, results and a summar Online evals judge what your system already did in production. There are no seeds, so there are only two phases: ``` -eac online collect collect production runs from a time window as cases -> outputs/ +eac online execute collect production runs from a time window as cases -> outputs/ eac online judge score each case with the picked judges -> scores/ traces/ results/ summary.json ``` -**Collect** +**Execute** Asks each dataset's online runner for the production runs in a time window (`--since`, `--window-end`, `--limit`), as cases with their outputs, and saves each output. diff --git a/core/src/cli/args.rs b/core/src/cli/args.rs index 9cf7660..ddf8aad 100644 --- a/core/src/cli/args.rs +++ b/core/src/cli/args.rs @@ -56,11 +56,11 @@ pub enum SchemaKind { pub enum Offline { /// Set up fixtures -> seeds.json, printing the new run's id Seed(SeedArgs), - /// Collect outputs by running the system under test on a seeded run -> outputs/ - Collect(PhaseArgs), + /// Execute a seeded run by running the system under test on each case -> outputs/ + Execute(PhaseArgs), /// Score recorded outputs -> scores/, results/, summary.json Judge(PhaseArgs), - /// Seed, collect and judge in one go + /// Seed, execute and judge in one go Run(RunArgs), /// Run a dataset comparison, one run per arm with shared seeds Compare(CompareArgs), @@ -73,10 +73,10 @@ pub enum Offline { #[derive(Subcommand)] pub enum Online { /// Collect production runs from a window as cases -> outputs/, printing the new run's id - Collect(OnlineCollectArgs), + Execute(OnlineExecuteArgs), /// Score a collected run's cases with --judge -> scores/, results/, summary.json Judge(OnlineJudgeArgs), - /// Collect and judge in one go + /// Execute and judge in one go Run(OnlineRunArgs), } @@ -188,7 +188,7 @@ pub struct PruneArgs { } #[derive(Args)] -pub struct OnlineCollectArgs { +pub struct OnlineExecuteArgs { #[command(flatten)] pub scope: Scope, #[command(flatten)] diff --git a/core/src/cli/mod.rs b/core/src/cli/mod.rs index 7a1e206..644c8d9 100644 --- a/core/src/cli/mod.rs +++ b/core/src/cli/mod.rs @@ -19,13 +19,13 @@ pub fn dispatch(command: Command) -> Result<()> { Command::Schema { which } => commands::schema(which), Command::Offline(Offline::Seed(a)) if a.teardown => offline::teardown(&a), Command::Offline(Offline::Seed(a)) => offline::seed(&a), - Command::Offline(Offline::Collect(a)) => offline::collect(&a), + Command::Offline(Offline::Execute(a)) => offline::execute(&a), Command::Offline(Offline::Judge(a)) => offline::judge(&a), Command::Offline(Offline::Run(a)) => offline::run(&a), Command::Offline(Offline::Compare(a)) => commands::compare(&a), Command::Offline(Offline::Shards(a)) => offline::shards(&a), Command::Offline(Offline::Prune(a)) => offline::prune(&a), - Command::Online(Online::Collect(a)) => online::collect(&a), + Command::Online(Online::Execute(a)) => online::execute(&a), Command::Online(Online::Judge(a)) => online::judge(&a), Command::Online(Online::Run(a)) => online::run(&a), } diff --git a/core/src/commands/compare.rs b/core/src/commands/compare.rs index 794ad0b..c62ab67 100644 --- a/core/src/commands/compare.rs +++ b/core/src/commands/compare.rs @@ -5,7 +5,7 @@ use std::slice; use anyhow::{bail, Context, Result}; -use super::runs::{check_judge_args, create_run, seed_collect_judge}; +use super::runs::{check_judge_args, create_run, seed_execute_judge}; use crate::cli::CompareArgs; use crate::eac::{select, ArmRef, Comparison, Dataset, Discovered, Engine, Manifest, ALL_PHASES}; use crate::report::{self, join_or_none}; @@ -115,7 +115,7 @@ fn compare_dataset( let (run, m) = create_run(engine, m)?; report::phase(&format!("arm {arm}")); info!("run {}", run.id); - let summary = seed_collect_judge(engine, &run, &m, a.keep_seeds)?; + let summary = seed_execute_judge(engine, &run, &m, a.keep_seeds)?; rows.push((arm, run.id, summary)); } report::print_comparison(&format!("compare {label}"), &rows); diff --git a/core/src/commands/offline.rs b/core/src/commands/offline.rs index b03a3e9..cff0ec5 100644 --- a/core/src/commands/offline.rs +++ b/core/src/commands/offline.rs @@ -5,7 +5,7 @@ use std::collections::HashSet; use anyhow::Result; use super::runs::{ - check_judge_args, create_run, fail_on, judge_run, open_run, seed_collect_judge, seed_run, + check_judge_args, create_run, fail_on, judge_run, open_run, seed_execute_judge, seed_run, teardown_uncached, }; use crate::cli::{ListArgs, PhaseArgs, PruneArgs, RunArgs, RunFlags, SeedArgs}; @@ -42,16 +42,16 @@ pub fn teardown(a: &SeedArgs) -> Result<()> { teardown_uncached(&mut engine, &seeds) } -/// Collects a seeded run's outputs by running the system under test on each -/// case. -pub fn collect(a: &PhaseArgs) -> Result<()> { +/// Executes a seeded run: runs the system under test on each case and saves +/// its output. +pub fn execute(a: &PhaseArgs) -> Result<()> { let mut engine = a.project.engine()?; engine.set_concurrency(a.concurrency); - let (run, m) = open_run(&engine, &a.run, Mode::Offline, "collect")?; - engine.check_credentials(&m.datasets, &[Phase::Collect])?; + let (run, m) = open_run(&engine, &a.run, Mode::Offline, "execute")?; + engine.check_credentials(&m.datasets, &[Phase::Execute])?; let seeds = run.read_seeds()?; - report::phase("collect"); - engine.collect(&run, &m, &seeds)?; + report::phase("execute"); + engine.execute(&run, &m, &seeds)?; info!("run {}", run.id); Ok(()) } @@ -65,7 +65,7 @@ pub fn judge(a: &PhaseArgs) -> Result<()> { fail_on(judge_run(&mut engine, &run, &m)?) } -/// Seeds, collects and judges, then tears down uncached seeds. +/// Seeds, executes and judges, then tears down uncached seeds. pub fn run(a: &RunArgs) -> Result<()> { let mut engine = a.scope.project.engine()?; engine.set_concurrency(a.concurrency); @@ -73,7 +73,7 @@ pub fn run(a: &RunArgs) -> Result<()> { let selection = a.select.selection(Some(&a.shard)); let (run, m) = start_run(&mut engine, &found, selection, &a.run_flags, &a.judge_args, ALL_PHASES)?; - fail_on(seed_collect_judge(&mut engine, &run, &m, a.keep_seeds)?) + fail_on(seed_execute_judge(&mut engine, &run, &m, a.keep_seeds)?) } /// Prints the most shards any selected dataset plans, for CI to fan out. diff --git a/core/src/commands/online.rs b/core/src/commands/online.rs index 34a2e3a..0b89736 100644 --- a/core/src/commands/online.rs +++ b/core/src/commands/online.rs @@ -4,20 +4,20 @@ use anyhow::{bail, Context, Result}; use chrono::{DateTime, SecondsFormat, Utc}; use super::runs::{check_judge_args, create_run, judge_run, open_run}; -use crate::cli::{OnlineCollectArgs, OnlineJudgeArgs, OnlineRunArgs, RunFlags, Scope, WindowFlags}; +use crate::cli::{OnlineExecuteArgs, OnlineJudgeArgs, OnlineRunArgs, RunFlags, Scope, WindowFlags}; use crate::eac::{Dataset, Engine, Manifest, Phase, Run, Window}; use crate::report::{self, join_or_none}; use crate::schema::{Mode, Object}; /// Collects production runs from the window into a new run, printing its /// id on stdout so CI can pass it to `eac online judge`. -pub fn collect(a: &OnlineCollectArgs) -> Result<()> { +pub fn execute(a: &OnlineExecuteArgs) -> Result<()> { let window = parse_window(&a.window)?; let mut engine = a.scope.project.engine()?; let mut datasets = online_datasets(&mut engine, &a.scope)?; validate_args(&mut engine, &mut datasets, &a.run_flags)?; - engine.check_credentials(&datasets, &[Phase::Collect])?; - let (run, _) = collect_run(&mut engine, datasets, window, &a.run_flags)?; + engine.check_credentials(&datasets, &[Phase::Execute])?; + let (run, _) = execute_run(&mut engine, datasets, window, &a.run_flags)?; info!("run {}", run.id); println!("{}", run.id); Ok(()) @@ -69,8 +69,8 @@ pub fn run(a: &OnlineRunArgs) -> Result<()> { let mut datasets = online_datasets(&mut engine, &a.scope)?; pick_judges(&mut datasets, &a.judges, &a.judge_args.clone().unwrap_or_default())?; validate_args(&mut engine, &mut datasets, &a.run_flags)?; - engine.check_credentials(&datasets, &[Phase::Collect, Phase::Judge])?; - let (run, m) = collect_run(&mut engine, datasets, window, &a.run_flags)?; + engine.check_credentials(&datasets, &[Phase::Execute, Phase::Judge])?; + let (run, m) = execute_run(&mut engine, datasets, window, &a.run_flags)?; judge_run(&mut engine, &run, &m)?; Ok(()) } @@ -149,15 +149,15 @@ fn pick_judges(datasets: &mut [Dataset], judges: &[String], judge_args: &Object) } /// Collects each dataset's production runs in the window into a new run. -fn collect_run( +fn execute_run( engine: &mut Engine, mut datasets: Vec, window: Window, run_flags: &RunFlags, ) -> Result<(Run, Manifest)> { - report::phase("collect"); + report::phase("execute"); detail!("{} -> {}, up to {} per dataset", window.since, window.until, window.limit); - let outputs = engine.collect_online(&mut datasets, &window)?; + let outputs = engine.execute_online(&mut datasets, &window)?; let m = Manifest { online: true, window: Some(window), diff --git a/core/src/commands/runs.rs b/core/src/commands/runs.rs index a2d1fdd..eaa7c77 100644 --- a/core/src/commands/runs.rs +++ b/core/src/commands/runs.rs @@ -66,17 +66,17 @@ pub fn seed_run(engine: &mut Engine, run: &Run, m: &Manifest) -> Result { Ok(seeds) } -/// Seeds, collects and judges a new run, then tears down its uncached seeds +/// Seeds, executes and judges a new run, then tears down its uncached seeds /// unless they're kept. -pub fn seed_collect_judge( +pub fn seed_execute_judge( engine: &mut Engine, run: &Run, m: &Manifest, keep_seeds: bool, ) -> Result { let seeds = seed_run(engine, run, m)?; - report::phase("collect"); - let summary = engine.collect(run, m, &seeds).and_then(|()| judge_run(engine, run, m)); + report::phase("execute"); + let summary = engine.execute(run, m, &seeds).and_then(|()| judge_run(engine, run, m)); if !keep_seeds { let _ = teardown_uncached(engine, &seeds); } diff --git a/core/src/eac/phases/credentials.rs b/core/src/eac/phases/credentials.rs index ab17ab2..bc38c44 100644 --- a/core/src/eac/phases/credentials.rs +++ b/core/src/eac/phases/credentials.rs @@ -15,11 +15,11 @@ use crate::worker::{check_interrupted, Interrupted, Worker}; #[derive(Clone, Copy, PartialEq, Eq)] pub enum Phase { Seed, - Collect, + Execute, Judge, } -pub const ALL_PHASES: &[Phase] = &[Phase::Seed, Phase::Collect, Phase::Judge]; +pub const ALL_PHASES: &[Phase] = &[Phase::Seed, Phase::Execute, Phase::Judge]; /// A credential to check, with the runtime whose SDK checks it. type Needed = (String, Credential); @@ -191,7 +191,7 @@ fn needed(datasets: &[Dataset], phases: &[Phase]) -> Vec { let seeds = d.cases.iter().flat_map(|c| &c.seeds); add(&mut needed, &d.runtime, seeds.flat_map(|s| &s.credentials)); } - if phases.contains(&Phase::Collect) { + if phases.contains(&Phase::Execute) { add(&mut needed, &d.runtime, &d.runner_credentials); } if phases.contains(&Phase::Judge) { diff --git a/core/src/eac/phases/collect.rs b/core/src/eac/phases/execute.rs similarity index 89% rename from core/src/eac/phases/collect.rs rename to core/src/eac/phases/execute.rs index 9a82e75..7601535 100644 --- a/core/src/eac/phases/collect.rs +++ b/core/src/eac/phases/execute.rs @@ -8,14 +8,14 @@ use super::seed::handles_for; use crate::eac::{Dataset, Engine, Manifest, Output, Run, Seeds, Window}; use crate::report::first_line; use crate::schema::{ - Case, CaseRunParams, CaseRunResult, Handle, OnlineCollectParams, OnlineCollectResult, + Case, CaseRunParams, CaseRunResult, Handle, OnlineExecuteParams, OnlineExecuteResult, }; use crate::worker::{each, Interrupted, Worker}; impl Engine { /// Runs the system under test on each case and records its raw output, /// up to the dataset's concurrency at a time. - pub fn collect(&mut self, run: &Run, m: &Manifest, seeds: &Seeds) -> Result<()> { + pub fn execute(&mut self, run: &Run, m: &Manifest, seeds: &Seeds) -> Result<()> { for d in &m.datasets { let n = self.concurrency(d); let jobs = d.cases.iter().map(|c| Ok((c, handles_for(seeds, d, c, true)?))); @@ -28,23 +28,23 @@ impl Engine { /// Collects each dataset's production runs in window as its cases, and /// returns their outputs, so an online run is judged like any other. - pub fn collect_online( + pub fn execute_online( &mut self, datasets: &mut [Dataset], window: &Window, ) -> Result> { let mut outputs = Vec::new(); for d in datasets { - let params = OnlineCollectParams { + let params = OnlineExecuteParams { dataset: &d.code, since: &window.since, until: &window.until, limit: window.limit, args: &d.args, }; - let res: OnlineCollectResult = self - .call(&d.runtime, "online.collect", params) - .with_context(|| format!("collecting {}", d.name))?; + let res: OnlineExecuteResult = self + .call(&d.runtime, "online.execute", params) + .with_context(|| format!("executing {}", d.name))?; info!("{:<24} {} cases", d.name, res.cases.len()); for c in res.cases { diff --git a/core/src/eac/phases/judge.rs b/core/src/eac/phases/judge.rs index 1dd45a3..5409a96 100644 --- a/core/src/eac/phases/judge.rs +++ b/core/src/eac/phases/judge.rs @@ -34,7 +34,7 @@ impl Engine { let jobs = d.cases.iter().map(|c| { let out = run.read_output(&d.name, &c.name).map_err(|_| { anyhow!( - "no recorded output for {}/{}: run 'eac offline collect' first", + "no recorded output for {}/{}: run 'eac offline execute' first", d.name, c.name ) diff --git a/core/src/eac/phases/mod.rs b/core/src/eac/phases/mod.rs index 66254a0..a8525c8 100644 --- a/core/src/eac/phases/mod.rs +++ b/core/src/eac/phases/mod.rs @@ -1,9 +1,9 @@ //! The phases a run goes through, each a method on Engine: discover, seed, -//! collect and judge, plus the credential checks that come before them. +//! execute and judge, plus the credential checks that come before them. -mod collect; mod credentials; mod discover; +mod execute; mod judge; mod seed; diff --git a/core/src/eac/run/manifest.rs b/core/src/eac/run/manifest.rs index 8cf70fd..c9a3d7b 100644 --- a/core/src/eac/run/manifest.rs +++ b/core/src/eac/run/manifest.rs @@ -78,7 +78,7 @@ pub struct Dataset { /// --judge-args by judge name, kept so a re-judge uses the same ones. #[serde(default, deserialize_with = "nullable", skip_serializing_if = "Object::is_empty")] pub judge_args: Object, - /// What the runner needs with these args, checked before collecting. + /// What the runner needs with these args, checked before executing. #[serde(default, deserialize_with = "nullable", skip_serializing_if = "Vec::is_empty")] pub runner_credentials: Vec, /// What each judge needs, by judge name, checked before judging. diff --git a/core/src/schema/document.rs b/core/src/schema/document.rs index 1b67629..51ad2d1 100644 --- a/core/src/schema/document.rs +++ b/core/src/schema/document.rs @@ -40,8 +40,8 @@ pub fn document() -> Value { "Scores a recorded output with the case's judges, or with the judges in params if any are named. \ Without a saved trace, the judges may fetch one.", ); - m.add::( - "online.collect", + m.add::( + "online.execute", "Returns at most limit production runs from the window, as cases with their outputs.", ); m.add::( diff --git a/core/src/schema/protocol.schema.json b/core/src/schema/protocol.schema.json index 8023e6f..257f951 100644 --- a/core/src/schema/protocol.schema.json +++ b/core/src/schema/protocol.schema.json @@ -482,7 +482,7 @@ ], "type": "string" }, - "OnlineCollectParams": { + "OnlineExecuteParams": { "properties": { "args": { "type": "object" @@ -509,7 +509,7 @@ ], "type": "object" }, - "OnlineCollectResult": { + "OnlineExecuteResult": { "properties": { "cases": { "description": "One case per production run, each with its `output` and, if it has one, its `conversation_id`.", @@ -835,15 +835,15 @@ ], "type": "object" }, - "online.collect": { + "online.execute": { "additionalProperties": false, "description": "Returns at most limit production runs from the window, as cases with their outputs.", "properties": { "params": { - "$ref": "#/$defs/OnlineCollectParams" + "$ref": "#/$defs/OnlineExecuteParams" }, "result": { - "$ref": "#/$defs/OnlineCollectResult" + "$ref": "#/$defs/OnlineExecuteResult" } }, "required": [ @@ -909,7 +909,7 @@ "credentials.check", "credentials.login", "discover", - "online.collect", + "online.execute", "online.judge", "seed.setup", "seed.teardown" diff --git a/core/src/schema/worker_methods.rs b/core/src/schema/worker_methods.rs index 948bb54..1d3d927 100644 --- a/core/src/schema/worker_methods.rs +++ b/core/src/schema/worker_methods.rs @@ -175,7 +175,7 @@ pub struct CaseJudgeResult { } #[derive(Serialize, JsonSchema)] -pub struct OnlineCollectParams<'a> { +pub struct OnlineExecuteParams<'a> { pub dataset: &'a DatasetRef, /// RFC 3339. Return runs from since up to, but not including, until. pub since: &'a str, @@ -186,7 +186,7 @@ pub struct OnlineCollectParams<'a> { } #[derive(Default, Deserialize, JsonSchema)] -pub struct OnlineCollectResult { +pub struct OnlineExecuteResult { /// One case per production run, each with its `output` and, if it has /// one, its `conversation_id`. #[serde(default, deserialize_with = "nullable")] diff --git a/core/tests/cli.rs b/core/tests/cli.rs index 7f4fec5..a9223a4 100644 --- a/core/tests/cli.rs +++ b/core/tests/cli.rs @@ -201,7 +201,7 @@ fn phases_run_separately() { let seeded = p.eac(&["offline", "seed", "--case", "wrong"]); seeded.code(0); let id = seeded.stdout.trim().to_string(); - p.eac(&["offline", "collect", "--run", &id]).code(0); + p.eac(&["offline", "execute", "--run", &id]).code(0); let judged = p.eac(&["offline", "judge"]); judged.code(1); assert_eq!(judged.stdout.trim(), id, "judge prints the id of the run it judged"); @@ -533,11 +533,11 @@ fn online_run_fetches_the_window_with_judge_args() { } #[test] -fn online_runs_can_collect_then_judge() { +fn online_runs_can_execute_then_judge() { let p = Project::new(&base()); - let collected = p.eac(&["online", "collect", "--limit", "5"]); - collected.code(0); - let id = collected.stdout.trim().to_string(); + let executed = p.eac(&["online", "execute", "--limit", "5"]); + executed.code(0); + let id = executed.stdout.trim().to_string(); assert_eq!(p.events("collect").len(), 1); assert!(p.events("online_judge").is_empty()); @@ -559,9 +559,9 @@ fn online_runs_can_collect_then_judge() { p.eac(&["offline", "judge", "--run", &id]) .code(2) .says("is an online run, and 'eac offline judge' only works on offline runs"); - p.eac(&["offline", "collect", "--run", &id]) + p.eac(&["offline", "execute", "--run", &id]) .code(2) - .says("'eac offline collect' only works on offline runs"); + .says("'eac offline execute' only works on offline runs"); } #[test] @@ -619,15 +619,15 @@ fn credentials_are_checked_before_the_phases_that_need_them() { let checks = p.events("credentials_check"); assert_eq!(checks[0]["names"], json!(["token_a", "token_b"])); - // Seeding needs only the seeds' credentials, and collecting the runner's. + // Seeding needs only the seeds' credentials, and executing the runner's. p.write(".env", "TOKEN_A=good\n"); let seeded = p.eac(&["offline", "seed", "--split", "smoke"]); seeded.code(0).says("✓ token_a"); let id = seeded.stdout.trim().to_string(); - p.eac(&["offline", "collect", "--run", &id]).code(2).says("token_b: missing or invalid"); + p.eac(&["offline", "execute", "--run", &id]).code(2).says("token_b: missing or invalid"); assert!(p.events("run").is_empty()); p.write(".env", "TOKEN_A=good\nTOKEN_B=good\n"); - p.eac(&["offline", "collect", "--run", &id]).code(0); + p.eac(&["offline", "execute", "--run", &id]).code(0); } #[test] diff --git a/core/tests/fixtures/project/eac/worker.py b/core/tests/fixtures/project/eac/worker.py index 285832e..1111046 100644 --- a/core/tests/fixtures/project/eac/worker.py +++ b/core/tests/fixtures/project/eac/worker.py @@ -66,7 +66,7 @@ def handle(method, p): if "conversation_id" in case: run["conversation_id"] = case["conversation_id"] return ds.judge(case, case.get("output"), p.get("judges", []), p.get("seeds", {}), p.get("trace"), run) - if method == "online.collect": + if method == "online.execute": return {"cases": ds.collect(p["since"], p["until"], p["limit"], p.get("args", {}))} if method == "online.judge": return ds.online_judge(p["case"], p["judges"], p.get("judge_args", {}), p.get("trace"), p.get("agent")) diff --git a/docs/app/cli/page.mdx b/docs/app/cli/page.mdx index 295b0ad..bde81b6 100644 --- a/docs/app/cli/page.mdx +++ b/docs/app/cli/page.mdx @@ -11,14 +11,14 @@ Run `eac --help` any time for the full list. widths={[240, 'auto']} rows={[ ['`eac list`', 'Show the datasets and cases eac found.'], - ['`eac offline run`', 'Seed, collect and judge in one go.'], + ['`eac offline run`', 'Seed, execute and judge in one go.'], ['`eac offline seed`', 'Set up fixtures and start a new run.'], - ['`eac offline collect`', 'Run your system on each case.'], + ['`eac offline execute`', 'Run your system on each case.'], ['`eac offline judge`', 'Score the outputs.'], ['`eac offline compare NAME`', 'Run a comparison, one run per arm.'], ['`eac offline prune`', "Clean up cached fixtures nothing uses."], ['`eac online run`', 'Collect production runs and judge them.'], - ['`eac online collect`', 'Collect production runs into a new run.'], + ['`eac online execute`', 'Collect production runs into a new run.'], ['`eac online judge`', 'Judge a collected run.'], ['`eac auth`', 'Log in to every credential your datasets need.'], ['`eac catalog`', 'Print every dataset, case and split as JSON.'], diff --git a/docs/app/concepts/page.mdx b/docs/app/concepts/page.mdx index 6ef6f85..3fbe467 100644 --- a/docs/app/concepts/page.mdx +++ b/docs/app/concepts/page.mdx @@ -16,7 +16,7 @@ Workers handle one thing at a time, so you never have to think about thread safe Every run gets its own folder, and each phase reads the previous phase's output from there. So you can: -- Seed in one CI job and collect in another. +- Seed in one CI job and execute in another. - Re-judge an old run after tweaking a judge. - Point your own scripts at the folder to upload results. @@ -25,12 +25,12 @@ An offline run has three phases: -`eac offline run` does all three in one go. Online runs skip seeding: they **collect** production runs as cases and **judge** them. +`eac offline run` does all three in one go. Online runs skip seeding: they **execute**, collecting production runs as cases, and **judge** them. ## Passing and failing diff --git a/docs/app/page.mdx b/docs/app/page.mdx index f3e7309..c5547e9 100644 --- a/docs/app/page.mdx +++ b/docs/app/page.mdx @@ -15,7 +15,7 @@ eac handles everything else: setting up fixtures, running each case, scoring the diff --git a/docs/app/protocol/page.mdx b/docs/app/protocol/page.mdx index b0d7a14..6d1d24d 100644 --- a/docs/app/protocol/page.mdx +++ b/docs/app/protocol/page.mdx @@ -30,7 +30,7 @@ eac starts a worker process for your language and talks to it with JSON, one mes ['`seed.teardown`', 'Clean up a fixture.'], ['`case.run`', 'Run one case.'], ['`case.judge`', "Score one case's output."], - ['`online.collect`', 'Collect production runs as cases.'], + ['`online.execute`', 'Collect production runs as cases.'], ['`online.judge`', 'Score one collected case.'], ['`credentials.check`', 'Report which credentials are ready.'], ['`credentials.login`', 'Log in to a credential.'], diff --git a/docs/app/quick-start/page.mdx b/docs/app/quick-start/page.mdx index 57df6a1..6b38b39 100644 --- a/docs/app/quick-start/page.mdx +++ b/docs/app/quick-start/page.mdx @@ -102,7 +102,7 @@ From the root of your repo: ```sh eac list # see what eac found -eac offline run # seed, collect and judge +eac offline run # seed, execute and judge ``` That's it. The results are saved in `.eac/runs//`. diff --git a/examples/basic-example-python/README.md b/examples/basic-example-python/README.md index 3cbfa62..cdf2244 100644 --- a/examples/basic-example-python/README.md +++ b/examples/basic-example-python/README.md @@ -18,7 +18,7 @@ dataset: ```sh eac list # the datasets eac found, and their cases -eac offline run # seed, collect, judge +eac offline run # seed, execute, judge eac offline run --dataset assistant # only this dataset, once there are more eac offline run --case get_dsn eac offline run --split smoke diff --git a/sdks/python/README.md b/sdks/python/README.md index f73b8bf..9ab7172 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -318,7 +318,7 @@ class ProdChats(OnlineRunner): Online judges are named in each `dataset.yml` and picked with `--judge `. `eac online run --judge ` collects cases and -judges them in one go, or `eac online collect` saves them in a run for +judges them in one go, or `eac online execute` saves them in a run for `eac online judge --run --judge ` to score later. Production runs have no `expected_output`, so judges that compare against it should return `None`. Online runs report each judge's mean score and never fail. @@ -368,7 +368,7 @@ Declare credentials on whatever needs them: - A seed's `credentials`, e.g. `self.credentials = (GitHub(self.repo),)` in `__init__`. eac checks them, and its children's, before seeding and tearing down. Include what its shared cache needs. -- A runner's `credentials`. eac checks them before collecting. +- A runner's `credentials`. eac checks them before executing. - A judge's `credentials`, checked before judging. Include what `get_agent_trace()` needs. @@ -393,7 +393,7 @@ takes no arguments. ```sh eac list # the datasets and cases eac found -eac offline run # seed, collect outputs and judge them, then print the results +eac offline run # seed, execute and judge, then print the results eac offline judge --run latest # judge the last run again, without re-running it eac online run --judge polite --since 24h eac --help # every command and flag diff --git a/sdks/python/eac/protocol.py b/sdks/python/eac/protocol.py index 1588ec3..129d163 100644 --- a/sdks/python/eac/protocol.py +++ b/sdks/python/eac/protocol.py @@ -24,7 +24,7 @@ "credentials.check", "credentials.login", "discover", - "online.collect", + "online.execute", "online.judge", "seed.setup", "seed.teardown", @@ -218,7 +218,7 @@ class Metrics(TypedDict): total_tokens: NotRequired[float] -class OnlineCollectParams(TypedDict): +class OnlineExecuteParams(TypedDict): args: NotRequired[dict[str, Any]] dataset: DatasetRef limit: int @@ -227,7 +227,7 @@ class OnlineCollectParams(TypedDict): until: str -class OnlineCollectResult(TypedDict): +class OnlineExecuteResult(TypedDict): #: One case per production run, each with its `output` and, if it has one, its #: `conversation_id`. cases: NotRequired[list[Case]] diff --git a/sdks/python/eac/runner/runner.py b/sdks/python/eac/runner/runner.py index c859d45..3d24eea 100644 --- a/sdks/python/eac/runner/runner.py +++ b/sdks/python/eac/runner/runner.py @@ -13,5 +13,5 @@ class Runner(ABC): #: per distinct args, before calling it. Checking them is up to you. args: dict[str, Any] = {} - #: What the runner needs. eac checks them before the collect phase. + #: What the runner needs. eac checks them before the execute phase. credentials: Sequence[Credential] = () diff --git a/sdks/python/eac/worker.py b/sdks/python/eac/worker.py index a4532a0..9a3b668 100644 --- a/sdks/python/eac/worker.py +++ b/sdks/python/eac/worker.py @@ -92,7 +92,7 @@ async def _dispatch(self, method: str, params: dict[str, Any]) -> Any: return await dataset.seed_teardown(params["seed"], params.get("handle") or {}) case "case.run": return await dataset.run_case(params) - case "online.collect": + case "online.execute": return await dataset.collect_cases(params) case "case.judge" | "online.judge": return await dataset.judge(params) @@ -255,7 +255,7 @@ async def run_case(self, params: wire.CaseRunParams) -> wire.CaseRunResult: output = await _call(runner.run_case, case, seeds=seeds, conversation_id=params["conversation_id"]) return {"output": _json_dict(output, f"{type(runner).__name__}.run_case()")} - async def collect_cases(self, params: wire.OnlineCollectParams) -> wire.OnlineCollectResult: + async def collect_cases(self, params: wire.OnlineExecuteParams) -> wire.OnlineExecuteResult: since, until = datetime.fromisoformat(params["since"]), datetime.fromisoformat(params["until"]) window = Window(since=since, until=until, limit=params["limit"]) runner = self.with_args(self.runner, params.get("args") or {})