@tangle-network/agent-bench 0.14.4 → 1.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 (187) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +2 -3
  3. package/dist/adapters.d.ts +2 -5
  4. package/dist/adapters.js +3 -4
  5. package/dist/benchmarks/_harness.d.ts +17 -20
  6. package/dist/benchmarks/_harness.js +4 -4
  7. package/dist/benchmarks/_harness.js.map +1 -1
  8. package/dist/benchmarks/aec-bench.d.ts +1 -4
  9. package/dist/benchmarks/aec-bench.js +1 -2
  10. package/dist/benchmarks/agentbench.d.ts +2 -5
  11. package/dist/benchmarks/agentbench.js +1 -2
  12. package/dist/benchmarks/appworld.d.ts +8 -10
  13. package/dist/benchmarks/appworld.js +23 -23
  14. package/dist/benchmarks/appworld.js.map +1 -1
  15. package/dist/benchmarks/bfcl.d.ts +2 -5
  16. package/dist/benchmarks/bfcl.js +1 -2
  17. package/dist/benchmarks/cad-design.d.ts +2 -5
  18. package/dist/benchmarks/cad-design.js +2 -3
  19. package/dist/benchmarks/cad-design.js.map +1 -1
  20. package/dist/benchmarks/cadbench.d.ts +1 -4
  21. package/dist/benchmarks/cadbench.js +1 -2
  22. package/dist/benchmarks/cadgenbench.d.ts +1 -4
  23. package/dist/benchmarks/cadgenbench.js +1 -2
  24. package/dist/benchmarks/commit0.d.ts +2 -5
  25. package/dist/benchmarks/commit0.js +1 -2
  26. package/dist/benchmarks/crag.d.ts +1 -4
  27. package/dist/benchmarks/crag.js +3 -3
  28. package/dist/benchmarks/crag.js.map +1 -1
  29. package/dist/benchmarks/dabstep.d.ts +2 -5
  30. package/dist/benchmarks/dabstep.js +2 -3
  31. package/dist/benchmarks/dabstep.js.map +1 -1
  32. package/dist/benchmarks/enterpriseops-gym.d.ts +2 -5
  33. package/dist/benchmarks/enterpriseops-gym.js +1 -2
  34. package/dist/benchmarks/finresearchbench.d.ts +2 -5
  35. package/dist/benchmarks/finresearchbench.js +2 -3
  36. package/dist/benchmarks/finsearchcomp.d.ts +2 -5
  37. package/dist/benchmarks/finsearchcomp.js +4 -4
  38. package/dist/benchmarks/finsearchcomp.js.map +1 -1
  39. package/dist/benchmarks/frames.d.ts +3 -19
  40. package/dist/benchmarks/frames.js +13 -39
  41. package/dist/benchmarks/frames.js.map +1 -1
  42. package/dist/benchmarks/hotpotqa.d.ts +4 -14
  43. package/dist/benchmarks/hotpotqa.js +12 -32
  44. package/dist/benchmarks/hotpotqa.js.map +1 -1
  45. package/dist/benchmarks/humaneval.d.ts +9 -12
  46. package/dist/benchmarks/humaneval.js +2 -3
  47. package/dist/benchmarks/humaneval.js.map +1 -1
  48. package/dist/benchmarks/mcad-bench.d.ts +13 -16
  49. package/dist/benchmarks/mcad-bench.js +2 -3
  50. package/dist/benchmarks/mcad-bench.js.map +1 -1
  51. package/dist/benchmarks/mcad-cq-bench.d.ts +17 -20
  52. package/dist/benchmarks/mcad-cq-bench.js +2 -3
  53. package/dist/benchmarks/mcad-cq-bench.js.map +1 -1
  54. package/dist/benchmarks/mcad-cq-golds.d.ts +2 -5
  55. package/dist/benchmarks/mcad-cq-golds.js +1 -2
  56. package/dist/benchmarks/mcad-golds.d.ts +1 -4
  57. package/dist/benchmarks/mcad-golds.js +0 -1
  58. package/dist/benchmarks/mcad-tasks.d.ts +5 -8
  59. package/dist/benchmarks/mcad-tasks.js +7 -8
  60. package/dist/benchmarks/mcad-tasks.js.map +1 -1
  61. package/dist/benchmarks/mind2web.d.ts +3 -5
  62. package/dist/benchmarks/mind2web.js +2 -3
  63. package/dist/benchmarks/mind2web.js.map +1 -1
  64. package/dist/benchmarks/nomiracl.d.ts +1 -4
  65. package/dist/benchmarks/nomiracl.js +1 -2
  66. package/dist/benchmarks/open-rag-bench.d.ts +1 -4
  67. package/dist/benchmarks/open-rag-bench.js +3 -3
  68. package/dist/benchmarks/open-rag-bench.js.map +1 -1
  69. package/dist/benchmarks/programbench.d.ts +2 -5
  70. package/dist/benchmarks/programbench.js +1 -2
  71. package/dist/benchmarks/rag-shared.d.ts +30 -22
  72. package/dist/benchmarks/rag-shared.js +8 -2
  73. package/dist/benchmarks/rag-shared.js.map +1 -1
  74. package/dist/benchmarks/ragbench.d.ts +1 -4
  75. package/dist/benchmarks/ragbench.js +3 -3
  76. package/dist/benchmarks/ragbench.js.map +1 -1
  77. package/dist/benchmarks/simpleqa.d.ts +2 -18
  78. package/dist/benchmarks/simpleqa.js +5 -31
  79. package/dist/benchmarks/simpleqa.js.map +1 -1
  80. package/dist/benchmarks/swe-bench.d.ts +7 -10
  81. package/dist/benchmarks/swe-bench.js +4 -4
  82. package/dist/benchmarks/swe-bench.js.map +1 -1
  83. package/dist/benchmarks/t2-ragbench.d.ts +1 -4
  84. package/dist/benchmarks/t2-ragbench.js +3 -3
  85. package/dist/benchmarks/t2-ragbench.js.map +1 -1
  86. package/dist/benchmarks/tau-bench-shared.d.ts +5 -8
  87. package/dist/benchmarks/tau-bench-shared.js +4 -4
  88. package/dist/benchmarks/tau-bench-shared.js.map +1 -1
  89. package/dist/benchmarks/tau2-bench.d.ts +2 -5
  90. package/dist/benchmarks/tau2-bench.js +1 -2
  91. package/dist/benchmarks/tau3-banking.d.ts +1 -4
  92. package/dist/benchmarks/tau3-banking.js +1 -2
  93. package/dist/benchmarks/terminal-bench.d.ts +1 -4
  94. package/dist/benchmarks/terminal-bench.js +4 -4
  95. package/dist/benchmarks/terminal-bench.js.map +1 -1
  96. package/dist/benchmarks/toollm.d.ts +2 -5
  97. package/dist/benchmarks/toollm.js +1 -2
  98. package/dist/benchmarks/trata-hedge.d.ts +1 -4
  99. package/dist/benchmarks/trata-hedge.js +2 -3
  100. package/dist/benchmarks/types.d.ts +6 -9
  101. package/dist/benchmarks/webarena-verified.d.ts +2 -5
  102. package/dist/benchmarks/webarena-verified.js +1 -2
  103. package/dist/{cadbench-BRF-59Mt.js → cadbench-DhAndllg.js} +4 -6
  104. package/dist/cadbench-DhAndllg.js.map +1 -0
  105. package/dist/{cadgenbench-DXtGkuW3.js → cadgenbench-Tvk16YKT.js} +15 -5
  106. package/dist/cadgenbench-Tvk16YKT.js.map +1 -0
  107. package/dist/index.d.ts +8 -18
  108. package/dist/index.js +16 -24
  109. package/dist/index.js.map +1 -1
  110. package/dist/{router-turn-uTYO6KQ1.js → router-turn-DNbQ_GjQ.js} +2 -3
  111. package/dist/router-turn-DNbQ_GjQ.js.map +1 -0
  112. package/fixtures/pier-agent/no-model-task/pre_artifacts.sh +0 -0
  113. package/fixtures/pier-agent/no-model-task/tests/test.sh +0 -0
  114. package/package.json +10 -10
  115. package/pier_agents/tangle_candidate.py +15 -23
  116. package/scripts/run-package-tests.mjs +8 -15
  117. package/src/atom-mcp-e2e.mts +2 -2
  118. package/src/benchmarks/frames.ts +10 -44
  119. package/src/benchmarks/hotpotqa.ts +9 -29
  120. package/src/benchmarks/rag-shared.ts +12 -0
  121. package/src/benchmarks/simpleqa.ts +2 -36
  122. package/src/commit0-prereqs.sh +0 -0
  123. package/src/corpus-replay.mts +8 -8
  124. package/src/corpus-report.mts +21 -21
  125. package/src/corpus.test.mts +5 -5
  126. package/src/corpus.ts +16 -16
  127. package/src/directives.ts +0 -38
  128. package/src/examples/lean-verify.ts +1 -1
  129. package/src/gate.ts +7 -7
  130. package/src/generate-eval/certify.ts +2 -2
  131. package/src/index.ts +1 -0
  132. package/src/refine-loop.ts +5 -5
  133. package/src/resolve-client.ts +1 -1
  134. package/src/router-turn.ts +3 -11
  135. package/src/run-pool.ts +1 -1
  136. package/src/runtime-hook-recorder.ts +2 -2
  137. package/src/search-bench/tasks.ts +1 -1
  138. package/src/selector.test.mts +13 -13
  139. package/src/selector.ts +19 -19
  140. package/src/swe-bench-env.ts +4 -12
  141. package/src/swe-jail.ts +5 -156
  142. package/src/swe-structural-judge-policy.ts +3 -3
  143. package/src/swe-structural-policy.ts +3 -3
  144. package/src/swe-structural-provenance.ts +4 -4
  145. package/src/terminal-compare.ts +10 -10
  146. package/src/worker-blender.ts +2 -106
  147. package/src/worker-build123d.ts +2 -81
  148. package/tb_agents/opencode_router_agent.py +1 -1
  149. package/dist/cadbench-BRF-59Mt.js.map +0 -1
  150. package/dist/cadgenbench-DXtGkuW3.js.map +0 -1
  151. package/dist/router-turn-uTYO6KQ1.js.map +0 -1
  152. package/scripts/cadbench_prepare.py +0 -22
  153. package/scripts/cadgenbench_hard_parts.py +0 -48
  154. package/scripts/clbench_codebase_judge.py +0 -73
  155. package/scripts/render-gate-chart.mjs +0 -176
  156. package/scripts/trata-hedge/README.md +0 -57
  157. package/scripts/trata-hedge/run.sh +0 -64
  158. package/src/cloud-loop.mts +0 -156
  159. package/src/coordination-mcp-container-reach.mts +0 -182
  160. package/src/fleet.mts +0 -143
  161. package/src/hev-structural.mts +0 -697
  162. package/src/humaneval-gate.mts +0 -220
  163. package/src/mbpp-structural.mts +0 -676
  164. package/src/mcp-mount-probe.mts +0 -141
  165. package/src/profiles.ts +0 -128
  166. package/src/research-gate.mts +0 -132
  167. package/src/research-shot.ts +0 -144
  168. package/src/router-executor.ts +0 -51
  169. package/src/sandbox-run.ts +0 -108
  170. package/src/search-bench/bridge.ts +0 -182
  171. package/src/search-bench/export.mts +0 -0
  172. package/src/search-bench/parametric-check.mts +0 -78
  173. package/src/search-bench/profiles.ts +0 -113
  174. package/src/search-bench/run.mts +0 -286
  175. package/src/search-bench/tasks-fresh.ts +0 -688
  176. package/src/smoke-structural-rollout.mts +0 -415
  177. package/src/stats.mts +0 -90
  178. package/src/swe-code-improve.mts +0 -306
  179. package/src/swe-improve.mts +0 -284
  180. package/src/swe-structural.mts +0 -707
  181. package/src/tb-container-executor.mts +0 -266
  182. package/src/tb-container-executor.test.mts +0 -134
  183. package/src/tb-supervisor-sidecar.mts +0 -208
  184. package/src/trata-gepa.mts +0 -381
  185. package/src/trata-hedge-solve.mts +0 -81
  186. package/tb_agents/opencode_refine_agent.py +0 -117
  187. package/tb_agents/opencode_supervisor_agent.py +0 -239
@@ -1,286 +0,0 @@
1
- /**
2
- * Coding-harness × web-search-backend benchmark runner.
3
- *
4
- * For each (task × harness × arm) cell: spin up a live sandbox, run the coding
5
- * task once through the harness with that arm's AgentProfile (native search /
6
- * provider-MCP+native-disabled), score the answer with the task's deterministic
7
- * oracle, and record score + cost + tokens + latency + tool-call count +
8
- * citations. Cells are concurrency-bounded and fault-isolated; an infra-errored
9
- * cell is recorded as such and excluded from rates (never a silent zero).
10
- *
11
- * Run (opencode, you.com vs native, seed tasks):
12
- * dotenvx run -f ~/company/devops/secrets/.env.keys -f ~/company/devops/secrets/agent-state.env -- \
13
- * env HARNESSES=opencode ARMS=native,you MODEL=opencode/deepseek/deepseek-v4-flash \
14
- * OUT=/tmp/search-bench.jsonl pnpm exec tsx src/search-bench/run.mts
15
- */
16
- import { appendFileSync, mkdirSync, writeFileSync } from 'node:fs'
17
- import { dirname } from 'node:path'
18
- import { extractLlmCallEvent, openSandboxRun } from '@tangle-network/agent-runtime/kernel'
19
- import { Sandbox, type SandboxEvent } from '@tangle-network/sandbox'
20
- import { answerOutput, sandboxAgentRun, type WorkerBackendType } from '../sandbox-run'
21
- import { type BridgeCfg, runBridgeCell } from './bridge'
22
- import { type SearchArm, armLabel, buildArmProfile } from './profiles'
23
- import { freshTasks } from './tasks-fresh'
24
- import { type SearchTask, scoreTask, seedTasks, taskToPrompt } from './tasks'
25
-
26
- export interface SearchCellResult {
27
- taskId: string
28
- domain: string
29
- harness: string
30
- /** Search arm: 'native' | 'off' | provider id (e.g. 'you', 'exa'). */
31
- arm: string
32
- model: string
33
- /** Deterministic oracle outcome. null ⇒ infra error (excluded from rates). */
34
- score: 0 | 1 | null
35
- reasons: string[]
36
- costUsd?: number
37
- tokensIn?: number
38
- tokensOut?: number
39
- wallMs: number
40
- /** Distinct tool calls observed (evidence the agent actually searched). */
41
- toolCalls: number
42
- /** Tool names used — distinguishes native (`webfetch`) from the provider MCP. */
43
- toolNames: string[]
44
- /** Distinct http(s) URLs cited in the answer. */
45
- citations: string[]
46
- /** Final answer text (truncated in the export; full in the raw JSONL). */
47
- answer: string
48
- infraError?: string
49
- ts: string
50
- }
51
-
52
- const urlRe = /https?:\/\/[^\s)\]}"'<>]+/gi
53
-
54
- function extractCitations(answer: string): string[] {
55
- const seen = new Set<string>()
56
- for (const m of answer.match(urlRe) ?? []) seen.add(m.replace(/[.,;]+$/, ''))
57
- return [...seen]
58
- }
59
-
60
- /** Sum token usage + cost across the run's llm_call events (the kernel's ledger). */
61
- function tally(events: SandboxEvent[]): { costUsd?: number; tokensIn?: number; tokensOut?: number } {
62
- let costUsd = 0
63
- let tokensIn = 0
64
- let tokensOut = 0
65
- let any = false
66
- for (const ev of events) {
67
- const call = extractLlmCallEvent(ev as never, 'search-bench')
68
- if (!call) continue
69
- any = true
70
- costUsd += call.costUsd ?? 0
71
- tokensIn += call.tokensIn ?? 0
72
- tokensOut += call.tokensOut ?? 0
73
- }
74
- return any ? { costUsd, tokensIn, tokensOut } : {}
75
- }
76
-
77
- /**
78
- * Distinct tool calls + the tool names used. opencode emits a tool call as
79
- * repeated `message.part.updated` events sharing a `data.part.callID` with
80
- * `data.part.type==='tool'` and `data.part.tool` the name (e.g. `webfetch`,
81
- * or an MCP tool like `tangle_search_web_search`). We dedupe by callID so a
82
- * single call counts once, and surface the names so the export can show which
83
- * search backend the agent actually used (native vs the provider MCP).
84
- */
85
- function extractTools(events: SandboxEvent[]): { count: number; names: string[] } {
86
- const calls = new Map<string, string>()
87
- for (const ev of events) {
88
- const part = (ev as { data?: { part?: Record<string, unknown> } }).data?.part
89
- if (!part || typeof part !== 'object' || part.type !== 'tool') continue
90
- const callId = typeof part.callID === 'string' ? part.callID : `${calls.size}`
91
- const name = typeof part.tool === 'string' ? part.tool : 'unknown'
92
- calls.set(callId, name)
93
- }
94
- return { count: calls.size, names: [...new Set(calls.values())] }
95
- }
96
-
97
- export interface RunCfg {
98
- tasks: SearchTask[]
99
- harnesses: WorkerBackendType[]
100
- arms: SearchArm[]
101
- model: string
102
- routerBaseUrl: string
103
- tangleApiKey: string
104
- sandboxBaseUrl: string
105
- sandboxKey: string
106
- outPath: string
107
- /** In-box model provider — `openai` (default) or `openai-compat` for cheap models. */
108
- provider?: string
109
- /** Execution surface: `sandbox` (live box) or `bridge` (local cli-bridge). */
110
- backend?: 'sandbox' | 'bridge'
111
- /** cli-bridge wiring, required when `backend === 'bridge'`. */
112
- bridge?: BridgeCfg
113
- concurrency?: number
114
- timeoutMs?: number
115
- }
116
-
117
- async function runCell(
118
- cfg: RunCfg,
119
- client: Sandbox,
120
- task: SearchTask,
121
- harness: WorkerBackendType,
122
- arm: SearchArm,
123
- ): Promise<SearchCellResult> {
124
- const startedAt = Date.now()
125
- const armId = armLabel(arm)
126
- const base = {
127
- taskId: task.id,
128
- domain: task.domain,
129
- harness,
130
- arm: armId,
131
- model: cfg.model,
132
- ts: new Date(startedAt).toISOString(),
133
- }
134
- const controller = new AbortController()
135
- const timer = setTimeout(() => controller.abort(), cfg.timeoutMs ?? 300_000)
136
- try {
137
- const agentRun = sandboxAgentRun({
138
- profile: buildArmProfile({
139
- arm,
140
- routerBaseUrl: cfg.routerBaseUrl,
141
- tangleApiKey: cfg.tangleApiKey,
142
- harness,
143
- model: cfg.model,
144
- provider: cfg.provider ?? 'openai',
145
- name: `search-bench-${harness}-${armId}`,
146
- metadata: { harness, arm: armId, taskId: task.id },
147
- }),
148
- })
149
- const run = await openSandboxRun<string>(
150
- client,
151
- { agentRun, signal: controller.signal },
152
- { kind: 'events', fromEvents: (events) => answerOutput.parse(events as never) },
153
- )
154
- let turn: Awaited<ReturnType<typeof run.start>>
155
- try {
156
- turn = await run.start(taskToPrompt(task))
157
- } finally {
158
- await run.close().catch(() => {})
159
- }
160
- if (process.env.DUMP_EVENTS) {
161
- writeFileSync(process.env.DUMP_EVENTS, JSON.stringify(turn.events, null, 2))
162
- }
163
- const answer = turn.out ?? ''
164
- const { score, reasons } = scoreTask(task, answer)
165
- const tools = extractTools(turn.events)
166
- return {
167
- ...base,
168
- score,
169
- reasons,
170
- ...tally(turn.events),
171
- wallMs: Date.now() - startedAt,
172
- toolCalls: tools.count,
173
- toolNames: tools.names,
174
- citations: extractCitations(answer),
175
- answer,
176
- }
177
- } catch (err) {
178
- return {
179
- ...base,
180
- score: null,
181
- reasons: [],
182
- wallMs: Date.now() - startedAt,
183
- toolCalls: 0,
184
- toolNames: [],
185
- citations: [],
186
- answer: '',
187
- infraError: err instanceof Error ? err.message : String(err),
188
- }
189
- } finally {
190
- clearTimeout(timer)
191
- }
192
- }
193
-
194
- export async function runSearchBench(cfg: RunCfg): Promise<SearchCellResult[]> {
195
- const useBridge = cfg.backend === 'bridge'
196
- if (useBridge && !cfg.bridge) throw new Error('backend=bridge requires cfg.bridge')
197
- const client = useBridge ? null : new Sandbox({ baseUrl: cfg.sandboxBaseUrl, apiKey: cfg.sandboxKey })
198
- const runOne = (task: SearchTask, harness: WorkerBackendType, arm: SearchArm): Promise<SearchCellResult> =>
199
- useBridge ? runBridgeCell(cfg.bridge!, task, harness, arm) : runCell(cfg, client!, task, harness, arm)
200
- const cells: Array<{ task: SearchTask; harness: WorkerBackendType; arm: SearchArm }> = []
201
- for (const task of cfg.tasks)
202
- for (const harness of cfg.harnesses) for (const arm of cfg.arms) cells.push({ task, harness, arm })
203
-
204
- mkdirSync(dirname(cfg.outPath), { recursive: true })
205
- writeFileSync(cfg.outPath, '')
206
- const results: SearchCellResult[] = []
207
- const conc = cfg.concurrency ?? 3
208
- let next = 0
209
- const worker = async (): Promise<void> => {
210
- while (next < cells.length) {
211
- const i = next++
212
- const { task, harness, arm } = cells[i]
213
- const r = await runOne(task, harness, arm)
214
- results.push(r)
215
- appendFileSync(cfg.outPath, `${JSON.stringify(r)}\n`)
216
- const mark = r.score === null ? 'ERR' : r.score === 1 ? 'PASS' : 'fail'
217
- console.error(
218
- `[${i + 1}/${cells.length}] ${harness}:${armLabel(arm)} ${task.id} → ${mark}` +
219
- (r.infraError ? ` (${r.infraError})` : ` tools=${r.toolCalls}[${r.toolNames.join(',')}] cites=${r.citations.length} ${Math.round(r.wallMs / 1000)}s`),
220
- )
221
- }
222
- }
223
- await Promise.all(Array.from({ length: Math.min(conc, cells.length) }, () => worker()))
224
- return results
225
- }
226
-
227
- // ── CLI ──────────────────────────────────────────────────────────────────────
228
- function env(name: string, fallback?: string): string {
229
- const v = process.env[name] ?? fallback
230
- if (v === undefined) throw new Error(`missing env ${name}`)
231
- return v
232
- }
233
-
234
- async function main(): Promise<void> {
235
- const harnesses = env('HARNESSES', 'opencode').split(',').map((s) => s.trim()) as WorkerBackendType[]
236
- const arms: SearchArm[] = env('ARMS', 'native,you')
237
- .split(',')
238
- .map((s) => s.trim())
239
- .map((s) => (s === 'native' || s === 'off' ? s : { provider: s }))
240
- const tangleApiKey = env('TANGLE_API_KEY')
241
- const backend = env('BACKEND', 'sandbox') as 'sandbox' | 'bridge'
242
- let bridge: BridgeCfg | undefined
243
- if (backend === 'bridge') {
244
- bridge = {
245
- bridgeUrl: env('BRIDGE_URL', 'http://127.0.0.1:3355'),
246
- bridgeBearer: env('BRIDGE_BEARER'),
247
- tangleApiKey,
248
- routerSearchMcp: env('ROUTER_SEARCH_MCP', 'https://router.tangle.tools/v1/search/mcp'),
249
- bridgeModels: JSON.parse(
250
- env('BRIDGE_MODELS', '{"claude-code":"claude-code/sonnet","opencode":"opencode/zai-coding-plan/glm-5.1"}'),
251
- ) as Record<string, string>,
252
- timeoutMs: Number(env('TIMEOUT_MS', '300000')),
253
- }
254
- }
255
- const taskSet = (process.env.TASK_SET ?? 'fresh') === 'seed' ? seedTasks : freshTasks
256
- const onlyIds = (process.env.TASK_IDS ?? '').split(',').map((s) => s.trim()).filter(Boolean)
257
- const tasks = onlyIds.length ? taskSet.filter((t) => onlyIds.includes(t.id)) : taskSet
258
- if (tasks.length === 0) throw new Error(`no tasks matched TASK_IDS=${process.env.TASK_IDS} in TASK_SET=${process.env.TASK_SET ?? 'fresh'}`)
259
- const results = await runSearchBench({
260
- tasks,
261
- harnesses,
262
- arms,
263
- backend,
264
- ...(bridge ? { bridge } : {}),
265
- model: env('MODEL', 'opencode/deepseek/deepseek-v4-flash'),
266
- routerBaseUrl: env('ROUTER_BASE_URL', 'https://router.tangle.tools/v1'),
267
- tangleApiKey,
268
- sandboxBaseUrl: env('SANDBOX_BASE_URL', 'https://sandbox.tangle.tools'),
269
- sandboxKey: env('SANDBOX_KEY', tangleApiKey),
270
- provider: env('PROVIDER', 'openai'),
271
- outPath: env('OUT', '/tmp/search-bench.jsonl'),
272
- concurrency: Number(env('CONCURRENCY', '3')),
273
- timeoutMs: Number(env('TIMEOUT_MS', '300000')),
274
- })
275
- const scored = results.filter((r) => r.score !== null)
276
- console.error(
277
- `\nDone: ${results.length} cells, ${scored.length} scored, ${results.length - scored.length} infra-errored → ${env('OUT', '/tmp/search-bench.jsonl')}`,
278
- )
279
- }
280
-
281
- if (import.meta.url === `file://${process.argv[1]}`) {
282
- main().catch((e) => {
283
- console.error(e)
284
- process.exit(1)
285
- })
286
- }