@tangle-network/agent-bench 0.4.7 → 0.4.8
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 +5 -0
- package/HARNESS.md +1 -1
- package/dist/adapters.js +2 -2
- package/dist/benchmarks/agentbench.d.ts +1 -1
- package/dist/benchmarks/agentbench.js.map +1 -1
- package/dist/benchmarks/appworld.d.ts +1 -1
- package/dist/benchmarks/appworld.js +1 -1
- package/dist/benchmarks/appworld.js.map +1 -1
- package/dist/benchmarks/bfcl.d.ts +1 -1
- package/dist/benchmarks/bfcl.js.map +1 -1
- package/dist/benchmarks/cadbench.js +1 -1
- package/dist/benchmarks/cadgenbench.js +1 -1
- package/dist/benchmarks/commit0.d.ts +1 -1
- package/dist/benchmarks/commit0.js.map +1 -1
- package/dist/benchmarks/dabstep.d.ts +1 -1
- package/dist/benchmarks/dabstep.js.map +1 -1
- package/dist/benchmarks/enterpriseops-gym.d.ts +1 -1
- package/dist/benchmarks/enterpriseops-gym.js.map +1 -1
- package/dist/benchmarks/programbench.d.ts +1 -1
- package/dist/benchmarks/programbench.js.map +1 -1
- package/dist/benchmarks/rag-shared.d.ts +1 -1
- package/dist/benchmarks/rag-shared.js.map +1 -1
- package/dist/benchmarks/swe-bench.d.ts +1 -1
- package/dist/benchmarks/swe-bench.js.map +1 -1
- package/dist/benchmarks/tau-bench-shared.d.ts +1 -1
- package/dist/benchmarks/tau-bench-shared.js.map +1 -1
- package/dist/benchmarks/tau2-bench.d.ts +1 -1
- package/dist/benchmarks/toollm.d.ts +1 -1
- package/dist/benchmarks/toollm.js.map +1 -1
- package/dist/benchmarks/types.d.ts +1 -1
- package/dist/benchmarks/webarena-verified.d.ts +1 -1
- package/dist/benchmarks/webarena-verified.js.map +1 -1
- package/dist/{cadbench-DpQWZHp4.js → cadbench-BrpwOU6A.js} +2 -2
- package/dist/cadbench-BrpwOU6A.js.map +1 -0
- package/dist/{cadgenbench-DRhczfsG.js → cadgenbench-DF7hYHdl.js} +2 -2
- package/dist/cadgenbench-DF7hYHdl.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
- package/scripts/wait-for-published-dependencies.mjs +245 -0
- package/scripts/wait-for-published-dependencies.test.mjs +96 -0
- package/src/aec-gate.mts +1 -1
- package/src/benchmarks/agentbench.ts +1 -1
- package/src/benchmarks/appworld.ts +1 -1
- package/src/benchmarks/bfcl.ts +1 -1
- package/src/benchmarks/commit0.ts +1 -1
- package/src/benchmarks/dabstep.ts +1 -1
- package/src/benchmarks/enterpriseops-gym.ts +1 -1
- package/src/benchmarks/programbench.ts +1 -1
- package/src/benchmarks/rag-shared.ts +1 -1
- package/src/benchmarks/swe-bench.ts +1 -1
- package/src/benchmarks/tau-bench-shared.ts +1 -1
- package/src/benchmarks/toollm.ts +1 -1
- package/src/benchmarks/types.ts +1 -1
- package/src/benchmarks/webarena-verified.ts +1 -1
- package/src/clbench-codebase-gate.mts +1 -1
- package/src/clbench-context-gate.mts +1 -1
- package/src/cloud-loop.mts +1 -1
- package/src/commit0-env-run.mts +1 -1
- package/src/commit0-env.ts +1 -1
- package/src/commit0-gate.mts +1 -1
- package/src/corpus.ts +1 -1
- package/src/examples/lean-proof-gate.mts +1 -1
- package/src/examples/math-demo.mts +1 -1
- package/src/examples/strategy-demo.mts +1 -1
- package/src/fleet.mts +1 -1
- package/src/gate-cli.mts +1 -1
- package/src/gate.test.mts +1 -1
- package/src/gate.ts +2 -2
- package/src/generate-eval/certify.ts +1 -1
- package/src/humaneval-gate.mts +1 -1
- package/src/humaneval-repair-gate.mts +1 -1
- package/src/research-shot.ts +1 -1
- package/src/resolve-client.ts +1 -1
- package/src/router-executor.ts +1 -1
- package/src/run-benchmarks-report.ts +1 -1
- package/src/run-benchmarks.test.mts +1 -1
- package/src/run-benchmarks.ts +2 -2
- package/src/sandbox-run.ts +3 -3
- package/src/search-bench/bridge.ts +1 -1
- package/src/search-bench/parametric-check.mts +1 -1
- package/src/search-bench/run.mts +1 -1
- package/src/search-tool.ts +1 -1
- package/src/swe-arena/fixtures/factory/loops-28/calibration.md +1 -1
- package/src/swe-arena/fixtures/gen1-salvage/cand1-76a8590.diff +1 -1
- package/src/swe-bench-env.ts +1 -1
- package/src/swe-emit-patch.mts +2 -2
- package/src/swe-improve.mts +2 -2
- package/src/swe-local-proof.mts +2 -2
- package/src/swe-repro-calibrate.mts +1 -1
- package/src/swe-self-improve.mts +1 -1
- package/src/swe-stream.mts +2 -2
- package/src/swe-structural.mts +2 -2
- package/src/tb-container-executor.test.mts +1 -1
- package/src/worker-blender.ts +1 -1
- package/src/worker-browser.ts +1 -1
- package/src/worker-build123d.ts +1 -1
- package/src/worker-cad.ts +1 -1
- package/src/worker.ts +1 -1
- package/dist/cadbench-DpQWZHp4.js.map +0 -1
- package/dist/cadgenbench-DRhczfsG.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-bench",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Benchmark adapters and execution for agent-runtime across coding, tool-use, RAG, memory, browser, and terminal tasks.",
|
|
6
6
|
"repository": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tangle-network/agent-eval": "0.
|
|
28
|
+
"@tangle-network/agent-eval": "0.135.1",
|
|
29
29
|
"@tangle-network/agent-interface": "0.36.0",
|
|
30
|
-
"@tangle-network/agent-knowledge": "6.1.
|
|
30
|
+
"@tangle-network/agent-knowledge": "6.1.10",
|
|
31
31
|
"@tangle-network/sandbox": "0.15.2",
|
|
32
|
-
"@tangle-network/agent-runtime": "0.
|
|
32
|
+
"@tangle-network/agent-runtime": "0.109.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@arethetypeswrong/cli": "0.18.5",
|
|
@@ -69,11 +69,12 @@
|
|
|
69
69
|
"run-benchmarks": "tsx src/run-benchmarks-cli.mts",
|
|
70
70
|
"gate-report": "tsx src/corpus-report.mts corpus/finsearch.jsonl",
|
|
71
71
|
"terminal-compare": "tsx src/terminal-compare.ts",
|
|
72
|
-
"test": "node scripts/run-package-tests.mjs",
|
|
72
|
+
"test": "node scripts/run-package-tests.mjs && node --test scripts/wait-for-published-dependencies.test.mjs",
|
|
73
73
|
"typecheck:public": "tsc -p tsconfig.public.json",
|
|
74
74
|
"verify:package": "pnpm run verify:package:static && node scripts/verify-packed-consumer.mjs",
|
|
75
75
|
"verify:package:local-runtime": "pnpm run verify:package:static && node scripts/verify-packed-consumer.mjs --local-runtime",
|
|
76
76
|
"verify:package:static": "pnpm run build && publint && attw --pack --profile esm-only .",
|
|
77
|
+
"wait:published-dependencies": "node scripts/wait-for-published-dependencies.mjs",
|
|
77
78
|
"verify:pier": "tsx scripts/verify-pier-pair.mts"
|
|
78
79
|
}
|
|
79
80
|
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process'
|
|
2
|
+
import { mkdtemp, readFile, readdir, rm } from 'node:fs/promises'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
import { promisify } from 'node:util'
|
|
7
|
+
|
|
8
|
+
const execFileAsync = promisify(execFile)
|
|
9
|
+
const benchDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
10
|
+
const localDependencyProtocol = /^(?:catalog|file|link|patch|portal|workspace):/
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_TIMEOUT_MS = 20 * 60_000
|
|
13
|
+
export const DEFAULT_INTERVAL_MS = 15_000
|
|
14
|
+
|
|
15
|
+
export function collectRequiredTangleDependencies(packageJson) {
|
|
16
|
+
const dependencies = new Map()
|
|
17
|
+
const sections = [
|
|
18
|
+
['dependencies', packageJson.dependencies],
|
|
19
|
+
['peerDependencies', packageJson.peerDependencies],
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
for (const [section, entries] of sections) {
|
|
23
|
+
for (const [name, spec] of Object.entries(entries ?? {})) {
|
|
24
|
+
if (!name.startsWith('@tangle-network/')) continue
|
|
25
|
+
if (
|
|
26
|
+
section === 'peerDependencies' &&
|
|
27
|
+
packageJson.peerDependenciesMeta?.[name]?.optional === true
|
|
28
|
+
) {
|
|
29
|
+
continue
|
|
30
|
+
}
|
|
31
|
+
if (
|
|
32
|
+
typeof spec !== 'string' ||
|
|
33
|
+
spec.length === 0 ||
|
|
34
|
+
localDependencyProtocol.test(spec)
|
|
35
|
+
) {
|
|
36
|
+
throw new Error(`${packageJson.name} has no published ${name} dependency version`)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const previous = dependencies.get(name)
|
|
40
|
+
if (previous && previous !== spec) {
|
|
41
|
+
throw new Error(`${packageJson.name} declares conflicting versions for ${name}`)
|
|
42
|
+
}
|
|
43
|
+
dependencies.set(name, spec)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return [...dependencies]
|
|
48
|
+
.map(([name, spec]) => ({ name, spec }))
|
|
49
|
+
.sort((left, right) => left.name.localeCompare(right.name))
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function waitForPublishedDependencies(
|
|
53
|
+
dependencies,
|
|
54
|
+
{
|
|
55
|
+
timeoutMs = DEFAULT_TIMEOUT_MS,
|
|
56
|
+
intervalMs = DEFAULT_INTERVAL_MS,
|
|
57
|
+
probe = probeNpm,
|
|
58
|
+
sleep = (milliseconds) =>
|
|
59
|
+
new Promise((resolveSleep) => setTimeout(resolveSleep, milliseconds)),
|
|
60
|
+
now = Date.now,
|
|
61
|
+
report = console.log,
|
|
62
|
+
} = {},
|
|
63
|
+
) {
|
|
64
|
+
requirePositiveInteger('timeoutMs', timeoutMs)
|
|
65
|
+
requirePositiveInteger('intervalMs', intervalMs)
|
|
66
|
+
if (dependencies.length === 0) {
|
|
67
|
+
throw new Error('agent-bench has no required published @tangle-network dependencies')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const startedAt = now()
|
|
71
|
+
const deadline = startedAt + timeoutMs
|
|
72
|
+
let attempts = 0
|
|
73
|
+
let pending = dependencies.map((dependency) => ({ dependency, detail: 'not checked' }))
|
|
74
|
+
|
|
75
|
+
report(
|
|
76
|
+
`Waiting up to ${formatDuration(timeoutMs)} for ${dependencies.length} published dependencies`,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
while (true) {
|
|
80
|
+
if (attempts > 0 && now() >= deadline) {
|
|
81
|
+
throw timeoutError(timeoutMs, attempts, pending)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
attempts += 1
|
|
85
|
+
const results = await Promise.all(
|
|
86
|
+
pending.map(async ({ dependency }) => {
|
|
87
|
+
try {
|
|
88
|
+
const result = await probe(dependency, {
|
|
89
|
+
timeoutMs: Math.max(1, deadline - now()),
|
|
90
|
+
})
|
|
91
|
+
return result.available
|
|
92
|
+
? undefined
|
|
93
|
+
: { dependency, detail: result.detail ?? 'not available' }
|
|
94
|
+
} catch (error) {
|
|
95
|
+
return {
|
|
96
|
+
dependency,
|
|
97
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
)
|
|
102
|
+
pending = results.filter((result) => result !== undefined)
|
|
103
|
+
|
|
104
|
+
if (pending.length === 0) {
|
|
105
|
+
return { attempts, elapsedMs: now() - startedAt }
|
|
106
|
+
}
|
|
107
|
+
if (now() >= deadline) {
|
|
108
|
+
throw timeoutError(timeoutMs, attempts, pending)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const delayMs = Math.min(intervalMs, deadline - now())
|
|
112
|
+
report(
|
|
113
|
+
`Attempt ${attempts}: ${pending.length}/${dependencies.length} unavailable: ${pending
|
|
114
|
+
.map(({ dependency }) => `${dependency.name}@${dependency.spec}`)
|
|
115
|
+
.join(', ')}. Retrying in ${formatDuration(delayMs)}`,
|
|
116
|
+
)
|
|
117
|
+
await sleep(delayMs)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function probeNpm(dependency, { timeoutMs }) {
|
|
122
|
+
try {
|
|
123
|
+
const { stdout } = await execFileAsync(
|
|
124
|
+
'npm',
|
|
125
|
+
[
|
|
126
|
+
'view',
|
|
127
|
+
`${dependency.name}@${dependency.spec}`,
|
|
128
|
+
'version',
|
|
129
|
+
'--json',
|
|
130
|
+
'--prefer-online',
|
|
131
|
+
],
|
|
132
|
+
{
|
|
133
|
+
env: { ...process.env, npm_config_color: 'false' },
|
|
134
|
+
maxBuffer: 1024 * 1024,
|
|
135
|
+
timeout: Math.min(30_000, timeoutMs),
|
|
136
|
+
},
|
|
137
|
+
)
|
|
138
|
+
const version = JSON.parse(stdout)
|
|
139
|
+
const available =
|
|
140
|
+
(typeof version === 'string' && version.length > 0) ||
|
|
141
|
+
(Array.isArray(version) && version.length > 0)
|
|
142
|
+
return available
|
|
143
|
+
? { available: true }
|
|
144
|
+
: { available: false, detail: 'npm returned no matching version' }
|
|
145
|
+
} catch (error) {
|
|
146
|
+
return { available: false, detail: summarizeCommandError(error) }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async function readPackedBenchManifest() {
|
|
151
|
+
const scratch = await mkdtemp(path.join(tmpdir(), 'agent-bench-published-dependencies-'))
|
|
152
|
+
try {
|
|
153
|
+
await execFileAsync('pnpm', ['pack', '--pack-destination', scratch], {
|
|
154
|
+
cwd: benchDir,
|
|
155
|
+
env: { ...process.env, npm_config_ignore_scripts: 'true' },
|
|
156
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
157
|
+
timeout: 120_000,
|
|
158
|
+
})
|
|
159
|
+
const tarballs = (await readdir(scratch)).filter((name) => name.endsWith('.tgz'))
|
|
160
|
+
if (tarballs.length !== 1) {
|
|
161
|
+
throw new Error(`expected one packed agent-bench tarball, found ${tarballs.length}`)
|
|
162
|
+
}
|
|
163
|
+
const { stdout } = await execFileAsync(
|
|
164
|
+
'tar',
|
|
165
|
+
['-xOzf', path.join(scratch, tarballs[0]), 'package/package.json'],
|
|
166
|
+
{ maxBuffer: 1024 * 1024, timeout: 30_000 },
|
|
167
|
+
)
|
|
168
|
+
return JSON.parse(stdout)
|
|
169
|
+
} finally {
|
|
170
|
+
await rm(scratch, { recursive: true, force: true })
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function timeoutError(timeoutMs, attempts, pending) {
|
|
175
|
+
const details = pending
|
|
176
|
+
.map(
|
|
177
|
+
({ dependency, detail }) =>
|
|
178
|
+
`- ${dependency.name}@${dependency.spec}: ${firstLine(detail)}`,
|
|
179
|
+
)
|
|
180
|
+
.join('\n')
|
|
181
|
+
return new Error(
|
|
182
|
+
`Timed out after ${formatDuration(timeoutMs)} and ${attempts} attempts waiting for ${pending.length} published dependencies:\n${details}`,
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function summarizeCommandError(error) {
|
|
187
|
+
if (!(error instanceof Error)) return String(error)
|
|
188
|
+
const stderr = typeof error.stderr === 'string' ? error.stderr.trim() : ''
|
|
189
|
+
return firstLine(stderr || error.message)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function firstLine(value) {
|
|
193
|
+
return String(value).split(/\r?\n/, 1)[0]
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function formatDuration(milliseconds) {
|
|
197
|
+
if (milliseconds >= 60_000 && milliseconds % 60_000 === 0) {
|
|
198
|
+
return `${milliseconds / 60_000}m`
|
|
199
|
+
}
|
|
200
|
+
if (milliseconds >= 1_000 && milliseconds % 1_000 === 0) {
|
|
201
|
+
return `${milliseconds / 1_000}s`
|
|
202
|
+
}
|
|
203
|
+
return `${milliseconds}ms`
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function requirePositiveInteger(name, value) {
|
|
207
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
208
|
+
throw new Error(`${name} must be a positive integer`)
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function readPositiveInteger(name, fallback) {
|
|
213
|
+
const value = process.env[name]
|
|
214
|
+
if (value === undefined) return fallback
|
|
215
|
+
const parsed = Number(value)
|
|
216
|
+
requirePositiveInteger(name, parsed)
|
|
217
|
+
return parsed
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async function main() {
|
|
221
|
+
const packageJson = await readPackedBenchManifest()
|
|
222
|
+
const dependencies = collectRequiredTangleDependencies(packageJson)
|
|
223
|
+
const result = await waitForPublishedDependencies(dependencies, {
|
|
224
|
+
timeoutMs: readPositiveInteger(
|
|
225
|
+
'BENCH_PUBLISH_WAIT_TIMEOUT_MS',
|
|
226
|
+
DEFAULT_TIMEOUT_MS,
|
|
227
|
+
),
|
|
228
|
+
intervalMs: readPositiveInteger(
|
|
229
|
+
'BENCH_PUBLISH_WAIT_INTERVAL_MS',
|
|
230
|
+
DEFAULT_INTERVAL_MS,
|
|
231
|
+
),
|
|
232
|
+
})
|
|
233
|
+
console.log(
|
|
234
|
+
`Published dependencies ready after ${result.attempts} attempt(s) in ${formatDuration(result.elapsedMs)}: ${dependencies
|
|
235
|
+
.map(({ name, spec }) => `${name}@${spec}`)
|
|
236
|
+
.join(', ')}`,
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (path.resolve(process.argv[1] ?? '') === fileURLToPath(import.meta.url)) {
|
|
241
|
+
main().catch((error) => {
|
|
242
|
+
console.error(error instanceof Error ? error.message : String(error))
|
|
243
|
+
process.exitCode = 1
|
|
244
|
+
})
|
|
245
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import test from 'node:test'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
collectRequiredTangleDependencies,
|
|
6
|
+
waitForPublishedDependencies,
|
|
7
|
+
} from './wait-for-published-dependencies.mjs'
|
|
8
|
+
|
|
9
|
+
test('collects required published Tangle dependencies from a packed manifest', () => {
|
|
10
|
+
const dependencies = collectRequiredTangleDependencies({
|
|
11
|
+
name: '@tangle-network/agent-bench',
|
|
12
|
+
dependencies: {
|
|
13
|
+
'@tangle-network/agent-runtime': '0.109.0',
|
|
14
|
+
'@tangle-network/agent-eval': '0.135.1',
|
|
15
|
+
undici: '^7.0.0',
|
|
16
|
+
},
|
|
17
|
+
peerDependencies: {
|
|
18
|
+
'@tangle-network/agent-interface': '>=0.36.0 <0.37.0',
|
|
19
|
+
'@tangle-network/optional-peer': '1.0.0',
|
|
20
|
+
},
|
|
21
|
+
peerDependenciesMeta: {
|
|
22
|
+
'@tangle-network/optional-peer': { optional: true },
|
|
23
|
+
},
|
|
24
|
+
devDependencies: {
|
|
25
|
+
'@tangle-network/dev-only': '1.0.0',
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
assert.deepEqual(dependencies, [
|
|
30
|
+
{ name: '@tangle-network/agent-eval', spec: '0.135.1' },
|
|
31
|
+
{ name: '@tangle-network/agent-interface', spec: '>=0.36.0 <0.37.0' },
|
|
32
|
+
{ name: '@tangle-network/agent-runtime', spec: '0.109.0' },
|
|
33
|
+
])
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('retries only unavailable dependencies until all are published', async () => {
|
|
37
|
+
const dependencies = [
|
|
38
|
+
{ name: '@tangle-network/already-published', spec: '1.0.0' },
|
|
39
|
+
{ name: '@tangle-network/publishes-later', spec: '2.0.0' },
|
|
40
|
+
]
|
|
41
|
+
const calls = new Map()
|
|
42
|
+
const reports = []
|
|
43
|
+
let currentTime = 0
|
|
44
|
+
|
|
45
|
+
const result = await waitForPublishedDependencies(dependencies, {
|
|
46
|
+
timeoutMs: 100,
|
|
47
|
+
intervalMs: 25,
|
|
48
|
+
now: () => currentTime,
|
|
49
|
+
sleep: async (milliseconds) => {
|
|
50
|
+
currentTime += milliseconds
|
|
51
|
+
},
|
|
52
|
+
probe: async ({ name }) => {
|
|
53
|
+
const count = (calls.get(name) ?? 0) + 1
|
|
54
|
+
calls.set(name, count)
|
|
55
|
+
return {
|
|
56
|
+
available: name.endsWith('already-published') || count >= 3,
|
|
57
|
+
detail: 'not published yet',
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
report: (message) => reports.push(message),
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
assert.deepEqual(result, { attempts: 3, elapsedMs: 50 })
|
|
64
|
+
assert.equal(calls.get('@tangle-network/already-published'), 1)
|
|
65
|
+
assert.equal(calls.get('@tangle-network/publishes-later'), 3)
|
|
66
|
+
assert.equal(reports.length, 3)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
test('fails at the deadline and names every dependency still missing', async () => {
|
|
70
|
+
const dependencies = [
|
|
71
|
+
{ name: '@tangle-network/never-published', spec: '9.9.9' },
|
|
72
|
+
{ name: '@tangle-network/also-missing', spec: '8.8.8' },
|
|
73
|
+
]
|
|
74
|
+
let currentTime = 0
|
|
75
|
+
|
|
76
|
+
await assert.rejects(
|
|
77
|
+
waitForPublishedDependencies(dependencies, {
|
|
78
|
+
timeoutMs: 100,
|
|
79
|
+
intervalMs: 40,
|
|
80
|
+
now: () => currentTime,
|
|
81
|
+
sleep: async (milliseconds) => {
|
|
82
|
+
currentTime += milliseconds
|
|
83
|
+
},
|
|
84
|
+
probe: async () => ({ available: false, detail: 'npm error code E404' }),
|
|
85
|
+
report: () => {},
|
|
86
|
+
}),
|
|
87
|
+
(error) => {
|
|
88
|
+
assert.match(error.message, /Timed out after 100ms and 3 attempts/)
|
|
89
|
+
assert.match(error.message, /@tangle-network\/never-published@9\.9\.9/)
|
|
90
|
+
assert.match(error.message, /@tangle-network\/also-missing@8\.8\.8/)
|
|
91
|
+
assert.match(error.message, /npm error code E404/)
|
|
92
|
+
return true
|
|
93
|
+
},
|
|
94
|
+
)
|
|
95
|
+
assert.equal(currentTime, 100)
|
|
96
|
+
})
|
package/src/aec-gate.mts
CHANGED
|
@@ -22,7 +22,7 @@ import { resolveAdapter } from './adapters'
|
|
|
22
22
|
import type { BenchmarkAdapter, BenchTask } from './benchmarks/types'
|
|
23
23
|
import { type AttemptRecord, appendRunRecord, buildRunRecordFromAttempts } from './corpus'
|
|
24
24
|
import { composeStrategies } from './directives'
|
|
25
|
-
import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/
|
|
25
|
+
import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/kernel'
|
|
26
26
|
import { pool } from './stats.mts'
|
|
27
27
|
|
|
28
28
|
function must(name: string): string {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { readFile } from 'node:fs/promises'
|
|
11
11
|
import { join } from 'node:path'
|
|
12
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
12
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
13
13
|
import { benchRoot } from './_harness'
|
|
14
14
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import { spawn } from 'node:child_process'
|
|
23
23
|
import { join } from 'node:path'
|
|
24
24
|
import { createInterface } from 'node:readline'
|
|
25
|
-
import { type OutputAdapter, routerToolLoop, type ToolSpec } from '@tangle-network/agent-runtime/
|
|
25
|
+
import { type OutputAdapter, routerToolLoop, type ToolSpec } from '@tangle-network/agent-runtime/kernel'
|
|
26
26
|
import { benchRoot, preflightVenvImports, runVenvScriptStdin, venvPython } from './_harness'
|
|
27
27
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
28
28
|
|
package/src/benchmarks/bfcl.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import { readFile, stat } from 'node:fs/promises'
|
|
13
13
|
import { join } from 'node:path'
|
|
14
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
14
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
15
15
|
import { benchRoot } from './_harness'
|
|
16
16
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
import { join } from 'node:path'
|
|
25
25
|
import { readFile } from 'node:fs/promises'
|
|
26
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
26
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
27
27
|
import { benchRoot, preflightVenvImports, runVenvScriptStdin, venvPythonAt } from './_harness'
|
|
28
28
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
29
29
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import { join } from 'node:path'
|
|
13
13
|
import { access, readFile, stat } from 'node:fs/promises'
|
|
14
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
14
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
15
15
|
import { benchRoot, runVenvPython, runVenvScriptStdin } from './_harness'
|
|
16
16
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
17
17
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises'
|
|
32
32
|
import { join } from 'node:path'
|
|
33
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
33
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
34
34
|
import { benchRoot, runVenvScriptStdin } from './_harness'
|
|
35
35
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
36
36
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
import { join } from 'node:path'
|
|
27
27
|
import { readFile } from 'node:fs/promises'
|
|
28
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
28
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
29
29
|
import { benchRoot, preflightVenvImports, runVenvScriptStdin } from './_harness'
|
|
30
30
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
31
31
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises'
|
|
2
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
2
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
3
3
|
import type { BenchScore, BenchTask, LoadOptions } from './types'
|
|
4
4
|
|
|
5
5
|
export const FINAL_ANSWER_SENTINEL = 'FINAL ANSWER:'
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { readFile, stat } from 'node:fs/promises'
|
|
11
11
|
import { resolve } from 'node:path'
|
|
12
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
12
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
13
13
|
import { runVenvPython } from './_harness'
|
|
14
14
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
15
15
|
|
package/src/benchmarks/toollm.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { readFile } from 'node:fs/promises'
|
|
11
11
|
import { join } from 'node:path'
|
|
12
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
12
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
13
13
|
import { benchRoot } from './_harness'
|
|
14
14
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
15
15
|
|
package/src/benchmarks/types.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* from the benchmark's published evaluation harness.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
11
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
12
12
|
|
|
13
13
|
export interface BenchTask {
|
|
14
14
|
/** Stable benchmark instance id. */
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { access, readFile, stat } from 'node:fs/promises'
|
|
11
11
|
import { join, resolve } from 'node:path'
|
|
12
|
-
import type { OutputAdapter } from '@tangle-network/agent-runtime/
|
|
12
|
+
import type { OutputAdapter } from '@tangle-network/agent-runtime/kernel'
|
|
13
13
|
import { benchRoot, runVenvPython } from './_harness'
|
|
14
14
|
import type { BenchmarkAdapter, BenchScore, BenchTask, LoadOptions } from './types'
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
|
31
31
|
import { tmpdir } from 'node:os'
|
|
32
32
|
import { join } from 'node:path'
|
|
33
33
|
import { promisify } from 'node:util'
|
|
34
|
-
import { acquireSandbox } from '@tangle-network/agent-runtime/
|
|
34
|
+
import { acquireSandbox } from '@tangle-network/agent-runtime/kernel'
|
|
35
35
|
import { Sandbox } from '@tangle-network/sandbox'
|
|
36
36
|
import { composeStrategies } from './directives'
|
|
37
37
|
import { type AttemptRecord, appendRunRecord, buildRunRecordFromAttempts } from './corpus'
|
|
@@ -36,7 +36,7 @@ import { execFileSync } from 'node:child_process'
|
|
|
36
36
|
import { existsSync, readFileSync } from 'node:fs'
|
|
37
37
|
import { composeStrategies } from './directives'
|
|
38
38
|
import { type AttemptRecord, appendRunRecord, buildRunRecordFromAttempts } from './corpus'
|
|
39
|
-
import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/
|
|
39
|
+
import { type RouterConfig, routerChatWithUsage } from '@tangle-network/agent-runtime/kernel'
|
|
40
40
|
import { selfConsistencySelect, verifierGroundedSelect } from './selector'
|
|
41
41
|
import { type PairedLift, pairedLift, pool } from './stats.mts'
|
|
42
42
|
|
package/src/cloud-loop.mts
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* env MODEL=gpt-4.1 ROUNDS=3 pnpm exec tsx src/cloud-loop.mts
|
|
31
31
|
*/
|
|
32
32
|
import { createChatClient } from '@tangle-network/agent-eval'
|
|
33
|
-
import { observe, openSandboxRun } from '@tangle-network/agent-runtime/
|
|
33
|
+
import { observe, openSandboxRun } from '@tangle-network/agent-runtime/kernel'
|
|
34
34
|
import { Sandbox } from '@tangle-network/sandbox'
|
|
35
35
|
import { answerOutput, sandboxAgentRun } from './sandbox-run'
|
|
36
36
|
|
package/src/commit0-env-run.mts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { readFileSync } from 'node:fs'
|
|
12
12
|
import { join } from 'node:path'
|
|
13
|
-
import { adaptiveRefine, printBenchmarkReport, refine, runBenchmark, sample, type Strategy } from '@tangle-network/agent-runtime/
|
|
13
|
+
import { adaptiveRefine, printBenchmarkReport, refine, runBenchmark, sample, type Strategy } from '@tangle-network/agent-runtime/kernel'
|
|
14
14
|
import { type Commit0Row, createCommit0Environment, rowToTask } from './commit0-env'
|
|
15
15
|
|
|
16
16
|
function must(name: string): string {
|
package/src/commit0-env.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { mkdtempSync, rmSync } from 'node:fs'
|
|
|
20
20
|
import { tmpdir } from 'node:os'
|
|
21
21
|
import { join } from 'node:path'
|
|
22
22
|
import { promisify } from 'node:util'
|
|
23
|
-
import type { AgenticSurface, AgenticTask, AgenticTool, ArtifactHandle, SurfaceScore } from '@tangle-network/agent-runtime/
|
|
23
|
+
import type { AgenticSurface, AgenticTask, AgenticTool, ArtifactHandle, SurfaceScore } from '@tangle-network/agent-runtime/kernel'
|
|
24
24
|
|
|
25
25
|
const exec = promisify(execFile)
|
|
26
26
|
|
package/src/commit0-gate.mts
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
type Deliverable,
|
|
58
58
|
openSandboxRun,
|
|
59
59
|
type SandboxRun,
|
|
60
|
-
} from '@tangle-network/agent-runtime/
|
|
60
|
+
} from '@tangle-network/agent-runtime/kernel'
|
|
61
61
|
import { Sandbox } from '@tangle-network/sandbox'
|
|
62
62
|
import { createCommit0Adapter } from './benchmarks/commit0'
|
|
63
63
|
import type { BenchTask } from './benchmarks/types'
|
package/src/corpus.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { appendFile, mkdir } from 'node:fs/promises'
|
|
|
16
16
|
import { dirname } from 'node:path'
|
|
17
17
|
import { hashContent, type RunSplitTag, validateRunRecord } from '@tangle-network/agent-eval'
|
|
18
18
|
import type { CorpusRecord } from '@tangle-network/agent-eval/rl'
|
|
19
|
-
import type { Iteration } from '@tangle-network/agent-runtime/
|
|
19
|
+
import type { Iteration } from '@tangle-network/agent-runtime/kernel'
|
|
20
20
|
import type { BenchRuntimeDecisionPoint, BenchRuntimeHookEvent } from './runtime-hook-recorder'
|
|
21
21
|
|
|
22
22
|
/** One attempt within a condition-run: the prompt/steer sent, the output, the
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
runBenchmark,
|
|
23
23
|
sample,
|
|
24
24
|
sampleThenRefine,
|
|
25
|
-
} from '@tangle-network/agent-runtime/
|
|
25
|
+
} from '@tangle-network/agent-runtime/kernel'
|
|
26
26
|
import { ensureLeanImage, leanCheck } from './lean-verify.js'
|
|
27
27
|
|
|
28
28
|
// Real, mathlib-free Lean 4 theorems (compile in core Lean). `header` is everything up to `:=`;
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
runBenchmark,
|
|
20
20
|
sample,
|
|
21
21
|
sampleThenRefine,
|
|
22
|
-
} from '@tangle-network/agent-runtime/
|
|
22
|
+
} from '@tangle-network/agent-runtime/kernel'
|
|
23
23
|
|
|
24
24
|
// GSM8K-style problems; meta.answer is the ground truth the deployable check compares to.
|
|
25
25
|
const problems: Array<{ q: string; answer: number }> = [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Toy task = only a router key needed (no dataset, no sandbox). Run from bench/:
|
|
13
13
|
* TANGLE_API_KEY=... WORKER_MODEL=gpt-4o-mini tsx src/examples/strategy-demo.mts
|
|
14
14
|
*/
|
|
15
|
-
import { adaptiveRefine, type AgenticTask, type ArtifactHandle, defineStrategy, type Environment, printBenchmarkReport, refine, runBenchmark, sample } from '@tangle-network/agent-runtime/
|
|
15
|
+
import { adaptiveRefine, type AgenticTask, type ArtifactHandle, defineStrategy, type Environment, printBenchmarkReport, refine, runBenchmark, sample } from '@tangle-network/agent-runtime/kernel'
|
|
16
16
|
|
|
17
17
|
// ── 1. Implement an Environment (the only thing a new domain writes) ──────────────
|
|
18
18
|
// A toy: the agent must drive a counter to exactly the target using the increment tool.
|
package/src/fleet.mts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Run it twice: the second run injects the first run's learnings into the workers.
|
|
14
14
|
*/
|
|
15
15
|
import { createChatClient } from '@tangle-network/agent-eval'
|
|
16
|
-
import { FileCorpus, observe, openSandboxRun, renderReport } from '@tangle-network/agent-runtime/
|
|
16
|
+
import { FileCorpus, observe, openSandboxRun, renderReport } from '@tangle-network/agent-runtime/kernel'
|
|
17
17
|
import { Sandbox } from '@tangle-network/sandbox'
|
|
18
18
|
import { answerOutput, sandboxAgentRun, type WorkerBackendType } from './sandbox-run'
|
|
19
19
|
|
package/src/gate-cli.mts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* single CLI run is the instrument, not the significance test).
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import type { AgentProfile } from '@tangle-network/agent-runtime/
|
|
18
|
+
import type { AgentProfile } from '@tangle-network/agent-runtime/kernel'
|
|
19
19
|
import { resolveAdapter } from './adapters'
|
|
20
20
|
import { runGate } from './gate'
|
|
21
21
|
|
package/src/gate.test.mts
CHANGED
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
Executor,
|
|
20
20
|
ExecutorFactory,
|
|
21
21
|
ExecutorResult,
|
|
22
|
-
} from '@tangle-network/agent-runtime/
|
|
22
|
+
} from '@tangle-network/agent-runtime/kernel'
|
|
23
23
|
import type { BenchmarkAdapter, BenchScore, BenchTask } from './benchmarks/types'
|
|
24
24
|
import { runGate, type SolveTask } from './gate'
|
|
25
25
|
|