diff --git a/.changeset/evals-root-folder.md b/.changeset/evals-root-folder.md new file mode 100644 index 0000000..1aacd5d --- /dev/null +++ b/.changeset/evals-root-folder.md @@ -0,0 +1,7 @@ +--- +"muxon": patch +--- + +Eval tasks, hidden checks, fixtures and model matrices moved from `harness/testdata/eval` to a root `evals/` folder. With no `--tasks`, `muxon eval basket` now reads `evals/tasks/*.json`. Matrices are `evals/matrices/{default,ci,opencode}.yaml`. + +**Upgrade:** scripts that pass `--matrix testdata/eval/...` or `--tasks 'testdata/eval/*.json'` need the new paths. diff --git a/.github/workflows/eval.yml b/.github/workflows/eval.yml index 7f2dc04..8a24f8b 100644 --- a/.github/workflows/eval.yml +++ b/.github/workflows/eval.yml @@ -25,8 +25,8 @@ jobs: DEEPINFRA_API_KEY: ${{ secrets.DEEPINFRA_API_KEY }} run: | ./muxon eval basket \ - --matrix testdata/eval/matrix-ci.yaml \ - --tasks 'testdata/eval/*.json' \ + --matrix ../evals/matrices/ci.yaml \ + --tasks '../evals/tasks/*.json' \ --trials 1 \ --concurrency 2 \ --budget-usd 5 \ diff --git a/Makefile b/Makefile index 6181f9c..ce2ebe2 100644 --- a/Makefile +++ b/Makefile @@ -33,4 +33,4 @@ lint: cd harness && golangci-lint run eval: - cd harness && go run ./cmd/muxon eval basket --matrix testdata/eval/matrix-opencode.yaml --tasks 'testdata/eval/*.json' --trials 1 --concurrency 2 --budget-usd 5 --trust + cd harness && go run ./cmd/muxon eval basket --matrix ../evals/matrices/opencode.yaml --tasks '../evals/tasks/*.json' --trials 1 --concurrency 2 --budget-usd 5 --trust diff --git a/Taskfile.yml b/Taskfile.yml index 8677713..5e6f843 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -46,4 +46,4 @@ tasks: desc: OpenCode Go basket dir: harness cmds: - - go run ./cmd/muxon eval basket --matrix testdata/eval/matrix-opencode.yaml --tasks 'testdata/eval/*.json' --trials 1 --concurrency 2 --budget-usd 5 --trust + - go run ./cmd/muxon eval basket --matrix ../evals/matrices/opencode.yaml --tasks '../evals/tasks/*.json' --trials 1 --concurrency 2 --budget-usd 5 --trust diff --git a/docs/benchmarks.md b/docs/benchmarks.md index dd5ae3f..e7b1a19 100644 --- a/docs/benchmarks.md +++ b/docs/benchmarks.md @@ -126,14 +126,14 @@ The task file is JSON. `check.files` is copied into the workspace only after the Commands: ```text -muxon eval basket --matrix harness/testdata/eval/matrix.yaml --trials 3 --budget-usd 20 +muxon eval basket --matrix evals/matrices/default.yaml --trials 3 --budget-usd 20 make eval muxon eval report muxon eval compare muxon eval export-swebench --instance repo__repo-1 --model muxon+qwen3-32b -o predictions.jsonl ``` -Each run lives in `.muxon/eval/runs//` (`run.json` plus `results.jsonl`). Rows also carry `run_id`, `provider`, `harness_sha`, `manifest_hash`, `salvaged_tool_calls`, `timeout_hit`, `reason`, and `overrides`. Prices in `models.yaml` are pinned 2026-10-14 (DeepInfra Qwen3.5-9B and Qwen3-32B, OpenAI gpt-5). `matrix-opencode.yaml` uses the OpenCode Go key: `OPENCODE_API_KEY`, or `~/.local/share/opencode/auth.json` under provider `opencode-go`. Its prices are the short-context rates from the OpenCode Go docs (Kimi K2.7 Code, GPT 6 Luna). +Each run lives in `.muxon/eval/runs//` (`run.json` plus `results.jsonl`). Rows also carry `run_id`, `provider`, `harness_sha`, `manifest_hash`, `salvaged_tool_calls`, `timeout_hit`, `reason`, and `overrides`. Prices in `models.yaml` are pinned 2026-10-14 (DeepInfra Qwen3.5-9B and Qwen3-32B, OpenAI gpt-5). `evals/matrices/opencode.yaml` uses the OpenCode Go key: `OPENCODE_API_KEY`, or `~/.local/share/opencode/auth.json` under provider `opencode-go`. Its prices are the short-context rates from the OpenCode Go docs (Kimi K2.7 Code, GPT 6 Luna). `muxon eval compare` is the gate for a new tool or harness flag: same tasks, one override flipped, and the McNemar result says whether the outcomes actually moved. diff --git a/docs/harness-architecture/implementation-plan.md b/docs/harness-architecture/implementation-plan.md index ba1cc63..488fc41 100644 --- a/docs/harness-architecture/implementation-plan.md +++ b/docs/harness-architecture/implementation-plan.md @@ -665,7 +665,7 @@ Files: `cmd/muxon/trust.go` (complete) Depends on: 7.1 Read: [benchmarks](../benchmarks.md), [observability § Eval](./observability.md#eval-integration) -Files: `internal/eval/task.go`, `cmd/muxon/eval.go`, `testdata/eval/fix-test.json` +Files: `internal/eval/task.go`, `cmd/muxon/eval.go`, `evals/tasks/fix-test.json` Done when: **Milestone A** documented in repo README. --- @@ -735,7 +735,7 @@ Files: `internal/tools/impl/test.go`, `git.go` ### Step 9.5 — Eval basket × matrix Depends on: 7.7 -Files: `testdata/eval/*.json`, nightly workflow optional +Files: `evals/tasks/*.json`, nightly workflow optional Done when: **Milestone C** `results.jsonl` + report stub. ### Step 9.6 — resume diff --git a/docs/harness-architecture/observability.md b/docs/harness-architecture/observability.md index 27c2f33..bbac915 100644 --- a/docs/harness-architecture/observability.md +++ b/docs/harness-architecture/observability.md @@ -76,7 +76,7 @@ Session: 4.2M in (3.1M cached) / 180k out (40k reasoning) ~$1.14 (worker 92%, ## Eval integration - `muxon eval run task.json` copies the fixture into a fresh temp workspace, runs the director, then runs the task's hidden `check` (files copied in only after the agent exits). Reward is 1 only when that check exits 0. A timeout is reward 0 with `timeout_hit`. -- `muxon eval basket --matrix testdata/eval/matrix.yaml --trials 3` writes `.muxon/eval/runs//results.jsonl` and `run.json`. `--budget-usd` stops scheduling once spent cost reaches the cap. +- `muxon eval basket --matrix evals/matrices/default.yaml --trials 3` writes `.muxon/eval/runs//results.jsonl` and `run.json`. `--budget-usd` stops scheduling once spent cost reaches the cap. - `muxon eval report ` groups by model and capability overrides and prints a task-clustered 95% bootstrap interval. `muxon eval compare ` pairs tasks and prints an exact McNemar p-value. - `muxon run --eval tasks/fix-test-001.json` still appends one row to the workspace `.muxon/eval/results.jsonl` from `session.end`. That path is not the hidden grader. - Weekly workflow (`.github/workflows/eval.yml`) runs the DeepInfra slice. The frontier row is manual. A harness change that helps the frontier row while hurting the 9B row is a regression. diff --git a/evals/README.md b/evals/README.md new file mode 100644 index 0000000..c57d1fe --- /dev/null +++ b/evals/README.md @@ -0,0 +1,34 @@ +# Evals + +Self-graded tasks for `muxon eval`. The runner lives in [`harness/internal/eval`](../harness/internal/eval). + +| Path | Contents | +|------|----------| +| `tasks/*.json` | One task per file: prompt, fixture, hidden check, timeout, tags | +| `checks//` | Hidden grader files, copied into the workspace only after the agent exits | +| `fixtures//` | Mini repos each task starts from | +| `matrices/*.yaml` | Model matrices for `eval basket` (`default`, `ci`, `opencode`) | + +## Run + +From the repo root: + +```sh +make eval +``` + +Or directly, from `harness/`: + +```sh +go run ./cmd/muxon eval basket --matrix ../evals/matrices/default.yaml --tasks '../evals/tasks/*.json' --trials 3 --budget-usd 20 +``` + +With no `--tasks`, the CLI looks for `evals/tasks/*.json` from the repo root or `harness/`. Results go to `.muxon/eval/runs//`. + +## Add a task + +1. Add a fixture under `fixtures//`, or reuse one. +2. Add `checks//` with the hidden test or script. +3. Add `tasks/.json`. `fixture` and `check.files` resolve relative to `tasks/`, so use `"fixture": ""` and `"files": "checks/"`. + +`fixtures/go-failing-test` is a copy of `harness/testdata/fixtures/go-failing-test`, which the Go unit tests use. Edit them separately. diff --git a/harness/testdata/eval/checks/bool-negate-001/hidden_test.go b/evals/checks/bool-negate-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/bool-negate-001/hidden_test.go rename to evals/checks/bool-negate-001/hidden_test.go diff --git a/harness/testdata/eval/checks/dep-bump-001/check_mod.py b/evals/checks/dep-bump-001/check_mod.py similarity index 100% rename from harness/testdata/eval/checks/dep-bump-001/check_mod.py rename to evals/checks/dep-bump-001/check_mod.py diff --git a/harness/testdata/eval/checks/feature-add-001/hidden_test.go b/evals/checks/feature-add-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/feature-add-001/hidden_test.go rename to evals/checks/feature-add-001/hidden_test.go diff --git a/harness/testdata/eval/checks/fix-test-001/hidden_test.go b/evals/checks/fix-test-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/fix-test-001/hidden_test.go rename to evals/checks/fix-test-001/hidden_test.go diff --git a/harness/testdata/eval/checks/lint-two-file-001/hidden_test.go b/evals/checks/lint-two-file-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/lint-two-file-001/hidden_test.go rename to evals/checks/lint-two-file-001/hidden_test.go diff --git a/harness/testdata/eval/checks/map-default-001/hidden_test.go b/evals/checks/map-default-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/map-default-001/hidden_test.go rename to evals/checks/map-default-001/hidden_test.go diff --git a/harness/testdata/eval/checks/missing-func-001/hidden_test.go b/evals/checks/missing-func-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/missing-func-001/hidden_test.go rename to evals/checks/missing-func-001/hidden_test.go diff --git a/harness/testdata/eval/checks/multi-file-001/hidden_test.go b/evals/checks/multi-file-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/multi-file-001/hidden_test.go rename to evals/checks/multi-file-001/hidden_test.go diff --git a/harness/testdata/eval/checks/off-by-one-001/hidden_test.go b/evals/checks/off-by-one-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/off-by-one-001/hidden_test.go rename to evals/checks/off-by-one-001/hidden_test.go diff --git a/harness/testdata/eval/checks/py-add-001/test_add.py b/evals/checks/py-add-001/test_add.py similarity index 100% rename from harness/testdata/eval/checks/py-add-001/test_add.py rename to evals/checks/py-add-001/test_add.py diff --git a/harness/testdata/eval/checks/py-sign-001/test_sign.py b/evals/checks/py-sign-001/test_sign.py similarity index 100% rename from harness/testdata/eval/checks/py-sign-001/test_sign.py rename to evals/checks/py-sign-001/test_sign.py diff --git a/harness/testdata/eval/checks/question-sum-001/check_answer.py b/evals/checks/question-sum-001/check_answer.py similarity index 100% rename from harness/testdata/eval/checks/question-sum-001/check_answer.py rename to evals/checks/question-sum-001/check_answer.py diff --git a/harness/testdata/eval/checks/rename-001/hidden_test.go b/evals/checks/rename-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/rename-001/hidden_test.go rename to evals/checks/rename-001/hidden_test.go diff --git a/harness/testdata/eval/checks/string-trim-001/hidden_test.go b/evals/checks/string-trim-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/string-trim-001/hidden_test.go rename to evals/checks/string-trim-001/hidden_test.go diff --git a/harness/testdata/eval/checks/wrong-const-001/hidden_test.go b/evals/checks/wrong-const-001/hidden_test.go similarity index 100% rename from harness/testdata/eval/checks/wrong-const-001/hidden_test.go rename to evals/checks/wrong-const-001/hidden_test.go diff --git a/harness/testdata/fixtures/bool-negate/go.mod b/evals/fixtures/bool-negate/go.mod similarity index 100% rename from harness/testdata/fixtures/bool-negate/go.mod rename to evals/fixtures/bool-negate/go.mod diff --git a/harness/testdata/fixtures/bool-negate/not.go b/evals/fixtures/bool-negate/not.go similarity index 100% rename from harness/testdata/fixtures/bool-negate/not.go rename to evals/fixtures/bool-negate/not.go diff --git a/harness/testdata/fixtures/dep-bump/go.mod b/evals/fixtures/dep-bump/go.mod similarity index 100% rename from harness/testdata/fixtures/dep-bump/go.mod rename to evals/fixtures/dep-bump/go.mod diff --git a/harness/testdata/fixtures/dep-bump/main.go b/evals/fixtures/dep-bump/main.go similarity index 100% rename from harness/testdata/fixtures/dep-bump/main.go rename to evals/fixtures/dep-bump/main.go diff --git a/evals/fixtures/go-failing-test/go.mod b/evals/fixtures/go-failing-test/go.mod new file mode 100644 index 0000000..ce2af42 --- /dev/null +++ b/evals/fixtures/go-failing-test/go.mod @@ -0,0 +1,3 @@ +module example.com/failing + +go 1.24 diff --git a/evals/fixtures/go-failing-test/sum.go b/evals/fixtures/go-failing-test/sum.go new file mode 100644 index 0000000..319ed0b --- /dev/null +++ b/evals/fixtures/go-failing-test/sum.go @@ -0,0 +1,5 @@ +package sum + +func Sum(a, b int) int { + return a - b +} diff --git a/evals/fixtures/go-failing-test/sum_test.go b/evals/fixtures/go-failing-test/sum_test.go new file mode 100644 index 0000000..701ae87 --- /dev/null +++ b/evals/fixtures/go-failing-test/sum_test.go @@ -0,0 +1,9 @@ +package sum + +import "testing" + +func TestSum(t *testing.T) { + if Sum(2, 3) != 5 { + t.Fatalf("expected 5") + } +} diff --git a/harness/testdata/fixtures/lint-two-file/a.go b/evals/fixtures/lint-two-file/a.go similarity index 100% rename from harness/testdata/fixtures/lint-two-file/a.go rename to evals/fixtures/lint-two-file/a.go diff --git a/harness/testdata/fixtures/lint-two-file/b.go b/evals/fixtures/lint-two-file/b.go similarity index 100% rename from harness/testdata/fixtures/lint-two-file/b.go rename to evals/fixtures/lint-two-file/b.go diff --git a/harness/testdata/fixtures/lint-two-file/go.mod b/evals/fixtures/lint-two-file/go.mod similarity index 100% rename from harness/testdata/fixtures/lint-two-file/go.mod rename to evals/fixtures/lint-two-file/go.mod diff --git a/harness/testdata/fixtures/map-default/go.mod b/evals/fixtures/map-default/go.mod similarity index 100% rename from harness/testdata/fixtures/map-default/go.mod rename to evals/fixtures/map-default/go.mod diff --git a/harness/testdata/fixtures/map-default/label.go b/evals/fixtures/map-default/label.go similarity index 100% rename from harness/testdata/fixtures/map-default/label.go rename to evals/fixtures/map-default/label.go diff --git a/harness/testdata/fixtures/missing-func/go.mod b/evals/fixtures/missing-func/go.mod similarity index 100% rename from harness/testdata/fixtures/missing-func/go.mod rename to evals/fixtures/missing-func/go.mod diff --git a/harness/testdata/fixtures/missing-func/greet.go b/evals/fixtures/missing-func/greet.go similarity index 100% rename from harness/testdata/fixtures/missing-func/greet.go rename to evals/fixtures/missing-func/greet.go diff --git a/harness/testdata/fixtures/multi-file/add.go b/evals/fixtures/multi-file/add.go similarity index 100% rename from harness/testdata/fixtures/multi-file/add.go rename to evals/fixtures/multi-file/add.go diff --git a/harness/testdata/fixtures/multi-file/double.go b/evals/fixtures/multi-file/double.go similarity index 100% rename from harness/testdata/fixtures/multi-file/double.go rename to evals/fixtures/multi-file/double.go diff --git a/harness/testdata/fixtures/multi-file/go.mod b/evals/fixtures/multi-file/go.mod similarity index 100% rename from harness/testdata/fixtures/multi-file/go.mod rename to evals/fixtures/multi-file/go.mod diff --git a/harness/testdata/fixtures/off-by-one/go.mod b/evals/fixtures/off-by-one/go.mod similarity index 100% rename from harness/testdata/fixtures/off-by-one/go.mod rename to evals/fixtures/off-by-one/go.mod diff --git a/harness/testdata/fixtures/off-by-one/last.go b/evals/fixtures/off-by-one/last.go similarity index 100% rename from harness/testdata/fixtures/off-by-one/last.go rename to evals/fixtures/off-by-one/last.go diff --git a/harness/testdata/fixtures/py-add/add.py b/evals/fixtures/py-add/add.py similarity index 100% rename from harness/testdata/fixtures/py-add/add.py rename to evals/fixtures/py-add/add.py diff --git a/harness/testdata/fixtures/py-sign/sign.py b/evals/fixtures/py-sign/sign.py similarity index 100% rename from harness/testdata/fixtures/py-sign/sign.py rename to evals/fixtures/py-sign/sign.py diff --git a/harness/testdata/fixtures/question-sum/.keep b/evals/fixtures/question-sum/.keep similarity index 100% rename from harness/testdata/fixtures/question-sum/.keep rename to evals/fixtures/question-sum/.keep diff --git a/harness/testdata/fixtures/rename-symbol/go.mod b/evals/fixtures/rename-symbol/go.mod similarity index 100% rename from harness/testdata/fixtures/rename-symbol/go.mod rename to evals/fixtures/rename-symbol/go.mod diff --git a/harness/testdata/fixtures/rename-symbol/oldname.go b/evals/fixtures/rename-symbol/oldname.go similarity index 100% rename from harness/testdata/fixtures/rename-symbol/oldname.go rename to evals/fixtures/rename-symbol/oldname.go diff --git a/harness/testdata/fixtures/small-feature/feature.go b/evals/fixtures/small-feature/feature.go similarity index 100% rename from harness/testdata/fixtures/small-feature/feature.go rename to evals/fixtures/small-feature/feature.go diff --git a/harness/testdata/fixtures/small-feature/feature_test.go b/evals/fixtures/small-feature/feature_test.go similarity index 100% rename from harness/testdata/fixtures/small-feature/feature_test.go rename to evals/fixtures/small-feature/feature_test.go diff --git a/harness/testdata/fixtures/small-feature/go.mod b/evals/fixtures/small-feature/go.mod similarity index 100% rename from harness/testdata/fixtures/small-feature/go.mod rename to evals/fixtures/small-feature/go.mod diff --git a/harness/testdata/fixtures/string-trim/clean.go b/evals/fixtures/string-trim/clean.go similarity index 100% rename from harness/testdata/fixtures/string-trim/clean.go rename to evals/fixtures/string-trim/clean.go diff --git a/harness/testdata/fixtures/string-trim/go.mod b/evals/fixtures/string-trim/go.mod similarity index 100% rename from harness/testdata/fixtures/string-trim/go.mod rename to evals/fixtures/string-trim/go.mod diff --git a/harness/testdata/fixtures/wrong-const/go.mod b/evals/fixtures/wrong-const/go.mod similarity index 100% rename from harness/testdata/fixtures/wrong-const/go.mod rename to evals/fixtures/wrong-const/go.mod diff --git a/harness/testdata/fixtures/wrong-const/version.go b/evals/fixtures/wrong-const/version.go similarity index 100% rename from harness/testdata/fixtures/wrong-const/version.go rename to evals/fixtures/wrong-const/version.go diff --git a/harness/testdata/eval/matrix-ci.yaml b/evals/matrices/ci.yaml similarity index 100% rename from harness/testdata/eval/matrix-ci.yaml rename to evals/matrices/ci.yaml diff --git a/harness/testdata/eval/matrix.yaml b/evals/matrices/default.yaml similarity index 100% rename from harness/testdata/eval/matrix.yaml rename to evals/matrices/default.yaml diff --git a/harness/testdata/eval/matrix-opencode.yaml b/evals/matrices/opencode.yaml similarity index 100% rename from harness/testdata/eval/matrix-opencode.yaml rename to evals/matrices/opencode.yaml diff --git a/harness/testdata/eval/bool-negate.json b/evals/tasks/bool-negate.json similarity index 100% rename from harness/testdata/eval/bool-negate.json rename to evals/tasks/bool-negate.json diff --git a/harness/testdata/eval/dep-bump.json b/evals/tasks/dep-bump.json similarity index 100% rename from harness/testdata/eval/dep-bump.json rename to evals/tasks/dep-bump.json diff --git a/harness/testdata/eval/feature-add.json b/evals/tasks/feature-add.json similarity index 100% rename from harness/testdata/eval/feature-add.json rename to evals/tasks/feature-add.json diff --git a/harness/testdata/eval/fix-test.json b/evals/tasks/fix-test.json similarity index 100% rename from harness/testdata/eval/fix-test.json rename to evals/tasks/fix-test.json diff --git a/harness/testdata/eval/lint-two-file.json b/evals/tasks/lint-two-file.json similarity index 100% rename from harness/testdata/eval/lint-two-file.json rename to evals/tasks/lint-two-file.json diff --git a/harness/testdata/eval/map-default.json b/evals/tasks/map-default.json similarity index 100% rename from harness/testdata/eval/map-default.json rename to evals/tasks/map-default.json diff --git a/harness/testdata/eval/missing-func.json b/evals/tasks/missing-func.json similarity index 100% rename from harness/testdata/eval/missing-func.json rename to evals/tasks/missing-func.json diff --git a/harness/testdata/eval/multi-file.json b/evals/tasks/multi-file.json similarity index 100% rename from harness/testdata/eval/multi-file.json rename to evals/tasks/multi-file.json diff --git a/harness/testdata/eval/off-by-one.json b/evals/tasks/off-by-one.json similarity index 100% rename from harness/testdata/eval/off-by-one.json rename to evals/tasks/off-by-one.json diff --git a/harness/testdata/eval/py-add.json b/evals/tasks/py-add.json similarity index 100% rename from harness/testdata/eval/py-add.json rename to evals/tasks/py-add.json diff --git a/harness/testdata/eval/py-sign.json b/evals/tasks/py-sign.json similarity index 100% rename from harness/testdata/eval/py-sign.json rename to evals/tasks/py-sign.json diff --git a/harness/testdata/eval/question-sum.json b/evals/tasks/question-sum.json similarity index 100% rename from harness/testdata/eval/question-sum.json rename to evals/tasks/question-sum.json diff --git a/harness/testdata/eval/rename.json b/evals/tasks/rename.json similarity index 100% rename from harness/testdata/eval/rename.json rename to evals/tasks/rename.json diff --git a/harness/testdata/eval/string-trim.json b/evals/tasks/string-trim.json similarity index 100% rename from harness/testdata/eval/string-trim.json rename to evals/tasks/string-trim.json diff --git a/harness/testdata/eval/wrong-const.json b/evals/tasks/wrong-const.json similarity index 100% rename from harness/testdata/eval/wrong-const.json rename to evals/tasks/wrong-const.json diff --git a/harness/cmd/muxon/eval.go b/harness/cmd/muxon/eval.go index 93ec4b6..1e3d342 100644 --- a/harness/cmd/muxon/eval.go +++ b/harness/cmd/muxon/eval.go @@ -249,8 +249,8 @@ func evalRunID(cmd *cobra.Command) string { func defaultTaskGlob() string { candidates := []string{ - filepath.Join("testdata", "eval", "*.json"), - filepath.Join("harness", "testdata", "eval", "*.json"), + filepath.Join("evals", "tasks", "*.json"), + filepath.Join("..", "evals", "tasks", "*.json"), } for _, c := range candidates { matches, _ := filepath.Glob(c) @@ -258,7 +258,7 @@ func defaultTaskGlob() string { return c } } - return filepath.Join("testdata", "eval", "*.json") + return candidates[0] } func resolveResults(outDir, arg string) (string, error) { diff --git a/harness/internal/eval/copy.go b/harness/internal/eval/copy.go index 3d7bc48..18c41f0 100644 --- a/harness/internal/eval/copy.go +++ b/harness/internal/eval/copy.go @@ -115,6 +115,8 @@ func fixtureCandidates(name string, extra []string) []string { wd, _ := os.Getwd() bases = append(bases, wd, + filepath.Join(wd, "evals", "fixtures"), + filepath.Join(wd, "..", "evals", "fixtures"), filepath.Join(wd, "testdata", "fixtures"), filepath.Join(wd, "harness", "testdata", "fixtures"), filepath.Join(wd, "..", "testdata", "fixtures"), diff --git a/harness/internal/eval/task_test.go b/harness/internal/eval/task_test.go new file mode 100644 index 0000000..997cc98 --- /dev/null +++ b/harness/internal/eval/task_test.go @@ -0,0 +1,26 @@ +package eval + +import ( + "path/filepath" + "testing" +) + +func TestRepoEvalTasksResolve(t *testing.T) { + tasks, err := LoadTasks(filepath.Join("..", "..", "..", "evals", "tasks", "*.json")) + if err != nil { + t.Fatal(err) + } + for _, pt := range tasks { + t.Run(pt.Task.ID, func(t *testing.T) { + if _, err := taskSource(pt.Task, TrialOptions{TaskDir: pt.TaskDir}); err != nil { + t.Errorf("fixture: %v", err) + } + if pt.Task.Check.Files == "" { + return + } + if _, err := findDir(pt.Task.Check.Files, []string{pt.TaskDir, filepath.Join(pt.TaskDir, "..")}); err != nil { + t.Errorf("check files: %v", err) + } + }) + } +}