@tangle-network/agent-bench 0.14.4 → 1.0.2
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 +46 -0
- package/README.md +2 -3
- package/dist/adapters.d.ts +2 -5
- package/dist/adapters.js +3 -4
- package/dist/benchmarks/_harness.d.ts +17 -20
- package/dist/benchmarks/_harness.js +4 -4
- package/dist/benchmarks/_harness.js.map +1 -1
- package/dist/benchmarks/aec-bench.d.ts +1 -4
- package/dist/benchmarks/aec-bench.js +1 -2
- package/dist/benchmarks/agentbench.d.ts +2 -5
- package/dist/benchmarks/agentbench.js +1 -2
- package/dist/benchmarks/appworld.d.ts +8 -10
- package/dist/benchmarks/appworld.js +23 -23
- package/dist/benchmarks/appworld.js.map +1 -1
- package/dist/benchmarks/bfcl.d.ts +2 -5
- package/dist/benchmarks/bfcl.js +1 -2
- package/dist/benchmarks/cad-design.d.ts +2 -5
- package/dist/benchmarks/cad-design.js +2 -3
- package/dist/benchmarks/cad-design.js.map +1 -1
- package/dist/benchmarks/cadbench.d.ts +1 -4
- package/dist/benchmarks/cadbench.js +1 -2
- package/dist/benchmarks/cadgenbench.d.ts +1 -4
- package/dist/benchmarks/cadgenbench.js +1 -2
- package/dist/benchmarks/commit0.d.ts +2 -5
- package/dist/benchmarks/commit0.js +1 -2
- package/dist/benchmarks/crag.d.ts +1 -4
- package/dist/benchmarks/crag.js +3 -3
- package/dist/benchmarks/crag.js.map +1 -1
- package/dist/benchmarks/dabstep.d.ts +2 -5
- package/dist/benchmarks/dabstep.js +2 -3
- package/dist/benchmarks/dabstep.js.map +1 -1
- package/dist/benchmarks/enterpriseops-gym.d.ts +2 -5
- package/dist/benchmarks/enterpriseops-gym.js +1 -2
- package/dist/benchmarks/finresearchbench.d.ts +2 -5
- package/dist/benchmarks/finresearchbench.js +2 -3
- package/dist/benchmarks/finsearchcomp.d.ts +2 -5
- package/dist/benchmarks/finsearchcomp.js +4 -4
- package/dist/benchmarks/finsearchcomp.js.map +1 -1
- package/dist/benchmarks/frames.d.ts +3 -19
- package/dist/benchmarks/frames.js +13 -39
- package/dist/benchmarks/frames.js.map +1 -1
- package/dist/benchmarks/hotpotqa.d.ts +4 -14
- package/dist/benchmarks/hotpotqa.js +12 -32
- package/dist/benchmarks/hotpotqa.js.map +1 -1
- package/dist/benchmarks/humaneval.d.ts +9 -12
- package/dist/benchmarks/humaneval.js +2 -3
- package/dist/benchmarks/humaneval.js.map +1 -1
- package/dist/benchmarks/mcad-bench.d.ts +13 -16
- package/dist/benchmarks/mcad-bench.js +2 -3
- package/dist/benchmarks/mcad-bench.js.map +1 -1
- package/dist/benchmarks/mcad-cq-bench.d.ts +17 -20
- package/dist/benchmarks/mcad-cq-bench.js +2 -3
- package/dist/benchmarks/mcad-cq-bench.js.map +1 -1
- package/dist/benchmarks/mcad-cq-golds.d.ts +2 -5
- package/dist/benchmarks/mcad-cq-golds.js +1 -2
- package/dist/benchmarks/mcad-golds.d.ts +1 -4
- package/dist/benchmarks/mcad-golds.js +0 -1
- package/dist/benchmarks/mcad-tasks.d.ts +5 -8
- package/dist/benchmarks/mcad-tasks.js +7 -8
- package/dist/benchmarks/mcad-tasks.js.map +1 -1
- package/dist/benchmarks/mind2web.d.ts +3 -5
- package/dist/benchmarks/mind2web.js +2 -3
- package/dist/benchmarks/mind2web.js.map +1 -1
- package/dist/benchmarks/nomiracl.d.ts +1 -4
- package/dist/benchmarks/nomiracl.js +1 -2
- package/dist/benchmarks/open-rag-bench.d.ts +1 -4
- package/dist/benchmarks/open-rag-bench.js +3 -3
- package/dist/benchmarks/open-rag-bench.js.map +1 -1
- package/dist/benchmarks/programbench.d.ts +2 -5
- package/dist/benchmarks/programbench.js +1 -2
- package/dist/benchmarks/rag-shared.d.ts +30 -22
- package/dist/benchmarks/rag-shared.js +8 -2
- package/dist/benchmarks/rag-shared.js.map +1 -1
- package/dist/benchmarks/ragbench.d.ts +1 -4
- package/dist/benchmarks/ragbench.js +3 -3
- package/dist/benchmarks/ragbench.js.map +1 -1
- package/dist/benchmarks/simpleqa.d.ts +2 -18
- package/dist/benchmarks/simpleqa.js +5 -31
- package/dist/benchmarks/simpleqa.js.map +1 -1
- package/dist/benchmarks/swe-bench.d.ts +7 -10
- package/dist/benchmarks/swe-bench.js +4 -4
- package/dist/benchmarks/swe-bench.js.map +1 -1
- package/dist/benchmarks/t2-ragbench.d.ts +1 -4
- package/dist/benchmarks/t2-ragbench.js +3 -3
- package/dist/benchmarks/t2-ragbench.js.map +1 -1
- package/dist/benchmarks/tau-bench-shared.d.ts +5 -8
- package/dist/benchmarks/tau-bench-shared.js +4 -4
- package/dist/benchmarks/tau-bench-shared.js.map +1 -1
- package/dist/benchmarks/tau2-bench.d.ts +2 -5
- package/dist/benchmarks/tau2-bench.js +1 -2
- package/dist/benchmarks/tau3-banking.d.ts +1 -4
- package/dist/benchmarks/tau3-banking.js +1 -2
- package/dist/benchmarks/terminal-bench.d.ts +1 -4
- package/dist/benchmarks/terminal-bench.js +4 -4
- package/dist/benchmarks/terminal-bench.js.map +1 -1
- package/dist/benchmarks/toollm.d.ts +2 -5
- package/dist/benchmarks/toollm.js +1 -2
- package/dist/benchmarks/trata-hedge.d.ts +1 -4
- package/dist/benchmarks/trata-hedge.js +2 -3
- package/dist/benchmarks/types.d.ts +6 -9
- package/dist/benchmarks/webarena-verified.d.ts +2 -5
- package/dist/benchmarks/webarena-verified.js +1 -2
- package/dist/{cadbench-BRF-59Mt.js → cadbench-DhAndllg.js} +4 -6
- package/dist/cadbench-DhAndllg.js.map +1 -0
- package/dist/{cadgenbench-DXtGkuW3.js → cadgenbench-Tvk16YKT.js} +15 -5
- package/dist/cadgenbench-Tvk16YKT.js.map +1 -0
- package/dist/index.d.ts +8 -18
- package/dist/index.js +16 -24
- package/dist/index.js.map +1 -1
- package/dist/{router-turn-uTYO6KQ1.js → router-turn-DNbQ_GjQ.js} +2 -3
- package/dist/router-turn-DNbQ_GjQ.js.map +1 -0
- package/fixtures/pier-agent/no-model-task/pre_artifacts.sh +0 -0
- package/fixtures/pier-agent/no-model-task/tests/test.sh +0 -0
- package/package.json +10 -10
- package/pier_agents/tangle_candidate.py +15 -23
- package/scripts/run-package-tests.mjs +8 -15
- package/src/atom-mcp-e2e.mts +2 -2
- package/src/benchmarks/frames.ts +10 -44
- package/src/benchmarks/hotpotqa.ts +9 -29
- package/src/benchmarks/rag-shared.ts +12 -0
- package/src/benchmarks/simpleqa.ts +2 -36
- package/src/commit0-prereqs.sh +0 -0
- package/src/corpus-replay.mts +8 -8
- package/src/corpus-report.mts +21 -21
- package/src/corpus.test.mts +5 -5
- package/src/corpus.ts +16 -16
- package/src/directives.ts +0 -38
- package/src/examples/lean-verify.ts +1 -1
- package/src/gate.ts +7 -7
- package/src/generate-eval/certify.ts +2 -2
- package/src/index.ts +1 -0
- package/src/refine-loop.ts +5 -5
- package/src/resolve-client.ts +1 -1
- package/src/router-turn.ts +3 -11
- package/src/run-pool.ts +1 -1
- package/src/runtime-hook-recorder.ts +2 -2
- package/src/search-bench/tasks.ts +1 -1
- package/src/selector.test.mts +13 -13
- package/src/selector.ts +19 -19
- package/src/swe-bench-env.ts +4 -12
- package/src/swe-jail.ts +5 -156
- package/src/swe-structural-judge-policy.ts +3 -3
- package/src/swe-structural-policy.ts +3 -3
- package/src/swe-structural-provenance.ts +4 -4
- package/src/terminal-compare.ts +10 -10
- package/src/worker-blender.ts +2 -106
- package/src/worker-build123d.ts +2 -81
- package/tb_agents/opencode_router_agent.py +1 -1
- package/dist/cadbench-BRF-59Mt.js.map +0 -1
- package/dist/cadgenbench-DXtGkuW3.js.map +0 -1
- package/dist/router-turn-uTYO6KQ1.js.map +0 -1
- package/scripts/cadbench_prepare.py +0 -22
- package/scripts/cadgenbench_hard_parts.py +0 -48
- package/scripts/clbench_codebase_judge.py +0 -73
- package/scripts/render-gate-chart.mjs +0 -176
- package/scripts/trata-hedge/README.md +0 -57
- package/scripts/trata-hedge/run.sh +0 -64
- package/src/cloud-loop.mts +0 -156
- package/src/coordination-mcp-container-reach.mts +0 -182
- package/src/fleet.mts +0 -143
- package/src/hev-structural.mts +0 -697
- package/src/humaneval-gate.mts +0 -220
- package/src/mbpp-structural.mts +0 -676
- package/src/mcp-mount-probe.mts +0 -141
- package/src/profiles.ts +0 -128
- package/src/research-gate.mts +0 -132
- package/src/research-shot.ts +0 -144
- package/src/router-executor.ts +0 -51
- package/src/sandbox-run.ts +0 -108
- package/src/search-bench/bridge.ts +0 -182
- package/src/search-bench/export.mts +0 -0
- package/src/search-bench/parametric-check.mts +0 -78
- package/src/search-bench/profiles.ts +0 -113
- package/src/search-bench/run.mts +0 -286
- package/src/search-bench/tasks-fresh.ts +0 -688
- package/src/smoke-structural-rollout.mts +0 -415
- package/src/stats.mts +0 -90
- package/src/swe-code-improve.mts +0 -306
- package/src/swe-improve.mts +0 -284
- package/src/swe-structural.mts +0 -707
- package/src/tb-container-executor.mts +0 -266
- package/src/tb-container-executor.test.mts +0 -134
- package/src/tb-supervisor-sidecar.mts +0 -208
- package/src/trata-gepa.mts +0 -381
- package/src/trata-hedge-solve.mts +0 -81
- package/tb_agents/opencode_refine_agent.py +0 -117
- package/tb_agents/opencode_supervisor_agent.py +0 -239
package/src/corpus-report.mts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Cross-benchmark corpus analysis instrument (docs/learning-flywheel.md - the
|
|
3
3
|
* "corpus" + "measurement" layers).
|
|
4
4
|
*
|
|
5
|
-
* The corpus (one JSONL
|
|
5
|
+
* The corpus (one JSONL BenchRunRecord per condition-run) is the flywheel's only durable
|
|
6
6
|
* asset. This reads it back and reports, GROUPED BY benchmark x condition, the
|
|
7
7
|
* numbers the doc says must hold before any rung is "earned":
|
|
8
8
|
*
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
import { readFile, stat } from 'node:fs/promises'
|
|
37
37
|
import { glob } from 'node:fs/promises'
|
|
38
38
|
import { resolve } from 'node:path'
|
|
39
|
-
import type {
|
|
39
|
+
import type { BenchRunRecord, AttemptRecord } from './corpus.ts'
|
|
40
40
|
import { benjaminiHochberg } from '@tangle-network/agent-eval'
|
|
41
41
|
|
|
42
42
|
const DEFAULT_CORPUS = resolve(import.meta.dirname, '..', 'corpus', 'finsearch.jsonl')
|
|
@@ -77,9 +77,9 @@ async function resolveCorpusFiles(args: string[]): Promise<string[]> {
|
|
|
77
77
|
|
|
78
78
|
/** Parse one JSONL file into RunRecords. Throws on a malformed line - corrupt fuel
|
|
79
79
|
* must surface, never be silently skipped. */
|
|
80
|
-
async function loadFile(file: string): Promise<
|
|
80
|
+
async function loadFile(file: string): Promise<BenchRunRecord[]> {
|
|
81
81
|
const text = await readFile(file, 'utf8')
|
|
82
|
-
const out:
|
|
82
|
+
const out: BenchRunRecord[] = []
|
|
83
83
|
const lines = text.split('\n')
|
|
84
84
|
for (let i = 0; i < lines.length; i++) {
|
|
85
85
|
const line = lines[i]
|
|
@@ -90,11 +90,11 @@ async function loadFile(file: string): Promise<RunRecord[]> {
|
|
|
90
90
|
} catch (err) {
|
|
91
91
|
throw new Error(`malformed JSONL at ${file}:${i + 1}: ${(err as Error).message}`)
|
|
92
92
|
}
|
|
93
|
-
const r = rec as Partial<
|
|
93
|
+
const r = rec as Partial<BenchRunRecord>
|
|
94
94
|
if (typeof r.benchmark !== 'string' || typeof r.instanceId !== 'string' || typeof r.condition !== 'string') {
|
|
95
|
-
throw new Error(`not a
|
|
95
|
+
throw new Error(`not a BenchRunRecord at ${file}:${i + 1} (missing benchmark/instanceId/condition)`)
|
|
96
96
|
}
|
|
97
|
-
out.push(rec as
|
|
97
|
+
out.push(rec as BenchRunRecord)
|
|
98
98
|
}
|
|
99
99
|
return out
|
|
100
100
|
}
|
|
@@ -107,8 +107,8 @@ async function loadFile(file: string): Promise<RunRecord[]> {
|
|
|
107
107
|
* emitted); the clean-trace cost axis below uses that same latest record so every
|
|
108
108
|
* reported number comes from one real run. Returns the kept records + how many were
|
|
109
109
|
* superseded (reported in caveats). */
|
|
110
|
-
function dedupeLatest(records:
|
|
111
|
-
const byKey = new Map<string,
|
|
110
|
+
function dedupeLatest(records: BenchRunRecord[]): { kept: BenchRunRecord[]; superseded: number } {
|
|
111
|
+
const byKey = new Map<string, BenchRunRecord>()
|
|
112
112
|
let superseded = 0
|
|
113
113
|
for (const r of records) {
|
|
114
114
|
const key = `${r.benchmark} ${r.instanceId} ${r.condition}`
|
|
@@ -160,7 +160,7 @@ function countMeasured(attempts: AttemptRecord[], pick: (a: AttemptRecord) => nu
|
|
|
160
160
|
return attempts.reduce((c, a) => c + (typeof pick(a) === 'number' ? 1 : 0), 0)
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
function cleanTrace(records:
|
|
163
|
+
function cleanTrace(records: BenchRunRecord[]): CleanTrace {
|
|
164
164
|
const n = records.length
|
|
165
165
|
// Tokens are measured as a PAIR (in+out) or not at all — an attempt counts as
|
|
166
166
|
// measured only when BOTH are present, and the sum includes only those (a
|
|
@@ -343,7 +343,7 @@ async function main(): Promise<void> {
|
|
|
343
343
|
if (files.length === 0) {
|
|
344
344
|
throw new Error('no corpus files resolved from the given paths')
|
|
345
345
|
}
|
|
346
|
-
const all:
|
|
346
|
+
const all: BenchRunRecord[] = []
|
|
347
347
|
for (const f of files) all.push(...(await loadFile(f)))
|
|
348
348
|
if (all.length === 0) {
|
|
349
349
|
throw new Error(`corpus is empty (0 RunRecords across ${files.length} file(s)): ${files.join(', ')}`)
|
|
@@ -356,7 +356,7 @@ async function main(): Promise<void> {
|
|
|
356
356
|
console.log(` bootstrap B=${BOOTSTRAP_N} (paired resample of shared instanceIds)`)
|
|
357
357
|
|
|
358
358
|
// Group by benchmark, then condition.
|
|
359
|
-
const benchmarks = new Map<string,
|
|
359
|
+
const benchmarks = new Map<string, BenchRunRecord[]>()
|
|
360
360
|
for (const r of kept) {
|
|
361
361
|
const arr = benchmarks.get(r.benchmark) ?? []
|
|
362
362
|
arr.push(r)
|
|
@@ -369,14 +369,14 @@ async function main(): Promise<void> {
|
|
|
369
369
|
const tests: TestEntry[] = []
|
|
370
370
|
|
|
371
371
|
for (const benchmark of [...benchmarks.keys()].sort()) {
|
|
372
|
-
const benchRecords = benchmarks.get(benchmark) as
|
|
372
|
+
const benchRecords = benchmarks.get(benchmark) as BenchRunRecord[]
|
|
373
373
|
console.log(`\n== benchmark: ${benchmark} ==`)
|
|
374
374
|
|
|
375
375
|
// Partition into clean (analyzed) vs infra-errored (excluded but counted).
|
|
376
376
|
const clean = benchRecords.filter((r) => r.infraError !== true)
|
|
377
377
|
const erroredCount = benchRecords.length - clean.length
|
|
378
378
|
|
|
379
|
-
const byCondition = new Map<string,
|
|
379
|
+
const byCondition = new Map<string, BenchRunRecord[]>()
|
|
380
380
|
for (const r of clean) {
|
|
381
381
|
const arr = byCondition.get(r.condition) ?? []
|
|
382
382
|
arr.push(r)
|
|
@@ -393,7 +393,7 @@ async function main(): Promise<void> {
|
|
|
393
393
|
// (1) + (4): per-condition rates and clean-trace cost.
|
|
394
394
|
console.log(' per-condition (resolve / blind rate * clean-trace cost):')
|
|
395
395
|
for (const condition of conditions) {
|
|
396
|
-
const recs = byCondition.get(condition) as
|
|
396
|
+
const recs = byCondition.get(condition) as BenchRunRecord[]
|
|
397
397
|
const n = recs.length
|
|
398
398
|
const resolveRate = recs.filter((r) => r.resolved === true).length / n
|
|
399
399
|
const blindRate = recs.filter((r) => r.blindResolved === true).length / n
|
|
@@ -408,12 +408,12 @@ async function main(): Promise<void> {
|
|
|
408
408
|
|
|
409
409
|
// (2) + (3): the ablation - paired lifts with bootstrap CIs.
|
|
410
410
|
// Outcome maps keyed by instanceId, per condition.
|
|
411
|
-
const resolvedById = (recs:
|
|
411
|
+
const resolvedById = (recs: BenchRunRecord[]) => {
|
|
412
412
|
const m = new Map<string, number>()
|
|
413
413
|
for (const r of recs) m.set(r.instanceId, r.resolved === true ? 1 : 0)
|
|
414
414
|
return m
|
|
415
415
|
}
|
|
416
|
-
const blindById = (recs:
|
|
416
|
+
const blindById = (recs: BenchRunRecord[]) => {
|
|
417
417
|
const m = new Map<string, number>()
|
|
418
418
|
for (const r of recs) m.set(r.instanceId, r.blindResolved === true ? 1 : 0)
|
|
419
419
|
return m
|
|
@@ -431,7 +431,7 @@ async function main(): Promise<void> {
|
|
|
431
431
|
console.log(' ablation: (no random@k condition - cannot isolate the compute control; lifts unmeasurable)')
|
|
432
432
|
}
|
|
433
433
|
for (const rc of randomConditions) {
|
|
434
|
-
const recs = byCondition.get(rc) as
|
|
434
|
+
const recs = byCondition.get(rc) as BenchRunRecord[]
|
|
435
435
|
const lift = pairedLift(blindById(recs), resolvedById(recs))
|
|
436
436
|
if (lift) tests.push({ benchmark, label: `more-compute (${rc} - blind)`, family: 'more-compute', lift })
|
|
437
437
|
}
|
|
@@ -447,15 +447,15 @@ async function main(): Promise<void> {
|
|
|
447
447
|
console.log(` steering (${refc} - random?) - no matching random@k condition`)
|
|
448
448
|
continue
|
|
449
449
|
}
|
|
450
|
-
const baseline = resolvedById(byCondition.get(matchRandom) as
|
|
451
|
-
const treatment = resolvedById(byCondition.get(refc) as
|
|
450
|
+
const baseline = resolvedById(byCondition.get(matchRandom) as BenchRunRecord[])
|
|
451
|
+
const treatment = resolvedById(byCondition.get(refc) as BenchRunRecord[])
|
|
452
452
|
const lift = pairedLift(baseline, treatment)
|
|
453
453
|
if (lift) tests.push({ benchmark, label: `steering (${refc} - ${matchRandom})`, family: 'steering', lift })
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
// (5) honest caveats for this benchmark.
|
|
457
457
|
const totalN = clean.length
|
|
458
|
-
const minCondN = conditions.length === 0 ? 0 : Math.min(...conditions.map((c) => (byCondition.get(c) as
|
|
458
|
+
const minCondN = conditions.length === 0 ? 0 : Math.min(...conditions.map((c) => (byCondition.get(c) as BenchRunRecord[]).length))
|
|
459
459
|
console.log(' caveats:')
|
|
460
460
|
console.log(` * clean records: ${totalN} across ${conditions.length} condition(s); smallest condition n=${minCondN}`)
|
|
461
461
|
console.log(` * infra-errored excluded: ${erroredCount}`)
|
package/src/corpus.test.mts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
benchRecordToCorpusRecords,
|
|
6
6
|
buildRunRecord,
|
|
7
7
|
buildRunRecordFromAttempts,
|
|
8
|
-
type
|
|
8
|
+
type BenchRunRecord,
|
|
9
9
|
} from './corpus'
|
|
10
10
|
import { createRuntimeHookRecorder } from './runtime-hook-recorder'
|
|
11
11
|
|
|
@@ -23,12 +23,12 @@ const measuredAttempt = (round: number, output: string, valid: boolean): Attempt
|
|
|
23
23
|
eventTypes: { llm_call: 1, tool_call: 1 },
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
const baseRec = (attempts: AttemptRecord[], over: Partial<
|
|
26
|
+
const baseRec = (attempts: AttemptRecord[], over: Partial<BenchRunRecord> = {}): BenchRunRecord => ({
|
|
27
27
|
ts: '2026-06-03T00:00:00.000Z',
|
|
28
28
|
benchmark: 'finsearchcomp',
|
|
29
29
|
instanceId: 'i1',
|
|
30
30
|
condition: 'random@3',
|
|
31
|
-
// canonical
|
|
31
|
+
// canonical BenchRunRecord requires a snapshot-pinned model; bench writes bare
|
|
32
32
|
// aliases, so the happy path supplies the resolved snapshot via opts.model.
|
|
33
33
|
model: 'gpt-5',
|
|
34
34
|
blindResolved: attempts[0]?.valid === true,
|
|
@@ -97,7 +97,7 @@ const baseRec = (attempts: AttemptRecord[], over: Partial<RunRecord> = {}): RunR
|
|
|
97
97
|
assert.equal(unmappable.length, 0, 'all measured attempts map')
|
|
98
98
|
assert.equal(records.length, 2, 'one record per attempt')
|
|
99
99
|
for (const r of records) {
|
|
100
|
-
assert.ok(isRunRecord(r), 'each is a valid canonical
|
|
100
|
+
assert.ok(isRunRecord(r), 'each is a valid canonical BenchRunRecord')
|
|
101
101
|
}
|
|
102
102
|
const [r0, r1] = records
|
|
103
103
|
assert.equal(r0?.candidateId, 'random@3', 'candidateId = condition (the gate-pairing arm)')
|
|
@@ -151,7 +151,7 @@ const baseRec = (attempts: AttemptRecord[], over: Partial<RunRecord> = {}): RunR
|
|
|
151
151
|
)
|
|
152
152
|
assert.equal(records.length, 0, 'a bare-alias model is not a reproducibility artifact')
|
|
153
153
|
assert.equal(unmappable.length, 1)
|
|
154
|
-
assert.match(unmappable[0]!.reason, /invalid
|
|
154
|
+
assert.match(unmappable[0]!.reason, /invalid BenchRunRecord/, 'surfaces the validator rejection')
|
|
155
155
|
assert.match(unmappable[0]!.reason, /snapshot/, 'reason explains the snapshot-pin requirement')
|
|
156
156
|
}
|
|
157
157
|
|
package/src/corpus.ts
CHANGED
|
@@ -27,7 +27,7 @@ import type { BenchRuntimeDecisionPoint, BenchRuntimeHookEvent } from './runtime
|
|
|
27
27
|
* path). A worker that reports no usage (e.g. a raw opencode-stdout shot)
|
|
28
28
|
* OMITS them — it never writes a fabricated `0`. Absence means "unmeasured",
|
|
29
29
|
* which is honest and lets the canonical bridge below refuse to forge a
|
|
30
|
-
*
|
|
30
|
+
* BenchRunRecord with phantom economics. (no-fallback: a silent `0` cost reads as a
|
|
31
31
|
* free run downstream, which is a lie the gate would then act on.) */
|
|
32
32
|
export interface AttemptRecord {
|
|
33
33
|
round: number
|
|
@@ -49,7 +49,7 @@ export interface AttemptRecord {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** One controller-run over a single benchmark instance under one condition. */
|
|
52
|
-
export interface
|
|
52
|
+
export interface BenchRunRecord {
|
|
53
53
|
ts: string
|
|
54
54
|
benchmark: string
|
|
55
55
|
instanceId: string
|
|
@@ -63,7 +63,7 @@ export interface RunRecord {
|
|
|
63
63
|
attempts: AttemptRecord[]
|
|
64
64
|
infraError: boolean
|
|
65
65
|
/** Canonical-pairing provenance (optional; writers set when known). These are
|
|
66
|
-
* what let a bench record project onto the substrate's `
|
|
66
|
+
* what let a bench record project onto the substrate's `BenchRunRecord` so it can
|
|
67
67
|
* pair across sweeps and feed `analyzeRuns`/`HeldOutGate`/the RL exporters. */
|
|
68
68
|
seed?: number
|
|
69
69
|
splitTag?: RunSplitTag
|
|
@@ -106,7 +106,7 @@ function summarizeAttempt<Task, Output>(iter: Iteration<Task, Output>): AttemptR
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
/** Build a
|
|
109
|
+
/** Build a BenchRunRecord from a runAgentRounds result. `now` injected for determinism in tests. */
|
|
110
110
|
export function buildRunRecord<Task, Output>(args: {
|
|
111
111
|
benchmark: string
|
|
112
112
|
instanceId: string
|
|
@@ -123,7 +123,7 @@ export function buildRunRecord<Task, Output>(args: {
|
|
|
123
123
|
commitSha?: string
|
|
124
124
|
runtimeEvents?: BenchRuntimeHookEvent[]
|
|
125
125
|
runtimeDecisionPoints?: BenchRuntimeDecisionPoint[]
|
|
126
|
-
}):
|
|
126
|
+
}): BenchRunRecord {
|
|
127
127
|
const attempts = args.iterations.map(summarizeAttempt)
|
|
128
128
|
return {
|
|
129
129
|
ts: (args.now ? args.now() : new Date()).toISOString(),
|
|
@@ -148,7 +148,7 @@ export function buildRunRecord<Task, Output>(args: {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
* Build a
|
|
151
|
+
* Build a BenchRunRecord from a hand-assembled `AttemptRecord[]` (the gate runners'
|
|
152
152
|
* shape — they score attempts directly rather than carrying `Iteration`s).
|
|
153
153
|
*
|
|
154
154
|
* The three run-level verdicts derive from the attempts by default:
|
|
@@ -177,7 +177,7 @@ export function buildRunRecordFromAttempts(
|
|
|
177
177
|
runtimeEvents?: BenchRuntimeHookEvent[]
|
|
178
178
|
runtimeDecisionPoints?: BenchRuntimeDecisionPoint[]
|
|
179
179
|
},
|
|
180
|
-
):
|
|
180
|
+
): BenchRunRecord {
|
|
181
181
|
const anyScored = attempts.some((a) => a.score !== undefined)
|
|
182
182
|
const anyValid = attempts.some((a) => a.valid !== undefined)
|
|
183
183
|
return {
|
|
@@ -203,10 +203,10 @@ export function buildRunRecordFromAttempts(
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
/** Run-level provenance the caller asserts when projecting a bench record onto
|
|
206
|
-
* the substrate. `commitSha` is required: a canonical `
|
|
206
|
+
* the substrate. `commitSha` is required: a canonical `BenchRunRecord` is a
|
|
207
207
|
* reproducibility artifact and must name the code that produced it — the
|
|
208
208
|
* bridge will not invent one. */
|
|
209
|
-
|
|
209
|
+
interface CorpusProjectionOpts {
|
|
210
210
|
commitSha: string
|
|
211
211
|
/** Defaults to the record's `benchmark`. */
|
|
212
212
|
experimentId?: string
|
|
@@ -224,12 +224,12 @@ export interface CorpusProjectionOpts {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/** One attempt that could not become a canonical record, with the reason. */
|
|
227
|
-
|
|
227
|
+
interface UnmappableAttempt {
|
|
228
228
|
round: number
|
|
229
229
|
reason: string
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
interface CorpusProjection {
|
|
233
233
|
records: CorpusRecord[]
|
|
234
234
|
/** Attempts dropped because they lacked the canonical-mandatory signal
|
|
235
235
|
* (measured economics / an output). The caller decides whether a non-empty
|
|
@@ -250,7 +250,7 @@ export interface CorpusProjection {
|
|
|
250
250
|
* measured `runAgentRounds`/sandbox path can, which is the correct, honest constraint.
|
|
251
251
|
*/
|
|
252
252
|
export async function benchRecordToCorpusRecords(
|
|
253
|
-
rec:
|
|
253
|
+
rec: BenchRunRecord,
|
|
254
254
|
opts: CorpusProjectionOpts,
|
|
255
255
|
): Promise<CorpusProjection> {
|
|
256
256
|
const records: CorpusRecord[] = []
|
|
@@ -304,14 +304,14 @@ export async function benchRecordToCorpusRecords(
|
|
|
304
304
|
}
|
|
305
305
|
try {
|
|
306
306
|
// Validate for the assertion (throws on a malformed record) but keep the
|
|
307
|
-
// CorpusRecord superset — the validator returns a
|
|
307
|
+
// CorpusRecord superset — the validator returns a BenchRunRecord and may drop
|
|
308
308
|
// the `prompt`/`completion` extras the RL exporters want.
|
|
309
309
|
validateRunRecord(candidate)
|
|
310
310
|
records.push(candidate)
|
|
311
311
|
} catch (err) {
|
|
312
312
|
unmappable.push({
|
|
313
313
|
round: a.round,
|
|
314
|
-
reason: `invalid
|
|
314
|
+
reason: `invalid BenchRunRecord: ${err instanceof Error ? err.message : String(err)}`,
|
|
315
315
|
})
|
|
316
316
|
}
|
|
317
317
|
}
|
|
@@ -319,8 +319,8 @@ export async function benchRecordToCorpusRecords(
|
|
|
319
319
|
return { records, unmappable }
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
/** Append one
|
|
323
|
-
export async function appendRunRecord(corpusPath: string, record:
|
|
322
|
+
/** Append one BenchRunRecord to the durable corpus (creating the dir if needed). */
|
|
323
|
+
export async function appendRunRecord(corpusPath: string, record: BenchRunRecord): Promise<void> {
|
|
324
324
|
// Fail loud on a real mkdir failure (EACCES, disk-full): recursive:true is
|
|
325
325
|
// idempotent when the dir already exists, so this throws ONLY on genuine errors
|
|
326
326
|
// — a silent swallow just made the append fail later with a confusing message.
|
package/src/directives.ts
CHANGED
|
@@ -33,44 +33,6 @@ const DIVERSE_STRATEGY_LENSES: ReadonlyArray<string> = [
|
|
|
33
33
|
'Name the most plausible WRONG answer and the trap that makes it tempting. Rule it out, then commit to the answer that survives.',
|
|
34
34
|
]
|
|
35
35
|
|
|
36
|
-
/** Compose the k diverse strategies for a run: each = an approach lens layered on the
|
|
37
|
-
* (optionally GEPA-learned) shared base. Returns exactly `k` distinct strategy prefixes
|
|
38
|
-
* (lenses cycle if k exceeds the lens count, but each carries its index so prompts differ). */
|
|
39
|
-
export function composeStrategies(base: string, k: number): string[] {
|
|
40
|
-
const lenses = DIVERSE_STRATEGY_LENSES
|
|
41
|
-
return Array.from({ length: k }, (_, i) => {
|
|
42
|
-
const lens = lenses[i % lenses.length] as string
|
|
43
|
-
const tag = i < lenses.length ? '' : ` (variant ${Math.floor(i / lenses.length) + 1})`
|
|
44
|
-
return `${lens}${tag}\n\n${base}`
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** Research (local opencode, model-knowledge) refine directive — hand-written. */
|
|
49
|
-
export const DEFAULT_RESEARCH_REFINE_DIRECTIVE =
|
|
50
|
-
'Double-check it for a specific factual or reasoning error. If it is correct, restate the SAME answer unchanged. Change it ONLY if you identify a concrete, specific error — do not change a correct answer. End with the FINAL ANSWER line.'
|
|
51
|
-
|
|
52
|
-
/** Sandbox research (live web/market sources) refine directive — hand-written. */
|
|
53
|
-
export const DEFAULT_SANDBOX_REFINE_DIRECTIVE =
|
|
54
|
-
'Double-check it: re-verify the figure against live sources and the requested units/precision/tolerance. If it is correct, restate the SAME final answer unchanged. Change it ONLY if you find a concrete error in the value or the source. End with the explicit final answer.'
|
|
55
|
-
|
|
56
|
-
/** GEPA-learned sandbox refine directive (bycd31l10, +7.1pp held-out vs the
|
|
57
|
-
* hand-written one on the GEPA run, n=8/noisy). Separates the verification note
|
|
58
|
-
* from the verbatim-preserved final answer, fixing the blank-reply failure mode. */
|
|
59
|
-
export const GEPA_LEARNED_DIRECTIVE =
|
|
60
|
-
'Double-check it: re-verify the fact/value against a reliable, citable source. Provide a brief Verification note naming the source you used (link or title); this note is not part of the final answer. Confirm the requested units/precision/tolerance exactly. If the prior answer is correct, copy the SAME final answer text verbatim with identical formatting—do not add or remove words. Change it ONLY if you find a concrete error in the value or in the cited source; in that case, briefly describe the specific error in the Verification note and provide the corrected value with the requested units/precision/tolerance. If you cannot verify, state that in the Verification note, but do not alter or omit the final answer. Always place the final answer as the last line of your reply, containing only the answer text.'
|
|
61
|
-
|
|
62
|
-
/** OpenSCAD authoring directive (CAD design) — the GEPA-optimizable system prompt.
|
|
63
|
-
* Minimal on purpose: states the contract (compile, source-only) but not HOW to
|
|
64
|
-
* satisfy the geometric spec, leaving headroom for the optimizer. */
|
|
65
|
-
export const DEFAULT_CAD_DIRECTIVE =
|
|
66
|
-
'You are an expert OpenSCAD engineer. Output ONLY valid OpenSCAD source — no prose, no markdown fences. The model MUST compile with `openscad -o out.stl model.scad`. Match the brief as closely as you can.'
|
|
67
|
-
|
|
68
|
-
/** OpenSCAD authoring directive for the SANDBOX path (solveCadRefine) — a terser
|
|
69
|
-
* variant of DEFAULT_CAD_DIRECTIVE (no "match the brief" tail). Kept distinct
|
|
70
|
-
* rather than unified to preserve that path's exact prompt. */
|
|
71
|
-
export const DEFAULT_CAD_SANDBOX_DIRECTIVE =
|
|
72
|
-
'You are an expert OpenSCAD engineer. Output ONLY valid OpenSCAD source — no prose, no markdown fences. The model must compile with `openscad -o out.stl model.scad`.'
|
|
73
|
-
|
|
74
36
|
/** Blender bpy authoring directive (BlenderLLM/CADBench) — the GEPA-optimizable
|
|
75
37
|
* system prompt. States the contract (runs headless, builds mesh(es) at origin,
|
|
76
38
|
* no cameras/lights) but not how to satisfy the criteria. */
|
|
@@ -24,7 +24,7 @@ const IMAGE = process.env.LEAN_IMAGE ?? 'agent-runtime-lean-verify:local'
|
|
|
24
24
|
/** A proof that reaches acceptance via an unchecked escape is not a proof — reject it. */
|
|
25
25
|
const TRUST_ESCAPE = /\b(sorry|admit|sorryAx|native_decide)\b/
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
interface LeanResult {
|
|
28
28
|
/** Lean accepted the proof AND it used no trust-escape. */
|
|
29
29
|
readonly passed: boolean
|
|
30
30
|
/** Lean's compiler output on failure — feed this back to the prover verbatim. */
|
package/src/gate.ts
CHANGED
|
@@ -67,7 +67,7 @@ export interface SolveTask {
|
|
|
67
67
|
|
|
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
71
|
readonly adapter: BenchmarkAdapter
|
|
72
72
|
readonly routerBaseUrl: string
|
|
73
73
|
readonly routerKey: string
|
|
@@ -107,7 +107,7 @@ function extractArtifact(adapter: BenchmarkAdapter, content: string): string {
|
|
|
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).
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
function benchSolveLeaf(opts: BenchSolverOptions, spec: AgentSpec, ctx: ExecutorContext): Executor<unknown> {
|
|
111
111
|
const inner = createExecutor({
|
|
112
112
|
backend: 'router',
|
|
113
113
|
routerBaseUrl: opts.routerBaseUrl,
|
|
@@ -138,7 +138,7 @@ export function benchSolveLeaf(opts: BenchSolverOptions, spec: AgentSpec, ctx: E
|
|
|
138
138
|
* spec; a shared BYO executor instance would race on its single result slot. `register` throws:
|
|
139
139
|
* this registry serves exactly one runtime (the bench solve leaf), by intent.
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
function benchSolverRegistry(opts: BenchSolverOptions): ExecutorRegistry {
|
|
142
142
|
return {
|
|
143
143
|
register(): void {
|
|
144
144
|
throw new Error('benchSolverRegistry: register is unsupported (single bench-router runtime)')
|
|
@@ -155,7 +155,7 @@ export function benchSolverRegistry(opts: BenchSolverOptions): ExecutorRegistry
|
|
|
155
155
|
/** Build the solver `Persona` from the developer's exact `AgentProfile` + a solve-and-grade
|
|
156
156
|
* registry. The profile still declares its execution identity; `AgentSpec.harness: null` only
|
|
157
157
|
* says that the supplied registry owns placement instead of a built-in executor. */
|
|
158
|
-
|
|
158
|
+
function defineSolverPersona(
|
|
159
159
|
profile: AgentProfile,
|
|
160
160
|
registry: ExecutorRegistry,
|
|
161
161
|
name = 'gate-solver',
|
|
@@ -183,7 +183,7 @@ function solveFanout(strategies: ReadonlyArray<string>, instance: BenchTask): Co
|
|
|
183
183
|
})
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
interface RunGateOptions {
|
|
187
187
|
readonly adapter: BenchmarkAdapter
|
|
188
188
|
/** The ONE specificity: who the solver is (prompt / model / tools). */
|
|
189
189
|
readonly profile: AgentProfile
|
|
@@ -213,7 +213,7 @@ export interface RunGateOptions {
|
|
|
213
213
|
/** One arm's aggregate over the n instances. `errored` = runs that ended `no-winner` for an
|
|
214
214
|
* infra reason (budget/abort) — excluded from the resolve denominator, like an infra-errored
|
|
215
215
|
* cell. A genuine all-children-down counts as not-resolved (a real failure, kept in n). */
|
|
216
|
-
|
|
216
|
+
interface GateArmResult {
|
|
217
217
|
readonly label: string
|
|
218
218
|
readonly n: number
|
|
219
219
|
readonly resolved: number
|
|
@@ -229,7 +229,7 @@ export interface GateArmResult {
|
|
|
229
229
|
readonly sampleBlocker?: string
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
interface GateReport {
|
|
233
233
|
readonly benchmark: string
|
|
234
234
|
readonly k: number
|
|
235
235
|
readonly n: number
|
|
@@ -24,7 +24,7 @@ import { execSync } from 'node:child_process'
|
|
|
24
24
|
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
25
25
|
import { tmpdir } from 'node:os'
|
|
26
26
|
import { dirname, join, resolve } from 'node:path'
|
|
27
|
-
import { scoreTask,
|
|
27
|
+
import { scoreTask, searchTaskPrompt } from '../search-bench/tasks'
|
|
28
28
|
import { runBenchRouterTurn } from '../router-turn'
|
|
29
29
|
import { type EvalCertification, type GeneratedEval, generatedEvalSchemaVersion, parseCandidate } from './schema'
|
|
30
30
|
|
|
@@ -130,7 +130,7 @@ export async function discriminationGate(
|
|
|
130
130
|
model: { provider: 'tangle-router', default: model },
|
|
131
131
|
},
|
|
132
132
|
},
|
|
133
|
-
|
|
133
|
+
searchTaskPrompt(candidate),
|
|
134
134
|
)
|
|
135
135
|
const { score, reasons } = scoreTask(candidate, res.finalText)
|
|
136
136
|
return score === 0
|
package/src/index.ts
CHANGED
package/src/refine-loop.ts
CHANGED
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
*
|
|
22
22
|
* This is the inference-timescale instance of the spine's atom: `runShot` is the
|
|
23
23
|
* worker Agent's `act→Output`; `prompt` is the driver Agent's `act→steer`. It is
|
|
24
|
-
* deliberately corpus-agnostic — callers map `RefineLoopResult` to a
|
|
24
|
+
* deliberately corpus-agnostic — callers map `RefineLoopResult` to a BenchRunRecord.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
/** Minimal per-round verdict — `valid` gates early-stop, `score` is informational. */
|
|
28
|
-
|
|
28
|
+
interface RoundVerdict {
|
|
29
29
|
valid: boolean
|
|
30
30
|
score?: number
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
interface RoundRecord<Artifact> {
|
|
34
34
|
/** 1-based round index. */
|
|
35
35
|
round: number
|
|
36
36
|
prompt: string
|
|
@@ -41,7 +41,7 @@ export interface RoundRecord<Artifact> {
|
|
|
41
41
|
note?: string
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
interface RefineLoopSpec<Artifact, Ctx = void> {
|
|
45
45
|
/** Max shots. Always ≥ 1. */
|
|
46
46
|
rounds: number
|
|
47
47
|
/** Build the per-task execution context once (clone repo / create box / mkdtemp). */
|
|
@@ -62,7 +62,7 @@ export interface RefineLoopSpec<Artifact, Ctx = void> {
|
|
|
62
62
|
teardown?: (ctx: Ctx) => Promise<void>
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
interface RefineLoopResult<Artifact> {
|
|
66
66
|
/** Every executed round in order. */
|
|
67
67
|
rounds: RoundRecord<Artifact>[]
|
|
68
68
|
/** Round 1 — the blind artifact. */
|
package/src/resolve-client.ts
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import { Sandbox } from '@tangle-network/sandbox'
|
|
29
29
|
import { makeSearchExecutor, webSearchTool } from './search-tool'
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
interface ResolveBenchClientOptions {
|
|
32
32
|
/** The selector (the `BACKEND` env value): `router` = off-box; anything else = in-box Sandbox. */
|
|
33
33
|
backend: string
|
|
34
34
|
routerBaseUrl: string
|
package/src/router-turn.ts
CHANGED
|
@@ -13,19 +13,19 @@ import {
|
|
|
13
13
|
} from '@tangle-network/agent-runtime/kernel'
|
|
14
14
|
|
|
15
15
|
/** Bench-local target shorthand; Runtime still executes only the exact profile below. */
|
|
16
|
-
|
|
16
|
+
interface BenchRouterTarget {
|
|
17
17
|
routerBaseUrl: string
|
|
18
18
|
routerKey: string
|
|
19
19
|
profile: AgentProfile
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
interface BenchRouterTurnConfig extends BenchRouterTarget {
|
|
23
23
|
tools?: ReadonlyArray<ToolSpec>
|
|
24
24
|
timeoutMs?: number
|
|
25
25
|
signal?: AbortSignal
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
interface BenchProfileSettings {
|
|
29
29
|
systemPrompt?: string
|
|
30
30
|
temperature?: number
|
|
31
31
|
maxTokens?: number
|
|
@@ -95,14 +95,6 @@ export function withBenchProfile(
|
|
|
95
95
|
})
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
export function benchProfileModel(profile: AgentProfile): string {
|
|
99
|
-
const model = profile.model?.default
|
|
100
|
-
if (typeof model !== 'string' || model.length === 0 || model === 'runtime-selected') {
|
|
101
|
-
throw new Error('benchmark AgentProfile.model.default must be concrete')
|
|
102
|
-
}
|
|
103
|
-
return model
|
|
104
|
-
}
|
|
105
|
-
|
|
106
98
|
/**
|
|
107
99
|
* The benchmark-side entry to Runtime's canonical one-turn path.
|
|
108
100
|
* It is only an ergonomic composition: Runtime still parses the exact profile,
|
package/src/run-pool.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface BenchRuntimeDecisionPoint {
|
|
|
32
32
|
metadata?: Record<string, unknown>
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
interface BenchRuntimeHooks {
|
|
36
36
|
onEvent?: (
|
|
37
37
|
event: BenchRuntimeHookEvent,
|
|
38
38
|
context: { signal?: AbortSignal },
|
|
@@ -43,7 +43,7 @@ export interface BenchRuntimeHooks {
|
|
|
43
43
|
) => void | Promise<void>
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
interface RuntimeHookRecorder {
|
|
47
47
|
readonly events: BenchRuntimeHookEvent[]
|
|
48
48
|
readonly decisionPoints: BenchRuntimeDecisionPoint[]
|
|
49
49
|
readonly hooks: BenchRuntimeHooks
|
|
@@ -40,7 +40,7 @@ export interface SearchTask {
|
|
|
40
40
|
const ANSWER_CONTRACT =
|
|
41
41
|
'Answer with the exact code/identifiers requested. Cite the source URL(s) you used. Be precise — exact method, option, and import names matter.'
|
|
42
42
|
|
|
43
|
-
export function
|
|
43
|
+
export function searchTaskPrompt(task: SearchTask): string {
|
|
44
44
|
return `${task.prompt}\n\n${ANSWER_CONTRACT}`
|
|
45
45
|
}
|
|
46
46
|
|