@leostera/evalkit 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +114 -1
- package/README.md +3 -2
- package/dist/cli.mjs +311 -92
- package/dist/dashboard/assets/index-CFJzcw3o.css +2 -0
- package/dist/dashboard/assets/{index-By1SJ1on.js → index-DgoX2x_M.js} +34 -31
- package/dist/dashboard/index.html +2 -2
- package/dist/{index-db-BbVblaHz.mjs → index-db-DI7xKMSX.mjs} +237 -47
- package/dist/index.d.mts +1141 -220
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +241 -52
- package/dist/runner.d.mts +782 -225
- package/dist/runner.d.mts.map +1 -1
- package/dist/runner.mjs +2 -2
- package/dist/share-worker.d.mts +1 -1
- package/dist/share-worker.d.mts.map +1 -1
- package/dist/share-worker.mjs +1 -1
- package/dist/share.d.mts +9 -6
- package/dist/share.d.mts.map +1 -1
- package/dist/share.mjs +2 -2
- package/dist/skills/evalkit/SKILL.md +3 -3
- package/dist/skills/evalkit-agents/SKILL.md +3 -3
- package/dist/skills/evalkit-datasets/SKILL.md +1 -1
- package/dist/skills/evalkit-evals/SKILL.md +1 -1
- package/dist/skills/evalkit-judges/SKILL.md +4 -4
- package/dist/skills/evalkit-results/SKILL.md +2 -2
- package/dist/{src-Bn6fnZnF.mjs → src-CXzbHAKN.mjs} +1 -1
- package/dist/{src-BrfIXfO2.mjs → src-D6Ax2t9b.mjs} +636 -220
- package/dist/src-Dc3GXacB.mjs +3637 -0
- package/dist/upgrade-rMsGzUEJ.mjs +230 -0
- package/dist/upgrade-transcript-C8DUykLd.mjs +402 -0
- package/package.json +2 -1
- package/dist/dashboard/assets/index-geXMXCx9.css +0 -2
- package/dist/src-CcdLZqFk.mjs +0 -1714
- package/dist/upgrade-60SIRius.mjs +0 -110
package/dist/runner.d.mts
CHANGED
|
@@ -1,51 +1,6 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
1
|
import * as Schema from "effect/Schema";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly _tag: "AutExecutionError";
|
|
6
|
-
} & Readonly<A>;
|
|
7
|
-
export declare class AutExecutionError extends AutExecutionError_base<{
|
|
8
|
-
cause: unknown;
|
|
9
|
-
message?: string;
|
|
10
|
-
}> {}
|
|
11
|
-
declare const DatasetError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
12
|
-
readonly _tag: "DatasetError";
|
|
13
|
-
} & Readonly<A>;
|
|
14
|
-
export declare class DatasetError extends DatasetError_base<{
|
|
15
|
-
cause: unknown;
|
|
16
|
-
message?: string;
|
|
17
|
-
}> {}
|
|
18
|
-
declare const ReportError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
19
|
-
readonly _tag: "ReportError";
|
|
20
|
-
} & Readonly<A>;
|
|
21
|
-
export declare class ReportError extends ReportError_base<{
|
|
22
|
-
cause: unknown;
|
|
23
|
-
message?: string;
|
|
24
|
-
}> {}
|
|
25
|
-
declare const ScoringError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
26
|
-
readonly _tag: "ScoringError";
|
|
27
|
-
} & Readonly<A>;
|
|
28
|
-
export declare class ScoringError extends ScoringError_base<{
|
|
29
|
-
cause: unknown;
|
|
30
|
-
message?: string;
|
|
31
|
-
}> {}
|
|
32
|
-
declare const CheckpointExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
33
|
-
readonly _tag: "CheckpointExecutionError";
|
|
34
|
-
} & Readonly<A>;
|
|
35
|
-
export declare class CheckpointExecutionError extends CheckpointExecutionError_base<{
|
|
36
|
-
step: number;
|
|
37
|
-
name: string;
|
|
38
|
-
message: string;
|
|
39
|
-
cause: unknown;
|
|
40
|
-
}> {}
|
|
41
|
-
declare const CancelledError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
42
|
-
readonly _tag: "CancelledError";
|
|
43
|
-
} & Readonly<A>;
|
|
44
|
-
/** The run was cancelled (Ctrl+C); the run stops and is finalized as cancelled. */
|
|
45
|
-
export declare class CancelledError extends CancelledError_base<{
|
|
46
|
-
message: string;
|
|
47
|
-
}> {}
|
|
48
|
-
//#endregion
|
|
2
|
+
import { AssistantBlock, EntryRecord, MessageRecord, ModelRef, Origin, StopReason, Transcript, Transcript as Transcript$1, TreeRecord, TreeRecord as TreeRecord$1, Usage, UserBlock } from "@leostera/atxf";
|
|
3
|
+
import { Effect } from "effect";
|
|
49
4
|
//#region ../core/src/identity.d.ts
|
|
50
5
|
declare const ResourceKindSchema: Schema.Literal<["run", "artifact"]>;
|
|
51
6
|
type ResourceKind = typeof ResourceKindSchema.Type;
|
|
@@ -106,64 +61,337 @@ type Dataset = {
|
|
|
106
61
|
readonly source: DatasetSource;
|
|
107
62
|
};
|
|
108
63
|
//#endregion
|
|
109
|
-
//#region ../core/src/
|
|
64
|
+
//#region ../core/src/usage.d.ts
|
|
110
65
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
66
|
+
* Token usage as an adapter reports it: ATXF's buckets, each optional.
|
|
67
|
+
* The buckets are disjoint: `input` excludes cached tokens, which are
|
|
68
|
+
* `cacheRead` (read from a prompt cache) and `cacheWrite` (written to one);
|
|
69
|
+
* `output` includes `reasoning`. Convert your provider's conventions: one
|
|
70
|
+
* that counts cached tokens inside its prompt tokens reports
|
|
71
|
+
* `input: promptTokens - cachedTokens, cacheRead: cachedTokens`.
|
|
113
72
|
*/
|
|
114
|
-
type
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
73
|
+
type UsageInput = {
|
|
74
|
+
input?: number;
|
|
75
|
+
output?: number;
|
|
76
|
+
cacheRead?: number;
|
|
77
|
+
cacheWrite?: number;
|
|
78
|
+
reasoning?: number;
|
|
79
|
+
/** The provider's total; used only when no bucket is reported. */
|
|
80
|
+
total?: number;
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region ../core/src/agent-transcript.d.ts
|
|
84
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
85
|
+
/** An ATXF tree record to append: `id`, `time` and `parentId` are filled in when absent. */
|
|
86
|
+
type RecordInput = DistributiveOmit<TreeRecord, 'id' | 'time' | 'parentId' | 'hash'> & {
|
|
87
|
+
id?: string;
|
|
88
|
+
time?: string;
|
|
89
|
+
parentId?: string | null;
|
|
90
|
+
};
|
|
91
|
+
/** An assistant message: what the model said and the tools it called. */
|
|
92
|
+
type AssistantInput = {
|
|
93
|
+
/** Text, or ATXF blocks: `text`, `reasoning`, `tool_call` and `image`. */
|
|
94
|
+
content: string | AssistantBlock[];
|
|
95
|
+
/** `provider/id` (`openai/gpt-5`), or an ATXF model reference. */
|
|
96
|
+
model?: string | ModelRef;
|
|
97
|
+
/** This response's usage, in ATXF's buckets. */
|
|
98
|
+
usage?: UsageInput;
|
|
99
|
+
stop?: StopReason;
|
|
100
|
+
error?: {
|
|
101
|
+
message: string;
|
|
102
|
+
code?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Where an adapter records what its agent did, as an ATXF transcript
|
|
107
|
+
* (https://atxf.leostera.dev). Each method appends one record and returns
|
|
108
|
+
* its ID. EvalKit writes each scripted user message itself, unless the
|
|
109
|
+
* adapter writes it (or imports a transcript holding it) first.
|
|
110
|
+
*/
|
|
111
|
+
type TranscriptWriter = {
|
|
112
|
+
/** A message the agent received. */
|
|
113
|
+
user(content: string | UserBlock[], options?: {
|
|
114
|
+
origin?: Origin;
|
|
115
|
+
}): string;
|
|
116
|
+
assistant(message: AssistantInput): string;
|
|
117
|
+
/**
|
|
118
|
+
* A tool call's result. A string is the result's text; any other
|
|
119
|
+
* JSON-convertible value is kept as is in `details.result` and shown as
|
|
120
|
+
* JSON.
|
|
121
|
+
*/
|
|
122
|
+
toolResult(callId: string, result: unknown, options?: {
|
|
123
|
+
name?: string;
|
|
124
|
+
isError?: boolean;
|
|
125
|
+
}): string;
|
|
126
|
+
/** Any other ATXF tree record, such as `reasoning` settings, a compaction or a sub-agent link. */
|
|
127
|
+
append(record: RecordInput): string;
|
|
128
|
+
/**
|
|
129
|
+
* Appends an ATXF transcript's records that were not imported before (by
|
|
130
|
+
* ID), keeping their IDs and native records: for agents whose sessions
|
|
131
|
+
* ATXF converts (`pi.toAtxf(await readFile(sessionFile, 'utf8'))`, from `@leostera/atxf/pi`). Import the whole session
|
|
132
|
+
* after each turn; a user message matching the one EvalKit is about to
|
|
133
|
+
* write stands for it.
|
|
134
|
+
*/
|
|
135
|
+
import(transcript: Transcript): void;
|
|
136
|
+
/**
|
|
137
|
+
* Marks a turn's start or end, as the agent saw it: `turn('start')`
|
|
138
|
+
* returns a turn ID to pass to `turn('end', { turnId, outcome })`.
|
|
139
|
+
*/
|
|
140
|
+
turn(phase: 'start' | 'end', options?: {
|
|
141
|
+
turnId?: string;
|
|
142
|
+
outcome?: 'succeeded' | 'failed' | 'interrupted';
|
|
143
|
+
error?: {
|
|
144
|
+
message: string;
|
|
145
|
+
code?: string;
|
|
146
|
+
};
|
|
147
|
+
}): string;
|
|
148
|
+
/**
|
|
149
|
+
* Keeps a sub-agent's ATXF transcript with the run, in
|
|
150
|
+
* `transcripts/<id>.atxf.jsonl`, linked from this one by an `agent_link`
|
|
151
|
+
* record with its `transcriptId` (append one, or import a session that
|
|
152
|
+
* has it). Its steps and tokens count toward the run's limits. Pass the
|
|
153
|
+
* whole transcript again as it grows; it replaces the one kept.
|
|
154
|
+
*/
|
|
155
|
+
subagent(transcript: Transcript): void;
|
|
152
156
|
};
|
|
153
157
|
type TurnToolCall = {
|
|
154
158
|
name: string;
|
|
155
159
|
arguments?: unknown;
|
|
156
|
-
/** When given,
|
|
160
|
+
/** When given, the call's result is recorded after it. */
|
|
157
161
|
result?: unknown;
|
|
158
162
|
id?: string;
|
|
159
163
|
};
|
|
160
|
-
/** What `send()` may return instead of
|
|
164
|
+
/** What `send()` may return instead of writing to the transcript. A string is the reply. */
|
|
161
165
|
type TurnResult = string | {
|
|
166
|
+
/** Text, or a JSON value (recorded as its JSON text). */
|
|
162
167
|
reply?: unknown;
|
|
163
168
|
toolCalls?: readonly TurnToolCall[];
|
|
164
|
-
usage?:
|
|
169
|
+
usage?: UsageInput;
|
|
170
|
+
/** The model that answered. */
|
|
171
|
+
model?: string | ModelRef;
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region ../core/src/isolation.d.ts
|
|
175
|
+
/**
|
|
176
|
+
* Where a run's processes run, and the shell adapters and scorers use to
|
|
177
|
+
* run them (RFD0009). Types and constructors only: the runner implements
|
|
178
|
+
* them.
|
|
179
|
+
*/
|
|
180
|
+
/** Commands run on the host, in the run's workspace. The default. */
|
|
181
|
+
type NoIsolation = {
|
|
182
|
+
kind: 'none';
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* What a run's container can reach: nothing, only the project's fixtures,
|
|
186
|
+
* or whatever the container runtime allows by default.
|
|
187
|
+
*/
|
|
188
|
+
type ContainerNetwork = 'none' | 'fixtures' | 'full';
|
|
189
|
+
/** A host path mounted read-only into every run's container. */
|
|
190
|
+
type ContainerMount = {
|
|
191
|
+
host: string;
|
|
192
|
+
path: string;
|
|
193
|
+
};
|
|
194
|
+
/** One container per run, from `image`, with the candidate workspace at `/workspace`. */
|
|
195
|
+
type ContainerIsolation = {
|
|
196
|
+
kind: 'container';
|
|
197
|
+
/** An image reference (`node:22`), or a Dockerfile path relative to the project (`./evals/Dockerfile`). */
|
|
198
|
+
image: string;
|
|
199
|
+
network: ContainerNetwork;
|
|
200
|
+
/** The `docker`-compatible command to run: `docker` (the default) or `podman`. */
|
|
201
|
+
runtime: string;
|
|
202
|
+
/** Names of host environment variables passed into the container; nothing else is. */
|
|
203
|
+
env: readonly string[];
|
|
204
|
+
mounts: readonly ContainerMount[];
|
|
205
|
+
};
|
|
206
|
+
/** macOS only: each run's processes run under a generated `sandbox-exec` profile. */
|
|
207
|
+
type SandboxExecIsolation = {
|
|
208
|
+
kind: 'sandbox-exec';
|
|
209
|
+
/** Host paths the run may read and write besides its workspace, such as a cache (`~/.npm`). */
|
|
210
|
+
allow: readonly string[];
|
|
211
|
+
/** Host paths the run may only read, such as a toolchain or an agent CLI's install. */
|
|
212
|
+
read: readonly string[];
|
|
213
|
+
/** More host paths the run may not touch, such as a fixture's state; `allow` and `read` still win inside them. */
|
|
214
|
+
deny: readonly string[];
|
|
215
|
+
/**
|
|
216
|
+
* Names of host environment variables the run gets, besides `PATH`,
|
|
217
|
+
* `HOME`, `TMPDIR`, `USER`, `LANG` and `TERM`; undefined passes the whole
|
|
218
|
+
* environment. A command's own `env` is added on top.
|
|
219
|
+
*/
|
|
220
|
+
env?: readonly string[];
|
|
221
|
+
};
|
|
222
|
+
type Isolation = NoIsolation | ContainerIsolation | SandboxExecIsolation;
|
|
223
|
+
/**
|
|
224
|
+
* A service runs reach, such as a fake store or API, started on the host
|
|
225
|
+
* before the first run that needs it and stopped after the invocation's
|
|
226
|
+
* last.
|
|
227
|
+
*/
|
|
228
|
+
type Fixture = {
|
|
229
|
+
/** The command that starts it, run with `sh -c` in the project root. */
|
|
230
|
+
start: string;
|
|
231
|
+
/** A URL polled until it answers, or a command that must exit 0. */
|
|
232
|
+
ready?: string;
|
|
233
|
+
/** A command run before the fixture is stopped. */
|
|
234
|
+
stop?: string;
|
|
235
|
+
/** The port it listens on; taken from `ready` when that is a URL with one. */
|
|
236
|
+
port?: number;
|
|
237
|
+
};
|
|
238
|
+
/** A fixture as one run reaches it. */
|
|
239
|
+
type FixtureAddress = {
|
|
240
|
+
/** Where the run reaches it: `http://localhost:8787`, or `http://fixtures.<name>:8787` from a container. */
|
|
241
|
+
url: string;
|
|
242
|
+
};
|
|
243
|
+
/** A process's exit: a signal shows as 128 plus its number, a timeout as 124. */
|
|
244
|
+
type ShellExit = {
|
|
245
|
+
exitCode: number;
|
|
246
|
+
/** The signal that stopped it, if one did. */
|
|
247
|
+
signal?: string;
|
|
248
|
+
/** True when `timeoutMs` passed and the process was stopped. */
|
|
249
|
+
timedOut?: true;
|
|
250
|
+
};
|
|
251
|
+
type ShellResult = ShellExit & {
|
|
252
|
+
stdout: string;
|
|
253
|
+
stderr: string;
|
|
254
|
+
};
|
|
255
|
+
type ShellOptions = {
|
|
256
|
+
/** Relative to the workspace. */
|
|
257
|
+
cwd?: string;
|
|
258
|
+
/** Added to the environment the process gets. */
|
|
259
|
+
env?: Readonly<Record<string, string>>;
|
|
260
|
+
/** Stops the process when aborted. Default: the run's signal. */
|
|
261
|
+
signal?: AbortSignal;
|
|
262
|
+
/** Stops the process after this many milliseconds. */
|
|
263
|
+
timeoutMs?: number;
|
|
264
|
+
/** Written to the process's standard input, which is then closed. */
|
|
265
|
+
input?: string;
|
|
266
|
+
};
|
|
267
|
+
/** A process started with `spawn`. Its output is always read, so it never blocks on a full pipe. */
|
|
268
|
+
type ShellProcess = {
|
|
269
|
+
/** Its process ID where it runs (inside the container, for container isolation). */
|
|
270
|
+
readonly pid: number | undefined;
|
|
271
|
+
/** Its standard output so far: the last megabyte. */
|
|
272
|
+
stdout(): string;
|
|
273
|
+
stderr(): string;
|
|
274
|
+
/** Calls `listener` with each chunk of output as it arrives; returns a function that stops. */
|
|
275
|
+
onOutput(listener: (chunk: string, stream: 'stdout' | 'stderr') => void): () => void;
|
|
276
|
+
/** Resolves when it exits. */
|
|
277
|
+
wait(): Promise<ShellExit>;
|
|
278
|
+
/** Signals it and the processes it started. Default `SIGTERM`. */
|
|
279
|
+
kill(signal?: string): Promise<void>;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* The run's shell: commands, long-lived processes and files, wherever the
|
|
283
|
+
* run's isolation puts them. One per run, shared by the adapter and the
|
|
284
|
+
* run's scorers; processes it started are stopped when the run ends. A
|
|
285
|
+
* string command runs with `sh -c`; an array runs as it is.
|
|
286
|
+
*/
|
|
287
|
+
type Shell = {
|
|
288
|
+
readonly isolation: Isolation['kind'];
|
|
289
|
+
/** The workspace as commands see it: its host path, or `/workspace` in a container. */
|
|
290
|
+
readonly root: string;
|
|
291
|
+
/**
|
|
292
|
+
* The run's private directory, outside the workspace, as commands see it
|
|
293
|
+
* (`/evalkit-home` in a container): for an agent CLI's config and session
|
|
294
|
+
* files. It is never snapshotted, and is removed with the run.
|
|
295
|
+
*/
|
|
296
|
+
readonly home: string;
|
|
297
|
+
exec(command: string | readonly string[], options?: ShellOptions): Promise<ShellResult>;
|
|
298
|
+
spawn(command: string | readonly string[], options?: Omit<ShellOptions, 'timeoutMs'>): ShellProcess;
|
|
299
|
+
/** Relative to the workspace, or absolute inside `root` or `home`. */
|
|
300
|
+
readFile(path: string): Promise<string>;
|
|
301
|
+
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
302
|
+
/** A directory's entries, relative to the workspace; directories end with `/`. */
|
|
303
|
+
list(path?: string): Promise<string[]>;
|
|
304
|
+
};
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region ../core/src/limits.d.ts
|
|
307
|
+
/** What a run may use before EvalKit stops it. */
|
|
308
|
+
type Limits = {
|
|
309
|
+
/** Assistant messages, one per model call, sub-agents included. */
|
|
310
|
+
steps?: number;
|
|
311
|
+
/** The `tokens` metric: uncached input, cache writes and output. Cache reads do not count. */
|
|
312
|
+
tokens?: number;
|
|
313
|
+
/** Milliseconds from the session's start to the end of its last turn; scoring is not counted. */
|
|
314
|
+
time?: number;
|
|
315
|
+
};
|
|
316
|
+
type LimitKind = keyof Limits;
|
|
317
|
+
/** Limits as written in config and scenarios: `time` may be a duration such as `'20m'`. */
|
|
318
|
+
type LimitsInput = {
|
|
319
|
+
steps?: number;
|
|
320
|
+
tokens?: number;
|
|
321
|
+
/** Milliseconds, or `'90s'`, `'20m'`, `'1h'`. */
|
|
322
|
+
time?: number | string;
|
|
323
|
+
};
|
|
324
|
+
/** Which limit a run hit, its value, and how much was used. */
|
|
325
|
+
type LimitReached = {
|
|
326
|
+
limit: LimitKind;
|
|
327
|
+
value: number;
|
|
328
|
+
used: number;
|
|
329
|
+
};
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region ../core/src/transcript.d.ts
|
|
332
|
+
type AssistantMessage = MessageRecord & {
|
|
333
|
+
role: 'assistant';
|
|
165
334
|
};
|
|
166
335
|
//#endregion
|
|
336
|
+
//#region ../core/src/judge.d.ts
|
|
337
|
+
/**
|
|
338
|
+
* How a judge must answer, and how EvalKit turns the answer into a score.
|
|
339
|
+
*
|
|
340
|
+
* - `verdict` (the default): a value from 0 to 1 and a reason, as JSON.
|
|
341
|
+
* - `choices`: one of a fixed set of answers, such as A/B/C, each worth a value.
|
|
342
|
+
* - `criteria`: a value from 0 to 1 per criterion; the score is their weighted mean.
|
|
343
|
+
*/
|
|
344
|
+
type JudgeAnswer = {
|
|
345
|
+
kind: 'verdict';
|
|
346
|
+
} | {
|
|
347
|
+
kind: 'choices';
|
|
348
|
+
choices: JudgeChoice[];
|
|
349
|
+
} | {
|
|
350
|
+
kind: 'criteria';
|
|
351
|
+
criteria: JudgeCriterion[];
|
|
352
|
+
};
|
|
353
|
+
/** One answer a `choices` judge can give. Keys are matched case-insensitively. */
|
|
354
|
+
type JudgeChoice = {
|
|
355
|
+
key: string;
|
|
356
|
+
label: string;
|
|
357
|
+
value: number;
|
|
358
|
+
};
|
|
359
|
+
/** One thing a `criteria` judge scores. */
|
|
360
|
+
type JudgeCriterion = {
|
|
361
|
+
name: string;
|
|
362
|
+
weight: number;
|
|
363
|
+
description?: string;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* One criterion's result, as a scorer returns it and as results record it:
|
|
367
|
+
* a value with what it saw, or `reached: false` when the check never got to
|
|
368
|
+
* run, because something before it failed (say, the app would not start).
|
|
369
|
+
* A criterion not reached counts as 0; the score's `explanation` says why,
|
|
370
|
+
* once, instead of every criterion repeating it.
|
|
371
|
+
*/
|
|
372
|
+
type CriterionResult = ReachedCriterion | UnreachedCriterion;
|
|
373
|
+
type ReachedCriterion = {
|
|
374
|
+
name: string;
|
|
375
|
+
/** From 0 to 1. */
|
|
376
|
+
value: number;
|
|
377
|
+
/** Default 1, or the declared weight. */
|
|
378
|
+
weight?: number;
|
|
379
|
+
/** Why this value. */
|
|
380
|
+
explanation?: string;
|
|
381
|
+
/** What the check observed, as plain data. */
|
|
382
|
+
evidence?: JsonValue;
|
|
383
|
+
};
|
|
384
|
+
type UnreachedCriterion = {
|
|
385
|
+
name: string;
|
|
386
|
+
reached: false;
|
|
387
|
+
weight?: number;
|
|
388
|
+
explanation?: string;
|
|
389
|
+
};
|
|
390
|
+
/** A criterion as a scorer returns it: its evidence may be any plain value. */
|
|
391
|
+
type CriterionInput = (Omit<ReachedCriterion, 'evidence'> & {
|
|
392
|
+
evidence?: unknown;
|
|
393
|
+
}) | UnreachedCriterion;
|
|
394
|
+
//#endregion
|
|
167
395
|
//#region ../core/src/catalog.d.ts
|
|
168
396
|
type EvalCatalogAgent = {
|
|
169
397
|
name?: string;
|
|
@@ -215,10 +443,20 @@ type EvalCatalogDataset = {
|
|
|
215
443
|
type EvalCatalogScorer = {
|
|
216
444
|
name: string;
|
|
217
445
|
kind: ScoringRule['kind'];
|
|
446
|
+
/** What it checks, in the author's words. */
|
|
447
|
+
description?: string;
|
|
218
448
|
passAt?: number;
|
|
219
449
|
supportsPartial?: boolean;
|
|
220
450
|
/** Judges only. */
|
|
221
451
|
rubric?: string;
|
|
452
|
+
/** Judges only: the agent that judges (its own, or the project's default). */
|
|
453
|
+
agent?: EvalCatalogAgent;
|
|
454
|
+
/** Judges only: the names of the inputs it sees. */
|
|
455
|
+
inputs?: string[];
|
|
456
|
+
/** Judges only: how it answers. */
|
|
457
|
+
answer?: JudgeAnswer;
|
|
458
|
+
/** Judges only: the prompt it receives, with `{input}` placeholders. */
|
|
459
|
+
prompt?: string;
|
|
222
460
|
definedAt?: string;
|
|
223
461
|
};
|
|
224
462
|
type EvalCatalogStep =
|
|
@@ -251,9 +489,10 @@ type EvalCatalogEntry = {
|
|
|
251
489
|
/** Runs started each time the scenario runs (`repeat`). */
|
|
252
490
|
repeat: number;
|
|
253
491
|
policy: {
|
|
254
|
-
timeoutMs?: number;
|
|
255
492
|
failfast?: boolean;
|
|
256
493
|
};
|
|
494
|
+
/** The scenario's own limits; the project's, a cell's and `--limit` may add to them. */
|
|
495
|
+
limits?: Limits;
|
|
257
496
|
transcript: EvalCatalogStep[];
|
|
258
497
|
scorers: EvalCatalogScorer[];
|
|
259
498
|
metadata?: JsonValue;
|
|
@@ -287,6 +526,15 @@ type EvalMatrixDefinition = {
|
|
|
287
526
|
cases?: readonly JsonObject[];
|
|
288
527
|
/** Partial patterns over declared dimensions; matching cells are never run. */
|
|
289
528
|
exclude?: readonly JsonObject[];
|
|
529
|
+
/**
|
|
530
|
+
* Limits to compare, as axes: `{ steps: [40, 80] }`. Each becomes the axis
|
|
531
|
+
* `limits.steps`, so cells show it and `-a limits.steps=80` selects it.
|
|
532
|
+
*/
|
|
533
|
+
limits?: Readonly<{
|
|
534
|
+
steps?: readonly number[];
|
|
535
|
+
tokens?: readonly number[];
|
|
536
|
+
time?: readonly (number | string)[];
|
|
537
|
+
}>;
|
|
290
538
|
};
|
|
291
539
|
type EvalMatrix = EvalMatrixDefinition & {
|
|
292
540
|
kind: 'matrix';
|
|
@@ -303,26 +551,6 @@ type AttachmentLimits = {
|
|
|
303
551
|
maxRunBytes?: number;
|
|
304
552
|
};
|
|
305
553
|
//#endregion
|
|
306
|
-
//#region ../core/src/usage.d.ts
|
|
307
|
-
/**
|
|
308
|
-
* Token usage an agent reports for one turn. EvalKit never measures or infers
|
|
309
|
-
* it; adapters copy it from their provider.
|
|
310
|
-
*/
|
|
311
|
-
type Usage = {
|
|
312
|
-
/**
|
|
313
|
-
* Every input token the model read this turn: the prompt, history and tool
|
|
314
|
-
* results, **including** tokens read from or written to a prompt cache.
|
|
315
|
-
* (Some providers report cached tokens separately; add them in.)
|
|
316
|
-
*/
|
|
317
|
-
inputTokens?: number;
|
|
318
|
-
/** Every token the model produced, including reasoning tokens. */
|
|
319
|
-
outputTokens?: number;
|
|
320
|
-
/** Of `inputTokens`, how many were read from a prompt cache. Informational. */
|
|
321
|
-
cachedInputTokens?: number;
|
|
322
|
-
/** The provider's own total; used only when input and output are not reported. */
|
|
323
|
-
totalTokens?: number;
|
|
324
|
-
};
|
|
325
|
-
//#endregion
|
|
326
554
|
//#region ../core/src/index.d.ts
|
|
327
555
|
type JsonPrimitive = boolean | number | string | null;
|
|
328
556
|
type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
@@ -353,45 +581,6 @@ type RecordedError = {
|
|
|
353
581
|
message: string;
|
|
354
582
|
stack?: string;
|
|
355
583
|
};
|
|
356
|
-
type AutEvent = {
|
|
357
|
-
kind: 'started';
|
|
358
|
-
timestamp: string;
|
|
359
|
-
} | {
|
|
360
|
-
kind: 'message';
|
|
361
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
362
|
-
content: JsonValue;
|
|
363
|
-
timestamp: string;
|
|
364
|
-
} | {
|
|
365
|
-
kind: 'tool-call';
|
|
366
|
-
id: string;
|
|
367
|
-
name: string;
|
|
368
|
-
arguments: JsonValue;
|
|
369
|
-
timestamp: string;
|
|
370
|
-
} | {
|
|
371
|
-
kind: 'tool-result';
|
|
372
|
-
id: string;
|
|
373
|
-
name?: string;
|
|
374
|
-
result: JsonValue;
|
|
375
|
-
timestamp: string;
|
|
376
|
-
} | {
|
|
377
|
-
kind: 'turn-started';
|
|
378
|
-
turn: number;
|
|
379
|
-
timestamp: string;
|
|
380
|
-
} | {
|
|
381
|
-
kind: 'turn-completed';
|
|
382
|
-
turn: number;
|
|
383
|
-
timestamp: string;
|
|
384
|
-
latencyMs?: number;
|
|
385
|
-
usage?: Usage;
|
|
386
|
-
} | {
|
|
387
|
-
kind: 'completed';
|
|
388
|
-
output?: JsonValue;
|
|
389
|
-
timestamp: string;
|
|
390
|
-
} | {
|
|
391
|
-
kind: 'error';
|
|
392
|
-
error: RecordedError;
|
|
393
|
-
timestamp: string;
|
|
394
|
-
};
|
|
395
584
|
type RunnerEvent = {
|
|
396
585
|
kind: 'run-started';
|
|
397
586
|
timestamp: string;
|
|
@@ -440,7 +629,10 @@ type RunnerEvent = {
|
|
|
440
629
|
scorer: string;
|
|
441
630
|
error: RecordedError;
|
|
442
631
|
timestamp: string;
|
|
443
|
-
} | {
|
|
632
|
+
} | ({
|
|
633
|
+
kind: 'limit-reached';
|
|
634
|
+
timestamp: string;
|
|
635
|
+
} & LimitReached) | {
|
|
444
636
|
kind: 'run-completed';
|
|
445
637
|
timestamp: string;
|
|
446
638
|
} | {
|
|
@@ -448,11 +640,9 @@ type RunnerEvent = {
|
|
|
448
640
|
error: RecordedError;
|
|
449
641
|
timestamp: string;
|
|
450
642
|
};
|
|
451
|
-
type
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
source: 'runner';
|
|
455
|
-
});
|
|
643
|
+
type RunEvent = RunnerEvent & {
|
|
644
|
+
at: string | null;
|
|
645
|
+
};
|
|
456
646
|
type WorkspaceView = {
|
|
457
647
|
/** Absolute path to this run-scoped workspace. Do not persist it in reports. */
|
|
458
648
|
root: string;
|
|
@@ -470,6 +660,20 @@ type AutContext = {
|
|
|
470
660
|
runtime?: AgentRuntimeName;
|
|
471
661
|
/** Values of the scenario's candidate datasets, by dataset ID. */
|
|
472
662
|
data: JsonObject;
|
|
663
|
+
/**
|
|
664
|
+
* Aborts when the run hits a limit or is cancelled. Pass it to model calls
|
|
665
|
+
* and tool processes so they stop with the run.
|
|
666
|
+
*/
|
|
667
|
+
signal: AbortSignal;
|
|
668
|
+
/** The limits in force for this run; see `limits` in the config. */
|
|
669
|
+
limits: Limits;
|
|
670
|
+
/**
|
|
671
|
+
* The run's shell: run the agent and its tools through it, so they run
|
|
672
|
+
* where the project's `isolation` puts them. Scorers get the same one.
|
|
673
|
+
*/
|
|
674
|
+
shell: Shell;
|
|
675
|
+
/** The project's fixtures, as this run reaches them, by name. */
|
|
676
|
+
fixtures: Readonly<Record<string, FixtureAddress>>;
|
|
473
677
|
/** Contains only resources visible to the AUT/model. */
|
|
474
678
|
workspace: CandidateWorkspace;
|
|
475
679
|
/** Private evaluator capability for trusted AUT adapters; never expose this to the model. */
|
|
@@ -482,8 +686,11 @@ type AutAdapter<TMessage = string> = {
|
|
|
482
686
|
start(options: {
|
|
483
687
|
context: AutContext;
|
|
484
688
|
runtime?: AgentRuntime;
|
|
485
|
-
/**
|
|
486
|
-
|
|
689
|
+
/**
|
|
690
|
+
* Where to record what the agent does, as ATXF. Optional: returning a
|
|
691
|
+
* turn result from `send` is enough for most agents.
|
|
692
|
+
*/
|
|
693
|
+
transcript: TranscriptWriter;
|
|
487
694
|
/**
|
|
488
695
|
* Saves a file with the run's results, such as the agent's raw log,
|
|
489
696
|
* whether or not its sandbox is kept. `name` is a relative path of
|
|
@@ -523,19 +730,15 @@ type AgentStep = {
|
|
|
523
730
|
kind: 'agent';
|
|
524
731
|
expectation: JsonObject;
|
|
525
732
|
};
|
|
733
|
+
/** One user step and what the agent did in answer to it. */
|
|
526
734
|
type TurnView = {
|
|
527
735
|
userStepIndex: number;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
assistantMessages: readonly (Extract<AutEvent, {
|
|
532
|
-
kind: 'message';
|
|
533
|
-
}> & {
|
|
534
|
-
role: 'assistant';
|
|
535
|
-
source: 'aut';
|
|
536
|
-
})[];
|
|
736
|
+
/** The transcript records of this turn, on the active path, in order. */
|
|
737
|
+
records: readonly TreeRecord$1[];
|
|
738
|
+
assistantMessages: readonly AssistantMessage[];
|
|
537
739
|
toolCalls: readonly {
|
|
538
|
-
|
|
740
|
+
/** The assistant message holding the call. */
|
|
741
|
+
messageId: string;
|
|
539
742
|
id: string;
|
|
540
743
|
name: string;
|
|
541
744
|
arguments: JsonValue;
|
|
@@ -553,11 +756,25 @@ type ExpectToolCallStep = {
|
|
|
553
756
|
};
|
|
554
757
|
};
|
|
555
758
|
type TranscriptStep = UserStep | AgentStep | ScoringRule | ExpectToolCallStep;
|
|
759
|
+
/**
|
|
760
|
+
* What a judge saw and said. The built-in `judge()` records all of it; a
|
|
761
|
+
* predicate that calls a model itself can report `model`, `prompt` and
|
|
762
|
+
* `reply` so the dashboard shows them the same way.
|
|
763
|
+
*/
|
|
556
764
|
type JudgeRunInfo = {
|
|
557
765
|
agent?: AutIdentity;
|
|
766
|
+
/** The model the judge reported using, as `provider/id`. */
|
|
767
|
+
model?: string;
|
|
768
|
+
/** Tokens the judge used: never counted in the agent's `tokens`. */
|
|
558
769
|
usage?: Usage;
|
|
559
|
-
/**
|
|
560
|
-
|
|
770
|
+
/** The exact prompt the judge received. */
|
|
771
|
+
prompt?: string;
|
|
772
|
+
/** Its reply, as text or JSON. */
|
|
773
|
+
reply?: JsonValue;
|
|
774
|
+
/** 2 when its first reply was not in the format asked for and it was asked again. */
|
|
775
|
+
attempts?: number;
|
|
776
|
+
/** The judge's own session, as ATXF; never part of the agent's transcript. */
|
|
777
|
+
transcript?: Transcript$1;
|
|
561
778
|
};
|
|
562
779
|
/** A scorer's "does not apply" result; see `skip()`. */
|
|
563
780
|
type SkippedScore = {
|
|
@@ -565,7 +782,8 @@ type SkippedScore = {
|
|
|
565
782
|
reason: string;
|
|
566
783
|
};
|
|
567
784
|
type ScoreValue<Evidence = unknown> = number | SkippedScore | {
|
|
568
|
-
|
|
785
|
+
/** From 0 to 1. Without it, the weighted mean of `criteria`. */
|
|
786
|
+
value?: number;
|
|
569
787
|
passed?: boolean;
|
|
570
788
|
explanation?: string;
|
|
571
789
|
/**
|
|
@@ -573,7 +791,12 @@ type ScoreValue<Evidence = unknown> = number | SkippedScore | {
|
|
|
573
791
|
* evidence reaches later scorers through `checkpoint(rule)`.
|
|
574
792
|
*/
|
|
575
793
|
evidence?: Evidence;
|
|
576
|
-
/**
|
|
794
|
+
/**
|
|
795
|
+
* Per-criterion results, each shown on its own; see `CriterionResult`.
|
|
796
|
+
* Return `{ name, reached: false }` for a check that never ran.
|
|
797
|
+
*/
|
|
798
|
+
criteria?: CriterionInput[];
|
|
799
|
+
/** What a model-backed scorer saw and said; never counted as AUT usage. */
|
|
577
800
|
judge?: JudgeRunInfo;
|
|
578
801
|
};
|
|
579
802
|
type ScoreResult = {
|
|
@@ -581,8 +804,15 @@ type ScoreResult = {
|
|
|
581
804
|
kind: 'predicate' | 'judge';
|
|
582
805
|
value?: number;
|
|
583
806
|
passed?: boolean;
|
|
807
|
+
/** The pass mark the value was held to (1 unless the rule set `passAt`). */
|
|
808
|
+
passAt?: number;
|
|
584
809
|
explanation?: string;
|
|
585
810
|
evidence?: JsonValue;
|
|
811
|
+
/** A `choices` judge's answer, such as `B`. */
|
|
812
|
+
choice?: string;
|
|
813
|
+
criteria?: CriterionResult[];
|
|
814
|
+
/** Files its scorer saved with `attach()`, by name. */
|
|
815
|
+
attachments?: string[];
|
|
586
816
|
judge?: JudgeRunInfo;
|
|
587
817
|
durationMs: number;
|
|
588
818
|
error?: RecordedError;
|
|
@@ -595,14 +825,21 @@ type ArtifactView = {
|
|
|
595
825
|
};
|
|
596
826
|
type ScoringContext = {
|
|
597
827
|
context: AutContext;
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
828
|
+
/**
|
|
829
|
+
* What the agent did, as an ATXF transcript: all of it for final scorers,
|
|
830
|
+
* up to this step for checkpoints. `messages(ctx)`, `toolCalls(ctx)` and
|
|
831
|
+
* `lastReply(ctx)` read it.
|
|
832
|
+
*/
|
|
833
|
+
transcript: Transcript$1;
|
|
834
|
+
/** Sub-agent transcripts the agent kept, by transcript ID. */
|
|
835
|
+
subagents: Readonly<Record<string, Transcript$1>>;
|
|
836
|
+
/** EvalKit's events so far: steps, checkpoints and scorers. */
|
|
837
|
+
runEvents: readonly RunEvent[];
|
|
601
838
|
artifacts: ArtifactView;
|
|
602
839
|
/** Most recent completed turn; absent if no user message has been sent. */
|
|
603
840
|
turn?: TurnView;
|
|
604
|
-
/**
|
|
605
|
-
output?:
|
|
841
|
+
/** The text of the last assistant message of `turn`. */
|
|
842
|
+
output?: string;
|
|
606
843
|
/** Values of all the scenario's datasets (candidate and evaluator), by dataset ID. */
|
|
607
844
|
data: JsonObject;
|
|
608
845
|
/**
|
|
@@ -637,15 +874,48 @@ type CheckpointOutcome<Evidence> = Omit<CheckpointResult, 'evidence'> & {
|
|
|
637
874
|
type PredicateScorer<Evidence = unknown> = {
|
|
638
875
|
kind: 'predicate';
|
|
639
876
|
name: string;
|
|
877
|
+
/** What it checks, in a sentence, shown wherever the scorer is. */
|
|
878
|
+
description?: string;
|
|
640
879
|
supportsPartial?: boolean;
|
|
641
880
|
/** A numeric result passes when it is at least this value. Default: only 1 passes. */
|
|
642
881
|
passAt?: number;
|
|
882
|
+
/**
|
|
883
|
+
* The checks it reports, declared up front so they show before a run.
|
|
884
|
+
* A declared criterion it leaves out is recorded as not reached; one it
|
|
885
|
+
* did not declare is an error.
|
|
886
|
+
*/
|
|
887
|
+
criteria?: JudgeCriterion[];
|
|
643
888
|
run(context: ScoringContext): boolean | ScoreValue<Evidence> | Promise<boolean | ScoreValue<Evidence>>;
|
|
644
889
|
};
|
|
890
|
+
/** What a judge sees: one named input, read from the run. */
|
|
891
|
+
type JudgeInput = (scoring: ScoringContext) => JsonValue | undefined | Promise<JsonValue | undefined>;
|
|
892
|
+
/**
|
|
893
|
+
* A rubric-graded scorer. EvalKit builds the prompt from the rubric, the
|
|
894
|
+
* inputs and the answer format, runs the judge agent, checks its answer
|
|
895
|
+
* (asking once more if it is not in the format asked for), and records
|
|
896
|
+
* what it saw and said.
|
|
897
|
+
*/
|
|
645
898
|
type JudgeRule = {
|
|
646
899
|
kind: 'judge';
|
|
647
900
|
name: string;
|
|
648
901
|
rubric: string;
|
|
902
|
+
/** What it checks, in a sentence, shown wherever the judge is. */
|
|
903
|
+
description?: string;
|
|
904
|
+
/**
|
|
905
|
+
* The agent that judges, made with `defineAgent()`. Default: `judge` in
|
|
906
|
+
* evalkit.config.ts. It gets the run's parameters, so a matrix axis can
|
|
907
|
+
* choose its model.
|
|
908
|
+
*/
|
|
909
|
+
agent?: AutAdapter;
|
|
910
|
+
/**
|
|
911
|
+
* What the judge sees, by name. Default: `conversation` (this turn at a
|
|
912
|
+
* checkpoint, the whole run in final scoring) and `reply` (the last reply).
|
|
913
|
+
*/
|
|
914
|
+
inputs?: Readonly<Record<string, JudgeInput>>;
|
|
915
|
+
/** How it answers. Default `verdict`: a value from 0 to 1 and a reason. */
|
|
916
|
+
answer: JudgeAnswer;
|
|
917
|
+
/** A value passes when it is at least this. Default: only 1 passes. */
|
|
918
|
+
passAt?: number;
|
|
649
919
|
/** Run even when the scenario stopped early or execution failed. */
|
|
650
920
|
supportsPartial?: boolean;
|
|
651
921
|
};
|
|
@@ -676,7 +946,6 @@ type MetricResult = {
|
|
|
676
946
|
error?: RecordedError;
|
|
677
947
|
};
|
|
678
948
|
type EvalPolicy = {
|
|
679
|
-
timeoutMs?: number;
|
|
680
949
|
/** Stop later transcript steps after a failed checkpoint assertion. Default false. */
|
|
681
950
|
failfast?: boolean;
|
|
682
951
|
};
|
|
@@ -684,8 +953,6 @@ type EvalDefinition<TAgent extends AutAdapter = AutAdapter> = {
|
|
|
684
953
|
id: string;
|
|
685
954
|
name?: string;
|
|
686
955
|
agent: TAgent;
|
|
687
|
-
/** Separate judge agent; its model and tools are never inherited from the AUT. */
|
|
688
|
-
judge?: AutAdapter;
|
|
689
956
|
/** Data and files the scenario uses; each run gets its own copy. */
|
|
690
957
|
datasets?: readonly Dataset[];
|
|
691
958
|
transcript: TranscriptStep[];
|
|
@@ -698,6 +965,11 @@ type EvalDefinition<TAgent extends AutAdapter = AutAdapter> = {
|
|
|
698
965
|
* under identical conditions, to see how often it passes. Default 1.
|
|
699
966
|
*/
|
|
700
967
|
repeat?: number;
|
|
968
|
+
/**
|
|
969
|
+
* What each run may use before EvalKit stops it: `{ steps: 40, time: '20m' }`.
|
|
970
|
+
* Over the project's `limits`; a matrix cell's and `--limit` come after.
|
|
971
|
+
*/
|
|
972
|
+
limits?: LimitsInput;
|
|
701
973
|
/** Any JSON-convertible object; converted when the eval is defined. */
|
|
702
974
|
metadata?: Record<string, unknown>;
|
|
703
975
|
workspace?: EvalWorkspace;
|
|
@@ -726,9 +998,11 @@ type EvalSuiteMetadata = {
|
|
|
726
998
|
};
|
|
727
999
|
/**
|
|
728
1000
|
* How a run ended: `passed` or `failed` by its scores, `errored` when it could
|
|
729
|
-
* not finish (the agent, a dataset or EvalKit failed), `cancelled` by Ctrl+C
|
|
1001
|
+
* not finish (the agent, a dataset or EvalKit failed), `cancelled` by Ctrl+C,
|
|
1002
|
+
* `limited` when it hit one of its limits (graded by scorers that support
|
|
1003
|
+
* partial work, and never a pass).
|
|
730
1004
|
*/
|
|
731
|
-
type RunStatus = 'running' | 'passed' | 'failed' | 'errored' | 'cancelled';
|
|
1005
|
+
type RunStatus = 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'limited';
|
|
732
1006
|
/** Runs launched together as repeats of one configuration (`repeat`). */
|
|
733
1007
|
type Batch = {
|
|
734
1008
|
id: string;
|
|
@@ -770,7 +1044,7 @@ type RunProcess = {
|
|
|
770
1044
|
hostname: string;
|
|
771
1045
|
};
|
|
772
1046
|
type RunMetadata = {
|
|
773
|
-
schemaVersion:
|
|
1047
|
+
schemaVersion: 7;
|
|
774
1048
|
runId: string;
|
|
775
1049
|
runUri: ResourceUri<'run'>;
|
|
776
1050
|
evalId: string;
|
|
@@ -791,6 +1065,18 @@ type RunMetadata = {
|
|
|
791
1065
|
workspaceIgnore?: string[];
|
|
792
1066
|
/** The datasets this run used, with content digests. */
|
|
793
1067
|
datasets?: RunDataset[];
|
|
1068
|
+
/** The limits in force. */
|
|
1069
|
+
limits?: Limits;
|
|
1070
|
+
/** Where its processes ran; absent for runs on the host. */
|
|
1071
|
+
isolation?: RunIsolation;
|
|
1072
|
+
};
|
|
1073
|
+
/** A run's isolation as its manifest records it: no host paths, no environment. */
|
|
1074
|
+
type RunIsolation = {
|
|
1075
|
+
kind: 'container';
|
|
1076
|
+
image: string;
|
|
1077
|
+
network: ContainerNetwork;
|
|
1078
|
+
} | {
|
|
1079
|
+
kind: 'sandbox-exec';
|
|
794
1080
|
};
|
|
795
1081
|
type RunDataset = {
|
|
796
1082
|
id: string;
|
|
@@ -806,13 +1092,19 @@ type CheckpointResult = {
|
|
|
806
1092
|
status: 'passed' | 'failed' | 'error' | 'skipped';
|
|
807
1093
|
value?: number;
|
|
808
1094
|
passed?: boolean;
|
|
1095
|
+
passAt?: number;
|
|
809
1096
|
explanation?: string;
|
|
810
1097
|
evidence?: JsonValue;
|
|
1098
|
+
choice?: string;
|
|
1099
|
+
criteria?: CriterionResult[];
|
|
1100
|
+
/** Files its scorer saved with `attach()`, by name. */
|
|
1101
|
+
attachments?: string[];
|
|
811
1102
|
judge?: JudgeRunInfo;
|
|
812
1103
|
durationMs?: number;
|
|
813
1104
|
error?: RecordedError;
|
|
1105
|
+
/** The tool call it matched: the assistant message holding it, and the call's ID. */
|
|
814
1106
|
matchedToolCall?: {
|
|
815
|
-
|
|
1107
|
+
messageId: string;
|
|
816
1108
|
id: string;
|
|
817
1109
|
};
|
|
818
1110
|
};
|
|
@@ -820,13 +1112,17 @@ type CheckpointResult = {
|
|
|
820
1112
|
* Metrics EvalKit records for every run; scenario metrics may not reuse
|
|
821
1113
|
* these names.
|
|
822
1114
|
*
|
|
823
|
-
* - `agent time` (ms): from the
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
* - `
|
|
1115
|
+
* - `agent time` (ms): from the session's start to the end of its last turn.
|
|
1116
|
+
* - `tokens`: uncached input, cache writes and output, summed over the
|
|
1117
|
+
* transcript (`uncachedTokens`). Absent when nothing reported usage.
|
|
1118
|
+
* - `cached tokens`: input tokens read from a prompt cache.
|
|
1119
|
+
* - `output tokens`: output, reasoning included.
|
|
1120
|
+
* - `cache hit rate`: the share of input tokens read from a cache, 0 to 1.
|
|
1121
|
+
* - `steps`: assistant messages, one per model call.
|
|
1122
|
+
* - `tool calls`: tool calls in the transcript.
|
|
1123
|
+
* - `judge tokens`: `tokens` over the judges' transcripts, never the agent's.
|
|
828
1124
|
*/
|
|
829
|
-
declare const BUILT_IN_METRICS: readonly ['agent time', 'tokens', 'tool calls'];
|
|
1125
|
+
declare const BUILT_IN_METRICS: readonly ['agent time', 'tokens', 'cached tokens', 'output tokens', 'cache hit rate', 'steps', 'tool calls', 'judge tokens'];
|
|
830
1126
|
type BuiltInMetricName = (typeof BUILT_IN_METRICS)[number];
|
|
831
1127
|
/** A built-in metric's name (suggested by editors), or a scenario's own. */
|
|
832
1128
|
type MetricName = BuiltInMetricName | (string & {});
|
|
@@ -860,10 +1156,17 @@ type RunSummary = {
|
|
|
860
1156
|
artifacts?: ArtifactEntry[];
|
|
861
1157
|
attachments?: AttachmentEntry[];
|
|
862
1158
|
error?: RecordedError;
|
|
1159
|
+
/** The limit a `limited` run hit. */
|
|
1160
|
+
limit?: LimitReached;
|
|
863
1161
|
};
|
|
864
1162
|
type RunWriter = {
|
|
865
1163
|
readonly location: string;
|
|
866
|
-
|
|
1164
|
+
/** Appends one of EvalKit's events to `run-events.jsonl`. */
|
|
1165
|
+
appendEvent(event: RunEvent): Promise<void>;
|
|
1166
|
+
/** Appends an ATXF record (the header first) to `transcript.atxf.jsonl`. */
|
|
1167
|
+
appendTranscript(line: Transcript$1['header'] | Transcript$1['records'][number]): Promise<void>;
|
|
1168
|
+
/** Writes a sub-agent's whole transcript (JSONL), replacing the one kept. */
|
|
1169
|
+
writeSubagent(id: string, text: string): Promise<void>;
|
|
867
1170
|
writeScores(scoring: RunScoring): Promise<void>;
|
|
868
1171
|
/** Writes a file below this run's artifact root. */
|
|
869
1172
|
writeArtifact(path: string, data: Uint8Array): Promise<void>;
|
|
@@ -885,8 +1188,86 @@ type RunResult = {
|
|
|
885
1188
|
durationMs?: number;
|
|
886
1189
|
scoring?: RunScoring;
|
|
887
1190
|
error?: RecordedError;
|
|
1191
|
+
/** The limit a `limited` run hit. */
|
|
1192
|
+
limit?: LimitReached;
|
|
888
1193
|
};
|
|
889
1194
|
//#endregion
|
|
1195
|
+
//#region ../runner/src/errors.d.ts
|
|
1196
|
+
declare const AutExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1197
|
+
readonly _tag: "AutExecutionError";
|
|
1198
|
+
} & Readonly<A>;
|
|
1199
|
+
export declare class AutExecutionError extends AutExecutionError_base<{
|
|
1200
|
+
cause: unknown;
|
|
1201
|
+
message?: string;
|
|
1202
|
+
}> {}
|
|
1203
|
+
declare const DatasetError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1204
|
+
readonly _tag: "DatasetError";
|
|
1205
|
+
} & Readonly<A>;
|
|
1206
|
+
export declare class DatasetError extends DatasetError_base<{
|
|
1207
|
+
cause: unknown;
|
|
1208
|
+
message?: string;
|
|
1209
|
+
}> {}
|
|
1210
|
+
declare const ReportError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1211
|
+
readonly _tag: "ReportError";
|
|
1212
|
+
} & Readonly<A>;
|
|
1213
|
+
export declare class ReportError extends ReportError_base<{
|
|
1214
|
+
cause: unknown;
|
|
1215
|
+
message?: string;
|
|
1216
|
+
}> {}
|
|
1217
|
+
declare const ScoringError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1218
|
+
readonly _tag: "ScoringError";
|
|
1219
|
+
} & Readonly<A>;
|
|
1220
|
+
export declare class ScoringError extends ScoringError_base<{
|
|
1221
|
+
cause: unknown;
|
|
1222
|
+
message?: string;
|
|
1223
|
+
}> {}
|
|
1224
|
+
declare const CheckpointExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1225
|
+
readonly _tag: "CheckpointExecutionError";
|
|
1226
|
+
} & Readonly<A>;
|
|
1227
|
+
export declare class CheckpointExecutionError extends CheckpointExecutionError_base<{
|
|
1228
|
+
step: number;
|
|
1229
|
+
name: string;
|
|
1230
|
+
message: string;
|
|
1231
|
+
cause: unknown;
|
|
1232
|
+
}> {}
|
|
1233
|
+
declare const CancelledError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1234
|
+
readonly _tag: "CancelledError";
|
|
1235
|
+
} & Readonly<A>;
|
|
1236
|
+
/** The run was cancelled (Ctrl+C); the run stops and is finalized as cancelled. */
|
|
1237
|
+
export declare class CancelledError extends CancelledError_base<{
|
|
1238
|
+
message: string;
|
|
1239
|
+
}> {}
|
|
1240
|
+
//#endregion
|
|
1241
|
+
//#region ../runner/src/shell/fixtures.d.ts
|
|
1242
|
+
type FixtureSet = {
|
|
1243
|
+
/** Starts every fixture, once; later calls wait for the same start. Throws when one never becomes ready. */
|
|
1244
|
+
ensure(): Promise<void>;
|
|
1245
|
+
/** True once `ensure` was called. */
|
|
1246
|
+
readonly started: boolean;
|
|
1247
|
+
/** The fixtures as a run with this isolation reaches them. */
|
|
1248
|
+
addresses(isolation: Isolation): Record<string, FixtureAddress>;
|
|
1249
|
+
/** The internal network containers share with the fixtures' proxies, created on first use. */
|
|
1250
|
+
network(runtime: string): Promise<string>;
|
|
1251
|
+
/** Each fixture's output so far. */
|
|
1252
|
+
logs(): Array<{
|
|
1253
|
+
name: string;
|
|
1254
|
+
content: string;
|
|
1255
|
+
}>;
|
|
1256
|
+
/** Runs each `stop` command, then stops the fixtures, their proxies and network. */
|
|
1257
|
+
stop(): Promise<void>;
|
|
1258
|
+
};
|
|
1259
|
+
/**
|
|
1260
|
+
* The project's fixtures for one invocation: started on the host, in the
|
|
1261
|
+
* project root, the first time a run needs them, and stopped after its last.
|
|
1262
|
+
*/
|
|
1263
|
+
export declare function fixtureSet(fixtures: Readonly<Record<string, Fixture>>, options: {
|
|
1264
|
+
root: string;
|
|
1265
|
+
}): FixtureSet;
|
|
1266
|
+
//#endregion
|
|
1267
|
+
//#region ../runner/src/shell/container-shell.d.ts
|
|
1268
|
+
/** Removes a run's kept container, if there is one; true when it removed one. */
|
|
1269
|
+
export declare function removeRunContainer(runId: string, runtime?: string): Promise<boolean>;
|
|
1270
|
+
//#endregion
|
|
890
1271
|
//#region ../runner/src/local-report-store.d.ts
|
|
891
1272
|
/** Persists each run as a local tree rooted below `rootDirectory`. */
|
|
892
1273
|
export declare function localReportStore(rootDirectory: string): ReportStore;
|
|
@@ -908,7 +1289,7 @@ export declare function staticDatasetFile(dataset: Dataset, root: string, file:
|
|
|
908
1289
|
//#endregion
|
|
909
1290
|
//#region ../runner/src/local-report-reader.d.ts
|
|
910
1291
|
export declare const readRunManifest: (root: string, runId: string) => Promise<{
|
|
911
|
-
readonly schemaVersion:
|
|
1292
|
+
readonly schemaVersion: 7;
|
|
912
1293
|
readonly runUri: string;
|
|
913
1294
|
readonly evalId: string;
|
|
914
1295
|
readonly suiteId?: string | undefined;
|
|
@@ -956,14 +1337,41 @@ export declare const readRunManifest: (root: string, runId: string) => Promise<{
|
|
|
956
1337
|
readonly source: "computed" | "static";
|
|
957
1338
|
readonly digest: string;
|
|
958
1339
|
}[] | undefined;
|
|
959
|
-
readonly
|
|
1340
|
+
readonly limits?: {
|
|
1341
|
+
readonly steps?: number | undefined;
|
|
1342
|
+
readonly tokens?: number | undefined;
|
|
1343
|
+
readonly time?: number | undefined;
|
|
1344
|
+
} | undefined;
|
|
1345
|
+
readonly isolation?: {
|
|
1346
|
+
readonly kind: "container";
|
|
1347
|
+
readonly image: string;
|
|
1348
|
+
readonly network: "fixtures" | "full" | "none";
|
|
1349
|
+
} | {
|
|
1350
|
+
readonly kind: "sandbox-exec";
|
|
1351
|
+
} | undefined;
|
|
1352
|
+
readonly status?: "cancelled" | "errored" | "failed" | "limited" | "passed" | "running" | undefined;
|
|
960
1353
|
}>;
|
|
961
1354
|
export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
962
|
-
readonly status: "cancelled" | "errored" | "failed" | "passed" | "running";
|
|
1355
|
+
readonly status: "cancelled" | "errored" | "failed" | "limited" | "passed" | "running";
|
|
963
1356
|
readonly endedAt: string;
|
|
964
1357
|
readonly durationMs?: number | undefined;
|
|
965
1358
|
readonly scoring?: {
|
|
966
1359
|
readonly results: {
|
|
1360
|
+
readonly passAt?: number | undefined;
|
|
1361
|
+
readonly choice?: string | undefined;
|
|
1362
|
+
readonly criteria?: ({
|
|
1363
|
+
readonly name: string;
|
|
1364
|
+
readonly value: number;
|
|
1365
|
+
readonly weight?: number | undefined;
|
|
1366
|
+
readonly explanation?: string | undefined;
|
|
1367
|
+
readonly evidence?: JsonValue | undefined;
|
|
1368
|
+
} | {
|
|
1369
|
+
readonly name: string;
|
|
1370
|
+
readonly reached: false;
|
|
1371
|
+
readonly weight?: number | undefined;
|
|
1372
|
+
readonly explanation?: string | undefined;
|
|
1373
|
+
})[] | undefined;
|
|
1374
|
+
readonly attachments?: string[] | undefined;
|
|
967
1375
|
readonly name: string;
|
|
968
1376
|
readonly kind: "judge" | "predicate";
|
|
969
1377
|
readonly value?: number | undefined;
|
|
@@ -977,13 +1385,27 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
977
1385
|
readonly name?: string | undefined;
|
|
978
1386
|
readonly version?: string | undefined;
|
|
979
1387
|
} | undefined;
|
|
1388
|
+
readonly model?: string | undefined;
|
|
980
1389
|
readonly usage?: {
|
|
981
|
-
readonly
|
|
982
|
-
readonly
|
|
983
|
-
readonly
|
|
984
|
-
readonly
|
|
1390
|
+
readonly input: number;
|
|
1391
|
+
readonly output: number;
|
|
1392
|
+
readonly cacheRead?: number | undefined;
|
|
1393
|
+
readonly cacheWrite?: number | undefined;
|
|
1394
|
+
readonly reasoning?: number | undefined;
|
|
1395
|
+
readonly total?: number | undefined;
|
|
1396
|
+
readonly cost?: {
|
|
1397
|
+
readonly currency?: string | undefined;
|
|
1398
|
+
readonly input?: number | undefined;
|
|
1399
|
+
readonly output?: number | undefined;
|
|
1400
|
+
readonly cacheRead?: number | undefined;
|
|
1401
|
+
readonly cacheWrite?: number | undefined;
|
|
1402
|
+
readonly total: number;
|
|
1403
|
+
} | undefined;
|
|
985
1404
|
} | undefined;
|
|
986
|
-
readonly
|
|
1405
|
+
readonly prompt?: string | undefined;
|
|
1406
|
+
readonly reply?: JsonValue | undefined;
|
|
1407
|
+
readonly attempts?: number | undefined;
|
|
1408
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
987
1409
|
} | undefined;
|
|
988
1410
|
readonly durationMs: number;
|
|
989
1411
|
readonly error?: {
|
|
@@ -1006,6 +1428,21 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1006
1428
|
} | undefined;
|
|
1007
1429
|
}[] | undefined;
|
|
1008
1430
|
readonly checkpoints?: {
|
|
1431
|
+
readonly passAt?: number | undefined;
|
|
1432
|
+
readonly choice?: string | undefined;
|
|
1433
|
+
readonly criteria?: ({
|
|
1434
|
+
readonly name: string;
|
|
1435
|
+
readonly value: number;
|
|
1436
|
+
readonly weight?: number | undefined;
|
|
1437
|
+
readonly explanation?: string | undefined;
|
|
1438
|
+
readonly evidence?: JsonValue | undefined;
|
|
1439
|
+
} | {
|
|
1440
|
+
readonly name: string;
|
|
1441
|
+
readonly reached: false;
|
|
1442
|
+
readonly weight?: number | undefined;
|
|
1443
|
+
readonly explanation?: string | undefined;
|
|
1444
|
+
})[] | undefined;
|
|
1445
|
+
readonly attachments?: string[] | undefined;
|
|
1009
1446
|
readonly step: number;
|
|
1010
1447
|
readonly kind: "expect-tool-call" | "judge" | "predicate";
|
|
1011
1448
|
readonly name: string;
|
|
@@ -1021,13 +1458,27 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1021
1458
|
readonly name?: string | undefined;
|
|
1022
1459
|
readonly version?: string | undefined;
|
|
1023
1460
|
} | undefined;
|
|
1461
|
+
readonly model?: string | undefined;
|
|
1024
1462
|
readonly usage?: {
|
|
1025
|
-
readonly
|
|
1026
|
-
readonly
|
|
1027
|
-
readonly
|
|
1028
|
-
readonly
|
|
1463
|
+
readonly input: number;
|
|
1464
|
+
readonly output: number;
|
|
1465
|
+
readonly cacheRead?: number | undefined;
|
|
1466
|
+
readonly cacheWrite?: number | undefined;
|
|
1467
|
+
readonly reasoning?: number | undefined;
|
|
1468
|
+
readonly total?: number | undefined;
|
|
1469
|
+
readonly cost?: {
|
|
1470
|
+
readonly currency?: string | undefined;
|
|
1471
|
+
readonly input?: number | undefined;
|
|
1472
|
+
readonly output?: number | undefined;
|
|
1473
|
+
readonly cacheRead?: number | undefined;
|
|
1474
|
+
readonly cacheWrite?: number | undefined;
|
|
1475
|
+
readonly total: number;
|
|
1476
|
+
} | undefined;
|
|
1029
1477
|
} | undefined;
|
|
1030
|
-
readonly
|
|
1478
|
+
readonly prompt?: string | undefined;
|
|
1479
|
+
readonly reply?: JsonValue | undefined;
|
|
1480
|
+
readonly attempts?: number | undefined;
|
|
1481
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
1031
1482
|
} | undefined;
|
|
1032
1483
|
readonly durationMs?: number | undefined;
|
|
1033
1484
|
readonly error?: {
|
|
@@ -1036,7 +1487,7 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1036
1487
|
readonly stack?: string | undefined;
|
|
1037
1488
|
} | undefined;
|
|
1038
1489
|
readonly matchedToolCall?: {
|
|
1039
|
-
readonly
|
|
1490
|
+
readonly messageId: string;
|
|
1040
1491
|
readonly id: string;
|
|
1041
1492
|
} | undefined;
|
|
1042
1493
|
}[] | undefined;
|
|
@@ -1059,9 +1510,29 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1059
1510
|
readonly message: string;
|
|
1060
1511
|
readonly stack?: string | undefined;
|
|
1061
1512
|
} | undefined;
|
|
1513
|
+
readonly limit?: {
|
|
1514
|
+
readonly limit: "steps" | "time" | "tokens";
|
|
1515
|
+
readonly value: number;
|
|
1516
|
+
readonly used: number;
|
|
1517
|
+
} | undefined;
|
|
1062
1518
|
}>;
|
|
1063
1519
|
export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
1064
1520
|
readonly results: {
|
|
1521
|
+
readonly passAt?: number | undefined;
|
|
1522
|
+
readonly choice?: string | undefined;
|
|
1523
|
+
readonly criteria?: ({
|
|
1524
|
+
readonly name: string;
|
|
1525
|
+
readonly value: number;
|
|
1526
|
+
readonly weight?: number | undefined;
|
|
1527
|
+
readonly explanation?: string | undefined;
|
|
1528
|
+
readonly evidence?: JsonValue | undefined;
|
|
1529
|
+
} | {
|
|
1530
|
+
readonly name: string;
|
|
1531
|
+
readonly reached: false;
|
|
1532
|
+
readonly weight?: number | undefined;
|
|
1533
|
+
readonly explanation?: string | undefined;
|
|
1534
|
+
})[] | undefined;
|
|
1535
|
+
readonly attachments?: string[] | undefined;
|
|
1065
1536
|
readonly name: string;
|
|
1066
1537
|
readonly kind: "judge" | "predicate";
|
|
1067
1538
|
readonly value?: number | undefined;
|
|
@@ -1075,13 +1546,27 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1075
1546
|
readonly name?: string | undefined;
|
|
1076
1547
|
readonly version?: string | undefined;
|
|
1077
1548
|
} | undefined;
|
|
1549
|
+
readonly model?: string | undefined;
|
|
1078
1550
|
readonly usage?: {
|
|
1079
|
-
readonly
|
|
1080
|
-
readonly
|
|
1081
|
-
readonly
|
|
1082
|
-
readonly
|
|
1551
|
+
readonly input: number;
|
|
1552
|
+
readonly output: number;
|
|
1553
|
+
readonly cacheRead?: number | undefined;
|
|
1554
|
+
readonly cacheWrite?: number | undefined;
|
|
1555
|
+
readonly reasoning?: number | undefined;
|
|
1556
|
+
readonly total?: number | undefined;
|
|
1557
|
+
readonly cost?: {
|
|
1558
|
+
readonly currency?: string | undefined;
|
|
1559
|
+
readonly input?: number | undefined;
|
|
1560
|
+
readonly output?: number | undefined;
|
|
1561
|
+
readonly cacheRead?: number | undefined;
|
|
1562
|
+
readonly cacheWrite?: number | undefined;
|
|
1563
|
+
readonly total: number;
|
|
1564
|
+
} | undefined;
|
|
1083
1565
|
} | undefined;
|
|
1084
|
-
readonly
|
|
1566
|
+
readonly prompt?: string | undefined;
|
|
1567
|
+
readonly reply?: JsonValue | undefined;
|
|
1568
|
+
readonly attempts?: number | undefined;
|
|
1569
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
1085
1570
|
} | undefined;
|
|
1086
1571
|
readonly durationMs: number;
|
|
1087
1572
|
readonly error?: {
|
|
@@ -1104,6 +1589,21 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1104
1589
|
} | undefined;
|
|
1105
1590
|
}[] | undefined;
|
|
1106
1591
|
readonly checkpoints?: {
|
|
1592
|
+
readonly passAt?: number | undefined;
|
|
1593
|
+
readonly choice?: string | undefined;
|
|
1594
|
+
readonly criteria?: ({
|
|
1595
|
+
readonly name: string;
|
|
1596
|
+
readonly value: number;
|
|
1597
|
+
readonly weight?: number | undefined;
|
|
1598
|
+
readonly explanation?: string | undefined;
|
|
1599
|
+
readonly evidence?: JsonValue | undefined;
|
|
1600
|
+
} | {
|
|
1601
|
+
readonly name: string;
|
|
1602
|
+
readonly reached: false;
|
|
1603
|
+
readonly weight?: number | undefined;
|
|
1604
|
+
readonly explanation?: string | undefined;
|
|
1605
|
+
})[] | undefined;
|
|
1606
|
+
readonly attachments?: string[] | undefined;
|
|
1107
1607
|
readonly step: number;
|
|
1108
1608
|
readonly kind: "expect-tool-call" | "judge" | "predicate";
|
|
1109
1609
|
readonly name: string;
|
|
@@ -1119,13 +1619,27 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1119
1619
|
readonly name?: string | undefined;
|
|
1120
1620
|
readonly version?: string | undefined;
|
|
1121
1621
|
} | undefined;
|
|
1622
|
+
readonly model?: string | undefined;
|
|
1122
1623
|
readonly usage?: {
|
|
1123
|
-
readonly
|
|
1124
|
-
readonly
|
|
1125
|
-
readonly
|
|
1126
|
-
readonly
|
|
1624
|
+
readonly input: number;
|
|
1625
|
+
readonly output: number;
|
|
1626
|
+
readonly cacheRead?: number | undefined;
|
|
1627
|
+
readonly cacheWrite?: number | undefined;
|
|
1628
|
+
readonly reasoning?: number | undefined;
|
|
1629
|
+
readonly total?: number | undefined;
|
|
1630
|
+
readonly cost?: {
|
|
1631
|
+
readonly currency?: string | undefined;
|
|
1632
|
+
readonly input?: number | undefined;
|
|
1633
|
+
readonly output?: number | undefined;
|
|
1634
|
+
readonly cacheRead?: number | undefined;
|
|
1635
|
+
readonly cacheWrite?: number | undefined;
|
|
1636
|
+
readonly total: number;
|
|
1637
|
+
} | undefined;
|
|
1127
1638
|
} | undefined;
|
|
1128
|
-
readonly
|
|
1639
|
+
readonly prompt?: string | undefined;
|
|
1640
|
+
readonly reply?: JsonValue | undefined;
|
|
1641
|
+
readonly attempts?: number | undefined;
|
|
1642
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
1129
1643
|
} | undefined;
|
|
1130
1644
|
readonly durationMs?: number | undefined;
|
|
1131
1645
|
readonly error?: {
|
|
@@ -1134,7 +1648,7 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1134
1648
|
readonly stack?: string | undefined;
|
|
1135
1649
|
} | undefined;
|
|
1136
1650
|
readonly matchedToolCall?: {
|
|
1137
|
-
readonly
|
|
1651
|
+
readonly messageId: string;
|
|
1138
1652
|
readonly id: string;
|
|
1139
1653
|
} | undefined;
|
|
1140
1654
|
}[] | undefined;
|
|
@@ -1142,7 +1656,15 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1142
1656
|
readonly overall?: number | undefined;
|
|
1143
1657
|
readonly passed: boolean;
|
|
1144
1658
|
}>;
|
|
1145
|
-
|
|
1659
|
+
/** EvalKit's events for a run, in order. */
|
|
1660
|
+
export declare function readRunEvents(root: string, runId: string): Promise<RunEvent[]>;
|
|
1661
|
+
/** A run's sub-agent transcripts, by transcript ID; none when it kept none. */
|
|
1662
|
+
export declare function readRunSubagents(root: string, runId: string): Promise<Record<string, Transcript$1>>;
|
|
1663
|
+
/**
|
|
1664
|
+
* The agent's ATXF transcript for a run. A running run's last line may be
|
|
1665
|
+
* half written; it is left out until it is complete.
|
|
1666
|
+
*/
|
|
1667
|
+
export declare function readRunTranscript(root: string, runId: string): Promise<Transcript$1>;
|
|
1146
1668
|
/**
|
|
1147
1669
|
* True when a run's owning process is known to be gone: it ran on this host
|
|
1148
1670
|
* and its PID no longer exists. Runs from other hosts are never judged.
|
|
@@ -1150,12 +1672,16 @@ export declare function readRunEvents(root: string, runId: string): Promise<Traj
|
|
|
1150
1672
|
export declare function ownerIsGone(owner: RunProcess | undefined): boolean;
|
|
1151
1673
|
//#endregion
|
|
1152
1674
|
//#region ../runner/src/matrix.d.ts
|
|
1153
|
-
/**
|
|
1675
|
+
/**
|
|
1676
|
+
* Cells and runs; a run that errored counts as failed, one stopped at a
|
|
1677
|
+
* limit as limited, a cancelled one as none of them.
|
|
1678
|
+
*/
|
|
1154
1679
|
type MatrixSummary = {
|
|
1155
1680
|
cells: number;
|
|
1156
1681
|
runs: number;
|
|
1157
1682
|
passed: number;
|
|
1158
1683
|
failed: number;
|
|
1684
|
+
limited: number;
|
|
1159
1685
|
cancelled: number;
|
|
1160
1686
|
};
|
|
1161
1687
|
/** Bounded workers pull cells from the iterator; no Cartesian job array is allocated. */
|
|
@@ -1177,6 +1703,13 @@ type UpgradeReport = {
|
|
|
1177
1703
|
batches: number;
|
|
1178
1704
|
/** Old runs left alone because they are still running. */
|
|
1179
1705
|
running: string[];
|
|
1706
|
+
/** Version 6 runs whose trajectory became an ATXF transcript (or would). */
|
|
1707
|
+
transcripts: number;
|
|
1708
|
+
/** Runs that could not be converted, left as they were, with why. */
|
|
1709
|
+
failed: Array<{
|
|
1710
|
+
runId: string;
|
|
1711
|
+
reason: string;
|
|
1712
|
+
}>;
|
|
1180
1713
|
};
|
|
1181
1714
|
/**
|
|
1182
1715
|
* Rewrites results from report schema versions 2 to 5 into version 6, in
|
|
@@ -1189,7 +1722,8 @@ type UpgradeReport = {
|
|
|
1189
1722
|
* old run is removed only after its new runs exist, and one replaced under
|
|
1190
1723
|
* the same ID is set aside first, so a crash at any point leaves the old run
|
|
1191
1724
|
* or complete new ones, and re-running finishes the job. Version 6 runs are
|
|
1192
|
-
* left alone.
|
|
1725
|
+
* left alone. Then every version 6 run is converted to version 7, its
|
|
1726
|
+
* trajectory into an ATXF transcript (RFD0009).
|
|
1193
1727
|
*/
|
|
1194
1728
|
export declare function upgradeReports(root: string, options?: {
|
|
1195
1729
|
dryRun?: boolean;
|
|
@@ -1207,8 +1741,14 @@ export type RunEvalOptions = {
|
|
|
1207
1741
|
suiteId?: string;
|
|
1208
1742
|
/** Overrides the scenario's `repeat`: how many runs to start, as one batch. */
|
|
1209
1743
|
repeat?: number;
|
|
1210
|
-
/** Parameters made available to the AUT for this invocation. */
|
|
1744
|
+
/** Parameters made available to the AUT, and to judges, for this invocation. */
|
|
1211
1745
|
parameters?: JsonObject;
|
|
1746
|
+
/** Where each run's processes run, through `context.shell`. Default `none()`: on the host. */
|
|
1747
|
+
isolation?: Isolation;
|
|
1748
|
+
/** The project's fixtures, shared by an invocation's runs; started by the first run. */
|
|
1749
|
+
fixtures?: FixtureSet;
|
|
1750
|
+
/** The agent for judges that name none (`judge` in evalkit.config.ts). */
|
|
1751
|
+
judge?: AutAdapter;
|
|
1212
1752
|
/** Matrix provenance recorded in every run's manifest. */
|
|
1213
1753
|
matrix?: RunMetadata['matrix'];
|
|
1214
1754
|
/** Selects a declared AUT runtime such as local, sandbox, or remote. */
|
|
@@ -1240,12 +1780,29 @@ export type RunEvalOptions = {
|
|
|
1240
1780
|
*/
|
|
1241
1781
|
signal?: AbortSignal;
|
|
1242
1782
|
/**
|
|
1243
|
-
*
|
|
1244
|
-
*
|
|
1783
|
+
* What each run may use before EvalKit stops it. `base` is the project's
|
|
1784
|
+
* limits; the scenario's own come after it, then a matrix cell's
|
|
1785
|
+
* `limits.<kind>` parameters, then `override` (`--limit`), kind by kind.
|
|
1786
|
+
*/
|
|
1787
|
+
limits?: {
|
|
1788
|
+
base?: Limits;
|
|
1789
|
+
override?: Limits;
|
|
1790
|
+
};
|
|
1791
|
+
/**
|
|
1792
|
+
* Observes every transcript record and run event once recorded, for live
|
|
1793
|
+
* progress. It must not throw; an error it throws is ignored.
|
|
1245
1794
|
*/
|
|
1246
|
-
|
|
1795
|
+
onUpdate?: (run: RunRef, update: RunUpdate) => void;
|
|
1247
1796
|
now?: () => Date;
|
|
1248
1797
|
};
|
|
1798
|
+
/** A record appended to a run's transcript, or one of EvalKit's events. */
|
|
1799
|
+
export type RunUpdate = {
|
|
1800
|
+
kind: 'record';
|
|
1801
|
+
record: EntryRecord;
|
|
1802
|
+
} | {
|
|
1803
|
+
kind: 'event';
|
|
1804
|
+
event: RunEvent;
|
|
1805
|
+
};
|
|
1249
1806
|
/** Identifies the run an observed event belongs to. */
|
|
1250
1807
|
export type RunRef = {
|
|
1251
1808
|
runId: string;
|
|
@@ -1261,5 +1818,5 @@ export type RunRef = {
|
|
|
1261
1818
|
*/
|
|
1262
1819
|
export declare function runEval(definition: EvalDefinition, options: RunEvalOptions): Effect.Effect<RunResult[], unknown>;
|
|
1263
1820
|
//#endregion
|
|
1264
|
-
export type { DatasetFileEntry, MatrixSummary, UpgradeReport };
|
|
1821
|
+
export type { DatasetFileEntry, FixtureSet, MatrixSummary, UpgradeReport };
|
|
1265
1822
|
//# sourceMappingURL=runner.d.mts.map
|