@tangle-network/agent-bench 0.4.1 → 0.4.3
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 +9 -0
- package/dist/adapters.d.ts +4 -11
- package/dist/adapters.js +78 -41
- package/dist/adapters.js.map +1 -1
- package/dist/benchmarks/_harness.d.ts +48 -66
- package/dist/benchmarks/_harness.js +329 -33
- package/dist/benchmarks/_harness.js.map +1 -1
- package/dist/benchmarks/aec-bench.d.ts +4 -25
- package/dist/benchmarks/aec-bench.js +242 -7
- package/dist/benchmarks/aec-bench.js.map +1 -1
- package/dist/benchmarks/agentbench.d.ts +5 -13
- package/dist/benchmarks/agentbench.js +114 -9
- package/dist/benchmarks/agentbench.js.map +1 -1
- package/dist/benchmarks/appworld.d.ts +9 -29
- package/dist/benchmarks/appworld.js +317 -12
- package/dist/benchmarks/appworld.js.map +1 -1
- package/dist/benchmarks/bfcl.d.ts +5 -15
- package/dist/benchmarks/bfcl.js +264 -9
- package/dist/benchmarks/bfcl.js.map +1 -1
- package/dist/benchmarks/cad-design.d.ts +16 -41
- package/dist/benchmarks/cad-design.js +512 -6
- package/dist/benchmarks/cad-design.js.map +1 -1
- package/dist/benchmarks/cadbench.d.ts +4 -17
- package/dist/benchmarks/cadbench.js +2 -8
- package/dist/benchmarks/cadgenbench.d.ts +4 -20
- package/dist/benchmarks/cadgenbench.js +2 -8
- package/dist/benchmarks/commit0.d.ts +5 -27
- package/dist/benchmarks/commit0.js +187 -9
- package/dist/benchmarks/commit0.js.map +1 -1
- package/dist/benchmarks/crag.d.ts +4 -12
- package/dist/benchmarks/crag.js +110 -8
- package/dist/benchmarks/crag.js.map +1 -1
- package/dist/benchmarks/dabstep.d.ts +5 -15
- package/dist/benchmarks/dabstep.js +177 -9
- package/dist/benchmarks/dabstep.js.map +1 -1
- package/dist/benchmarks/enterpriseops-gym.d.ts +5 -34
- package/dist/benchmarks/enterpriseops-gym.js +236 -9
- package/dist/benchmarks/enterpriseops-gym.js.map +1 -1
- package/dist/benchmarks/finresearchbench.d.ts +4 -13
- package/dist/benchmarks/finresearchbench.js +218 -7
- package/dist/benchmarks/finresearchbench.js.map +1 -1
- package/dist/benchmarks/finsearchcomp.d.ts +8 -39
- package/dist/benchmarks/finsearchcomp.js +267 -6
- package/dist/benchmarks/finsearchcomp.js.map +1 -1
- package/dist/benchmarks/frames.d.ts +15 -37
- package/dist/benchmarks/frames.js +408 -11
- package/dist/benchmarks/frames.js.map +1 -1
- package/dist/benchmarks/hotpotqa.d.ts +4 -24
- package/dist/benchmarks/hotpotqa.js +250 -14
- package/dist/benchmarks/hotpotqa.js.map +1 -1
- package/dist/benchmarks/humaneval.d.ts +19 -37
- package/dist/benchmarks/humaneval.js +279 -16
- package/dist/benchmarks/humaneval.js.map +1 -1
- package/dist/benchmarks/mind2web.d.ts +7 -34
- package/dist/benchmarks/mind2web.js +257 -8
- package/dist/benchmarks/mind2web.js.map +1 -1
- package/dist/benchmarks/nomiracl.d.ts +4 -13
- package/dist/benchmarks/nomiracl.js +146 -8
- package/dist/benchmarks/nomiracl.js.map +1 -1
- package/dist/benchmarks/open-rag-bench.d.ts +4 -12
- package/dist/benchmarks/open-rag-bench.js +110 -8
- package/dist/benchmarks/open-rag-bench.js.map +1 -1
- package/dist/benchmarks/programbench.d.ts +5 -29
- package/dist/benchmarks/programbench.js +161 -9
- package/dist/benchmarks/programbench.js.map +1 -1
- package/dist/benchmarks/rag-shared.d.ts +21 -20
- package/dist/benchmarks/rag-shared.js +245 -38
- package/dist/benchmarks/rag-shared.js.map +1 -1
- package/dist/benchmarks/ragbench.d.ts +4 -14
- package/dist/benchmarks/ragbench.js +127 -8
- package/dist/benchmarks/ragbench.js.map +1 -1
- package/dist/benchmarks/simpleqa.d.ts +17 -44
- package/dist/benchmarks/simpleqa.js +293 -10
- package/dist/benchmarks/simpleqa.js.map +1 -1
- package/dist/benchmarks/swe-bench.d.ts +23 -36
- package/dist/benchmarks/swe-bench.js +234 -13
- package/dist/benchmarks/swe-bench.js.map +1 -1
- package/dist/benchmarks/t2-ragbench.d.ts +4 -12
- package/dist/benchmarks/t2-ragbench.js +118 -8
- package/dist/benchmarks/t2-ragbench.js.map +1 -1
- package/dist/benchmarks/tau-bench-shared.d.ts +14 -22
- package/dist/benchmarks/tau-bench-shared.js +169 -9
- package/dist/benchmarks/tau-bench-shared.js.map +1 -1
- package/dist/benchmarks/tau2-bench.d.ts +5 -5
- package/dist/benchmarks/tau2-bench.js +28 -10
- package/dist/benchmarks/tau2-bench.js.map +1 -1
- package/dist/benchmarks/tau3-banking.d.ts +4 -13
- package/dist/benchmarks/tau3-banking.js +28 -8
- package/dist/benchmarks/tau3-banking.js.map +1 -1
- package/dist/benchmarks/terminal-bench.d.ts +4 -22
- package/dist/benchmarks/terminal-bench.js +140 -7
- package/dist/benchmarks/terminal-bench.js.map +1 -1
- package/dist/benchmarks/toollm.d.ts +5 -13
- package/dist/benchmarks/toollm.js +184 -9
- package/dist/benchmarks/toollm.js.map +1 -1
- package/dist/benchmarks/trata-hedge.d.ts +4 -30
- package/dist/benchmarks/trata-hedge.js +336 -6
- package/dist/benchmarks/trata-hedge.js.map +1 -1
- package/dist/benchmarks/types.d.ts +85 -94
- package/dist/benchmarks/types.js +1 -1
- package/dist/benchmarks/webarena-verified.d.ts +5 -13
- package/dist/benchmarks/webarena-verified.js +152 -9
- package/dist/benchmarks/webarena-verified.js.map +1 -1
- package/dist/cadbench-DpQWZHp4.js +285 -0
- package/dist/cadbench-DpQWZHp4.js.map +1 -0
- package/dist/cadgenbench-DRhczfsG.js +151 -0
- package/dist/cadgenbench-DRhczfsG.js.map +1 -0
- package/dist/index.d.ts +245 -293
- package/dist/index.js +1669 -1791
- package/dist/index.js.map +1 -1
- package/package.json +17 -14
- package/scripts/verify-packed-consumer.mjs +20 -17
- package/src/corpus.test.mts +13 -0
- package/src/corpus.ts +4 -0
- package/src/profile-coordinates.ts +2 -2
- package/src/rollout-ledger/backfill-swe-arena.mts +5 -1
- package/src/rollout-ledger/settle-capture.mts +7 -1
- package/src/search-bench/profiles.ts +1 -1
- package/src/skill-sandbox-smoke.mts +2 -1
- package/src/swe-arena/gepa-seat.mts +1 -1
- package/src/swe-arena/ledger-orphans.test.mts +36 -34
- package/dist/benchmarks/cadbench.js.map +0 -1
- package/dist/benchmarks/cadgenbench.js.map +0 -1
- package/dist/benchmarks/types.js.map +0 -1
- package/dist/chunk-53UPUNBZ.js +0 -325
- package/dist/chunk-53UPUNBZ.js.map +0 -1
- package/dist/chunk-5FEQDSCT.js +0 -211
- package/dist/chunk-5FEQDSCT.js.map +0 -1
- package/dist/chunk-5H5XV76F.js +0 -240
- package/dist/chunk-5H5XV76F.js.map +0 -1
- package/dist/chunk-67ACKDCX.js +0 -118
- package/dist/chunk-67ACKDCX.js.map +0 -1
- package/dist/chunk-7FKBWOQT.js +0 -147
- package/dist/chunk-7FKBWOQT.js.map +0 -1
- package/dist/chunk-BEN6IF2X.js +0 -221
- package/dist/chunk-BEN6IF2X.js.map +0 -1
- package/dist/chunk-BZY5QARD.js +0 -120
- package/dist/chunk-BZY5QARD.js.map +0 -1
- package/dist/chunk-C7T7WEK2.js +0 -103
- package/dist/chunk-C7T7WEK2.js.map +0 -1
- package/dist/chunk-CLIKAXKH.js +0 -276
- package/dist/chunk-CLIKAXKH.js.map +0 -1
- package/dist/chunk-CWIOBFSP.js +0 -197
- package/dist/chunk-CWIOBFSP.js.map +0 -1
- package/dist/chunk-CXDUTWQE.js +0 -318
- package/dist/chunk-CXDUTWQE.js.map +0 -1
- package/dist/chunk-DWALFME7.js +0 -182
- package/dist/chunk-DWALFME7.js.map +0 -1
- package/dist/chunk-EEOC6QPJ.js +0 -144
- package/dist/chunk-EEOC6QPJ.js.map +0 -1
- package/dist/chunk-EIETHPD5.js +0 -321
- package/dist/chunk-EIETHPD5.js.map +0 -1
- package/dist/chunk-GC2EPS6L.js +0 -130
- package/dist/chunk-GC2EPS6L.js.map +0 -1
- package/dist/chunk-GCHL6XPM.js +0 -169
- package/dist/chunk-GCHL6XPM.js.map +0 -1
- package/dist/chunk-HQ5HCCKF.js +0 -142
- package/dist/chunk-HQ5HCCKF.js.map +0 -1
- package/dist/chunk-HVW25KSX.js +0 -208
- package/dist/chunk-HVW25KSX.js.map +0 -1
- package/dist/chunk-INNOYXCP.js +0 -387
- package/dist/chunk-INNOYXCP.js.map +0 -1
- package/dist/chunk-J6BU3NTM.js +0 -251
- package/dist/chunk-J6BU3NTM.js.map +0 -1
- package/dist/chunk-JSQOUKXS.js +0 -149
- package/dist/chunk-JSQOUKXS.js.map +0 -1
- package/dist/chunk-JTHWEDEW.js +0 -32
- package/dist/chunk-JTHWEDEW.js.map +0 -1
- package/dist/chunk-NRMGT25X.js +0 -116
- package/dist/chunk-NRMGT25X.js.map +0 -1
- package/dist/chunk-PA2ZKHJC.js +0 -230
- package/dist/chunk-PA2ZKHJC.js.map +0 -1
- package/dist/chunk-PUIRNYI7.js +0 -189
- package/dist/chunk-PUIRNYI7.js.map +0 -1
- package/dist/chunk-QZZEAHWJ.js +0 -136
- package/dist/chunk-QZZEAHWJ.js.map +0 -1
- package/dist/chunk-SEVJPLZC.js +0 -260
- package/dist/chunk-SEVJPLZC.js.map +0 -1
- package/dist/chunk-TBKU5XQI.js +0 -228
- package/dist/chunk-TBKU5XQI.js.map +0 -1
- package/dist/chunk-UPAMRDX4.js +0 -233
- package/dist/chunk-UPAMRDX4.js.map +0 -1
- package/dist/chunk-VQRS7VUC.js +0 -342
- package/dist/chunk-VQRS7VUC.js.map +0 -1
- package/dist/chunk-WG7TM7UV.js +0 -30
- package/dist/chunk-WG7TM7UV.js.map +0 -1
- package/dist/chunk-X3BTXCJ4.js +0 -262
- package/dist/chunk-X3BTXCJ4.js.map +0 -1
- package/dist/chunk-XXFF3RRD.js +0 -162
- package/dist/chunk-XXFF3RRD.js.map +0 -1
- package/dist/chunk-ZFNOM7WR.js +0 -27
- package/dist/chunk-ZFNOM7WR.js.map +0 -1
- package/dist/chunk-ZNCCYTFG.js +0 -170
- package/dist/chunk-ZNCCYTFG.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,235 +1,184 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The ONE harness → worker-client mapping for the bench layer. Every bench entrypoint
|
|
18
|
-
* (rsi.ts, run.ts, …) derives the `SandboxClient` the kernel's `runLoop` drives from a single
|
|
19
|
-
* selector instead of hand-rolling the branch:
|
|
20
|
-
*
|
|
21
|
-
* - `router` → OFF-BOX: a router chat-completion as the leaf executor, presented
|
|
22
|
-
* as a SandboxClient (no sandbox dependency). For deployable-checker
|
|
23
|
-
* domains whose worker is a completion, or where box egress is blocked.
|
|
24
|
-
* - `router` + searchProvider → OFF-BOX `router-tools`: the same off-box loop with a live
|
|
25
|
-
* `web_search` tool (the capability axis research benches need).
|
|
26
|
-
* - `bridge` → OFF-BOX: a local cli-bridge fronting a harness CLI
|
|
27
|
-
* (opencode/kimi-code/…) as the leaf executor. Same resumable
|
|
28
|
-
* `bridgeExecutor` the supervisor uses; harness+model ride the
|
|
29
|
-
* bridge `model` id (`${harness}/${model}`).
|
|
30
|
-
* - anything else (`sandbox`/a BackendType) → IN-BOX: a real `Sandbox`. The in-box backend
|
|
31
|
-
* TYPE (opencode/codex/…) is set separately on the `AgentRunSpec`;
|
|
32
|
-
* this only decides off-box-vs-in-box transport for `runLoop`.
|
|
33
|
-
*
|
|
34
|
-
* Centralizing it here means a new entrypoint gets the full off-box/in-box matrix for free and
|
|
35
|
-
* the mapping can't drift between callers.
|
|
36
|
-
*/
|
|
37
|
-
|
|
1
|
+
import { BenchScore, BenchTask, BenchmarkAdapter, JudgeArtifactFileReceipt, JudgeArtifactReceipt, LoadOptions } from "./benchmarks/types.js";
|
|
2
|
+
import { ADAPTERS, resolveAdapter } from "./adapters.js";
|
|
3
|
+
import { StagedJudgeError, StagedRunCaptureSpec, StagedRunSpec, runStagedJudge } from "./benchmarks/_harness.js";
|
|
4
|
+
import { createCragAdapter } from "./benchmarks/crag.js";
|
|
5
|
+
import { createNoMiraclAdapter } from "./benchmarks/nomiracl.js";
|
|
6
|
+
import { createOpenRagBenchAdapter } from "./benchmarks/open-rag-bench.js";
|
|
7
|
+
import { FINAL_ANSWER_SENTINEL, RagAnswerScore, RagContext, answerScoreToBenchScore, contextBlock, contextsFrom, normalizeAnswer, parseCitations, parseFinalAnswer, ragAnswerOutput, scoreAnswerArtifact, tokenF1 } from "./benchmarks/rag-shared.js";
|
|
8
|
+
import { createRagBenchAdapter } from "./benchmarks/ragbench.js";
|
|
9
|
+
import { SweBenchAdapterOptions, SweBenchArtifactCaptureContext, SweBenchCacheLevel, createSweBenchAdapter, scoreSweReport, sweEvaluationArgv, swePatchOutput } from "./benchmarks/swe-bench.js";
|
|
10
|
+
import { createT2RagBenchAdapter } from "./benchmarks/t2-ragbench.js";
|
|
11
|
+
import { AgentProfile, SandboxClient } from "@tangle-network/agent-runtime/loops";
|
|
12
|
+
import { AgentCandidateBenchmarkGraderPort, AgentCandidateExecutionClaimStore, AgentCandidateExecutorPort, AgentCandidateExecutorRequest, AgentCandidateExecutorStopRequest, AgentCandidateOutputArtifactPort, AgentCandidateRunFinalization, PreparedAgentCandidateExecution } from "@tangle-network/agent-runtime";
|
|
13
|
+
import { TraceStore } from "@tangle-network/agent-eval";
|
|
14
|
+
//#region src/resolve-client.d.ts
|
|
38
15
|
interface ResolveBenchClientOptions {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
16
|
+
/** The selector (the `BACKEND` env value): `router` = off-box; anything else = in-box Sandbox. */
|
|
17
|
+
backend: string;
|
|
18
|
+
routerBaseUrl: string;
|
|
19
|
+
routerKey: string;
|
|
20
|
+
model: string;
|
|
21
|
+
/** When set on the `router` backend, the off-box worker becomes a `router-tools` agentic loop
|
|
22
|
+
* with a live `web_search` tool backed by this provider (`you`/`exa`/…). */
|
|
23
|
+
searchProvider?: string;
|
|
24
|
+
sandboxBaseUrl?: string;
|
|
25
|
+
/** In-box sandbox timeout (ms). Also the per-turn deadline for the `bridge` backend. */
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
/** `bridge` backend: cli-bridge base URL. Defaults to `http://127.0.0.1:3355`. */
|
|
28
|
+
bridgeUrl?: string;
|
|
29
|
+
/** `bridge` backend: bearer the bridge requires. Falls back to `routerKey` when unset. */
|
|
30
|
+
bridgeBearer?: string;
|
|
54
31
|
}
|
|
55
32
|
declare function resolveBenchClient(opts: ResolveBenchClientOptions): SandboxClient;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* `runBenchmarks` — the bench unifier.
|
|
59
|
-
*
|
|
60
|
-
* `gate.ts` runs ONE adapter as a diverse-vs-blind research gate through the recursive atom.
|
|
61
|
-
* This is the other half it references: run a SUBSET of the registry's benchmarks over a MATRIX of
|
|
62
|
-
* agent cells (harness × model × persona), each scored by the benchmark's OWN deterministic judge,
|
|
63
|
-
* and return a ranked leaderboard. It is the "which harness/model/persona combination wins on which
|
|
64
|
-
* benchmark" question, answered over an arbitrary subset in one call.
|
|
65
|
-
*
|
|
66
|
-
* It owns no new mechanism. Each cell is one `openSandboxRun` shot (the same per-run primitive the
|
|
67
|
-
* SWE worker uses) driven by `resolveBenchClient` (off-box router completion OR in-box Sandbox; the
|
|
68
|
-
* harness rides `sandboxOverrides.backend.type`). The deliverable is the adapter's OWN parser
|
|
69
|
-
* (`adapter.output`), defaulting to the final answer text — so `runBenchmarks` needs no
|
|
70
|
-
* per-benchmark branching. Concurrency is the shared `runPool`. The number comes from
|
|
71
|
-
* `adapter.judge`, never a self-authored judge.
|
|
72
|
-
*
|
|
73
|
-
* Subset = the `benchmarks` and `cells` arrays plus `n`/`ids`/`split`. A benchmark whose
|
|
74
|
-
* `preflight()` fails (missing Docker/venv/dataset) is recorded as unavailable and skipped — the
|
|
75
|
-
* sweep never aborts because one bench's harness is absent.
|
|
76
|
-
*
|
|
77
|
-
* const report = await runBenchmarks({
|
|
78
|
-
* benchmarks: ['humaneval', 'swe-bench'],
|
|
79
|
-
* cells: [
|
|
80
|
-
* { label: 'opencode/glm-4.6', model: 'glm-4.6', harness: 'opencode' },
|
|
81
|
-
* { label: 'codex/gpt-5', model: 'gpt-5', harness: 'codex' },
|
|
82
|
-
* ],
|
|
83
|
-
* routerBaseUrl, routerKey, n: 20,
|
|
84
|
-
* })
|
|
85
|
-
*/
|
|
86
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/run-benchmarks.d.ts
|
|
87
35
|
/** One agent under test: a profile (prompt/tools/persona) plus the harness + model that run it. */
|
|
88
36
|
interface BenchCell {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
37
|
+
/** Leaderboard row label, e.g. `opencode/glm-4.6` or `tax-agent@v1`. */
|
|
38
|
+
readonly label: string;
|
|
39
|
+
/** Model id for this cell. */
|
|
40
|
+
readonly model: string;
|
|
41
|
+
/** Coding harness for the in-box path (`opencode`/`codex`/`claude-code`/`kimi-code`). Defaults to
|
|
42
|
+
* `profile.metadata.backendType`, then `opencode`. Ignored on the `router` transport. */
|
|
43
|
+
readonly harness?: string;
|
|
44
|
+
/** Transport: `router` (off-box completion, default), `sandbox`, or a BackendType for in-box. */
|
|
45
|
+
readonly backend?: string;
|
|
46
|
+
/** Web-search provider for the `router` transport (turns the leaf into a `router-tools` loop). */
|
|
47
|
+
readonly searchProvider?: string;
|
|
48
|
+
/** The agent under test. Defaults to a minimal `{ name, metadata.backendType }` profile. */
|
|
49
|
+
readonly profile?: AgentProfile;
|
|
102
50
|
}
|
|
103
51
|
/** Runs one (adapter, task, cell) shot and returns the deliverable text. The default uses
|
|
104
52
|
* `openSandboxRun`; tests inject a deterministic stub so the matrix runs offline. */
|
|
105
53
|
type BenchShot = (input: {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
54
|
+
readonly adapter: BenchmarkAdapter;
|
|
55
|
+
readonly task: BenchTask;
|
|
56
|
+
readonly cell: BenchCell;
|
|
57
|
+
/** Prompt to hand to the worker. Defaults to `task.prompt`; looped runs pass revised prompts. */
|
|
58
|
+
readonly prompt?: string;
|
|
59
|
+
/** 1-based attempt index for looped runs. */
|
|
60
|
+
readonly attempt?: number;
|
|
61
|
+
readonly routerBaseUrl: string;
|
|
62
|
+
readonly routerKey: string;
|
|
63
|
+
readonly bridgeUrl?: string;
|
|
64
|
+
readonly bridgeBearer?: string;
|
|
65
|
+
readonly sandboxBaseUrl?: string;
|
|
66
|
+
readonly timeoutMs?: number;
|
|
67
|
+
readonly resolveClient?: typeof resolveBenchClient;
|
|
120
68
|
}) => Promise<{
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
69
|
+
artifact: string;
|
|
70
|
+
ok: boolean;
|
|
71
|
+
detail?: string;
|
|
124
72
|
}>;
|
|
125
73
|
interface RunBenchmarksOptions {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
74
|
+
/** Registry keys (`resolveAdapter`) — the benchmark subset to run. */
|
|
75
|
+
readonly benchmarks: readonly string[];
|
|
76
|
+
/** The agent cells to rank. */
|
|
77
|
+
readonly cells: readonly BenchCell[];
|
|
78
|
+
readonly routerBaseUrl: string;
|
|
79
|
+
readonly routerKey: string;
|
|
80
|
+
readonly bridgeUrl?: string;
|
|
81
|
+
readonly bridgeBearer?: string;
|
|
82
|
+
readonly sandboxBaseUrl?: string;
|
|
83
|
+
/** Tasks per benchmark (the n). */
|
|
84
|
+
readonly n?: number;
|
|
85
|
+
readonly ids?: string[];
|
|
86
|
+
readonly split?: string;
|
|
87
|
+
/** Replicates per (benchmark × cell × task). Default 1. */
|
|
88
|
+
readonly reps?: number;
|
|
89
|
+
/** Bounded concurrency across all shots. Default 4. */
|
|
90
|
+
readonly concurrency?: number;
|
|
91
|
+
/** Per-shot wall-clock (ms). */
|
|
92
|
+
readonly timeoutMs?: number;
|
|
93
|
+
/** Test seam: resolve the runtime transport. Defaults to `resolveBenchClient`. */
|
|
94
|
+
readonly resolveClient?: typeof resolveBenchClient;
|
|
95
|
+
/** Max attempts per (benchmark × cell × task). Default 1. Attempts after the first receive
|
|
96
|
+
* non-answer checker feedback and the previous artifacts; the loop stops early on pass. */
|
|
97
|
+
readonly loopAttempts?: number;
|
|
98
|
+
/** Self-verify each benchmark's judge against its gold artifact on the first task before spending
|
|
99
|
+
* model tokens; a benchmark whose judge rejects its own gold is recorded unavailable. Default true. */
|
|
100
|
+
readonly verifyJudge?: boolean;
|
|
101
|
+
/** Test seam: a deterministic shot runner. Defaults to the `openSandboxRun` leaf. */
|
|
102
|
+
readonly runShot?: BenchShot;
|
|
103
|
+
/** Test seam: resolve a benchmark key to an adapter. Defaults to the registry `resolveAdapter`. */
|
|
104
|
+
readonly resolveAdapter?: (key: string) => BenchmarkAdapter;
|
|
105
|
+
readonly onResult?: (r: BenchCellTaskResult) => void;
|
|
158
106
|
}
|
|
159
107
|
interface BenchCellTaskResult {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
108
|
+
readonly benchmark: string;
|
|
109
|
+
readonly cell: string;
|
|
110
|
+
readonly taskId: string;
|
|
111
|
+
readonly rep: number;
|
|
112
|
+
readonly resolved: boolean;
|
|
113
|
+
readonly score: number;
|
|
114
|
+
/** false = the shot threw or produced no artifact (infra/empty), excluded from the resolve
|
|
115
|
+
* denominator so a harness outage can't masquerade as a 0% capability result. */
|
|
116
|
+
readonly ok: boolean;
|
|
117
|
+
readonly detail?: string;
|
|
118
|
+
readonly wallMs: number;
|
|
171
119
|
}
|
|
172
120
|
interface BenchLeaderboardRow {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
121
|
+
readonly benchmark: string;
|
|
122
|
+
readonly cell: string;
|
|
123
|
+
readonly n: number;
|
|
124
|
+
readonly resolved: number;
|
|
125
|
+
readonly errored: number;
|
|
126
|
+
/** resolved / (n - errored). */
|
|
127
|
+
readonly resolveRate: number;
|
|
128
|
+
/** Mean graded score over non-errored shots (partial credit where the judge supports it). */
|
|
129
|
+
readonly meanScore: number;
|
|
182
130
|
}
|
|
183
131
|
interface RunBenchmarksReport {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
132
|
+
/** One row per (benchmark × cell), sorted by benchmark then descending resolveRate. */
|
|
133
|
+
readonly rows: readonly BenchLeaderboardRow[];
|
|
134
|
+
readonly perTask: readonly BenchCellTaskResult[];
|
|
135
|
+
readonly benchmarks: readonly string[];
|
|
136
|
+
readonly cells: readonly string[];
|
|
137
|
+
/** Benchmarks skipped because `preflight`/judge-self-check failed, with the reason. */
|
|
138
|
+
readonly unavailable: ReadonlyArray<{
|
|
139
|
+
readonly benchmark: string;
|
|
140
|
+
readonly reason: string;
|
|
141
|
+
}>;
|
|
194
142
|
}
|
|
195
143
|
declare function runBenchmarks(opts: RunBenchmarksOptions): Promise<RunBenchmarksReport>;
|
|
196
144
|
/** Render the leaderboard as a fixed-width table for a CLI/log. */
|
|
197
145
|
declare function printBenchmarksReport(report: RunBenchmarksReport): string;
|
|
198
|
-
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/pier-agent.d.ts
|
|
199
148
|
interface StagePreparedPierCandidateOptions {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
149
|
+
readonly prepared: PreparedAgentCandidateExecution;
|
|
150
|
+
/** Evaluator-owned directory persisted with the Pier trial. */
|
|
151
|
+
readonly directory: string;
|
|
152
|
+
/** Exact Pier package version pinned by the experiment contract. */
|
|
153
|
+
readonly pierVersion: string;
|
|
205
154
|
}
|
|
206
155
|
interface StagedPierCandidateExecution {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
156
|
+
readonly executionId: string;
|
|
157
|
+
readonly directory: string;
|
|
158
|
+
readonly taskDirectory: string;
|
|
159
|
+
readonly candidateDirectory?: string;
|
|
160
|
+
readonly profileDirectory: string;
|
|
161
|
+
readonly planPath: string;
|
|
162
|
+
readonly receiptPath: string;
|
|
163
|
+
readonly agentArgs: readonly string[];
|
|
164
|
+
/** Executor-only model and trace bindings; never present on the prepared object or disk. */
|
|
165
|
+
readonly evaluatorEnv: Readonly<Record<string, string>>;
|
|
166
|
+
/** One prepared execution is exactly one Pier trial attempt. */
|
|
167
|
+
readonly attemptArgs: readonly ['--n-attempts', '1', '--max-retries', '0'];
|
|
219
168
|
}
|
|
220
169
|
interface PierCandidateTerminationAcknowledgement {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
170
|
+
/** The Pier process has exited and has been reaped. */
|
|
171
|
+
readonly processExited: true;
|
|
172
|
+
/** Every task container created for this one trial has been removed. */
|
|
173
|
+
readonly containersRemoved: true;
|
|
225
174
|
}
|
|
226
175
|
interface PierCandidateTrialHandle {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
176
|
+
/** Non-secret durable identity shared with a fresh evaluator process. */
|
|
177
|
+
readonly identity: PierCandidateTrialIdentity;
|
|
178
|
+
/** Resolves only after the Pier process exits and its task container is gone. */
|
|
179
|
+
readonly result: Promise<PierCandidateTrialResult>;
|
|
180
|
+
/** Idempotently kill/reap Pier and remove its task container, then acknowledge their death. */
|
|
181
|
+
readonly terminateAndWait: () => Promise<PierCandidateTerminationAcknowledgement>;
|
|
233
182
|
}
|
|
234
183
|
type PierCandidateTrialIdentity = Readonly<AgentCandidateExecutorStopRequest>;
|
|
235
184
|
/**
|
|
@@ -237,119 +186,122 @@ type PierCandidateTrialIdentity = Readonly<AgentCandidateExecutorStopRequest>;
|
|
|
237
186
|
* handle returned by `start`.
|
|
238
187
|
*/
|
|
239
188
|
interface PierCandidateTrialController {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
189
|
+
start(staged: StagedPierCandidateExecution, context: {
|
|
190
|
+
readonly request: AgentCandidateExecutorRequest;
|
|
191
|
+
readonly traceStore: TraceStore;
|
|
192
|
+
readonly signal: AbortSignal;
|
|
193
|
+
readonly deadlineAtMs: number;
|
|
194
|
+
}): PierCandidateTrialHandle;
|
|
195
|
+
terminateAndWait(identity: PierCandidateTrialIdentity): Promise<PierCandidateTerminationAcknowledgement>;
|
|
196
|
+
/** Read immutable official bytes after termination; undefined proves no result was emitted. */
|
|
197
|
+
captureResult(identity: PierCandidateTrialIdentity): Promise<PierCandidateTrialResult | undefined>;
|
|
249
198
|
}
|
|
250
199
|
/** Evaluator-owned bytes captured from one completed official Pier trial. */
|
|
251
200
|
interface PierCandidateTrialResult {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
201
|
+
/** Parsed value of the exact `result.json` bytes. */
|
|
202
|
+
readonly value: unknown;
|
|
203
|
+
/** Exact official `result.json` bytes used as grader evidence. */
|
|
204
|
+
readonly resultBytes: Uint8Array;
|
|
205
|
+
/** Exact `/logs/artifacts/model.patch` bytes emitted before official tests. */
|
|
206
|
+
readonly taskPatch: Uint8Array;
|
|
258
207
|
}
|
|
259
208
|
interface PierCandidateOfficialResult {
|
|
260
|
-
|
|
261
|
-
|
|
209
|
+
readonly value: unknown;
|
|
210
|
+
readonly bytes: Uint8Array;
|
|
262
211
|
}
|
|
263
212
|
type RuntimeGraderInput = Parameters<AgentCandidateBenchmarkGraderPort['run']>[0];
|
|
264
213
|
type RuntimeGraderResult = Awaited<ReturnType<AgentCandidateBenchmarkGraderPort['run']>>;
|
|
265
214
|
/** Executes the exact admitted grader bytes against the official Pier result. */
|
|
266
215
|
interface PierCandidateGraderPort {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
216
|
+
readonly name: string;
|
|
217
|
+
readonly version: string;
|
|
218
|
+
readonly artifact: AgentCandidateBenchmarkGraderPort['artifact'];
|
|
219
|
+
run(input: RuntimeGraderInput & {
|
|
220
|
+
readonly officialResult: PierCandidateOfficialResult;
|
|
221
|
+
}): Promise<RuntimeGraderResult>;
|
|
273
222
|
}
|
|
274
223
|
interface ExecutePreparedPierCandidateOptions extends StagePreparedPierCandidateOptions {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
224
|
+
readonly traceStore: TraceStore;
|
|
225
|
+
/** Durable one-shot store shared by every process capable of running this benchmark. */
|
|
226
|
+
readonly claimStore: AgentCandidateExecutionClaimStore;
|
|
227
|
+
readonly outputArtifacts: AgentCandidateOutputArtifactPort;
|
|
228
|
+
readonly grader: PierCandidateGraderPort;
|
|
229
|
+
/**
|
|
230
|
+
* Starts exactly one Pier trial synchronously and persists its non-secret
|
|
231
|
+
* process/container identity before returning.
|
|
232
|
+
*/
|
|
233
|
+
readonly controller: PierCandidateTrialController;
|
|
285
234
|
}
|
|
286
235
|
/** Recovery-only runtime executor for an expired attempt owned by another process. */
|
|
287
236
|
declare function createPierCandidateRecoveryExecutor(controller: PierCandidateTrialController): AgentCandidateExecutorPort;
|
|
288
237
|
/** Execute and finalize through the runtime's only gradable candidate path. */
|
|
289
238
|
declare function executePreparedPierCandidate(options: ExecutePreparedPierCandidateOptions): Promise<AgentCandidateRunFinalization>;
|
|
290
|
-
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/pier-trial-controller.d.ts
|
|
291
241
|
interface PierCandidateProcessSpec {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
242
|
+
/** Returns launch data only. The controller, not this callback, starts the process. */
|
|
243
|
+
readonly command: string;
|
|
244
|
+
readonly args: readonly string[];
|
|
245
|
+
readonly cwd: string;
|
|
246
|
+
/** Exact Pier child environment. The controller adds its Docker connection variables. */
|
|
247
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
248
|
+
readonly jobsDirectory: string;
|
|
249
|
+
/** Must be unique: the controller atomically reserves this Pier job directory. */
|
|
250
|
+
readonly jobName: string;
|
|
251
|
+
readonly dockerCommand?: string;
|
|
252
|
+
/** Called only by the originating process after the supervisor reports clean exit. */
|
|
253
|
+
readonly readResult: () => Promise<PierCandidateTrialResult>;
|
|
304
254
|
}
|
|
305
255
|
interface PierDockerConnection {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
256
|
+
/** Stable, non-secret name that every recovery worker maps to the same Docker endpoint. */
|
|
257
|
+
readonly id: string;
|
|
258
|
+
/** Exact variables needed by both Pier and Docker cleanup; values are never persisted. */
|
|
259
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
310
260
|
}
|
|
311
261
|
interface FilePierCandidateTrialControllerOptions {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
262
|
+
/** Shared evaluator-owned control root, available to crash-recovery workers. */
|
|
263
|
+
readonly directory: string;
|
|
264
|
+
readonly launch?: (staged: StagedPierCandidateExecution, context: {
|
|
265
|
+
readonly request: AgentCandidateExecutorRequest;
|
|
266
|
+
readonly traceStore: TraceStore;
|
|
267
|
+
readonly signal: AbortSignal;
|
|
268
|
+
readonly deadlineAtMs: number;
|
|
269
|
+
}) => PierCandidateProcessSpec;
|
|
270
|
+
/** Restart-safe reader for immutable official bytes under the persisted Pier job identity. */
|
|
271
|
+
readonly readResult?: (input: {
|
|
272
|
+
readonly jobsDirectory: string;
|
|
273
|
+
readonly jobName: string;
|
|
274
|
+
}) => Promise<PierCandidateTrialResult | undefined>;
|
|
275
|
+
/** Omit only for the default local Docker socket with no environment variables. */
|
|
276
|
+
readonly dockerConnection?: PierDockerConnection;
|
|
277
|
+
readonly supervisorPath?: string;
|
|
278
|
+
readonly pollIntervalMs?: number;
|
|
329
279
|
}
|
|
330
280
|
declare class FilePierCandidateTrialController implements PierCandidateTrialController {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
281
|
+
private readonly directory;
|
|
282
|
+
private readonly launch?;
|
|
283
|
+
private readonly readResult?;
|
|
284
|
+
private readonly dockerConnection;
|
|
285
|
+
private readonly supervisorPath;
|
|
286
|
+
private readonly pollIntervalMs;
|
|
287
|
+
constructor(options: FilePierCandidateTrialControllerOptions);
|
|
288
|
+
start(staged: StagedPierCandidateExecution, context: {
|
|
289
|
+
readonly request: AgentCandidateExecutorRequest;
|
|
290
|
+
readonly traceStore: TraceStore;
|
|
291
|
+
readonly signal: AbortSignal;
|
|
292
|
+
readonly deadlineAtMs: number;
|
|
293
|
+
}): PierCandidateTrialHandle;
|
|
294
|
+
terminateAndWait(requested: PierCandidateTrialIdentity): Promise<PierCandidateTerminationAcknowledgement>;
|
|
295
|
+
captureResult(requested: PierCandidateTrialIdentity): Promise<PierCandidateTrialResult | undefined>;
|
|
296
|
+
private controlDirectory;
|
|
297
|
+
private assertDockerConnection;
|
|
298
|
+
private validateSpec;
|
|
299
|
+
private waitForResult;
|
|
300
|
+
private forceRecovery;
|
|
351
301
|
}
|
|
352
|
-
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/pier-result-grader.d.ts
|
|
353
304
|
declare function createPierResultGrader(descriptor: Pick<PierCandidateGraderPort, 'name' | 'version' | 'artifact'>): PierCandidateGraderPort;
|
|
354
|
-
|
|
355
|
-
export { type BenchCell, type BenchCellTaskResult, type BenchLeaderboardRow, type BenchShot, BenchTask, BenchmarkAdapter, type ExecutePreparedPierCandidateOptions, FilePierCandidateTrialController, type FilePierCandidateTrialControllerOptions, type PierCandidateGraderPort, type PierCandidateOfficialResult, type PierCandidateProcessSpec, type PierCandidateTerminationAcknowledgement, type PierCandidateTrialController, type PierCandidateTrialHandle, type PierCandidateTrialIdentity, type PierCandidateTrialResult, type PierDockerConnection, type RunBenchmarksOptions, type RunBenchmarksReport, type StagedPierCandidateExecution, createPierCandidateRecoveryExecutor, createPierResultGrader, executePreparedPierCandidate, printBenchmarksReport, runBenchmarks };
|
|
305
|
+
//#endregion
|
|
306
|
+
export { ADAPTERS, type BenchCell, type BenchCellTaskResult, type BenchLeaderboardRow, type BenchScore, type BenchShot, type BenchTask, type BenchmarkAdapter, type ExecutePreparedPierCandidateOptions, FINAL_ANSWER_SENTINEL, FilePierCandidateTrialController, type FilePierCandidateTrialControllerOptions, type JudgeArtifactFileReceipt, type JudgeArtifactReceipt, type LoadOptions, type PierCandidateGraderPort, type PierCandidateOfficialResult, type PierCandidateProcessSpec, type PierCandidateTerminationAcknowledgement, type PierCandidateTrialController, type PierCandidateTrialHandle, type PierCandidateTrialIdentity, type PierCandidateTrialResult, type PierDockerConnection, type RagAnswerScore, type RagContext, type RunBenchmarksOptions, type RunBenchmarksReport, StagedJudgeError, type StagedPierCandidateExecution, type StagedRunCaptureSpec, type StagedRunSpec, type SweBenchAdapterOptions, type SweBenchArtifactCaptureContext, type SweBenchCacheLevel, answerScoreToBenchScore, contextBlock, contextsFrom, createCragAdapter, createNoMiraclAdapter, createOpenRagBenchAdapter, createPierCandidateRecoveryExecutor, createPierResultGrader, createRagBenchAdapter, createSweBenchAdapter, createT2RagBenchAdapter, executePreparedPierCandidate, normalizeAnswer, parseCitations, parseFinalAnswer, printBenchmarksReport, ragAnswerOutput, resolveAdapter, runBenchmarks, runStagedJudge, scoreAnswerArtifact, scoreSweReport, sweEvaluationArgv, swePatchOutput, tokenF1 };
|
|
307
|
+
//# sourceMappingURL=index.d.ts.map
|