@tangle-network/agent-bench 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +24 -2
- package/dist/adapters.d.ts +3 -3
- package/dist/adapters.js +3 -5
- package/dist/adapters.js.map +1 -1
- package/dist/benchmarks/_harness.d.ts +4 -4
- package/dist/benchmarks/_harness.js +5 -2
- package/dist/benchmarks/_harness.js.map +1 -1
- package/dist/benchmarks/aec-bench.d.ts +2 -2
- package/dist/benchmarks/aec-bench.js +49 -42
- package/dist/benchmarks/aec-bench.js.map +1 -1
- package/dist/benchmarks/agentbench.d.ts +2 -2
- package/dist/benchmarks/agentbench.js +41 -34
- package/dist/benchmarks/agentbench.js.map +1 -1
- package/dist/benchmarks/appworld.d.ts +4 -4
- package/dist/benchmarks/appworld.js +67 -53
- package/dist/benchmarks/appworld.js.map +1 -1
- package/dist/benchmarks/bfcl.d.ts +2 -2
- package/dist/benchmarks/bfcl.js +52 -44
- package/dist/benchmarks/bfcl.js.map +1 -1
- package/dist/benchmarks/cad-design.d.ts +2 -2
- package/dist/benchmarks/cad-design.js +53 -44
- package/dist/benchmarks/cad-design.js.map +1 -1
- package/dist/benchmarks/cadbench.d.ts +2 -2
- package/dist/benchmarks/cadbench.js +1 -1
- package/dist/benchmarks/cadgenbench.d.ts +2 -2
- package/dist/benchmarks/cadgenbench.js +1 -1
- package/dist/benchmarks/commit0.d.ts +2 -2
- package/dist/benchmarks/commit0.js +38 -31
- package/dist/benchmarks/commit0.js.map +1 -1
- package/dist/benchmarks/crag.d.ts +2 -2
- package/dist/benchmarks/crag.js +37 -32
- package/dist/benchmarks/crag.js.map +1 -1
- package/dist/benchmarks/dabstep.d.ts +2 -2
- package/dist/benchmarks/dabstep.js +41 -34
- package/dist/benchmarks/dabstep.js.map +1 -1
- package/dist/benchmarks/finresearchbench.d.ts +4 -4
- package/dist/benchmarks/finresearchbench.js +61 -48
- package/dist/benchmarks/finresearchbench.js.map +1 -1
- package/dist/benchmarks/finsearchcomp.d.ts +3 -3
- package/dist/benchmarks/finsearchcomp.js +54 -43
- package/dist/benchmarks/finsearchcomp.js.map +1 -1
- package/dist/benchmarks/frames.d.ts +2 -2
- package/dist/benchmarks/frames.js +66 -51
- package/dist/benchmarks/frames.js.map +1 -1
- package/dist/benchmarks/hotpotqa.d.ts +2 -2
- package/dist/benchmarks/hotpotqa.js +59 -47
- package/dist/benchmarks/hotpotqa.js.map +1 -1
- package/dist/benchmarks/humaneval.d.ts +3 -3
- package/dist/benchmarks/humaneval.js +39 -35
- package/dist/benchmarks/humaneval.js.map +1 -1
- package/dist/benchmarks/mcad-bench.d.ts +2 -2
- package/dist/benchmarks/mcad-bench.js +68 -56
- package/dist/benchmarks/mcad-bench.js.map +1 -1
- package/dist/benchmarks/mcad-cq-bench.d.ts +2 -2
- package/dist/benchmarks/mcad-cq-bench.js +69 -57
- package/dist/benchmarks/mcad-cq-bench.js.map +1 -1
- package/dist/benchmarks/mcad-cq-golds.d.ts +1 -1
- package/dist/benchmarks/mcad-cq-golds.js +1 -1
- package/dist/benchmarks/mcad-cq-golds.js.map +1 -1
- package/dist/benchmarks/mcad-golds.d.ts +1 -1
- package/dist/benchmarks/mcad-golds.js.map +1 -1
- package/dist/benchmarks/mind2web.d.ts +3 -3
- package/dist/benchmarks/mind2web.js +62 -49
- package/dist/benchmarks/mind2web.js.map +1 -1
- package/dist/benchmarks/nomiracl.d.ts +2 -2
- package/dist/benchmarks/nomiracl.js +43 -36
- package/dist/benchmarks/nomiracl.js.map +1 -1
- package/dist/benchmarks/open-rag-bench.d.ts +2 -2
- package/dist/benchmarks/open-rag-bench.js +37 -32
- package/dist/benchmarks/open-rag-bench.js.map +1 -1
- package/dist/benchmarks/programbench.d.ts +2 -2
- package/dist/benchmarks/programbench.js +28 -23
- package/dist/benchmarks/programbench.js.map +1 -1
- package/dist/benchmarks/rag-shared.d.ts +2 -2
- package/dist/benchmarks/rag-shared.js +15 -13
- package/dist/benchmarks/rag-shared.js.map +1 -1
- package/dist/benchmarks/ragbench.d.ts +2 -2
- package/dist/benchmarks/ragbench.js +34 -29
- package/dist/benchmarks/ragbench.js.map +1 -1
- package/dist/benchmarks/simpleqa.d.ts +2 -2
- package/dist/benchmarks/simpleqa.js +62 -51
- package/dist/benchmarks/simpleqa.js.map +1 -1
- package/dist/benchmarks/swe-bench.d.ts +4 -4
- package/dist/benchmarks/swe-bench.js +47 -41
- package/dist/benchmarks/swe-bench.js.map +1 -1
- package/dist/benchmarks/t2-ragbench.d.ts +2 -2
- package/dist/benchmarks/t2-ragbench.js +37 -32
- package/dist/benchmarks/t2-ragbench.js.map +1 -1
- package/dist/benchmarks/tau-bench-shared.d.ts +2 -2
- package/dist/benchmarks/tau-bench-shared.js +43 -36
- package/dist/benchmarks/tau-bench-shared.js.map +1 -1
- package/dist/benchmarks/tau2-bench.d.ts +2 -2
- package/dist/benchmarks/tau2-bench.js.map +1 -1
- package/dist/benchmarks/tau3-banking.d.ts +2 -2
- package/dist/benchmarks/tau3-banking.js.map +1 -1
- package/dist/benchmarks/terminal-bench.d.ts +2 -2
- package/dist/benchmarks/terminal-bench.js +29 -23
- package/dist/benchmarks/terminal-bench.js.map +1 -1
- package/dist/benchmarks/toollm.d.ts +2 -2
- package/dist/benchmarks/toollm.js +40 -34
- package/dist/benchmarks/toollm.js.map +1 -1
- package/dist/benchmarks/trata-hedge.d.ts +2 -2
- package/dist/benchmarks/trata-hedge.js +46 -38
- package/dist/benchmarks/trata-hedge.js.map +1 -1
- package/dist/benchmarks/types.d.ts +33 -63
- package/dist/benchmarks/types.js +36 -1
- package/dist/benchmarks/types.js.map +1 -0
- package/dist/benchmarks/webarena-verified.d.ts +2 -2
- package/dist/benchmarks/webarena-verified.js +29 -24
- package/dist/benchmarks/webarena-verified.js.map +1 -1
- package/dist/{cadbench-Byr5gO1M.js → cadbench-htzAmMaI.js} +39 -32
- package/dist/cadbench-htzAmMaI.js.map +1 -0
- package/dist/{cadgenbench-Tvk16YKT.js → cadgenbench-BLvEtnxU.js} +28 -22
- package/dist/cadgenbench-BLvEtnxU.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +667 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +9 -8
- package/dist/index.js +61 -56
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
- package/scripts/enterpriseops-gym-run.sh +82 -0
- package/scripts/grade-recorded-evidence.mjs +6 -6
- package/scripts/harvey-lab-judge.py +50 -0
- package/scripts/harvey-lab-run.sh +53 -0
- package/scripts/harvey-lab-sandbox.sh +21 -0
- package/scripts/healthbench-professional-run.sh +30 -0
- package/scripts/healthbench_professional_run.py +112 -0
- package/scripts/mlcr-run.sh +17 -0
- package/scripts/mlcr_run.py +133 -0
- package/scripts/prbench-run.sh +39 -0
- package/scripts/prbench_run.py +53 -0
- package/scripts/verify-packed-consumer.mjs +32 -27
- package/src/adapters.ts +5 -7
- package/src/benchmarks/_harness.test.mts +18 -1
- package/src/benchmarks/_harness.ts +12 -7
- package/src/benchmarks/aec-bench.test.mts +14 -14
- package/src/benchmarks/aec-bench.ts +62 -56
- package/src/benchmarks/agent-eval-contract.test.mts +38 -0
- package/src/benchmarks/agentbench.ts +44 -37
- package/src/benchmarks/appworld.test.mts +7 -7
- package/src/benchmarks/appworld.ts +88 -75
- package/src/benchmarks/bfcl.ts +60 -53
- package/src/benchmarks/cad-design.ts +34 -32
- package/src/benchmarks/cadbench.ts +34 -32
- package/src/benchmarks/cadgenbench.ts +30 -28
- package/src/benchmarks/commit0.test.mts +9 -9
- package/src/benchmarks/commit0.ts +50 -43
- package/src/benchmarks/crag.ts +45 -40
- package/src/benchmarks/dabstep-official.test.mts +8 -8
- package/src/benchmarks/dabstep.test.mts +11 -11
- package/src/benchmarks/dabstep.ts +47 -40
- package/src/benchmarks/external-adapters.test.mts +43 -44
- package/src/benchmarks/finresearchbench.ts +57 -47
- package/src/benchmarks/finsearchcomp.ts +72 -67
- package/src/benchmarks/frames.ts +76 -69
- package/src/benchmarks/hotpotqa.ts +69 -64
- package/src/benchmarks/humaneval.ts +37 -35
- package/src/benchmarks/mcad-bench.test.mts +30 -30
- package/src/benchmarks/mcad-bench.ts +66 -60
- package/src/benchmarks/mcad-cq-bench.ts +69 -63
- package/src/benchmarks/mcad-cq-golds.ts +1 -1
- package/src/benchmarks/mcad-cq.test.mts +40 -40
- package/src/benchmarks/mcad-golds.ts +1 -1
- package/src/benchmarks/mind2web.ts +66 -58
- package/src/benchmarks/nomiracl.ts +53 -46
- package/src/benchmarks/open-rag-bench.ts +47 -42
- package/src/benchmarks/programbench.test.mts +10 -10
- package/src/benchmarks/programbench.ts +38 -33
- package/src/benchmarks/rag-benchmarks.test.mts +31 -31
- package/src/benchmarks/rag-shared.ts +13 -16
- package/src/benchmarks/ragbench.ts +44 -39
- package/src/benchmarks/simpleqa.ts +78 -73
- package/src/benchmarks/swe-bench.test.mts +3 -3
- package/src/benchmarks/swe-bench.ts +66 -61
- package/src/benchmarks/t2-ragbench.ts +47 -42
- package/src/benchmarks/tau-bench-shared.ts +51 -44
- package/src/benchmarks/tau-pin.test.mts +1 -1
- package/src/benchmarks/tau2-bench.ts +2 -2
- package/src/benchmarks/tau3-banking.ts +2 -2
- package/src/benchmarks/terminal-bench.test.mts +3 -3
- package/src/benchmarks/terminal-bench.ts +41 -36
- package/src/benchmarks/toollm.ts +54 -47
- package/src/benchmarks/trata-hedge.ts +57 -52
- package/src/benchmarks/types.ts +70 -59
- package/src/benchmarks/webarena-verified.ts +49 -42
- package/src/cli.ts +74 -0
- package/src/corpus-replay.mts +9 -9
- package/src/examples/benchmark-matrix.mts +13 -10
- package/src/gate-cli.mts +5 -5
- package/src/gate.test.mts +14 -12
- package/src/gate.ts +23 -22
- package/src/index.ts +17 -11
- package/src/published.test.mts +534 -0
- package/src/published.ts +524 -0
- package/src/run-benchmarks-cli.mts +2 -2
- package/src/run-benchmarks.test.mts +58 -48
- package/src/run-benchmarks.ts +64 -57
- package/src/swe-bench-env.ts +6 -6
- package/src/worker.ts +1 -1
- package/dist/benchmarks/enterpriseops-gym.d.ts +0 -6
- package/dist/benchmarks/enterpriseops-gym.js +0 -236
- package/dist/benchmarks/enterpriseops-gym.js.map +0 -1
- package/dist/cadbench-Byr5gO1M.js.map +0 -1
- package/dist/cadgenbench-Tvk16YKT.js.map +0 -1
- package/fixtures/enterpriseops-gym.json +0 -103
- package/scripts/enterpriseops_gym_judge.py +0 -281
- package/src/benchmarks/enterpriseops-gym.test.mts +0 -77
- package/src/benchmarks/enterpriseops-gym.ts +0 -343
- package/src/eops-skills/address-every-subtask.md +0 -5
- package/src/eops-skills/exact-tools-and-args.md +0 -5
- package/src/eops-skills/full-sequence-to-goal.md +0 -5
- package/src/eops-skills/ground-every-value.md +0 -5
- package/src/eops-skills/honor-the-policies.md +0 -5
package/src/published.ts
ADDED
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published benchmarks, run by their publishers' own runners, unmodified, at a pinned commit.
|
|
3
|
+
*
|
|
4
|
+
* One registry entry per benchmark: the publisher's repository and commit, its install and run commands, a parser from the
|
|
5
|
+
* publisher's result file to per-task scores (agent-eval's verdict names: `passed`, `score`, `notes`), the license, the data terms, and the judge the publisher names. Nothing here loads
|
|
6
|
+
* tasks, drives an agent loop, or grades: the publisher's runner does all three. A target becomes the OpenAI-compatible
|
|
7
|
+
* endpoint that runner calls:
|
|
8
|
+
*
|
|
9
|
+
* model:<router model> the Tangle Router with `TANGLE_API_KEY`; the target is a model driving the benchmark's tools.
|
|
10
|
+
* profile:<harness/model> a CLI Bridge (`AGENT_BENCH_BRIDGE_URL`, default http://127.0.0.1:3344/v1) running that harness with
|
|
11
|
+
* its own loop and tools; the benchmark's tools reach it as caller-executed MCP tools (cli-bridge#397).
|
|
12
|
+
* app:<agent app>@<harness/model>
|
|
13
|
+
* the AgentProfile the app serves in production (prompt, skills, subagents, resources), run by
|
|
14
|
+
* that subscription harness through the same CLI Bridge at `/profiles/<id>/v1` (cli-bridge#408).
|
|
15
|
+
* The app's production model and its own MCP servers are not part of it; the run record names both.
|
|
16
|
+
*
|
|
17
|
+
* Every run says what it measured: `model-shaped` (the target as a model calling the benchmark's tools, which the
|
|
18
|
+
* benchmark executes) or `own-loop` (the agent with its own loop and tools). The two are never compared as one.
|
|
19
|
+
*/
|
|
20
|
+
import { spawn } from 'node:child_process'
|
|
21
|
+
import { createHash, randomUUID } from 'node:crypto'
|
|
22
|
+
import { existsSync } from 'node:fs'
|
|
23
|
+
import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises'
|
|
24
|
+
import { homedir } from 'node:os'
|
|
25
|
+
import path from 'node:path'
|
|
26
|
+
import { fileURLToPath } from 'node:url'
|
|
27
|
+
import { canonicalJson, RunRecordValidationError, UNKNOWN_MODEL, validateRunRecord, type RunRecord } from '@tangle-network/agent-eval'
|
|
28
|
+
|
|
29
|
+
export type Measured = 'model-shaped' | 'own-loop'
|
|
30
|
+
|
|
31
|
+
/** The OpenAI-compatible endpoint a publisher's runner calls for one target. */
|
|
32
|
+
export interface Endpoint {
|
|
33
|
+
target: string
|
|
34
|
+
baseUrl: string
|
|
35
|
+
model: string
|
|
36
|
+
/** The environment variable that holds the endpoint's key; the runner reads it, nothing here prints it. */
|
|
37
|
+
apiKeyVar: string
|
|
38
|
+
/** What a run through this endpoint measures. */
|
|
39
|
+
measured: Measured
|
|
40
|
+
/** For an app target: which served profile ran, and what of the app it leaves out. */
|
|
41
|
+
app?: AppProfile
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** An agent app's served AgentProfile as an app target runs it. */
|
|
45
|
+
export interface AppProfile {
|
|
46
|
+
app: string
|
|
47
|
+
profileUrl: string
|
|
48
|
+
profileName: string | null
|
|
49
|
+
profileVersion: string | null
|
|
50
|
+
/** sha256 of the profile as run (served profile without `model` and `mcp`). */
|
|
51
|
+
profileDigest: string
|
|
52
|
+
/** The model the app runs in production, replaced by the target's harness model. */
|
|
53
|
+
productionModel: unknown
|
|
54
|
+
/** The app's own MCP servers, which need the app's deployment and are not mounted. */
|
|
55
|
+
omittedMcp: string[]
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Agent apps a benchmark can target, each by the executable AgentProfile it serves in production: the projection its own
|
|
60
|
+
* sandbox sends a harness (gtm-agent toExecutableAgentProfile, legal-agent slimSandboxProfile). `AGENT_BENCH_APPS`, a JSON
|
|
61
|
+
* object of app name to profile URL or absolute file path, adds an app or points one at another source: a staging deployment,
|
|
62
|
+
* a profile exported from a checkout, or a candidate profile an optimizer is scoring.
|
|
63
|
+
*/
|
|
64
|
+
export const AGENT_APPS: Readonly<Record<string, { profileUrl: string }>> = {
|
|
65
|
+
'gtm-agent': { profileUrl: 'https://gtm.tangle.tools/api/tools/profile?definition=executable' },
|
|
66
|
+
'legal-agent': { profileUrl: 'https://legal.tangle.tools/api/tools/profile?definition=executable' },
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function agentApps(env: NodeJS.ProcessEnv): Record<string, { profileUrl: string }> {
|
|
70
|
+
if (!env.AGENT_BENCH_APPS) return { ...AGENT_APPS }
|
|
71
|
+
const extra = JSON.parse(env.AGENT_BENCH_APPS) as unknown
|
|
72
|
+
if (!extra || typeof extra !== 'object' || Array.isArray(extra) || !Object.values(extra).every((url) => typeof url === 'string')) {
|
|
73
|
+
throw new Error('AGENT_BENCH_APPS must be a JSON object of app name to profile URL or absolute file path')
|
|
74
|
+
}
|
|
75
|
+
return { ...AGENT_APPS, ...Object.fromEntries(Object.entries(extra as Record<string, string>).map(([name, profileUrl]) => [name, { profileUrl }])) }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface PublishedRunOptions {
|
|
79
|
+
/** Run this many tasks in the publisher's order (a sample, never a full official run unless asked). */
|
|
80
|
+
tasks?: number
|
|
81
|
+
/** Run exactly these publisher task ids. */
|
|
82
|
+
taskIds?: string[]
|
|
83
|
+
/** Extra arguments passed to the publisher's runner unchanged, after the ones this registry sets. */
|
|
84
|
+
args?: string[]
|
|
85
|
+
/** Where the publisher's result file and this run's record are written. */
|
|
86
|
+
out: string
|
|
87
|
+
env?: NodeJS.ProcessEnv
|
|
88
|
+
/** Where publisher checkouts are cached; defaults to ~/.cache/agent-bench/published. */
|
|
89
|
+
cacheDir?: string
|
|
90
|
+
/**
|
|
91
|
+
* Replace the publisher's judge with `bridge/<harness/model>`, a model on a subscription seat behind a CLI Bridge
|
|
92
|
+
* (AGENT_BENCH_JUDGE_URL, default the profile Bridge). The run is then not official, and its record says so.
|
|
93
|
+
*/
|
|
94
|
+
judge?: string
|
|
95
|
+
/** The agent-eval RunRecord identity each task row carries; defaults: experiment `<benchmark>@<ref>`, candidate the target, split holdout. */
|
|
96
|
+
record?: { experimentId?: string; candidateId?: string; splitTag?: 'search' | 'dev' | 'holdout' }
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** One task's score; `raw` carries the publisher's numeric per-task detail (Harvey LAB: `crit.<id>` 1|0, criteria counts). */
|
|
100
|
+
export interface PublishedTaskScore {
|
|
101
|
+
id: string
|
|
102
|
+
passed: boolean
|
|
103
|
+
score: number
|
|
104
|
+
notes?: string
|
|
105
|
+
raw?: Record<string, number>
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface PublishedBenchmark {
|
|
109
|
+
name: string
|
|
110
|
+
repository: string
|
|
111
|
+
/** The exact publisher commit; a moved tag cannot change a recorded number. */
|
|
112
|
+
ref: string
|
|
113
|
+
version: string
|
|
114
|
+
license: string
|
|
115
|
+
terms: string
|
|
116
|
+
/** The judge model the publisher names, or null when the publisher's grader is deterministic. */
|
|
117
|
+
judge: string | null
|
|
118
|
+
/** The benchmark's runner accepts a substituted judge (`--judge`). */
|
|
119
|
+
judgeSubstitutable?: boolean
|
|
120
|
+
/** Why no run of this entry is official, when the publisher reports from an implementation it does not release. */
|
|
121
|
+
unofficial?: string
|
|
122
|
+
measured: Measured
|
|
123
|
+
/** The runner writes a folder of results rather than one file. */
|
|
124
|
+
resultIsFolder?: boolean
|
|
125
|
+
install: string[][]
|
|
126
|
+
run(endpoint: Endpoint, options: PublishedRunOptions, resultPath: string): string[]
|
|
127
|
+
/** Read the publisher's result (a file or a folder) into one score per task, as the publisher's grader reported it. */
|
|
128
|
+
parse(resultPath: string): Promise<PublishedTaskScore[]>
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface PublishedRun {
|
|
132
|
+
benchmark: string
|
|
133
|
+
version: string
|
|
134
|
+
ref: string
|
|
135
|
+
target: string
|
|
136
|
+
model: string
|
|
137
|
+
measured: Measured
|
|
138
|
+
judge: string | null
|
|
139
|
+
/** The judge the publisher names, kept beside a substituted one. */
|
|
140
|
+
publisherJudge: string | null
|
|
141
|
+
/** True when the score comes from the publisher's own grader and judge; false whenever a judge was substituted. */
|
|
142
|
+
official: boolean
|
|
143
|
+
/** Why the entry is never official (`PublishedBenchmark.unofficial`). */
|
|
144
|
+
unofficial?: string
|
|
145
|
+
app?: AppProfile
|
|
146
|
+
tasks: number
|
|
147
|
+
passed: number
|
|
148
|
+
/** Mean task score, 0..1, as the publisher's grader reports it. */
|
|
149
|
+
score: number
|
|
150
|
+
taskScores: PublishedTaskScore[]
|
|
151
|
+
resultPath: string
|
|
152
|
+
/** One agent-eval RunRecord per task (JSON lines), for the ledgers, dashboards and promotion gates every other run feeds. */
|
|
153
|
+
runRecords: string
|
|
154
|
+
license: string
|
|
155
|
+
terms: string
|
|
156
|
+
startedAt: string
|
|
157
|
+
finishedAt: string
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export const PUBLISHED_BENCHMARKS: Readonly<Record<string, PublishedBenchmark>> = {
|
|
161
|
+
automationbench: {
|
|
162
|
+
name: 'automationbench',
|
|
163
|
+
repository: 'https://github.com/zapier/AutomationBench.git',
|
|
164
|
+
ref: '4a8e1061254004d9dac807054eed33fad7d1ff14',
|
|
165
|
+
version: '1.0.6',
|
|
166
|
+
license: 'MIT (Zapier, Inc.); third-party API schemas excluded',
|
|
167
|
+
terms: 'MIT: tasks and code may be redistributed with attribution',
|
|
168
|
+
judge: null,
|
|
169
|
+
measured: 'model-shaped',
|
|
170
|
+
install: [['uv', 'sync', '--frozen']],
|
|
171
|
+
run: (endpoint, options, resultPath) => [
|
|
172
|
+
'uv', 'run', 'auto-bench',
|
|
173
|
+
'--model', endpoint.model, '--base-url', endpoint.baseUrl, '--api-key-var', endpoint.apiKeyVar,
|
|
174
|
+
...(options.taskIds?.length ? ['--tasks', options.taskIds.join(',')] : []),
|
|
175
|
+
...(options.tasks === undefined ? [] : ['--num-examples', String(options.tasks)]),
|
|
176
|
+
'--max-concurrent', String(Math.max(1, Math.min(options.tasks ?? options.taskIds?.length ?? 4, 4))),
|
|
177
|
+
'--export-json', resultPath,
|
|
178
|
+
...(options.args ?? []),
|
|
179
|
+
],
|
|
180
|
+
parse: async (resultPath) => {
|
|
181
|
+
const tasks = (JSON.parse(await readFile(resultPath, 'utf8')) as { tasks?: Array<{ name?: unknown; score?: unknown; passed?: unknown }> }).tasks
|
|
182
|
+
if (!Array.isArray(tasks)) throw new Error('AutomationBench result has no tasks array')
|
|
183
|
+
return tasks.map((task) => {
|
|
184
|
+
if (typeof task.name !== 'string' || typeof task.score !== 'number' || typeof task.passed !== 'boolean') {
|
|
185
|
+
throw new Error(`AutomationBench task result is malformed: ${JSON.stringify(task).slice(0, 200)}`)
|
|
186
|
+
}
|
|
187
|
+
return { id: task.name, passed: task.passed, score: task.score }
|
|
188
|
+
})
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
'enterpriseops-gym': {
|
|
192
|
+
name: 'enterpriseops-gym',
|
|
193
|
+
repository: 'https://github.com/ServiceNow/EnterpriseOps-Gym.git',
|
|
194
|
+
ref: '271f2c357f763376997dfd16807fcde2474ae41b',
|
|
195
|
+
version: '271f2c3 (no release tag)',
|
|
196
|
+
license: 'Apache-2.0 (ServiceNow; code and the ServiceNow-AI/EnterpriseOps-Gym dataset)',
|
|
197
|
+
terms: 'Apache-2.0: tasks may be redistributed with attribution',
|
|
198
|
+
judge: null,
|
|
199
|
+
measured: 'model-shaped',
|
|
200
|
+
resultIsFolder: true,
|
|
201
|
+
install: [['uv', 'sync', '--extra', 'openai'], ['python3', '-c', "import zipfile; zipfile.ZipFile('gym_dbs.zip').extractall('.')"]],
|
|
202
|
+
// A sample runs `--task` ids or the first --tasks of the domain (default teams, mode oracle; pass `-- --domain d --mode m`).
|
|
203
|
+
run: (endpoint, options, resultPath) => [
|
|
204
|
+
'sh', fileURLToPath(new URL('../scripts/enterpriseops-gym-run.sh', import.meta.url)),
|
|
205
|
+
resultPath, endpoint.baseUrl, endpoint.model, endpoint.apiKeyVar,
|
|
206
|
+
options.tasks === undefined ? 'all' : String(options.tasks), (options.taskIds ?? []).join(','),
|
|
207
|
+
...(options.args ?? []),
|
|
208
|
+
],
|
|
209
|
+
parse: async (resultPath) => {
|
|
210
|
+
const folder = path.join(resultPath, 'run_1')
|
|
211
|
+
const files = (await readdir(folder)).filter((file) => file.startsWith('results_') && file.endsWith('.json')).sort()
|
|
212
|
+
if (!files.length) throw new Error(`EnterpriseOps-Gym wrote no task results under ${folder}`)
|
|
213
|
+
return Promise.all(files.map(async (file) => {
|
|
214
|
+
const result = JSON.parse(await readFile(path.join(folder, file), 'utf8')) as {
|
|
215
|
+
statistics?: { overall_success_rate?: unknown; verifier_level_pass_rate?: unknown }; runs?: Array<{ error?: unknown }>
|
|
216
|
+
}
|
|
217
|
+
const success = result.statistics?.overall_success_rate
|
|
218
|
+
const verifiers = result.statistics?.verifier_level_pass_rate
|
|
219
|
+
if (typeof success !== 'number') throw new Error(`EnterpriseOps-Gym result ${file} has no statistics.overall_success_rate`)
|
|
220
|
+
const error = result.runs?.find((run) => run.error)?.error
|
|
221
|
+
return {
|
|
222
|
+
id: file.slice('results_'.length, -'.json'.length).split('__').pop()!, passed: success === 1, score: success,
|
|
223
|
+
notes: `verifier pass rate ${typeof verifiers === 'number' ? verifiers : 'unknown'}${error ? `; runner error: ${String(error).slice(0, 200)}` : ''}`,
|
|
224
|
+
}
|
|
225
|
+
}))
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
'harvey-lab': {
|
|
229
|
+
name: 'harvey-lab',
|
|
230
|
+
repository: 'https://github.com/harveyai/harvey-labs.git',
|
|
231
|
+
// v1.3.0, the latest tag: v1.0 has no OpenAI-compatible chat adapter; v1.3.0 ships baseten/ (chat completions with tools).
|
|
232
|
+
ref: '81d6a31b22d7c9f661cda4770cffcc12a5735dc2',
|
|
233
|
+
version: 'v1.3.0',
|
|
234
|
+
license: 'MIT (Harvey AI)',
|
|
235
|
+
terms: 'MIT: tasks and their synthetic documents ship in the repository; no training or redistribution restriction stated',
|
|
236
|
+
judge: 'claude-sonnet-4-6 + gpt-5.5 (LAB standard dual judge, all-pass per criterion)',
|
|
237
|
+
judgeSubstitutable: true,
|
|
238
|
+
measured: 'model-shaped',
|
|
239
|
+
resultIsFolder: true,
|
|
240
|
+
install: [
|
|
241
|
+
['uv', 'sync', '--all-extras'],
|
|
242
|
+
// The publisher's own pinned pandoc, which its grader needs for .docx deliverables, into the checkout.
|
|
243
|
+
['sh', 'lab_core/sandbox/install_pandoc.sh', '.agent-bench'],
|
|
244
|
+
['sh', fileURLToPath(new URL('../scripts/harvey-lab-sandbox.sh', import.meta.url))],
|
|
245
|
+
],
|
|
246
|
+
// A sample runs --task ids or the first --tasks in sorted task-id order (pass `-- --area <practice area>` to stay in one).
|
|
247
|
+
run: (endpoint, options, resultPath) => [
|
|
248
|
+
'sh', fileURLToPath(new URL('../scripts/harvey-lab-run.sh', import.meta.url)),
|
|
249
|
+
resultPath, endpoint.baseUrl, endpoint.model, endpoint.apiKeyVar,
|
|
250
|
+
options.tasks === undefined ? 'all' : String(options.tasks), (options.taskIds ?? []).join(','), options.judge ?? 'publisher',
|
|
251
|
+
...(options.args ?? []),
|
|
252
|
+
],
|
|
253
|
+
parse: async (resultPath) => {
|
|
254
|
+
const runs = (await readFile(path.join(resultPath, 'tasks.tsv'), 'utf8')).trim().split('\n').map((line) => line.split('\t') as [string, string])
|
|
255
|
+
return Promise.all(runs.map(async ([run, task]) => {
|
|
256
|
+
const read = (file: string) => readFile(path.join(resultPath, run, file), 'utf8').then((text) => JSON.parse(text) as Record<string, unknown>, () => null)
|
|
257
|
+
const dual = await read('scores_dual.json')
|
|
258
|
+
if (dual) return { id: task, passed: dual.all_pass === true, score: Number(dual.dual_all_pass_rate), notes: `dual-judge criterion pass ${String(dual.dual_criterion_pass)}` }
|
|
259
|
+
const single = await read('scores.json')
|
|
260
|
+
if (single) {
|
|
261
|
+
const criteria = Array.isArray(single.criteria_results) ? single.criteria_results as Array<{ id?: unknown; verdict?: unknown }> : []
|
|
262
|
+
return { id: task, passed: single.all_pass === true, score: single.all_pass === true ? 1 : 0,
|
|
263
|
+
notes: `${String(single.n_passed)} of ${String(single.n_criteria)} criteria passed${single.n_grading_errors ? `; ${String(single.n_grading_errors)} grading errors` : ''}`,
|
|
264
|
+
raw: { criteria_passed: Number(single.n_passed) || 0, criteria_total: Number(single.n_criteria) || 0,
|
|
265
|
+
...Object.fromEntries(criteria.filter((c) => typeof c.id === 'string').map((c) => [`crit.${String(c.id)}`, c.verdict === 'pass' ? 1 : 0])) } }
|
|
266
|
+
}
|
|
267
|
+
return { id: task, passed: false, score: 0, notes: 'no scores: the harness or the grader failed (see the runner log)' }
|
|
268
|
+
}))
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
prbench: {
|
|
272
|
+
name: 'prbench',
|
|
273
|
+
repository: 'https://github.com/scaleapi/PRBench.git',
|
|
274
|
+
ref: '7b2df0a28bf99ec51263c41b90dd510a740a7711',
|
|
275
|
+
version: '7b2df0a (no release tag)',
|
|
276
|
+
license: 'MIT (Scale AI); dataset ScaleAI/PRBench CC-BY-4.0',
|
|
277
|
+
terms: 'CC-BY-4.0 dataset, not gated, loaded from Hugging Face at run time; attribution required, no training restriction stated',
|
|
278
|
+
judge: 'openai/o4-mini (reasoning effort high), one call per rubric criterion',
|
|
279
|
+
judgeSubstitutable: true,
|
|
280
|
+
measured: 'model-shaped',
|
|
281
|
+
resultIsFolder: true,
|
|
282
|
+
// The publisher pins no dependency versions (requirements.txt), so a fresh install resolves them anew.
|
|
283
|
+
install: [['uv', 'venv', '--quiet', '--python', '3.12'], ['uv', 'pip', 'install', '--quiet', '-r', 'requirements.txt']],
|
|
284
|
+
// A sample runs --task ids or the first --tasks rows of the split (default legal; pass `-- --split finance`).
|
|
285
|
+
run: (endpoint, options, resultPath) => [
|
|
286
|
+
'sh', fileURLToPath(new URL('../scripts/prbench-run.sh', import.meta.url)),
|
|
287
|
+
resultPath, endpoint.baseUrl, endpoint.model, endpoint.apiKeyVar,
|
|
288
|
+
options.tasks === undefined ? 'all' : String(options.tasks), (options.taskIds ?? []).join(','), options.judge ?? 'publisher',
|
|
289
|
+
...(options.args ?? []),
|
|
290
|
+
],
|
|
291
|
+
// Per task, the publisher's clipped score: rubric points over the positive weights (negative criteria can take it below
|
|
292
|
+
// zero; clamped to 0..1 here). The publisher's aggregate, mean_clipped, is max(0, mean of the unclamped scores).
|
|
293
|
+
parse: async (resultPath) => {
|
|
294
|
+
const folder = path.join(resultPath, 'results')
|
|
295
|
+
const files = (await readdir(folder)).filter((file) => file.endsWith('.json'))
|
|
296
|
+
if (files.length !== 1) throw new Error(`PRBench wrote ${files.length} result files under ${folder}, expected one`)
|
|
297
|
+
const result = JSON.parse(await readFile(path.join(folder, files[0]!), 'utf8')) as { outputs?: Record<string, Record<string, { points?: unknown; weights?: unknown }>> }
|
|
298
|
+
const tasks = Object.values(result.outputs ?? {})[0]
|
|
299
|
+
if (!tasks) throw new Error(`PRBench result ${files[0]} has no outputs`)
|
|
300
|
+
return Object.entries(tasks).map(([id, task]) => {
|
|
301
|
+
const weights = Array.isArray(task.weights) ? task.weights.filter((weight): weight is number => typeof weight === 'number') : []
|
|
302
|
+
const best = weights.filter((weight) => weight > 0).reduce((sum, weight) => sum + weight, 0)
|
|
303
|
+
const points = typeof task.points === 'number' ? task.points : Number.NaN
|
|
304
|
+
if (!best || Number.isNaN(points)) throw new Error(`PRBench task ${id} has no points or weights`)
|
|
305
|
+
return { id, passed: points >= best, score: Math.min(1, Math.max(0, points / best)), notes: `${points} of ${best} rubric points` }
|
|
306
|
+
})
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
'healthbench-professional': {
|
|
310
|
+
name: 'healthbench-professional',
|
|
311
|
+
repository: 'https://github.com/openai/simple-evals.git',
|
|
312
|
+
ref: '652c89d0ca9df547706735883097e9537d40dc47',
|
|
313
|
+
version: '652c89d (no release tag), data openai/healthbench-professional@349962fd',
|
|
314
|
+
license: 'MIT (OpenAI simple-evals); dataset openai/healthbench-professional MIT',
|
|
315
|
+
terms: 'MIT dataset, not gated, fetched from Hugging Face at the pinned revision at run time and never committed: the authors ask that examples not be revealed in plain text or images online. No training restriction stated.',
|
|
316
|
+
judge: 'gpt-5.4-2026-03-05 (reasoning effort low), one call per rubric item; length-adjusted (center 2000 characters, 1.47 points per 500)',
|
|
317
|
+
judgeSubstitutable: true,
|
|
318
|
+
unofficial: 'OpenAI reports HealthBench Professional from an internal implementation it does not release; simple-evals with its Professional settings is the reference implementation',
|
|
319
|
+
measured: 'model-shaped',
|
|
320
|
+
resultIsFolder: true,
|
|
321
|
+
// The publisher pins no dependency versions and ships no requirements file; these are the imports HealthBenchEval needs.
|
|
322
|
+
install: [['uv', 'venv', '--quiet', '--python', '3.12'], ['uv', 'pip', 'install', '--quiet', 'openai', 'blobfile', 'numpy', 'pandas', 'jinja2', 'requests', 'tqdm']],
|
|
323
|
+
// A sample runs the publisher's seeded sample of --tasks examples, or the --task ids.
|
|
324
|
+
run: (endpoint, options, resultPath) => [
|
|
325
|
+
'sh', fileURLToPath(new URL('../scripts/healthbench-professional-run.sh', import.meta.url)),
|
|
326
|
+
resultPath, endpoint.baseUrl, endpoint.model, endpoint.apiKeyVar,
|
|
327
|
+
options.tasks === undefined ? 'all' : String(options.tasks), (options.taskIds ?? []).join(','), options.judge ?? 'publisher',
|
|
328
|
+
...(options.args ?? []),
|
|
329
|
+
],
|
|
330
|
+
// Per task, the publisher's length-adjusted rubric score, clamped to 0..1 (the publisher clips the mean, not each task).
|
|
331
|
+
// Passed: every positive criterion met and no negative one.
|
|
332
|
+
parse: async (resultPath) => {
|
|
333
|
+
const result = JSON.parse(await readFile(path.join(resultPath, 'result.json'), 'utf8')) as {
|
|
334
|
+
examples?: Array<{ prompt_id: string; overall_score: number; length_adjusted: number; response_chars: number; positive_met: number; positive_total: number; negative_met: number }>
|
|
335
|
+
}
|
|
336
|
+
if (!result.examples?.length) throw new Error(`HealthBench Professional wrote no examples under ${resultPath}`)
|
|
337
|
+
return result.examples.map((example) => ({
|
|
338
|
+
id: example.prompt_id,
|
|
339
|
+
passed: example.positive_met === example.positive_total && example.negative_met === 0,
|
|
340
|
+
score: Math.min(1, Math.max(0, example.length_adjusted)),
|
|
341
|
+
notes: `${example.positive_met} of ${example.positive_total} positive criteria met, ${example.negative_met} negative met; rubric score ${example.overall_score.toFixed(3)}, length-adjusted for ${example.response_chars} characters`,
|
|
342
|
+
raw: {
|
|
343
|
+
overall_score: example.overall_score, length_adjusted: example.length_adjusted, response_chars: example.response_chars,
|
|
344
|
+
positive_met: example.positive_met, positive_total: example.positive_total, negative_met: example.negative_met,
|
|
345
|
+
},
|
|
346
|
+
}))
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
mlcr: {
|
|
350
|
+
name: 'mlcr',
|
|
351
|
+
repository: 'https://github.com/Wisedocs-AI/medical-long-context-reasoning.git',
|
|
352
|
+
ref: 'ca822de2d274184bb0cd5bf280ff917922f3716f',
|
|
353
|
+
version: 'v1.1 (ca822de, the release commit; no tag), data Wisedocs/mlcr-dataset@1198206e',
|
|
354
|
+
license: 'none: neither the code nor the Wisedocs/mlcr-dataset release carries a license (the dataset card says "other")',
|
|
355
|
+
terms: 'No license: run locally for evaluation only, never committed, redistributed, or used for training or prompt optimization. The dataset is not gated and is fetched from Hugging Face at the pinned revision at run time.',
|
|
356
|
+
// A substituted judge sits all three jury seats, each sampling independently, so the publisher's two-of-three rule applies.
|
|
357
|
+
judge: "jury of gemini-3.1-pro-preview, claude-opus-4-8-gcp and gpt-5.5 (majority vote, medium thinking) on the publisher's Vertex, Anthropic-on-GCP and Azure OpenAI providers, after a conciseness gate",
|
|
358
|
+
judgeSubstitutable: true,
|
|
359
|
+
measured: 'model-shaped',
|
|
360
|
+
resultIsFolder: true,
|
|
361
|
+
install: [['uv', 'venv', '--quiet', '--python', '3.12'], ['uv', 'pip', 'install', '--quiet', '-e', '.[all]']],
|
|
362
|
+
// A sample is the runner's first --tasks rows of the publisher's smoke experiment; MLCR names rows by matrix cell, not id.
|
|
363
|
+
run: (endpoint, options, resultPath) => [
|
|
364
|
+
'sh', fileURLToPath(new URL('../scripts/mlcr-run.sh', import.meta.url)),
|
|
365
|
+
resultPath, endpoint.baseUrl, endpoint.model, endpoint.apiKeyVar,
|
|
366
|
+
options.tasks === undefined ? 'all' : String(options.tasks), (options.taskIds ?? []).join(','), options.judge ?? 'publisher',
|
|
367
|
+
...(options.args ?? []),
|
|
368
|
+
],
|
|
369
|
+
// Per row, the jury's verdict: correct (complete and accurate by majority) after the conciseness gate.
|
|
370
|
+
parse: async (resultPath) => {
|
|
371
|
+
const result = JSON.parse(await readFile(path.join(resultPath, 'result.json'), 'utf8')) as {
|
|
372
|
+
examples?: Array<{ id: string; concise: string; complete: string; accurate: string; correct: string; judge_error: boolean; response_chars: number }>
|
|
373
|
+
}
|
|
374
|
+
if (!result.examples?.length) throw new Error(`MLCR wrote no scored rows under ${resultPath}`)
|
|
375
|
+
const verdict = (value: string) => (value === '' ? undefined : Number(value))
|
|
376
|
+
return result.examples.map((example) => {
|
|
377
|
+
if (example.correct === '') throw new Error(`MLCR row ${example.id} has no jury verdict${example.judge_error ? ' (the judge failed)' : ''}`)
|
|
378
|
+
const raw = Object.fromEntries(Object.entries({ concise: verdict(example.concise), complete: verdict(example.complete), accurate: verdict(example.accurate), correct: verdict(example.correct) })
|
|
379
|
+
.filter((entry): entry is [string, number] => entry[1] !== undefined))
|
|
380
|
+
return {
|
|
381
|
+
id: example.id, passed: example.correct === '1', score: example.correct === '1' ? 1 : 0,
|
|
382
|
+
notes: `concise ${example.concise || '-'}, complete ${example.complete || '-'}, accurate ${example.accurate || '-'}; ${example.response_chars} characters`,
|
|
383
|
+
raw: { ...raw, response_chars: example.response_chars },
|
|
384
|
+
}
|
|
385
|
+
})
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** Resolve a `model:`, `app:` or `profile:` target to the endpoint a publisher's runner calls. */
|
|
391
|
+
export async function resolveEndpoint(target: string, benchmark: PublishedBenchmark, env: NodeJS.ProcessEnv = process.env): Promise<Endpoint> {
|
|
392
|
+
const match = /^(model|app|profile):(.+)$/.exec(target)
|
|
393
|
+
if (!match) throw new Error(`target must be model:<router model>, app:<agent app>@<harness/model> or profile:<harness/model>, not '${target}'`)
|
|
394
|
+
const [, kind, id] = match as unknown as [string, 'model' | 'app' | 'profile', string]
|
|
395
|
+
if (kind === 'model') {
|
|
396
|
+
return { target, model: id, baseUrl: env.AGENT_BENCH_ROUTER_URL ?? 'https://router.tangle.tools/v1', apiKeyVar: 'TANGLE_API_KEY', measured: benchmark.measured }
|
|
397
|
+
}
|
|
398
|
+
// A loopback Bridge without a bearer accepts any key; the runner still needs one to send.
|
|
399
|
+
const bridge = env.AGENT_BENCH_BRIDGE_URL ?? 'http://127.0.0.1:3344/v1'
|
|
400
|
+
if (kind === 'profile') return { target, model: id, baseUrl: bridge, apiKeyVar: 'AGENT_BENCH_BRIDGE_KEY', measured: 'own-loop' }
|
|
401
|
+
const at = id.indexOf('@')
|
|
402
|
+
const [name, harness] = at === -1 ? [id, ''] : [id.slice(0, at), id.slice(at + 1)]
|
|
403
|
+
const apps = agentApps(env)
|
|
404
|
+
const app = apps[name]
|
|
405
|
+
if (!app) throw new Error(`no agent app '${name}'; registered: ${Object.keys(apps).join(', ')} (add one with AGENT_BENCH_APPS)`)
|
|
406
|
+
if (!harness) throw new Error(`app:${name} needs @<harness/model>, the subscription harness that runs the app's profile, e.g. app:${name}@opencode/zai-coding-plan/glm-5.3`)
|
|
407
|
+
const catalog = env.AGENT_BENCH_BRIDGE_PROFILES_DIR
|
|
408
|
+
if (!catalog) throw new Error(`AGENT_BENCH_BRIDGE_PROFILES_DIR is not set: point it at the CLI Bridge's SANDBOX_PROFILES_DIR, where app:${name} writes its profile`)
|
|
409
|
+
const { mcp, model, ...profile } = await readAppProfile(name, app.profileUrl)
|
|
410
|
+
const text = JSON.stringify(profile)
|
|
411
|
+
const digest = createHash('sha256').update(text).digest('hex')
|
|
412
|
+
// Content-addressed: the Bridge rereads its catalog only for an id it does not know.
|
|
413
|
+
const profileId = `${name}-${digest.slice(0, 12)}`
|
|
414
|
+
await mkdir(catalog, { recursive: true })
|
|
415
|
+
await writeFile(path.join(catalog, `${profileId}.json`), text)
|
|
416
|
+
return {
|
|
417
|
+
target, model: harness, baseUrl: `${bridge.replace(/\/v1\/?$/, '')}/profiles/${profileId}/v1`, apiKeyVar: 'AGENT_BENCH_BRIDGE_KEY', measured: 'own-loop',
|
|
418
|
+
app: {
|
|
419
|
+
app: name, profileUrl: app.profileUrl, profileDigest: `sha256:${digest}`, productionModel: model ?? null,
|
|
420
|
+
profileName: typeof profile.name === 'string' ? profile.name : null, profileVersion: typeof profile.version === 'string' ? profile.version : null,
|
|
421
|
+
omittedMcp: mcp && typeof mcp === 'object' ? Object.keys(mcp) : [],
|
|
422
|
+
},
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** An app's profile from its URL, or from an absolute file path. */
|
|
427
|
+
async function readAppProfile(name: string, source: string): Promise<Record<string, unknown>> {
|
|
428
|
+
if (path.isAbsolute(source)) return JSON.parse(await readFile(source, 'utf8')) as Record<string, unknown>
|
|
429
|
+
const response = await fetch(source)
|
|
430
|
+
if (!response.ok) throw new Error(`${source} answered ${response.status}; app:${name} needs the profile the app serves`)
|
|
431
|
+
return await response.json() as Record<string, unknown>
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/** Run one published benchmark against one target with the publisher's runner and grader, and record the result. */
|
|
435
|
+
export async function runPublished(name: string, target: string, options: PublishedRunOptions): Promise<PublishedRun> {
|
|
436
|
+
const benchmark = PUBLISHED_BENCHMARKS[name]
|
|
437
|
+
if (!benchmark) throw new Error(`no published benchmark '${name}'; registered: ${Object.keys(PUBLISHED_BENCHMARKS).join(', ')}`)
|
|
438
|
+
const env = { ...process.env, ...options.env }
|
|
439
|
+
if (options.judge !== undefined && !benchmark.judgeSubstitutable) {
|
|
440
|
+
throw new Error(`${benchmark.name} grades ${benchmark.judge === null ? 'deterministically' : `with ${benchmark.judge}`}; this registry cannot substitute its judge`)
|
|
441
|
+
}
|
|
442
|
+
if (options.judge !== undefined && !options.judge.startsWith('bridge/')) throw new Error(`--judge must be bridge/<harness/model>, not '${options.judge}'`)
|
|
443
|
+
env.AGENT_BENCH_JUDGE_URL ??= env.AGENT_BENCH_BRIDGE_URL ?? 'http://127.0.0.1:3344/v1'
|
|
444
|
+
const endpoint = await resolveEndpoint(target, benchmark, env)
|
|
445
|
+
if (!env[endpoint.apiKeyVar]) throw new Error(`${endpoint.apiKeyVar} is not set; the ${target} endpoint needs it`)
|
|
446
|
+
const checkout = await publisherCheckout(benchmark, options.cacheDir, env)
|
|
447
|
+
await mkdir(options.out, { recursive: true })
|
|
448
|
+
const resultPath = path.resolve(options.out, `${benchmark.name}-result${benchmark.resultIsFolder ? '' : '.json'}`)
|
|
449
|
+
const startedAt = new Date().toISOString()
|
|
450
|
+
const [command, ...args] = benchmark.run(endpoint, options, resultPath)
|
|
451
|
+
await execute(command!, args, checkout, env)
|
|
452
|
+
const taskScores = await benchmark.parse(resultPath)
|
|
453
|
+
const run: PublishedRun = {
|
|
454
|
+
benchmark: benchmark.name, version: benchmark.version, ref: benchmark.ref, target, model: endpoint.model,
|
|
455
|
+
measured: endpoint.measured, judge: options.judge ?? benchmark.judge, publisherJudge: benchmark.judge,
|
|
456
|
+
official: options.judge === undefined && benchmark.unofficial === undefined,
|
|
457
|
+
...(benchmark.unofficial ? { unofficial: benchmark.unofficial } : {}),
|
|
458
|
+
...(endpoint.app ? { app: endpoint.app } : {}),
|
|
459
|
+
tasks: taskScores.length, passed: taskScores.filter((task) => task.passed).length,
|
|
460
|
+
score: taskScores.length ? taskScores.reduce((sum, task) => sum + task.score, 0) / taskScores.length : 0,
|
|
461
|
+
taskScores, resultPath, runRecords: path.resolve(options.out, `${benchmark.name}-runrecords.jsonl`),
|
|
462
|
+
license: benchmark.license, terms: benchmark.terms, startedAt, finishedAt: new Date().toISOString(),
|
|
463
|
+
}
|
|
464
|
+
await writeFile(run.runRecords, runRecords(run, options).map((record) => JSON.stringify(record)).join('\n') + '\n')
|
|
465
|
+
await writeFile(path.resolve(options.out, `${benchmark.name}-run.json`), `${JSON.stringify(run, null, 2)}\n`)
|
|
466
|
+
return run
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* One agent-eval RunRecord per task, validated by agent-eval's own validator. The publisher's runner makes the model calls,
|
|
471
|
+
* so cost and tokens are uncaptured, never zero. A RunRecord's model must name a served snapshot; a subscription harness
|
|
472
|
+
* reports none, and a snapshot invented from the date would be false, so such rows record `unknown` with terminal outcome
|
|
473
|
+
* `unknown` and keep the requested model in `candidateId`. A pinned model id (a Router snapshot) is recorded as served.
|
|
474
|
+
*/
|
|
475
|
+
function runRecords(run: PublishedRun, options: PublishedRunOptions): RunRecord[] {
|
|
476
|
+
const split = options.record?.splitTag ?? 'holdout'
|
|
477
|
+
const sha = (value: string) => `sha256:${createHash('sha256').update(value).digest('hex')}`
|
|
478
|
+
const configHash = sha(canonicalJson({ benchmark: run.benchmark, ref: run.ref, target: run.target, judge: run.judge, args: options.args ?? [] }))
|
|
479
|
+
return run.taskScores.map((task) => {
|
|
480
|
+
const row = {
|
|
481
|
+
runId: randomUUID(), experimentId: options.record?.experimentId ?? `${run.benchmark}@${run.ref}`,
|
|
482
|
+
candidateId: options.record?.candidateId ?? run.target, seed: 0, model: run.model,
|
|
483
|
+
// The publisher owns the prompt; an app run's prompt is its profile.
|
|
484
|
+
promptHash: run.app?.profileDigest ?? sha(run.target), configHash, commitSha: run.ref,
|
|
485
|
+
wallMs: Math.max(0, Date.parse(run.finishedAt) - Date.parse(run.startedAt)),
|
|
486
|
+
costUsd: null, costProvenance: { kind: 'uncaptured', usd: null }, tokenUsage: { input: 0, output: 0, tokensKnown: false },
|
|
487
|
+
terminalOutcome: 'succeeded',
|
|
488
|
+
outcome: { [split === 'holdout' ? 'holdoutScore' : 'searchScore']: task.score, raw: { passed: task.passed ? 1 : 0, ...task.raw } },
|
|
489
|
+
splitTag: split, scenarioId: `${run.benchmark}:${task.id}`,
|
|
490
|
+
}
|
|
491
|
+
try {
|
|
492
|
+
return validateRunRecord(row)
|
|
493
|
+
} catch (error) {
|
|
494
|
+
if (!(error instanceof RunRecordValidationError) || error.path !== 'model') throw error
|
|
495
|
+
return validateRunRecord({ ...row, model: UNKNOWN_MODEL, terminalOutcome: 'unknown' })
|
|
496
|
+
}
|
|
497
|
+
})
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/** The publisher's repository at the pinned commit, installed once per cache. */
|
|
501
|
+
async function publisherCheckout(benchmark: PublishedBenchmark, cacheDir: string | undefined, env: NodeJS.ProcessEnv): Promise<string> {
|
|
502
|
+
const root = cacheDir ?? path.join(homedir(), '.cache', 'agent-bench', 'published')
|
|
503
|
+
const dir = path.join(root, `${benchmark.name}@${benchmark.ref}`)
|
|
504
|
+
const installed = path.join(dir, '.agent-bench-installed')
|
|
505
|
+
if (existsSync(installed)) return dir
|
|
506
|
+
if (!existsSync(path.join(dir, '.git'))) {
|
|
507
|
+
await mkdir(root, { recursive: true })
|
|
508
|
+
await execute('git', ['clone', '--quiet', '--filter=blob:none', '--no-checkout', benchmark.repository, dir], root, env)
|
|
509
|
+
}
|
|
510
|
+
await execute('git', ['checkout', '--quiet', '--detach', benchmark.ref], dir, env)
|
|
511
|
+
for (const [command, ...args] of benchmark.install) await execute(command!, args, dir, env)
|
|
512
|
+
await writeFile(installed, `${benchmark.ref}\n`)
|
|
513
|
+
return dir
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function execute(command: string, args: string[], cwd: string, env: NodeJS.ProcessEnv): Promise<void> {
|
|
517
|
+
return new Promise((resolve, reject) => {
|
|
518
|
+
const child = spawn(command, args, { cwd, env, stdio: 'inherit' })
|
|
519
|
+
child.once('error', (error) => reject(new Error(`${command} could not start in ${cwd}: ${error.message}`)))
|
|
520
|
+
child.once('exit', (code, signal) => code === 0
|
|
521
|
+
? resolve()
|
|
522
|
+
: reject(new Error(`${command} ${args.slice(0, 3).join(' ')} exited ${signal ?? code} in ${cwd}`)))
|
|
523
|
+
})
|
|
524
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* A cell is `harness/model` (in-box: that coding harness runs the model) or a bare `model`
|
|
10
10
|
* (off-box: a router completion is the worker). The number is the adapter's OWN deterministic
|
|
11
|
-
* judge — pick benchmarks whose `adapter.
|
|
11
|
+
* judge — pick benchmarks whose `adapter.evaluate` is a runnable checker. Output is a leaderboard:
|
|
12
12
|
* resolve-rate and mean graded score per (benchmark × cell), with any unavailable benchmark
|
|
13
13
|
* (missing Docker/venv/dataset) listed, never silently dropped.
|
|
14
14
|
*/
|
|
@@ -52,7 +52,7 @@ async function main(): Promise<void> {
|
|
|
52
52
|
...(process.env.SANDBOX_BASE ? { sandboxBaseUrl: process.env.SANDBOX_BASE } : {}),
|
|
53
53
|
n: Number(process.env.N ?? 10),
|
|
54
54
|
...(process.env.IDS ? { ids: process.env.IDS.split(',') } : {}),
|
|
55
|
-
...(process.env.
|
|
55
|
+
...(process.env.SUBSET ? { subset: process.env.SUBSET } : {}),
|
|
56
56
|
...(process.env.REPS ? { reps: Number(process.env.REPS) } : {}),
|
|
57
57
|
...(process.env.LOOP_ATTEMPTS ? { loopAttempts: Number(process.env.LOOP_ATTEMPTS) } : {}),
|
|
58
58
|
concurrency: Number(process.env.CONCURRENCY ?? 4),
|