@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/fleet.mts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The whole vision, end to end, runnable from a laptop: a thin local driver
|
|
3
|
-
* fans out N workers to CLOUD sandboxes, observes each worker's trace, reports
|
|
4
|
-
* what to fix, and writes durable learnings to a corpus the NEXT run reads back.
|
|
5
|
-
*
|
|
6
|
-
* Local process = the driver (orchestrate + observe). All agent work runs in the
|
|
7
|
-
* cloud (Tangle sandbox SDK). Scale is the API key, not the laptop.
|
|
8
|
-
*
|
|
9
|
-
* dotenvx run -f ~/company/devops/secrets/.env.keys -f ~/company/devops/secrets/agent-state.env -- \
|
|
10
|
-
* env BACKEND=opencode MODEL=gpt-4.1 N=2 CORPUS=/tmp/fleet-corpus.jsonl \
|
|
11
|
-
* pnpm exec tsx src/fleet.mts
|
|
12
|
-
*
|
|
13
|
-
* Run it twice: the second run injects the first run's learnings into the workers.
|
|
14
|
-
*/
|
|
15
|
-
import {
|
|
16
|
-
defaultAnalystInstruction,
|
|
17
|
-
FileCorpus,
|
|
18
|
-
observe,
|
|
19
|
-
openSandboxRun,
|
|
20
|
-
renderReport,
|
|
21
|
-
} from '@tangle-network/agent-runtime/kernel'
|
|
22
|
-
import { Sandbox } from '@tangle-network/sandbox'
|
|
23
|
-
import { answerOutput, sandboxAgentRun, type WorkerBackendType } from './sandbox-run'
|
|
24
|
-
|
|
25
|
-
function env(name: string, fallback?: string): string {
|
|
26
|
-
const v = process.env[name] ?? fallback
|
|
27
|
-
if (v === undefined) throw new Error(`missing env ${name}`)
|
|
28
|
-
return v
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// The fleet's work: each worker gets one subtask. Swap for any real decomposition.
|
|
32
|
-
const subtasks = [
|
|
33
|
-
'Write a Python function `is_prime(n)` and three asserts proving it. Run them and report PASS/FAIL.',
|
|
34
|
-
'Write a Python function `fib(n)` (iterative) and three asserts proving it. Run them and report PASS/FAIL.',
|
|
35
|
-
'Write a Python function `rev_words(s)` that reverses word order, with asserts. Run them and report PASS/FAIL.',
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
interface WorkerResult {
|
|
39
|
-
id: string
|
|
40
|
-
task: string
|
|
41
|
-
output: string
|
|
42
|
-
events: unknown[]
|
|
43
|
-
wallMs: number
|
|
44
|
-
error?: string
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async function runWorker(
|
|
48
|
-
client: Sandbox,
|
|
49
|
-
cfg: { backendType: WorkerBackendType; model: string; provider: string; routerBaseUrl: string },
|
|
50
|
-
id: string,
|
|
51
|
-
task: string,
|
|
52
|
-
priorLearnings: string,
|
|
53
|
-
): Promise<WorkerResult> {
|
|
54
|
-
const startedAt = Date.now()
|
|
55
|
-
const prompt = priorLearnings ? `${priorLearnings}\n\n---\n\n${task}` : task
|
|
56
|
-
const controller = new AbortController()
|
|
57
|
-
const timer = setTimeout(() => controller.abort(), Number(process.env.TIMEOUT_MS ?? 240_000))
|
|
58
|
-
try {
|
|
59
|
-
const agentRun = sandboxAgentRun({
|
|
60
|
-
profile: {
|
|
61
|
-
name: id,
|
|
62
|
-
harness: cfg.backendType,
|
|
63
|
-
model: { provider: cfg.provider, default: cfg.model },
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
const run = await openSandboxRun<string>(
|
|
67
|
-
client,
|
|
68
|
-
{ agentRun, signal: controller.signal },
|
|
69
|
-
{ kind: 'events', fromEvents: (events) => answerOutput.parse(events as never) },
|
|
70
|
-
)
|
|
71
|
-
try {
|
|
72
|
-
const turn = await run.start(prompt)
|
|
73
|
-
return { id, task, output: (turn.out ?? '').trim(), events: turn.events, wallMs: Date.now() - startedAt }
|
|
74
|
-
} finally {
|
|
75
|
-
await run.close().catch(() => {})
|
|
76
|
-
}
|
|
77
|
-
} catch (err) {
|
|
78
|
-
return { id, task, output: '', events: [], wallMs: Date.now() - startedAt, error: err instanceof Error ? err.message : String(err) }
|
|
79
|
-
} finally {
|
|
80
|
-
clearTimeout(timer)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async function main(): Promise<void> {
|
|
85
|
-
const routerKey = env('TANGLE_API_KEY')
|
|
86
|
-
const cfg = {
|
|
87
|
-
backendType: env('BACKEND', 'opencode') as WorkerBackendType,
|
|
88
|
-
model: env('MODEL', 'deepseek-v4-flash'),
|
|
89
|
-
provider: env('WORKER_PROVIDER', 'openai-compat'),
|
|
90
|
-
routerBaseUrl: env('ROUTER_BASE_URL', 'https://router.tangle.tools/v1'),
|
|
91
|
-
}
|
|
92
|
-
const n = Math.min(Number(env('N', '2')), subtasks.length)
|
|
93
|
-
const corpus = new FileCorpus(env('CORPUS', '/tmp/fleet-corpus.jsonl'))
|
|
94
|
-
const observerModel = env('OBSERVER_MODEL', 'deepseek-v4-flash')
|
|
95
|
-
const observerProfile = {
|
|
96
|
-
name: 'fleet-observer',
|
|
97
|
-
harness: 'cli-base' as const,
|
|
98
|
-
model: { provider: 'tangle-router', default: observerModel },
|
|
99
|
-
prompt: { systemPrompt: defaultAnalystInstruction },
|
|
100
|
-
}
|
|
101
|
-
const client = new Sandbox({ baseUrl: env('SANDBOX_BASE_URL', 'https://sandbox.tangle.tools'), apiKey: routerKey })
|
|
102
|
-
|
|
103
|
-
// ── continuous: read what prior runs LEARNED, inject it into this run's workers
|
|
104
|
-
const prior = await corpus.query({ tags: ['audience:agent'], limit: 8 })
|
|
105
|
-
const priorLearnings = prior.length
|
|
106
|
-
? `PRIOR LEARNINGS (from earlier runs — apply them):\n${prior.map((r) => `- ${r.claim}`).join('\n')}`
|
|
107
|
-
: ''
|
|
108
|
-
console.error(`\n=== FLEET · ${n} workers · ${cfg.backendType}/${cfg.model} · cloud ===`)
|
|
109
|
-
console.error(prior.length ? `carrying ${prior.length} prior learning(s) into the workers\n` : 'first run — no prior learnings yet\n')
|
|
110
|
-
|
|
111
|
-
// ── fan out N workers to cloud sandboxes, in parallel
|
|
112
|
-
const tasks = subtasks.slice(0, n)
|
|
113
|
-
const workers = await Promise.all(
|
|
114
|
-
tasks.map((task, i) => runWorker(client, cfg, `worker-${i + 1}`, task, priorLearnings)),
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
// ── observe each worker's trace → findings → operator report + durable learnings
|
|
118
|
-
let totalLearned = 0
|
|
119
|
-
for (const w of workers) {
|
|
120
|
-
console.error(`\n── ${w.id} (${Math.round(w.wallMs / 1000)}s)${w.error ? ` — ERROR: ${w.error}` : ''}`)
|
|
121
|
-
if (w.error) continue
|
|
122
|
-
const ob = await observe(
|
|
123
|
-
{ task: w.task, output: w.output, trace: w.events, outcome: w.output ? 'passed' : 'unknown', runId: w.id },
|
|
124
|
-
{
|
|
125
|
-
profile: observerProfile,
|
|
126
|
-
executor: { backend: 'router', routerBaseUrl: cfg.routerBaseUrl, routerKey },
|
|
127
|
-
corpus,
|
|
128
|
-
tags: [cfg.backendType, 'fleet'],
|
|
129
|
-
},
|
|
130
|
-
)
|
|
131
|
-
totalLearned += ob.learned.length
|
|
132
|
-
console.error(` answer: ${w.output.slice(0, 120).replace(/\n/g, ' ')}`)
|
|
133
|
-
console.error(renderReport(ob.findings).split('\n').map((l) => ` ${l}`).join('\n'))
|
|
134
|
-
console.error(` → ${ob.learned.length} new learning(s) saved to the corpus`)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
console.error(`\n=== fleet done: ${workers.filter((w) => !w.error).length}/${n} workers ok · ${totalLearned} learnings banked → run again to apply them ===`)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
main().catch((e) => {
|
|
141
|
-
console.error(e)
|
|
142
|
-
process.exit(1)
|
|
143
|
-
})
|