From 91bd64b071154ef0ae14b187209e670c4aaaa474 Mon Sep 17 00:00:00 2001 From: Gen TANG Date: Mon, 3 Aug 2026 16:19:35 +0800 Subject: [PATCH 1/3] simplify the procedure of yada eval --- docs/cli-reference.md | 167 +++++++++++++++++--------- src/yada/evals/benchmarks/swebench.py | 121 +++++++++++-------- src/yada/evals/cli.py | 96 ++++----------- tests/evals/test_eval_cli.py | 38 ++++++ tests/evals/test_local_benchmark.py | 8 +- tests/evals/test_swebench.py | 76 +++++++++--- 6 files changed, 307 insertions(+), 199 deletions(-) create mode 100644 tests/evals/test_eval_cli.py diff --git a/docs/cli-reference.md b/docs/cli-reference.md index cd6f6c1..1612d46 100644 --- a/docs/cli-reference.md +++ b/docs/cli-reference.md @@ -53,48 +53,68 @@ keyboard interruption. Argument errors also use the standard argparse status `2` ## `yada eval` `yada eval` runs an agent behind a benchmark-neutral adapter and persists a -schema-versioned result even for ordinary adapter failures. +schema-versioned result even for ordinary adapter failures. Unlike a direct +`yada` run, an evaluation always has a task adapter and a grader. -### Checked-in development case +### Choose a run mode + +```mermaid +flowchart TD + start{"What do you want to run?"} + start -->|"Edit one repository"| direct["yada TASK --workspace REPO"] + start -->|"Run a reproducible evaluation"| eval["yada eval"] + + eval --> source{"Which task source?"} + source -->|"Checked-in case directory"| case["--case PATH"] + source -->|"Official SWE-bench Verified"| swe["--swebench INSTANCE_ID"] + + case --> local_adapter["Local adapter\ncase.json + declared grader"] + local_adapter --> local_result["Development/private result\nnot an official SWE-bench score"] + + swe --> official["Generate patch, then run\nofficial SWE-bench Docker Harness"] + official --> official_result["Official-compatible SWE-bench result"] +``` + +`yada eval` deliberately exposes only two task selectors: + +| Invocation | Meaning | Grader | +| --- | --- | --- | +| `--case PATH` | Run a portable local case. A directory resolves to `PATH/case.json`; a manifest file may also be passed directly. | The command declared by the case manifest | +| `--swebench INSTANCE_ID` | Load one SWE-bench Verified task, generate a prediction, and delegate grading to the official Docker Harness. | Official SWE-bench Docker Harness | + +There is no `--local`, `--benchmark`, or separate `--manifest` selector. Pass a +custom manifest directly to `--case`. A case is called local because its +manifest controls preparation and grading; it may still fetch a Git repository +and call the DeepSeek API. Each invocation runs exactly one task. + +### Checked-in development case (`--case`) + +Use a checked-in case for fast development and regression testing: ```bash uv run yada eval \ --case benchmarks/swebench_verified/pytest-10051 \ --agent yada \ - --yes + --yes \ + --trace-level debug ``` The first run fetches the pinned pytest commit and builds the case's locked Python environment. Later runs reuse caches but create a fresh agent workspace. -This local grader is a development feedback loop, not an official SWE-bench -Docker score. - -### Common options - -| Option | Meaning | Default | -| --- | --- | --- | -| `--benchmark local\|swebench` | Benchmark adapter. | Inferred from `--case`, otherwise required | -| `--case PATH` | Portable local case directory or `case.json`. | — | -| `--instance ID` | Benchmark instance ID. | Manifest ID for local cases | -| `--agent yada\|command` | Agent adapter. | `yada` | -| `--output PATH` | Result JSON path. | `eval-results/__