@tangle-network/agent-bench 1.0.2 → 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.
Files changed (222) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +24 -2
  3. package/dist/adapters.d.ts +3 -3
  4. package/dist/adapters.js +3 -5
  5. package/dist/adapters.js.map +1 -1
  6. package/dist/benchmarks/_harness.d.ts +4 -4
  7. package/dist/benchmarks/_harness.js +5 -2
  8. package/dist/benchmarks/_harness.js.map +1 -1
  9. package/dist/benchmarks/aec-bench.d.ts +2 -2
  10. package/dist/benchmarks/aec-bench.js +49 -42
  11. package/dist/benchmarks/aec-bench.js.map +1 -1
  12. package/dist/benchmarks/agentbench.d.ts +2 -2
  13. package/dist/benchmarks/agentbench.js +41 -34
  14. package/dist/benchmarks/agentbench.js.map +1 -1
  15. package/dist/benchmarks/appworld.d.ts +4 -4
  16. package/dist/benchmarks/appworld.js +67 -53
  17. package/dist/benchmarks/appworld.js.map +1 -1
  18. package/dist/benchmarks/bfcl.d.ts +2 -2
  19. package/dist/benchmarks/bfcl.js +52 -44
  20. package/dist/benchmarks/bfcl.js.map +1 -1
  21. package/dist/benchmarks/cad-design.d.ts +2 -2
  22. package/dist/benchmarks/cad-design.js +53 -44
  23. package/dist/benchmarks/cad-design.js.map +1 -1
  24. package/dist/benchmarks/cadbench.d.ts +2 -2
  25. package/dist/benchmarks/cadbench.js +1 -1
  26. package/dist/benchmarks/cadgenbench.d.ts +2 -2
  27. package/dist/benchmarks/cadgenbench.js +1 -1
  28. package/dist/benchmarks/commit0.d.ts +2 -2
  29. package/dist/benchmarks/commit0.js +38 -31
  30. package/dist/benchmarks/commit0.js.map +1 -1
  31. package/dist/benchmarks/crag.d.ts +2 -2
  32. package/dist/benchmarks/crag.js +37 -32
  33. package/dist/benchmarks/crag.js.map +1 -1
  34. package/dist/benchmarks/dabstep.d.ts +2 -2
  35. package/dist/benchmarks/dabstep.js +41 -34
  36. package/dist/benchmarks/dabstep.js.map +1 -1
  37. package/dist/benchmarks/finresearchbench.d.ts +4 -4
  38. package/dist/benchmarks/finresearchbench.js +63 -50
  39. package/dist/benchmarks/finresearchbench.js.map +1 -1
  40. package/dist/benchmarks/finsearchcomp.d.ts +3 -3
  41. package/dist/benchmarks/finsearchcomp.js +55 -44
  42. package/dist/benchmarks/finsearchcomp.js.map +1 -1
  43. package/dist/benchmarks/frames.d.ts +2 -2
  44. package/dist/benchmarks/frames.js +66 -51
  45. package/dist/benchmarks/frames.js.map +1 -1
  46. package/dist/benchmarks/hotpotqa.d.ts +2 -2
  47. package/dist/benchmarks/hotpotqa.js +59 -47
  48. package/dist/benchmarks/hotpotqa.js.map +1 -1
  49. package/dist/benchmarks/humaneval.d.ts +3 -3
  50. package/dist/benchmarks/humaneval.js +39 -35
  51. package/dist/benchmarks/humaneval.js.map +1 -1
  52. package/dist/benchmarks/mcad-bench.d.ts +2 -2
  53. package/dist/benchmarks/mcad-bench.js +68 -56
  54. package/dist/benchmarks/mcad-bench.js.map +1 -1
  55. package/dist/benchmarks/mcad-cq-bench.d.ts +3 -3
  56. package/dist/benchmarks/mcad-cq-bench.js +70 -58
  57. package/dist/benchmarks/mcad-cq-bench.js.map +1 -1
  58. package/dist/benchmarks/mcad-cq-golds.d.ts +1 -1
  59. package/dist/benchmarks/mcad-cq-golds.js +1 -1
  60. package/dist/benchmarks/mcad-cq-golds.js.map +1 -1
  61. package/dist/benchmarks/mcad-golds.d.ts +1 -1
  62. package/dist/benchmarks/mcad-golds.js.map +1 -1
  63. package/dist/benchmarks/mind2web.d.ts +3 -3
  64. package/dist/benchmarks/mind2web.js +62 -49
  65. package/dist/benchmarks/mind2web.js.map +1 -1
  66. package/dist/benchmarks/nomiracl.d.ts +2 -2
  67. package/dist/benchmarks/nomiracl.js +43 -36
  68. package/dist/benchmarks/nomiracl.js.map +1 -1
  69. package/dist/benchmarks/open-rag-bench.d.ts +2 -2
  70. package/dist/benchmarks/open-rag-bench.js +37 -32
  71. package/dist/benchmarks/open-rag-bench.js.map +1 -1
  72. package/dist/benchmarks/programbench.d.ts +2 -2
  73. package/dist/benchmarks/programbench.js +28 -23
  74. package/dist/benchmarks/programbench.js.map +1 -1
  75. package/dist/benchmarks/rag-shared.d.ts +2 -2
  76. package/dist/benchmarks/rag-shared.js +15 -13
  77. package/dist/benchmarks/rag-shared.js.map +1 -1
  78. package/dist/benchmarks/ragbench.d.ts +2 -2
  79. package/dist/benchmarks/ragbench.js +34 -29
  80. package/dist/benchmarks/ragbench.js.map +1 -1
  81. package/dist/benchmarks/simpleqa.d.ts +2 -2
  82. package/dist/benchmarks/simpleqa.js +63 -52
  83. package/dist/benchmarks/simpleqa.js.map +1 -1
  84. package/dist/benchmarks/swe-bench.d.ts +4 -4
  85. package/dist/benchmarks/swe-bench.js +47 -41
  86. package/dist/benchmarks/swe-bench.js.map +1 -1
  87. package/dist/benchmarks/t2-ragbench.d.ts +2 -2
  88. package/dist/benchmarks/t2-ragbench.js +37 -32
  89. package/dist/benchmarks/t2-ragbench.js.map +1 -1
  90. package/dist/benchmarks/tau-bench-shared.d.ts +2 -2
  91. package/dist/benchmarks/tau-bench-shared.js +43 -36
  92. package/dist/benchmarks/tau-bench-shared.js.map +1 -1
  93. package/dist/benchmarks/tau2-bench.d.ts +2 -2
  94. package/dist/benchmarks/tau2-bench.js.map +1 -1
  95. package/dist/benchmarks/tau3-banking.d.ts +2 -2
  96. package/dist/benchmarks/tau3-banking.js.map +1 -1
  97. package/dist/benchmarks/terminal-bench.d.ts +2 -2
  98. package/dist/benchmarks/terminal-bench.js +29 -23
  99. package/dist/benchmarks/terminal-bench.js.map +1 -1
  100. package/dist/benchmarks/toollm.d.ts +2 -2
  101. package/dist/benchmarks/toollm.js +40 -34
  102. package/dist/benchmarks/toollm.js.map +1 -1
  103. package/dist/benchmarks/trata-hedge.d.ts +2 -2
  104. package/dist/benchmarks/trata-hedge.js +49 -43
  105. package/dist/benchmarks/trata-hedge.js.map +1 -1
  106. package/dist/benchmarks/types.d.ts +33 -63
  107. package/dist/benchmarks/types.js +36 -1
  108. package/dist/benchmarks/types.js.map +1 -0
  109. package/dist/benchmarks/webarena-verified.d.ts +2 -2
  110. package/dist/benchmarks/webarena-verified.js +29 -24
  111. package/dist/benchmarks/webarena-verified.js.map +1 -1
  112. package/dist/{cadbench-DhAndllg.js → cadbench-htzAmMaI.js} +41 -36
  113. package/dist/cadbench-htzAmMaI.js.map +1 -0
  114. package/dist/{cadgenbench-Tvk16YKT.js → cadgenbench-BLvEtnxU.js} +28 -22
  115. package/dist/cadgenbench-BLvEtnxU.js.map +1 -0
  116. package/dist/cli.d.ts +1 -0
  117. package/dist/cli.js +667 -0
  118. package/dist/cli.js.map +1 -0
  119. package/dist/index.d.ts +11 -10
  120. package/dist/index.js +64 -59
  121. package/dist/index.js.map +1 -1
  122. package/package.json +9 -6
  123. package/scripts/enterpriseops-gym-run.sh +82 -0
  124. package/scripts/grade-recorded-evidence.mjs +50 -0
  125. package/scripts/harvey-lab-judge.py +50 -0
  126. package/scripts/harvey-lab-run.sh +53 -0
  127. package/scripts/harvey-lab-sandbox.sh +21 -0
  128. package/scripts/healthbench-professional-run.sh +30 -0
  129. package/scripts/healthbench_professional_run.py +112 -0
  130. package/scripts/mlcr-run.sh +17 -0
  131. package/scripts/mlcr_run.py +133 -0
  132. package/scripts/prbench-run.sh +39 -0
  133. package/scripts/prbench_run.py +53 -0
  134. package/scripts/verify-packed-consumer.mjs +32 -27
  135. package/src/adapters.ts +5 -7
  136. package/src/atom-mcp-e2e.mts +2 -2
  137. package/src/benchmarks/_harness.test.mts +18 -1
  138. package/src/benchmarks/_harness.ts +12 -7
  139. package/src/benchmarks/aec-bench.test.mts +14 -14
  140. package/src/benchmarks/aec-bench.ts +62 -56
  141. package/src/benchmarks/agent-eval-contract.test.mts +38 -0
  142. package/src/benchmarks/agentbench.ts +44 -37
  143. package/src/benchmarks/appworld.test.mts +7 -7
  144. package/src/benchmarks/appworld.ts +88 -75
  145. package/src/benchmarks/bfcl.ts +60 -53
  146. package/src/benchmarks/cad-design.ts +34 -32
  147. package/src/benchmarks/cadbench.ts +36 -36
  148. package/src/benchmarks/cadgenbench.ts +30 -28
  149. package/src/benchmarks/commit0.test.mts +9 -9
  150. package/src/benchmarks/commit0.ts +50 -43
  151. package/src/benchmarks/crag.ts +45 -40
  152. package/src/benchmarks/dabstep-official.test.mts +8 -8
  153. package/src/benchmarks/dabstep.test.mts +11 -11
  154. package/src/benchmarks/dabstep.ts +47 -40
  155. package/src/benchmarks/external-adapters.test.mts +43 -44
  156. package/src/benchmarks/finresearchbench.ts +58 -48
  157. package/src/benchmarks/finsearchcomp.ts +73 -68
  158. package/src/benchmarks/frames.ts +76 -69
  159. package/src/benchmarks/hotpotqa.ts +69 -64
  160. package/src/benchmarks/humaneval.ts +37 -35
  161. package/src/benchmarks/mcad-bench.test.mts +30 -30
  162. package/src/benchmarks/mcad-bench.ts +66 -60
  163. package/src/benchmarks/mcad-cq-bench.ts +69 -63
  164. package/src/benchmarks/mcad-cq-golds.ts +1 -1
  165. package/src/benchmarks/mcad-cq.test.mts +40 -40
  166. package/src/benchmarks/mcad-golds.ts +1 -1
  167. package/src/benchmarks/mind2web.ts +66 -58
  168. package/src/benchmarks/nomiracl.ts +53 -46
  169. package/src/benchmarks/open-rag-bench.ts +47 -42
  170. package/src/benchmarks/programbench.test.mts +10 -10
  171. package/src/benchmarks/programbench.ts +38 -33
  172. package/src/benchmarks/rag-benchmarks.test.mts +31 -31
  173. package/src/benchmarks/rag-shared.ts +13 -16
  174. package/src/benchmarks/ragbench.ts +44 -39
  175. package/src/benchmarks/simpleqa.ts +79 -74
  176. package/src/benchmarks/swe-bench.test.mts +3 -3
  177. package/src/benchmarks/swe-bench.ts +66 -61
  178. package/src/benchmarks/t2-ragbench.ts +47 -42
  179. package/src/benchmarks/tau-bench-shared.ts +51 -44
  180. package/src/benchmarks/tau-pin.test.mts +1 -1
  181. package/src/benchmarks/tau2-bench.ts +2 -2
  182. package/src/benchmarks/tau3-banking.ts +2 -2
  183. package/src/benchmarks/terminal-bench.test.mts +3 -3
  184. package/src/benchmarks/terminal-bench.ts +41 -36
  185. package/src/benchmarks/toollm.ts +54 -47
  186. package/src/benchmarks/trata-hedge.ts +61 -58
  187. package/src/benchmarks/types.ts +70 -59
  188. package/src/benchmarks/webarena-verified.ts +49 -42
  189. package/src/cli.ts +74 -0
  190. package/src/corpus-replay.mts +9 -9
  191. package/src/examples/benchmark-matrix.mts +19 -16
  192. package/src/examples/lean-proof-gate.mts +1 -1
  193. package/src/examples/math-demo.mts +2 -2
  194. package/src/examples/strategy-demo.mts +1 -1
  195. package/src/gate-cli.mts +6 -6
  196. package/src/gate.test.mts +14 -12
  197. package/src/gate.ts +23 -22
  198. package/src/generate-eval/certify.ts +4 -4
  199. package/src/index.ts +17 -11
  200. package/src/published.test.mts +534 -0
  201. package/src/published.ts +524 -0
  202. package/src/run-benchmarks-cli.mts +3 -3
  203. package/src/run-benchmarks.test.mts +58 -48
  204. package/src/run-benchmarks.ts +64 -57
  205. package/src/swe-bench-env.ts +6 -6
  206. package/src/swe-self-improve.mts +3 -3
  207. package/src/terminal-compare.ts +1 -1
  208. package/src/worker.ts +1 -1
  209. package/dist/benchmarks/enterpriseops-gym.d.ts +0 -6
  210. package/dist/benchmarks/enterpriseops-gym.js +0 -236
  211. package/dist/benchmarks/enterpriseops-gym.js.map +0 -1
  212. package/dist/cadbench-DhAndllg.js.map +0 -1
  213. package/dist/cadgenbench-Tvk16YKT.js.map +0 -1
  214. package/fixtures/enterpriseops-gym.json +0 -103
  215. package/scripts/enterpriseops_gym_judge.py +0 -281
  216. package/src/benchmarks/enterpriseops-gym.test.mts +0 -77
  217. package/src/benchmarks/enterpriseops-gym.ts +0 -343
  218. package/src/eops-skills/address-every-subtask.md +0 -5
  219. package/src/eops-skills/exact-tools-and-args.md +0 -5
  220. package/src/eops-skills/full-sequence-to-goal.md +0 -5
  221. package/src/eops-skills/ground-every-value.md +0 -5
  222. package/src/eops-skills/honor-the-policies.md +0 -5
@@ -13,14 +13,14 @@
13
13
  * # live: real benchmarks graded by their real graders
14
14
  * TANGLE_API_KEY=... BENCHMARKS=humaneval tsx src/examples/benchmark-matrix.mts
15
15
  */
16
- import type { BenchmarkAdapter, BenchScore, BenchTask } from '../benchmarks/types'
16
+ import { type BenchEvaluation, type BenchTask, type RuntimeBenchmark, runtimeBenchmark } from '../benchmarks/types'
17
17
  import { type BenchCell, type BenchShot, printBenchmarksReport, runBenchmarks } from '../run-benchmarks'
18
18
 
19
19
  /** The matrix: three cells spanning harnesses, models, and transports. */
20
20
  const cells: BenchCell[] = [
21
- { label: 'opencode/glm-4.6', harness: 'opencode', model: 'glm-4.6', backend: 'sandbox' },
22
- { label: 'codex/gpt-5', harness: 'codex', model: 'gpt-5', backend: 'sandbox' },
23
- { label: 'router/deepseek-v4-flash', model: 'deepseek-v4-flash', backend: 'router' },
21
+ { label: 'opencode/glm-5.3', harness: 'opencode', model: 'glm-5.3', backend: 'sandbox' },
22
+ { label: 'codex/gpt-6.1-sol', harness: 'codex', model: 'gpt-6.1-sol', backend: 'sandbox' },
23
+ { label: 'router/deepseek-v4.1-flash', model: 'deepseek/deepseek-v4.1-flash', backend: 'router' },
24
24
  ]
25
25
 
26
26
  async function live(): Promise<void> {
@@ -46,31 +46,34 @@ async function live(): Promise<void> {
46
46
  /** Offline proof: a stub registry whose judge is deterministic, and a stub shot whose "ability"
47
47
  * differs per cell — so the leaderboard ORDER reflects the cells, with no model or sandbox. */
48
48
  async function demo(): Promise<void> {
49
- const stub = (name: string, n: number): BenchmarkAdapter => ({
50
- name,
51
- preflight: async () => {},
52
- loadTasks: async (o) =>
49
+ const stub = (name: string, n: number): RuntimeBenchmark => runtimeBenchmark({
50
+ id: name,
51
+ loadAll: async (o) =>
53
52
  Array.from({ length: o?.limit ?? n }, (_, i) => ({
54
53
  id: `${name}-${i}`,
55
- prompt: `task ${i}`,
54
+ payload: { prompt: `task ${i}` },
56
55
  metadata: { gold: `G-${name}-${i}` },
57
56
  })),
58
- judge: async (t: BenchTask, a: string): Promise<BenchScore> => ({
59
- resolved: a === t.metadata?.gold,
57
+ evaluate: async (t: BenchTask, a: string): Promise<BenchEvaluation> => ({
58
+ passed: a === t.metadata?.gold,
60
59
  score: a === t.metadata?.gold ? 1 : 0,
60
+ raw: {},
61
61
  }),
62
- goldArtifact: async (t: BenchTask) => String(t.metadata?.gold),
62
+ runtime: {
63
+ preflight: async () => {},
64
+ goldArtifact: async (t: BenchTask) => String(t.metadata?.gold),
65
+ },
63
66
  })
64
- const registry: Record<string, BenchmarkAdapter> = {
67
+ const registry: Record<string, RuntimeBenchmark> = {
65
68
  'demo-coding': stub('demo-coding', 8),
66
69
  'demo-research': stub('demo-research', 8),
67
70
  }
68
71
 
69
72
  // Cell ability: opencode/glm solves the most, router the least — deterministic by task index.
70
73
  const ability: Record<string, number> = {
71
- 'opencode/glm-4.6': 0.88,
72
- 'codex/gpt-5': 0.62,
73
- 'router/deepseek-v4-flash': 0.38,
74
+ 'opencode/glm-5.3': 0.88,
75
+ 'codex/gpt-6.1-sol': 0.62,
76
+ 'router/deepseek-v4.1-flash': 0.38,
74
77
  }
75
78
  const shot: BenchShot = async ({ task, cell }) => {
76
79
  const idx = Number(task.id.split('-').pop())
@@ -148,7 +148,7 @@ async function main(): Promise<void> {
148
148
  routerKey,
149
149
  workerProfile: benchRouterProfile(
150
150
  'lean-proof-worker',
151
- process.env.WORKER_MODEL ?? 'deepseek-v4-flash',
151
+ process.env.WORKER_MODEL ?? 'deepseek/deepseek-v4.1-flash',
152
152
  {
153
153
  systemPrompt: 'Construct and verify Lean proofs with the available checker before answering.',
154
154
  maxTurns: 8,
@@ -8,7 +8,7 @@
8
8
  * sampleThenRefine (both). Swap the `check` and this same file grades a tax return value,
9
9
  * a rubric score, anything answer-shaped.
10
10
  *
11
- * Run from bench/ (needs a router key; default model deepseek-v4-flash):
11
+ * Run from bench/ (needs a router key; default model deepseek/deepseek-v4.1-flash):
12
12
  * TANGLE_API_KEY=... WORKER_MODEL=gpt-4o-mini BUDGET=3 tsx src/examples/math-demo.mts
13
13
  */
14
14
  import {
@@ -98,7 +98,7 @@ async function main(): Promise<void> {
98
98
  routerKey,
99
99
  workerProfile: benchRouterProfile(
100
100
  'math-worker',
101
- process.env.WORKER_MODEL ?? 'deepseek-v4-flash',
101
+ process.env.WORKER_MODEL ?? 'deepseek/deepseek-v4.1-flash',
102
102
  {
103
103
  systemPrompt: 'Solve the requested math task with the available tools and verify the result.',
104
104
  maxTurns: 6,
@@ -99,7 +99,7 @@ async function main(): Promise<void> {
99
99
  routerKey: process.env.TANGLE_API_KEY ?? '',
100
100
  workerProfile: benchRouterProfile(
101
101
  'strategy-demo-worker',
102
- process.env.WORKER_MODEL ?? 'deepseek-v4-flash',
102
+ process.env.WORKER_MODEL ?? 'deepseek/deepseek-v4.1-flash',
103
103
  {
104
104
  systemPrompt: 'Use the available tools to complete and verify the task.',
105
105
  maxTurns: 6,
package/src/gate-cli.mts CHANGED
@@ -2,12 +2,12 @@
2
2
  * Run the diverse-vs-blind gate THROUGH the recursive atom, end to end, in two lines:
3
3
  *
4
4
  * export TANGLE_API_KEY=... # router + the deployable judge's creds
5
- * BENCH=enterpriseops-gym EOPS_FIXTURES=1 N=20 K=4 tsx src/gate-cli.mts
5
+ * BENCH=swe-bench N=20 K=4 tsx src/gate-cli.mts
6
6
  *
7
7
  * The arms are equal-k by construction (both open K children; blind = K identical copies,
8
8
  * diverse = K distinct strategy directives). The deployable selector is the benchmark's OWN
9
- * judge — pick a benchmark whose `adapter.judge` is a runnable checker (enterpriseops-gym,
10
- * swe-bench, terminal-bench), NOT an LLM-judge bench (finsearchcomp), or the selector is not
9
+ * judge — pick a benchmark whose `adapter.evaluate` is a runnable checker (swe-bench,
10
+ * terminal-bench), NOT an LLM-judge bench (finsearchcomp), or the selector is not
11
11
  * deployable and the result does not answer the gate.
12
12
  *
13
13
  * Output is a verdict-first report: the headline delta, the per-arm resolve table, the equal-k
@@ -35,9 +35,9 @@ const defaultStrategies: ReadonlyArray<string> = [
35
35
  ]
36
36
 
37
37
  async function main(): Promise<void> {
38
- const benchKey = process.env.BENCH ?? 'enterpriseops-gym'
38
+ const benchKey = must('BENCH')
39
39
  const adapter = resolveAdapter(benchKey)
40
- const model = process.env.WORKER_MODEL ?? 'deepseek-v4-flash'
40
+ const model = process.env.WORKER_MODEL ?? 'deepseek/deepseek-v4.1-flash'
41
41
  const routerBaseUrl = process.env.ROUTER_BASE ?? 'https://router.tangle.tools/v1'
42
42
  const routerKey = must('TANGLE_API_KEY')
43
43
  const k = Number(process.env.K ?? defaultStrategies.length)
@@ -65,7 +65,7 @@ async function main(): Promise<void> {
65
65
  routerKey,
66
66
  n: Number(process.env.N ?? 20),
67
67
  ...(process.env.IDS ? { ids: process.env.IDS.split(',') } : {}),
68
- ...(process.env.SPLIT ? { split: process.env.SPLIT } : {}),
68
+ ...(process.env.SUBSET ? { subset: process.env.SUBSET } : {}),
69
69
  ...(process.env.PER_CHILD_TOKENS ? { perChildTokens: Number(process.env.PER_CHILD_TOKENS) } : {}),
70
70
  })
71
71
 
package/src/gate.test.mts CHANGED
@@ -4,7 +4,7 @@
4
4
  * drives the `Supervisor`, the per-child deployable verdict drives selection, the paired metric is
5
5
  * derived from the run's own trajectory, and the conserved pool yields equal-k across arms.
6
6
  *
7
- * The LIVE solve-and-grade path (`benchSolverRegistry` → router + `adapter.judge`) is exercised
7
+ * The LIVE solve-and-grade path (`benchSolverRegistry` → router + `adapter.evaluate`) is exercised
8
8
  * by a real gate run against a deployable-checker domain, not here.
9
9
  *
10
10
  * tsx bench/src/gate.test.mts
@@ -21,7 +21,7 @@ import type {
21
21
  ExecutorFactory,
22
22
  ExecutorResult,
23
23
  } from '@tangle-network/agent-runtime/kernel'
24
- import type { BenchmarkAdapter, BenchScore, BenchTask } from './benchmarks/types'
24
+ import { type BenchEvaluation, type BenchTask, type RuntimeBenchmark, runtimeBenchmark } from './benchmarks/types'
25
25
  import { runGate, type SolveTask } from './gate'
26
26
 
27
27
  /** A child whose verdict is decided purely by whether its prompt carries the STRONG marker — so a
@@ -62,23 +62,25 @@ const stubRegistry: ExecutorRegistry = {
62
62
  },
63
63
  }
64
64
 
65
- function stubAdapter(n: number): BenchmarkAdapter {
65
+ function stubAdapter(n: number): RuntimeBenchmark {
66
66
  const tasks: BenchTask[] = Array.from({ length: n }, (_v, i) => ({
67
67
  id: `t${i}`,
68
- prompt: `solve instance ${i}`,
68
+ payload: { prompt: `solve instance ${i}` },
69
69
  }))
70
- return {
71
- name: 'stub-bench',
72
- preflight: () => Promise.resolve(),
73
- loadTasks: (opts) =>
70
+ return runtimeBenchmark({
71
+ id: 'stub-bench',
72
+ loadAll: (opts) =>
74
73
  Promise.resolve(opts?.limit !== undefined ? tasks.slice(0, opts.limit) : tasks),
75
- // judge is NOT exercised on the injected-registry path (the stub leaf sets verdicts directly);
74
+ // evaluate is NOT exercised on the injected-registry path (the stub leaf sets verdicts directly);
76
75
  // a real run reaches the adapter judge through benchSolverRegistry.
77
- judge: (): Promise<BenchScore> => {
76
+ evaluate: (): Promise<BenchEvaluation> => {
78
77
  throw new Error('stub judge must not be called on the injected-registry path')
79
78
  },
80
- goldArtifact: () => Promise.resolve(undefined),
81
- }
79
+ runtime: {
80
+ preflight: () => Promise.resolve(),
81
+ goldArtifact: () => Promise.resolve(undefined),
82
+ },
83
+ })
82
84
  }
83
85
 
84
86
  const profile = {
package/src/gate.ts CHANGED
@@ -12,8 +12,8 @@
12
12
  *
13
13
  * The gate's two non-negotiables, enforced structurally here:
14
14
  * - DEPLOYABLE selector. Each fanout child SOLVES via the router, then is graded by the
15
- * benchmark's OWN deterministic `adapter.judge` (a runnable checker — NOT an LLM judge, NOT
16
- * the answer oracle). That `BenchScore` becomes the child's `DefaultVerdict`, and `fanout`'s
15
+ * benchmark's OWN deterministic `adapter.evaluate` (a runnable checker — NOT an LLM judge, NOT
16
+ * the answer oracle). That `BenchEvaluation` becomes the child's `DefaultVerdict`, and `fanout`'s
17
17
  * single-sourced `defaultSelectWinner` picks the best-scoring candidate. Selection therefore
18
18
  * reads only the deployable verifier — selector ≠ oracle by construction.
19
19
  * - EQUAL k. Both arms open the SAME number of children (k = strategies.length; blind = k
@@ -55,10 +55,10 @@ import {
55
55
  runPersonified,
56
56
  trajectoryReport,
57
57
  } from '@tangle-network/agent-runtime/kernel'
58
- import type { BenchmarkAdapter, BenchTask } from './benchmarks/types'
58
+ import type { BenchTask, RuntimeBenchmark } from './benchmarks/types'
59
59
 
60
60
  /** A fanout child's task: the prompt to solve with + the instance to grade against. The instance
61
- * travels with the prompt so the solve-and-grade leaf can run `adapter.judge` without a closure
61
+ * travels with the prompt so the solve-and-grade leaf can run `adapter.evaluate` without a closure
62
62
  * over the per-task state (the registry closes only over the adapter + router config). */
63
63
  export interface SolveTask {
64
64
  readonly prompt: string
@@ -68,7 +68,7 @@ export interface SolveTask {
68
68
  /** What `benchSolverRegistry` needs to build a solve-and-grade leaf. The router config is the
69
69
  * cheapest leaf (one chat completion, no box); the adapter supplies the deployable judge. */
70
70
  interface BenchSolverOptions {
71
- readonly adapter: BenchmarkAdapter
71
+ readonly adapter: RuntimeBenchmark
72
72
  readonly routerBaseUrl: string
73
73
  readonly routerKey: string
74
74
  }
@@ -93,16 +93,16 @@ const fnv = (prefix: string, value: unknown): string => {
93
93
  * (e.g. the last fenced ```json block for a transcript bench), so the gate leaf honors
94
94
  * `benchmark = adapter owns its deliverable`. Falls back to the trimmed reply when the adapter
95
95
  * defines no output parser (the research/QA case). */
96
- function extractArtifact(adapter: BenchmarkAdapter, content: string): string {
97
- if (!adapter.output) return content.trim()
96
+ function extractArtifact(adapter: RuntimeBenchmark, content: string): string {
97
+ if (!adapter.runtime.output) return content.trim()
98
98
  const events = [{ type: 'agent', data: { finalText: content } }] as unknown as SandboxEvent[]
99
- return adapter.output.parse(events)
99
+ return adapter.runtime.output.parse(events)
100
100
  }
101
101
 
102
102
  /**
103
103
  * A single solve-and-grade leaf executor. Solves the task with ONE router completion, extracts
104
104
  * the deliverable via the adapter, then grades it with the benchmark's deterministic judge and
105
- * surfaces that `BenchScore` as the child's `DefaultVerdict`. The verdict is what `fanout`'s
105
+ * surfaces that `BenchEvaluation` as the child's `DefaultVerdict`. The verdict is what `fanout`'s
106
106
  * deployable selector ranks on. Reports REAL token usage; a missing-usage provider records zero
107
107
  * tokens but still one iteration (never a fabricated priced cost). Fail-loud: a router non-2xx or
108
108
  * a judge throw rejects the leaf (the scope types it into a `down` settlement — never a silent 0).
@@ -118,14 +118,14 @@ function benchSolveLeaf(opts: BenchSolverOptions, spec: AgentSpec, ctx: Executor
118
118
  const raw = result.out as { content?: unknown }
119
119
  const content = typeof raw?.content === 'string' ? raw.content : ''
120
120
  const candidate = extractArtifact(opts.adapter, content)
121
- const score = await opts.adapter.judge(t.instance, candidate)
121
+ const score = await opts.adapter.evaluate(t.instance, candidate)
122
122
  return {
123
123
  outRef: fnv('bench', { id: t.instance.id, candidate }),
124
124
  out: candidate,
125
125
  verdict: {
126
- valid: score.resolved,
126
+ valid: score.passed === true,
127
127
  score: score.score,
128
- ...(score.detail ? { notes: score.detail } : {}),
128
+ ...(score.notes ? { notes: score.notes } : {}),
129
129
  },
130
130
  }
131
131
  })
@@ -173,10 +173,10 @@ function defineSolverPersona(
173
173
  /** The blind/diverse `fanout` over k children. Each item is a strategy directive appended to the
174
174
  * task prompt; the blind arm passes k empty strategies (k identical prompts = the compute
175
175
  * control). No `synthesize` → the deployable `defaultSelectWinner` returns the best-graded child. */
176
- function solveFanout(strategies: ReadonlyArray<string>, instance: BenchTask): CombinatorShape<unknown, string> {
176
+ function solveFanout(strategies: ReadonlyArray<string>, instance: BenchTask, prompt: string): CombinatorShape<unknown, string> {
177
177
  return fanout<unknown, string, string>(strategies, {
178
178
  itemTask: (strategy): SolveTask => ({
179
- prompt: strategy.length > 0 ? `${instance.prompt}\n\n${strategy}` : instance.prompt,
179
+ prompt: strategy.length > 0 ? `${prompt}\n\n${strategy}` : prompt,
180
180
  instance,
181
181
  }),
182
182
  label: (_s, i) => `solve:${i}`,
@@ -184,7 +184,7 @@ function solveFanout(strategies: ReadonlyArray<string>, instance: BenchTask): Co
184
184
  }
185
185
 
186
186
  interface RunGateOptions {
187
- readonly adapter: BenchmarkAdapter
187
+ readonly adapter: RuntimeBenchmark
188
188
  /** The ONE specificity: who the solver is (prompt / model / tools). */
189
189
  readonly profile: AgentProfile
190
190
  /**
@@ -198,7 +198,8 @@ interface RunGateOptions {
198
198
  /** How many benchmark instances to run (the paired n). */
199
199
  readonly n?: number
200
200
  readonly ids?: string[]
201
- readonly split?: string
201
+ /** The publisher's subset (domain, category, language), for benchmarks that have them. */
202
+ readonly subset?: string
202
203
  /** Per-child token ceiling the conserved pool reserves. Default 60_000. */
203
204
  readonly perChildTokens?: number
204
205
  /** Per-child wall-clock deadline (ms) forwarded to the root budget. */
@@ -288,13 +289,13 @@ export async function runGate(opts: RunGateOptions): Promise<GateReport> {
288
289
  throw new Error('runGate: need >= 2 strategies (k = strategies.length fixes both arms’ child count)')
289
290
  }
290
291
  const k = opts.strategies.length
291
- await opts.adapter.preflight()
292
- const tasks = await opts.adapter.loadTasks({
292
+ await opts.adapter.runtime.preflight?.()
293
+ const tasks = await opts.adapter.loadAll({
293
294
  ...(opts.n !== undefined ? { limit: opts.n } : {}),
294
295
  ...(opts.ids ? { ids: opts.ids } : {}),
295
- ...(opts.split ? { split: opts.split } : {}),
296
+ ...(opts.subset ? { subset: opts.subset } : {}),
296
297
  })
297
- if (tasks.length === 0) throw new Error('runGate: adapter.loadTasks returned no tasks')
298
+ if (tasks.length === 0) throw new Error('runGate: adapter.loadAll returned no tasks')
298
299
 
299
300
  const registry = opts.solverRegistry ?? benchSolverRegistry(opts)
300
301
  const perChildTokens = opts.perChildTokens ?? 60_000
@@ -330,7 +331,7 @@ export async function runGate(opts: RunGateOptions): Promise<GateReport> {
330
331
  const runId = `gate:${armDef.label}:${task.id}`
331
332
  const result: SupervisedResult<Outcome<string>> = await runPersonified<unknown, string>({
332
333
  persona,
333
- shape: solveFanout(armDef.strategies, task),
334
+ shape: solveFanout(armDef.strategies, task, opts.adapter.runtime.prompt(task)),
334
335
  task: undefined,
335
336
  budget,
336
337
  shapeBudget: { fanout: k, perChild },
@@ -395,7 +396,7 @@ export async function runGate(opts: RunGateOptions): Promise<GateReport> {
395
396
  const blind = arms.find((a) => a.label === 'blind')!
396
397
  const diverse = arms.find((a) => a.label === 'diverse')!
397
398
  return {
398
- benchmark: opts.adapter.name,
399
+ benchmark: opts.adapter.id,
399
400
  k,
400
401
  n: tasks.length,
401
402
  perTask,
@@ -18,7 +18,7 @@
18
18
  * exit 0 admitted · 1 rejected · 2 malformed/infra
19
19
  * Env: EVAL_GATE_BASE_URL (default https://router.tangle.tools/v1)
20
20
  * EVAL_GATE_API_KEY (default $TANGLE_API_KEY)
21
- * EVAL_GATE_MODEL (default gpt-4.1)
21
+ * EVAL_GATE_MODEL (default deepseek/deepseek-v4.1-flash)
22
22
  */
23
23
  import { execSync } from 'node:child_process'
24
24
  import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
@@ -119,14 +119,14 @@ export async function discriminationGate(
119
119
  ): Promise<{ passed: boolean; detail: string }> {
120
120
  const baseUrl = opts.gateBaseUrl ?? process.env.EVAL_GATE_BASE_URL ?? 'https://router.tangle.tools/v1'
121
121
  const apiKey = opts.gateApiKey ?? process.env.EVAL_GATE_API_KEY ?? process.env.TANGLE_API_KEY
122
- const model = opts.gateModel ?? process.env.EVAL_GATE_MODEL ?? 'deepseek-v4-flash'
122
+ const model = opts.gateModel ?? process.env.EVAL_GATE_MODEL ?? 'deepseek/deepseek-v4.1-flash'
123
123
  if (!apiKey) throw new Error('discrimination gate needs EVAL_GATE_API_KEY (or TANGLE_API_KEY)')
124
124
  const res = await runBenchRouterTurn(
125
125
  {
126
126
  routerBaseUrl: baseUrl,
127
127
  routerKey: apiKey,
128
128
  profile: {
129
- name: 'generated-eval-parametric-check',
129
+ name: 'generated-eval-parametric-check', harness: 'cli-base',
130
130
  model: { provider: 'tangle-router', default: model },
131
131
  },
132
132
  },
@@ -150,7 +150,7 @@ export async function certifyEval(candidate: GeneratedEval, opts: CertifyOpts =
150
150
  schemaVersion: generatedEvalSchemaVersion,
151
151
  groundingPassed: true,
152
152
  parametricFailed: true,
153
- parametricModel: opts.gateModel ?? process.env.EVAL_GATE_MODEL ?? 'deepseek-v4-flash',
153
+ parametricModel: opts.gateModel ?? process.env.EVAL_GATE_MODEL ?? 'deepseek/deepseek-v4.1-flash',
154
154
  resolvedTarget: declaredTarget(candidate.setup),
155
155
  certifiedAt: new Date().toISOString(),
156
156
  certifier: certifierId,
package/src/index.ts CHANGED
@@ -5,10 +5,12 @@
5
5
  * and scores its agent's artifact against a real, deterministic judge — without owning the benchmark:
6
6
  *
7
7
  * import { resolveAdapter } from '@tangle-network/agent-bench'
8
- * const verdict = await resolveAdapter('commit0').judge(task, myAgentsDiff)
8
+ * const verdict = await resolveAdapter('commit0').evaluate(task, myAgentsDiff)
9
9
  *
10
- * Each adapter fails loud in `preflight()` when its harness/deps (Docker, a venv, a dataset) are
11
- * absent, so importing the registry is cheap; running a specific benchmark pulls only its deps.
10
+ * Every adapter is an agent-eval `BenchmarkAdapter` (`RuntimeBenchmark`: its `runtime` hooks, and
11
+ * `loadAll`, which ignores agent-eval's splits). Each fails loud in `runtime.preflight()` when its
12
+ * harness/deps (Docker, a venv, a dataset) are absent, so importing the registry is cheap; running a
13
+ * specific benchmark pulls only its deps.
12
14
  */
13
15
  export { ADAPTERS, resolveAdapter } from './adapters'
14
16
  export { createCragAdapter } from './benchmarks/crag'
@@ -17,7 +19,7 @@ export { createOpenRagBenchAdapter } from './benchmarks/open-rag-bench'
17
19
  export { createRagBenchAdapter } from './benchmarks/ragbench'
18
20
  export {
19
21
  FINAL_ANSWER_SENTINEL,
20
- answerScoreToBenchScore,
22
+ answerScoreToEvaluation,
21
23
  contextBlock,
22
24
  contextsFrom,
23
25
  normalizeAnswer,
@@ -46,13 +48,17 @@ export {
46
48
  type StagedRunCaptureSpec,
47
49
  type StagedRunSpec,
48
50
  } from './benchmarks/_harness'
49
- export type {
50
- BenchmarkAdapter,
51
- BenchScore,
52
- BenchTask,
53
- JudgeArtifactFileReceipt,
54
- JudgeArtifactReceipt,
55
- LoadOptions,
51
+ export {
52
+ runtimeBenchmark,
53
+ type BenchEvaluation,
54
+ type BenchPayload,
55
+ type BenchRuntime,
56
+ type BenchTask,
57
+ type JudgeArtifactFileReceipt,
58
+ type JudgeArtifactReceipt,
59
+ type LoadOptions,
60
+ type RuntimeBenchmark,
61
+ type RuntimeBenchmarkSpec,
56
62
  } from './benchmarks/types'
57
63
 
58
64
  /**