@leostera/evalkit 0.6.1 → 0.8.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 +48 -1
- package/dist/cli.mjs +5186 -10301
- package/dist/dashboard/assets/index-C12IeG2y.css +2 -0
- package/dist/dashboard/assets/{index-CTJpd8q8.js → index-xlVsW6ZR.js} +14 -11
- package/dist/dashboard/index.html +2 -2
- package/dist/index.d.mts +130 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -8
- package/dist/runner.d.mts +104 -3
- package/dist/runner.d.mts.map +1 -1
- package/dist/runner.mjs +2 -2
- package/dist/skills/evalkit-evals/SKILL.md +1 -1
- package/dist/skills/evalkit-judges/SKILL.md +3 -2
- package/dist/skills/evalkit-results/SKILL.md +1 -1
- package/dist/{src-CZPufWN_.mjs → src-LeGSyDD2.mjs} +56 -3
- package/dist/{src-CKqOzeBi.mjs → src-mm8L_IxM.mjs} +227 -36
- package/package.json +1 -1
- package/dist/dashboard/assets/index-YAabTN3X.css +0 -2
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>EvalKit</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-xlVsW6ZR.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C12IeG2y.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/index.d.mts
CHANGED
|
@@ -241,9 +241,11 @@ export type EvalCatalogScorer = {
|
|
|
241
241
|
rubric?: string;
|
|
242
242
|
definedAt?: string;
|
|
243
243
|
};
|
|
244
|
-
export type EvalCatalogStep =
|
|
244
|
+
export type EvalCatalogStep =
|
|
245
|
+
/** `message` is absent when it is computed for each trial. */
|
|
246
|
+
{
|
|
245
247
|
kind: 'user';
|
|
246
|
-
message
|
|
248
|
+
message?: string;
|
|
247
249
|
} | {
|
|
248
250
|
kind: 'agent';
|
|
249
251
|
expectation: JsonValue;
|
|
@@ -341,13 +343,29 @@ type EvalkitConfig = {
|
|
|
341
343
|
maxCells?: number;
|
|
342
344
|
};
|
|
343
345
|
reportDir?: string;
|
|
346
|
+
/** The candidate files saved with each trial's results. */
|
|
347
|
+
artifacts?: {
|
|
348
|
+
/**
|
|
349
|
+
* Paths to leave out, as globs relative to the candidate workspace; a
|
|
350
|
+
* pattern without `/` matches that name at any depth. Replaces the default,
|
|
351
|
+
* `DEFAULT_ARTIFACT_EXCLUDE` (dependencies, build output, VCS metadata).
|
|
352
|
+
* A scenario's `workspace.ignore` patterns come after these.
|
|
353
|
+
*/
|
|
354
|
+
exclude?: readonly string[];
|
|
355
|
+
};
|
|
356
|
+
/** Where each trial's real workspace lives during a run. Default `_evalkit-sandbox`. */
|
|
344
357
|
sandboxDir?: string;
|
|
358
|
+
/** Which trial workspaces to keep in `sandboxDir` afterwards. Default `'failed'`: only trials that did not pass. */
|
|
359
|
+
keepSandboxes?: KeepSandboxes;
|
|
345
360
|
share?: ShareConfig;
|
|
346
361
|
};
|
|
362
|
+
type KeepSandboxes = 'failed' | 'all' | 'none';
|
|
363
|
+
/** Left out of candidate snapshots unless `artifacts.exclude` says otherwise. */
|
|
364
|
+
export declare const DEFAULT_ARTIFACT_EXCLUDE: readonly string[];
|
|
347
365
|
/** HTTP header names and values. */
|
|
348
366
|
type ShareHeaders = Record<string, string>;
|
|
349
367
|
type ShareConfig = {
|
|
350
|
-
/** Where `evalkit share` uploads results.
|
|
368
|
+
/** Where `evalkit share` uploads results. `--server <url>` overrides it. */
|
|
351
369
|
url: string;
|
|
352
370
|
/**
|
|
353
371
|
* Extra headers for every request to the share server, e.g. credentials for
|
|
@@ -476,6 +494,8 @@ export declare const TrialMetadataSchema: Schema.Struct<{
|
|
|
476
494
|
version: Schema.optional<typeof Schema.String>;
|
|
477
495
|
}>>;
|
|
478
496
|
startedAt: typeof Schema.String;
|
|
497
|
+
/** The effective snapshot ignore patterns: the project's, then the scenario's. */
|
|
498
|
+
workspaceIgnore: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
|
|
479
499
|
datasets: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
480
500
|
id: typeof Schema.String;
|
|
481
501
|
visibility: Schema.Literal<["candidate", "evaluator"]>;
|
|
@@ -539,6 +559,7 @@ export declare const TrialManifestSchema: Schema.Struct<{
|
|
|
539
559
|
version: Schema.optional<typeof Schema.String>;
|
|
540
560
|
}>>;
|
|
541
561
|
startedAt: typeof Schema.String;
|
|
562
|
+
workspaceIgnore: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
|
|
542
563
|
datasets: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
543
564
|
id: typeof Schema.String;
|
|
544
565
|
visibility: Schema.Literal<["candidate", "evaluator"]>;
|
|
@@ -629,6 +650,18 @@ export declare const CheckpointResultSchema: Schema.Struct<{
|
|
|
629
650
|
id: typeof Schema.String;
|
|
630
651
|
}>>;
|
|
631
652
|
}>;
|
|
653
|
+
export declare const MetricResultSchema: Schema.Struct<{
|
|
654
|
+
name: typeof Schema.String;
|
|
655
|
+
value: Schema.optional<typeof Schema.Number>;
|
|
656
|
+
unit: Schema.optional<typeof Schema.String>;
|
|
657
|
+
better: Schema.optional<Schema.Literal<["lower", "higher"]>>;
|
|
658
|
+
builtIn: Schema.optional<Schema.Literal<[true]>>;
|
|
659
|
+
error: Schema.optional<Schema.Struct<{
|
|
660
|
+
name: typeof Schema.String;
|
|
661
|
+
message: typeof Schema.String;
|
|
662
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
663
|
+
}>>;
|
|
664
|
+
}>;
|
|
632
665
|
export declare const TrialScoringSchema: Schema.Struct<{
|
|
633
666
|
results: Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
634
667
|
name: typeof Schema.String;
|
|
@@ -659,6 +692,18 @@ export declare const TrialScoringSchema: Schema.Struct<{
|
|
|
659
692
|
}>>;
|
|
660
693
|
skipped: Schema.optional<Schema.Literal<[true]>>;
|
|
661
694
|
}>>>;
|
|
695
|
+
metrics: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
696
|
+
name: typeof Schema.String;
|
|
697
|
+
value: Schema.optional<typeof Schema.Number>;
|
|
698
|
+
unit: Schema.optional<typeof Schema.String>;
|
|
699
|
+
better: Schema.optional<Schema.Literal<["lower", "higher"]>>;
|
|
700
|
+
builtIn: Schema.optional<Schema.Literal<[true]>>;
|
|
701
|
+
error: Schema.optional<Schema.Struct<{
|
|
702
|
+
name: typeof Schema.String;
|
|
703
|
+
message: typeof Schema.String;
|
|
704
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
705
|
+
}>>;
|
|
706
|
+
}>>>>;
|
|
662
707
|
checkpoints: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
663
708
|
step: typeof Schema.Number;
|
|
664
709
|
kind: Schema.Literal<["predicate", "judge", "expect-tool-call"]>;
|
|
@@ -736,6 +781,18 @@ export declare const TrialSummarySchema: Schema.Struct<{
|
|
|
736
781
|
}>>;
|
|
737
782
|
skipped: Schema.optional<Schema.Literal<[true]>>;
|
|
738
783
|
}>>>;
|
|
784
|
+
metrics: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
785
|
+
name: typeof Schema.String;
|
|
786
|
+
value: Schema.optional<typeof Schema.Number>;
|
|
787
|
+
unit: Schema.optional<typeof Schema.String>;
|
|
788
|
+
better: Schema.optional<Schema.Literal<["lower", "higher"]>>;
|
|
789
|
+
builtIn: Schema.optional<Schema.Literal<[true]>>;
|
|
790
|
+
error: Schema.optional<Schema.Struct<{
|
|
791
|
+
name: typeof Schema.String;
|
|
792
|
+
message: typeof Schema.String;
|
|
793
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
794
|
+
}>>;
|
|
795
|
+
}>>>>;
|
|
739
796
|
checkpoints: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
740
797
|
step: typeof Schema.Number;
|
|
741
798
|
kind: Schema.Literal<["predicate", "judge", "expect-tool-call"]>;
|
|
@@ -995,9 +1052,20 @@ export declare function agentRuntimes(agent: AutAdapter<any>): AgentRuntimes;
|
|
|
995
1052
|
* It preserves the adapter's concrete type for application-specific helpers.
|
|
996
1053
|
*/
|
|
997
1054
|
export declare function defineAgent<const T extends AutAdapter>(agent: T): T;
|
|
1055
|
+
/** What a computed user message may depend on: only what the agent is given too. */
|
|
1056
|
+
export type UserMessageInput = {
|
|
1057
|
+
/** The matrix cell's parameters and CLI overrides. */
|
|
1058
|
+
parameters: JsonObject;
|
|
1059
|
+
/** Values of the scenario's candidate datasets, by dataset ID (never evaluator ones). */
|
|
1060
|
+
data: JsonObject;
|
|
1061
|
+
/** The trial's random seed (also in `context.metadata.randomSeed`). */
|
|
1062
|
+
seed: number;
|
|
1063
|
+
trialIndex: number;
|
|
1064
|
+
};
|
|
998
1065
|
export type UserStep = {
|
|
999
1066
|
kind: 'user';
|
|
1000
|
-
message
|
|
1067
|
+
/** A fixed message, or one computed for each trial. */
|
|
1068
|
+
message: string | ((input: UserMessageInput) => string);
|
|
1001
1069
|
};
|
|
1002
1070
|
export type AgentStep = {
|
|
1003
1071
|
kind: 'agent';
|
|
@@ -1035,7 +1103,11 @@ export type ExpectToolCallStep = {
|
|
|
1035
1103
|
export type TranscriptStep = UserStep | AgentStep | ScoringRule | ExpectToolCallStep;
|
|
1036
1104
|
/** Observes a tool call in the preceding turn; never invokes a tool. */
|
|
1037
1105
|
export declare function expectToolCall(expected: ExpectToolCallStep['expected']): ExpectToolCallStep;
|
|
1038
|
-
|
|
1106
|
+
/**
|
|
1107
|
+
* A user message. Pass a function to compute it for each trial, e.g. from a
|
|
1108
|
+
* matrix axis: `user(({ parameters }) => `Set up OCaml with ${parameters.toolchain}.`)`.
|
|
1109
|
+
*/
|
|
1110
|
+
export declare function user(message: UserStep['message']): UserStep;
|
|
1039
1111
|
export declare function agent(expectation: JsonObject): AgentStep;
|
|
1040
1112
|
export type JudgeRunInfo = {
|
|
1041
1113
|
agent?: AutIdentity;
|
|
@@ -1091,6 +1163,12 @@ export type ScoringContext = {
|
|
|
1091
1163
|
output?: JsonValue;
|
|
1092
1164
|
/** Values of all the scenario's datasets (candidate and evaluator), by dataset ID. */
|
|
1093
1165
|
data: JsonObject;
|
|
1166
|
+
/**
|
|
1167
|
+
* Results of the transcript's checkpoints so far, in order: all of them for
|
|
1168
|
+
* final scorers. A checkpoint's `evidence` can carry what it observed (for
|
|
1169
|
+
* example, in a container that is gone by final scoring).
|
|
1170
|
+
*/
|
|
1171
|
+
checkpoints: readonly CheckpointResult[];
|
|
1094
1172
|
};
|
|
1095
1173
|
export type PredicateScorer = {
|
|
1096
1174
|
kind: 'predicate';
|
|
@@ -1109,6 +1187,32 @@ export type JudgeRule = {
|
|
|
1109
1187
|
};
|
|
1110
1188
|
export type ScoringRule = PredicateScorer | JudgeRule;
|
|
1111
1189
|
export declare function predicate(name: string, run: PredicateScorer['run'], options?: Pick<PredicateScorer, 'supportsPartial' | 'passAt'>): PredicateScorer;
|
|
1190
|
+
/**
|
|
1191
|
+
* A number measured for every trial, such as tokens, retries or web searches.
|
|
1192
|
+
* Metrics never decide pass or fail; they are averaged per run and shown on
|
|
1193
|
+
* the scoreboard. Return undefined when there is nothing to measure.
|
|
1194
|
+
*/
|
|
1195
|
+
export type Metric = {
|
|
1196
|
+
kind: 'metric';
|
|
1197
|
+
name: string;
|
|
1198
|
+
/** Shown next to values: `ms` formats as a duration, others as numbers. */
|
|
1199
|
+
unit?: string;
|
|
1200
|
+
/** Which direction is an improvement, for comparisons. */
|
|
1201
|
+
better?: 'lower' | 'higher';
|
|
1202
|
+
run(context: ScoringContext): number | undefined | Promise<number | undefined>;
|
|
1203
|
+
};
|
|
1204
|
+
export declare function metric(name: string, run: Metric['run'], options?: Pick<Metric, 'unit' | 'better'>): Metric;
|
|
1205
|
+
/** A metric's value for one trial. */
|
|
1206
|
+
export type MetricResult = {
|
|
1207
|
+
name: string;
|
|
1208
|
+
/** Absent when the metric measured nothing or failed. */
|
|
1209
|
+
value?: number;
|
|
1210
|
+
unit?: string;
|
|
1211
|
+
better?: 'lower' | 'higher';
|
|
1212
|
+
/** Measured by EvalKit itself (agent time, tokens, tool calls). */
|
|
1213
|
+
builtIn?: true;
|
|
1214
|
+
error?: RecordedError;
|
|
1215
|
+
};
|
|
1112
1216
|
export declare function judge(name: string, options: Pick<JudgeRule, 'rubric' | 'supportsPartial'>): JudgeRule;
|
|
1113
1217
|
export type EvalPolicy = {
|
|
1114
1218
|
timeoutMs?: number;
|
|
@@ -1127,9 +1231,24 @@ export type EvalDefinition<TAgent extends AutAdapter = AutAdapter> = {
|
|
|
1127
1231
|
datasets?: readonly Dataset[];
|
|
1128
1232
|
transcript: TranscriptStep[];
|
|
1129
1233
|
scoring: ScoringRule[];
|
|
1234
|
+
/** Numbers to measure for every trial; they never affect pass or fail. */
|
|
1235
|
+
metrics?: readonly Metric[];
|
|
1130
1236
|
policy?: EvalPolicy;
|
|
1131
1237
|
/** Any JSON-convertible object; converted when the eval is defined. */
|
|
1132
1238
|
metadata?: Record<string, unknown>;
|
|
1239
|
+
workspace?: EvalWorkspace;
|
|
1240
|
+
};
|
|
1241
|
+
/** How EvalKit treats this scenario's candidate workspace. */
|
|
1242
|
+
export type EvalWorkspace = {
|
|
1243
|
+
/**
|
|
1244
|
+
* Paths to leave out of the trial's snapshot, read like `.gitignore`: globs
|
|
1245
|
+
* relative to the workspace, where a pattern without `/` matches that name
|
|
1246
|
+
* at any depth and later patterns win. They come after the project's
|
|
1247
|
+
* `artifacts.exclude` (default `DEFAULT_ARTIFACT_EXCLUDE`), so `!pattern`
|
|
1248
|
+
* can keep a path the project leaves out, even inside an ignored directory:
|
|
1249
|
+
* `['!_build/doc/**']` keeps generated docs while dropping the rest of `_build`.
|
|
1250
|
+
*/
|
|
1251
|
+
ignore?: readonly string[];
|
|
1133
1252
|
};
|
|
1134
1253
|
export declare function defineEval<const T extends EvalDefinition>(definition: T): T;
|
|
1135
1254
|
export type EvalSuite<TEvals extends readonly EvalDefinition[] = readonly EvalDefinition[]> = {
|
|
@@ -1236,6 +1355,8 @@ export type TrialMetadata = {
|
|
|
1236
1355
|
};
|
|
1237
1356
|
aut?: AutIdentity;
|
|
1238
1357
|
startedAt: string;
|
|
1358
|
+
/** The effective snapshot ignore patterns: the project's `artifacts.exclude`, then the scenario's `workspace.ignore`. */
|
|
1359
|
+
workspaceIgnore?: string[];
|
|
1239
1360
|
/** From schema version 5: the datasets this trial used, with content digests. */
|
|
1240
1361
|
datasets?: TrialDataset[];
|
|
1241
1362
|
};
|
|
@@ -1263,8 +1384,11 @@ export type CheckpointResult = {
|
|
|
1263
1384
|
id: string;
|
|
1264
1385
|
};
|
|
1265
1386
|
};
|
|
1387
|
+
/** Metrics EvalKit records for every trial; scenario metrics may not reuse these names. */
|
|
1388
|
+
export declare const BUILT_IN_METRICS: readonly string[];
|
|
1266
1389
|
export type TrialScoring = {
|
|
1267
1390
|
results: ScoreResult[];
|
|
1391
|
+
metrics?: MetricResult[];
|
|
1268
1392
|
checkpoints?: CheckpointResult[];
|
|
1269
1393
|
skippedScorers?: string[];
|
|
1270
1394
|
overall?: number;
|
|
@@ -1352,5 +1476,5 @@ type PiAutOptions = {
|
|
|
1352
1476
|
/** A local, one-prompt-per-turn AUT backed by Pi's non-interactive print mode. */
|
|
1353
1477
|
export declare function piAgent(options?: PiAutOptions): AutAdapter;
|
|
1354
1478
|
//#endregion
|
|
1355
|
-
export type { DefinitionSite, EvalMatrix, EvalMatrixCell, EvalkitConfig, MatrixSelection, ShareConfig, ShareHeaders };
|
|
1479
|
+
export type { DefinitionSite, EvalMatrix, EvalMatrixCell, EvalkitConfig, KeepSandboxes, MatrixSelection, ShareConfig, ShareHeaders };
|
|
1356
1480
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../core/src/identity.ts","../../core/src/dataset.ts","../../core/src/aut-events.ts","../../core/src/catalog.ts","../../core/src/canonical-json.ts","../../core/src/matrix.ts","../../core/src/config.ts","../../core/src/json.ts","../../core/src/definition-site.ts","../../core/src/schema.ts","../../core/src/trajectory.ts","../../core/src/index.ts","../../agents/src/index.ts"],"mappings":";;qBAEa,oBAAkB,OAAA;YACnB,sBAAsB,mBAAmB;;wBAGrC,SAAS;;qBAOZ,YAAU,OAAA,cAAA,OAAA;YAKX,cAAc,WAAW;YAEzB,YAAY,cAAc,eAAe,2BACxC;qBAEA,mBAAiB,OAAA,cAAA,OAAA;wBAMd,kBAAkB,cAAc,cAAc,MAAM,QAAK,OAAA,cAAA,OAAA;wBAWzD,YAAY,cAAc,cACxC,MAAM,OACN,MAAM,OACL,YAAY;wBAIC,iBAAiB,cAAc,cAC7C,eACA,eAAe;EACZ,MAAM;EAAO,MAAM;EAAM,KAAK,YAAY;;wBAY/B,aAAa,eAAe,eAAe,eAAe;;;;YCvD9D;;YAGA,6BAA6B;EAAe;;;;;;YAM5C,wBAAwB,SAAS,eAAe;;YAGhD;EACV,QAAQ;;EAER;;YAGU;;EAEV;EACA,QAAQ;;YAGE;EACV;EACA;EACA;EACA;;EAEA;;EAEA,YAAY;EACZ,QAAQ;;KAGL;EACH;EACA;;EAEA,aAAa;;EAEb;;YAGU,0BAA0B;EACpC,QAAQ;;EAER;;EAEA;EACA;EACA;;YAGU,0BAA0B,gBAAgB,kBACpD;;EAEE,SAAS,MAAM,uBAAuB,UAAU,QAAQ;;EAExD,SACE,QAAQ,SACR,OAAO,wBACJ,iBAAiB,QAAQ;EAC9B;EACA;EACA;;YAGQ;EAEN;EACA,QAAQ;EACR;EACA;;EAGA;EACA,SACE,MAAM,uBACH,iBAAiB,QAAQ;EAC9B,SACE,QAAQ,gBACR,OAAO,wBACJ,iBAAiB,QAAQ;;;YAIxB;WACD;WACA;WACA;WACA,YAAY;;WAEZ;WACA,QAAQ;;;wBAIH,oBAAoB,eAAe;;;;;;;wBAuBnC,cAAc,gBAAgB,gBAC5C,YAAY,0BAA0B,0BAA0B,WAC/D;wBAmFa,UAAU,iBAAiB,SAAS;;;;;;;YC/MxC;EACN;EAAiB;;EAEjB;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EAAsB;EAAc;;EAEpC;EACA;EACA;EACA;EACA,QAAQ;;EAER;EAAmB;EAAkB;;EACrC;EAAe,OAAO;EAAe;;YAE/B;EACV;EACA;;EAEA;EACA;;;YAIU;EAGN;EACA,qBAAqB;EACrB,QAAQ;;;wBAIE,kBACd,OAAO,eACP,WAAW,OACV;;;;;wBA0Da,iBACd,QAAQ,YACR,cACA,WAAW,OACV;;;;;;;;;YCtGS;;EAEV;;YAGU;EACV;EACA;EACA;EACA;EACA,UAAU;IAAQ,MAAM;IAAkB;;;EAE1C;;;YAIU;EACN;EAAe;;EACf;EAAgB;;EAChB;;YAEM;EACV;EACA;EACA,YAAY;EACZ;EACA;;EAEA;IAAU;;IAAwB;;;EAElC;IAAU,OAAO;;IAAiB;;;EAElC;IAAU;IAAc;;EACxB;;YAGU;EACV;EACA,MAAM;EACN;EACA;;EAEA;EACA;;YAGU;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../core/src/identity.ts","../../core/src/dataset.ts","../../core/src/aut-events.ts","../../core/src/catalog.ts","../../core/src/canonical-json.ts","../../core/src/matrix.ts","../../core/src/config.ts","../../core/src/json.ts","../../core/src/definition-site.ts","../../core/src/schema.ts","../../core/src/trajectory.ts","../../core/src/index.ts","../../agents/src/index.ts"],"mappings":";;qBAEa,oBAAkB,OAAA;YACnB,sBAAsB,mBAAmB;;wBAGrC,SAAS;;qBA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ACA,UAAU;EACV,YAAY;EACZ,QAAQ;;YAGE;EACV,QAAQ;EACR;EACA;EACA;EACA;EACA;;EAEA;EACA,QAAQ;;YAGE;EACV,YAAY,OAAO,kBAAkB;EACrC,YAAY,SAAS,eAAe;;EAEpC,cAAc,cAAc,MAAM,aAAa;EAC/C,SAAS,SAAS,eAAe;;YAGvB;WACD;EACT,WAAW,UAAU,gBAAgB,QAAQ;EAC7C,SAAS,SAAS,aAAa;;YAGrB;EACV,SACE,UAAU,aACV;IAAY,UAAU;MACrB,QAAQ;;YAGD;EACV;EACA,QAAQ;EACR;EACA,UAAU;EACV;EACA;EACA,QAAQ;EACR;EACA;EACA,UAAU;EACV,QAAQ;;YAGE;EACV;EACA;EACA;EACA;EACA;;YAGU,YAAY;EACtB;EACA;EACA;EACA;EACA,mBAAmB;;EAEnB,SAAS;;wBAYK,YAAY,iBAAiB;;;KCj1BjC;EACV;;EAEA;;;wBAIc,QAAQ,UAAS,eAAoB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
//#region ../core/src/config.ts
|
|
3
|
-
/** Pure, typed project configuration. Loading/discovery belongs to the CLI. */
|
|
4
|
-
function defineConfig(configuration) {
|
|
5
|
-
return configuration;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
1
|
+
import { $ as ResourceUriSchema, A as RunSummarySchema, B as defineEvalMatrix, C as JudgeRunInfoSchema, D as RunMetadataSchema, E as RunManifestSchema, F as TrialScoringSchema, G as NotJsonError, H as DEFAULT_ARTIFACT_EXCLUDE, I as TrialSummarySchema, J as defineDataset, K as toJson, L as UsageSchema, M as TrajectoryEventSchema, N as TrialManifestSchema, O as RunSourceSchema, P as TrialMetadataSchema, Q as ResourceKindSchema, R as normalizeAutEvent, S as JsonValueSchema, T as RecordedErrorSchema, U as defineConfig, V as canonicalParameters, W as catalogEntry, X as relativeDatasetPath, Y as isDataset, Z as definitionSite, _ as parseTrajectoryJsonl, a as authoringId, at as resourceUuid, b as AutIdentitySchema, c as defineSuite, d as metric, et as UuidSchema, f as predicate, g as user, h as skip, i as agentRuntimes, it as resourceUriSchema, j as ScoreResultSchema, k as RunStatusSchema, l as expectToolCall, m as registerEvals, n as DEFAULT_AGENT_RUNTIMES, nt as parseResourceUri, o as defineAgent, p as recordError, q as toJsonObject, r as agent, rt as resourceUri, s as defineEval, t as BUILT_IN_METRICS, tt as authorId, u as judge, v as ApiErrorSchema, w as MetricResultSchema, x as CheckpointResultSchema, y as ArtifactEntrySchema, z as turnResultEvents } from "./src-LeGSyDD2.mjs";
|
|
8
2
|
//#region ../agents/src/index.ts
|
|
9
3
|
/** A local, one-prompt-per-turn AUT backed by Pi's non-interactive print mode. */
|
|
10
4
|
function piAgent(options = {}) {
|
|
@@ -74,4 +68,4 @@ function piAgent(options = {}) {
|
|
|
74
68
|
});
|
|
75
69
|
}
|
|
76
70
|
//#endregion
|
|
77
|
-
export { ApiErrorSchema, ArtifactEntrySchema, AutIdentitySchema, CheckpointResultSchema, DEFAULT_AGENT_RUNTIMES, JsonValueSchema, JudgeRunInfoSchema, NotJsonError, RecordedErrorSchema, ResourceKindSchema, ResourceUriSchema, RunManifestSchema, RunMetadataSchema, RunSourceSchema, RunStatusSchema, RunSummarySchema, ScoreResultSchema, TrajectoryEventSchema, TrialManifestSchema, TrialMetadataSchema, TrialScoringSchema, TrialSummarySchema, UsageSchema, UuidSchema, agent, agentRuntimes, authorId, authoringId, canonicalParameters, catalogEntry, defineAgent, defineConfig, defineDataset, defineEval, defineEvalMatrix, defineSuite, definitionSite, expectToolCall, isDataset, judge, normalizeAutEvent, parseResourceUri, parseTrajectoryJsonl, piAgent, predicate, recordError, registerEvals, relativeDatasetPath, resourceUri, resourceUriSchema, resourceUuid, skip, toJson, toJsonObject, turnResultEvents, user };
|
|
71
|
+
export { ApiErrorSchema, ArtifactEntrySchema, AutIdentitySchema, BUILT_IN_METRICS, CheckpointResultSchema, DEFAULT_AGENT_RUNTIMES, DEFAULT_ARTIFACT_EXCLUDE, JsonValueSchema, JudgeRunInfoSchema, MetricResultSchema, NotJsonError, RecordedErrorSchema, ResourceKindSchema, ResourceUriSchema, RunManifestSchema, RunMetadataSchema, RunSourceSchema, RunStatusSchema, RunSummarySchema, ScoreResultSchema, TrajectoryEventSchema, TrialManifestSchema, TrialMetadataSchema, TrialScoringSchema, TrialSummarySchema, UsageSchema, UuidSchema, agent, agentRuntimes, authorId, authoringId, canonicalParameters, catalogEntry, defineAgent, defineConfig, defineDataset, defineEval, defineEvalMatrix, defineSuite, definitionSite, expectToolCall, isDataset, judge, metric, normalizeAutEvent, parseResourceUri, parseTrajectoryJsonl, piAgent, predicate, recordError, registerEvals, relativeDatasetPath, resourceUri, resourceUriSchema, resourceUuid, skip, toJson, toJsonObject, turnResultEvents, user };
|
package/dist/runner.d.mts
CHANGED
|
@@ -221,9 +221,11 @@ type EvalCatalogScorer = {
|
|
|
221
221
|
rubric?: string;
|
|
222
222
|
definedAt?: string;
|
|
223
223
|
};
|
|
224
|
-
type EvalCatalogStep =
|
|
224
|
+
type EvalCatalogStep =
|
|
225
|
+
/** `message` is absent when it is computed for each trial. */
|
|
226
|
+
{
|
|
225
227
|
kind: 'user';
|
|
226
|
-
message
|
|
228
|
+
message?: string;
|
|
227
229
|
} | {
|
|
228
230
|
kind: 'agent';
|
|
229
231
|
expectation: JsonValue;
|
|
@@ -292,6 +294,9 @@ type EvalMatrix = EvalMatrixDefinition & {
|
|
|
292
294
|
cells(selection?: MatrixSelection): IterableIterator<EvalMatrixCell>;
|
|
293
295
|
};
|
|
294
296
|
//#endregion
|
|
297
|
+
//#region ../core/src/config.d.ts
|
|
298
|
+
type KeepSandboxes = 'failed' | 'all' | 'none';
|
|
299
|
+
//#endregion
|
|
295
300
|
//#region ../core/src/index.d.ts
|
|
296
301
|
type JsonPrimitive = boolean | number | string | null;
|
|
297
302
|
type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
@@ -469,9 +474,20 @@ type AutSession<TMessage = string> = {
|
|
|
469
474
|
/** Optional; defaults to doing nothing. */
|
|
470
475
|
close?(): Promise<void>;
|
|
471
476
|
};
|
|
477
|
+
/** What a computed user message may depend on: only what the agent is given too. */
|
|
478
|
+
type UserMessageInput = {
|
|
479
|
+
/** The matrix cell's parameters and CLI overrides. */
|
|
480
|
+
parameters: JsonObject;
|
|
481
|
+
/** Values of the scenario's candidate datasets, by dataset ID (never evaluator ones). */
|
|
482
|
+
data: JsonObject;
|
|
483
|
+
/** The trial's random seed (also in `context.metadata.randomSeed`). */
|
|
484
|
+
seed: number;
|
|
485
|
+
trialIndex: number;
|
|
486
|
+
};
|
|
472
487
|
type UserStep = {
|
|
473
488
|
kind: 'user';
|
|
474
|
-
message
|
|
489
|
+
/** A fixed message, or one computed for each trial. */
|
|
490
|
+
message: string | ((input: UserMessageInput) => string);
|
|
475
491
|
};
|
|
476
492
|
type AgentStep = {
|
|
477
493
|
kind: 'agent';
|
|
@@ -556,6 +572,12 @@ type ScoringContext = {
|
|
|
556
572
|
output?: JsonValue;
|
|
557
573
|
/** Values of all the scenario's datasets (candidate and evaluator), by dataset ID. */
|
|
558
574
|
data: JsonObject;
|
|
575
|
+
/**
|
|
576
|
+
* Results of the transcript's checkpoints so far, in order: all of them for
|
|
577
|
+
* final scorers. A checkpoint's `evidence` can carry what it observed (for
|
|
578
|
+
* example, in a container that is gone by final scoring).
|
|
579
|
+
*/
|
|
580
|
+
checkpoints: readonly CheckpointResult[];
|
|
559
581
|
};
|
|
560
582
|
type PredicateScorer = {
|
|
561
583
|
kind: 'predicate';
|
|
@@ -573,6 +595,31 @@ type JudgeRule = {
|
|
|
573
595
|
supportsPartial?: boolean;
|
|
574
596
|
};
|
|
575
597
|
type ScoringRule = PredicateScorer | JudgeRule;
|
|
598
|
+
/**
|
|
599
|
+
* A number measured for every trial, such as tokens, retries or web searches.
|
|
600
|
+
* Metrics never decide pass or fail; they are averaged per run and shown on
|
|
601
|
+
* the scoreboard. Return undefined when there is nothing to measure.
|
|
602
|
+
*/
|
|
603
|
+
type Metric = {
|
|
604
|
+
kind: 'metric';
|
|
605
|
+
name: string;
|
|
606
|
+
/** Shown next to values: `ms` formats as a duration, others as numbers. */
|
|
607
|
+
unit?: string;
|
|
608
|
+
/** Which direction is an improvement, for comparisons. */
|
|
609
|
+
better?: 'lower' | 'higher';
|
|
610
|
+
run(context: ScoringContext): number | undefined | Promise<number | undefined>;
|
|
611
|
+
};
|
|
612
|
+
/** A metric's value for one trial. */
|
|
613
|
+
type MetricResult = {
|
|
614
|
+
name: string;
|
|
615
|
+
/** Absent when the metric measured nothing or failed. */
|
|
616
|
+
value?: number;
|
|
617
|
+
unit?: string;
|
|
618
|
+
better?: 'lower' | 'higher';
|
|
619
|
+
/** Measured by EvalKit itself (agent time, tokens, tool calls). */
|
|
620
|
+
builtIn?: true;
|
|
621
|
+
error?: RecordedError;
|
|
622
|
+
};
|
|
576
623
|
type EvalPolicy = {
|
|
577
624
|
timeoutMs?: number;
|
|
578
625
|
/** Stop later transcript steps after a failed checkpoint assertion. Default false. */
|
|
@@ -590,9 +637,24 @@ type EvalDefinition<TAgent extends AutAdapter = AutAdapter> = {
|
|
|
590
637
|
datasets?: readonly Dataset[];
|
|
591
638
|
transcript: TranscriptStep[];
|
|
592
639
|
scoring: ScoringRule[];
|
|
640
|
+
/** Numbers to measure for every trial; they never affect pass or fail. */
|
|
641
|
+
metrics?: readonly Metric[];
|
|
593
642
|
policy?: EvalPolicy;
|
|
594
643
|
/** Any JSON-convertible object; converted when the eval is defined. */
|
|
595
644
|
metadata?: Record<string, unknown>;
|
|
645
|
+
workspace?: EvalWorkspace;
|
|
646
|
+
};
|
|
647
|
+
/** How EvalKit treats this scenario's candidate workspace. */
|
|
648
|
+
type EvalWorkspace = {
|
|
649
|
+
/**
|
|
650
|
+
* Paths to leave out of the trial's snapshot, read like `.gitignore`: globs
|
|
651
|
+
* relative to the workspace, where a pattern without `/` matches that name
|
|
652
|
+
* at any depth and later patterns win. They come after the project's
|
|
653
|
+
* `artifacts.exclude` (default `DEFAULT_ARTIFACT_EXCLUDE`), so `!pattern`
|
|
654
|
+
* can keep a path the project leaves out, even inside an ignored directory:
|
|
655
|
+
* `['!_build/doc/**']` keeps generated docs while dropping the rest of `_build`.
|
|
656
|
+
*/
|
|
657
|
+
ignore?: readonly string[];
|
|
596
658
|
};
|
|
597
659
|
type EvalRegistryMetadata = {
|
|
598
660
|
id: string;
|
|
@@ -671,6 +733,8 @@ type TrialMetadata = {
|
|
|
671
733
|
};
|
|
672
734
|
aut?: AutIdentity;
|
|
673
735
|
startedAt: string;
|
|
736
|
+
/** The effective snapshot ignore patterns: the project's `artifacts.exclude`, then the scenario's `workspace.ignore`. */
|
|
737
|
+
workspaceIgnore?: string[];
|
|
674
738
|
/** From schema version 5: the datasets this trial used, with content digests. */
|
|
675
739
|
datasets?: TrialDataset[];
|
|
676
740
|
};
|
|
@@ -700,6 +764,7 @@ type CheckpointResult = {
|
|
|
700
764
|
};
|
|
701
765
|
type TrialScoring = {
|
|
702
766
|
results: ScoreResult[];
|
|
767
|
+
metrics?: MetricResult[];
|
|
703
768
|
checkpoints?: CheckpointResult[];
|
|
704
769
|
skippedScorers?: string[];
|
|
705
770
|
overall?: number;
|
|
@@ -870,6 +935,7 @@ export declare const readTrialManifest: (root: string, runId: string, trialId: s
|
|
|
870
935
|
readonly version?: string | undefined;
|
|
871
936
|
} | undefined;
|
|
872
937
|
readonly startedAt: string;
|
|
938
|
+
readonly workspaceIgnore?: string[] | undefined;
|
|
873
939
|
readonly datasets?: {
|
|
874
940
|
readonly id: string;
|
|
875
941
|
readonly visibility: "candidate" | "evaluator";
|
|
@@ -912,6 +978,18 @@ export declare const readTrialSummary: (root: string, runId: string, trialId: st
|
|
|
912
978
|
} | undefined;
|
|
913
979
|
readonly skipped?: true | undefined;
|
|
914
980
|
}[];
|
|
981
|
+
readonly metrics?: {
|
|
982
|
+
readonly name: string;
|
|
983
|
+
readonly value?: number | undefined;
|
|
984
|
+
readonly unit?: string | undefined;
|
|
985
|
+
readonly better?: "higher" | "lower" | undefined;
|
|
986
|
+
readonly builtIn?: true | undefined;
|
|
987
|
+
readonly error?: {
|
|
988
|
+
readonly name: string;
|
|
989
|
+
readonly message: string;
|
|
990
|
+
readonly stack?: string | undefined;
|
|
991
|
+
} | undefined;
|
|
992
|
+
}[] | undefined;
|
|
915
993
|
readonly checkpoints?: {
|
|
916
994
|
readonly step: number;
|
|
917
995
|
readonly kind: "expect-tool-call" | "judge" | "predicate";
|
|
@@ -991,6 +1069,18 @@ export declare const readTrialScoring: (root: string, runId: string, trialId: st
|
|
|
991
1069
|
} | undefined;
|
|
992
1070
|
readonly skipped?: true | undefined;
|
|
993
1071
|
}[];
|
|
1072
|
+
readonly metrics?: {
|
|
1073
|
+
readonly name: string;
|
|
1074
|
+
readonly value?: number | undefined;
|
|
1075
|
+
readonly unit?: string | undefined;
|
|
1076
|
+
readonly better?: "higher" | "lower" | undefined;
|
|
1077
|
+
readonly builtIn?: true | undefined;
|
|
1078
|
+
readonly error?: {
|
|
1079
|
+
readonly name: string;
|
|
1080
|
+
readonly message: string;
|
|
1081
|
+
readonly stack?: string | undefined;
|
|
1082
|
+
} | undefined;
|
|
1083
|
+
}[] | undefined;
|
|
994
1084
|
readonly checkpoints?: {
|
|
995
1085
|
readonly step: number;
|
|
996
1086
|
readonly kind: "expect-tool-call" | "judge" | "predicate";
|
|
@@ -1052,6 +1142,10 @@ export declare function runMatrix(matrix: EvalMatrix, options: Omit<RunEvalOptio
|
|
|
1052
1142
|
onResult?: (cell: EvalMatrixCell, result: RunResult) => void | Promise<void>;
|
|
1053
1143
|
}): Effect.Effect<MatrixSummary, unknown>;
|
|
1054
1144
|
//#endregion
|
|
1145
|
+
//#region ../runner/src/workspace.d.ts
|
|
1146
|
+
/** Where a trial's persistent workspace lives below `root`. */
|
|
1147
|
+
export declare function trialWorkspacePath(root: string, trialId: string): string;
|
|
1148
|
+
//#endregion
|
|
1055
1149
|
//#region ../runner/src/index.d.ts
|
|
1056
1150
|
export type RunEvalOptions = {
|
|
1057
1151
|
report: ReportStore;
|
|
@@ -1072,6 +1166,13 @@ export type RunEvalOptions = {
|
|
|
1072
1166
|
semaphore?: Effect.Semaphore;
|
|
1073
1167
|
/** Base directory for persistent local trial workspaces. Omit for an ephemeral OS temp workspace. */
|
|
1074
1168
|
workspaceRoot?: string;
|
|
1169
|
+
/** With `workspaceRoot`: which trial workspaces to keep afterwards. Default `'failed'`. */
|
|
1170
|
+
keepWorkspaces?: KeepSandboxes;
|
|
1171
|
+
/**
|
|
1172
|
+
* Candidate paths left out of the artifact snapshot, before the scenario's
|
|
1173
|
+
* own `workspace.ignore`. Default `DEFAULT_ARTIFACT_EXCLUDE`.
|
|
1174
|
+
*/
|
|
1175
|
+
artifactExclude?: readonly string[];
|
|
1075
1176
|
/** Repository and commit the eval code came from, recorded in the manifest. */
|
|
1076
1177
|
source?: RunSource;
|
|
1077
1178
|
/** The project's evals and suites at run time, saved beside the manifest. */
|
package/dist/runner.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.mts","names":["_$_evalkit_core0.JsonValue","_$_evalkit_core0.TrajectoryEvent"],"sources":["../../runner/src/errors.ts","../../core/src/identity.ts","../../core/src/dataset.ts","../../core/src/aut-events.ts","../../core/src/catalog.ts","../../core/src/matrix.ts","../../core/src/index.ts","../../runner/src/local-report-store.ts","../../runner/src/datasets.ts","../../runner/src/local-report-reader.ts","../../runner/src/matrix.ts","../../runner/src/index.ts"],"mappings":";;;;;;qBAEa,0BAA0B;EACrC;EACA;;;;;qBAGW,qBAAqB;EAChC;EACA;;;;;qBAGW,oBAAoB;EAC/B;EACA;;;;;qBAGW,qBAAqB;EAChC;EACA;;;;;qBASW,iCAAiC;EAG5C;EACA;EACA;EACA;;;;;;qBAIW,uBAAuB;EAClC;;;;cCrCW,oBAAkB,OAAA;KACnB,sBAAsB,mBAAmB;KAiBzC,YAAY,cAAc,eAAe,2BACxC;;;;KCdD;;KAGA,6BAA6B;EAAe;;;;;;KAM5C,wBAAwB,SAAS,eAAe;;KAGhD;EACV,QAAQ;;EAER;;KAGU;;EAEV;EACA,QAAQ;;KAGE;EACV;EACA;EACA;EACA;;EAEA;;EAEA,YAAY;EACZ,QAAQ;;KAoCE;EAEN;EACA,QAAQ;EACR;EACA;;EAGA;EACA,SACE,MAAM,uBACH,iBAAiB,QAAQ;EAC9B,SACE,QAAQ,gBACR,OAAO,wBACJ,iBAAiB,QAAQ;;;KAIxB;WACD;WACA;WACA;WACA,YAAY;;WAEZ;WACA,QAAQ;;;;;;;;KC/FP;EACN;EAAiB;;EAEjB;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EAAsB;EAAc;;EAEpC;EACA;EACA;EACA;EACA,QAAQ;;EAER;EAAmB;EAAkB;;EACrC;EAAe,OAAO;EAAe;;KAE/B;EACV;EACA;;EAEA;EACA;;;KAIU;EAGN;EACA,qBAAqB;EACrB,QAAQ;;;;KC5BF;EACV;EACA;EACA;EACA;EACA,UAAU;IAAQ,MAAM;IAAkB;;;EAE1C;;;KAIU;EACN;EAAe;;EACf;EAAgB;;EAChB;;KAEM;EACV;EACA;EACA,YAAY;EACZ;EACA;;EAEA;IAAU;;IAAwB;;;EAElC;IAAU,OAAO;;IAAiB;;;EAElC;IAAU;IAAc;;EACxB;;KAGU;EACV;EACA,MAAM;EACN;EACA;;EAEA;EACA;;KAGU;
|
|
1
|
+
{"version":3,"file":"runner.d.mts","names":["_$_evalkit_core0.JsonValue","_$_evalkit_core0.TrajectoryEvent"],"sources":["../../runner/src/errors.ts","../../core/src/identity.ts","../../core/src/dataset.ts","../../core/src/aut-events.ts","../../core/src/catalog.ts","../../core/src/matrix.ts","../../core/src/config.ts","../../core/src/index.ts","../../runner/src/local-report-store.ts","../../runner/src/datasets.ts","../../runner/src/local-report-reader.ts","../../runner/src/matrix.ts","../../runner/src/workspace.ts","../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OAAO,UAAU,OAAO;EACnC,YAAY;;;YAIF;EACV;EACA;EACA;EACA;EACA;EACA,aAAa;;;wBASC,QACd,YAAY,gBACZ,SAAS,iBACR,OAAO,OAAO"}
|
package/dist/runner.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { AutExecutionError, CancelledError, CheckpointExecutionError, DatasetError, ReportError, ScoringError, localReportStore, ownerIsGone, readRunManifest, readRunSummary, readTrialEvents, readTrialManifest, readTrialScoring, readTrialSummary, runEval, runMatrix, staticDatasetFile, staticDatasetFiles };
|
|
1
|
+
import { _ as CheckpointExecutionError, a as readRunSummary, b as ScoringError, c as readTrialScoring, d as trialWorkspacePath, f as staticDatasetFile, g as CancelledError, h as AutExecutionError, i as readRunManifest, l as readTrialSummary, n as runMatrix, o as readTrialEvents, p as staticDatasetFiles, r as ownerIsGone, s as readTrialManifest, t as runEval, u as localReportStore, v as DatasetError, y as ReportError } from "./src-mm8L_IxM.mjs";
|
|
2
|
+
export { AutExecutionError, CancelledError, CheckpointExecutionError, DatasetError, ReportError, ScoringError, localReportStore, ownerIsGone, readRunManifest, readRunSummary, readTrialEvents, readTrialManifest, readTrialScoring, readTrialSummary, runEval, runMatrix, staticDatasetFile, staticDatasetFiles, trialWorkspacePath };
|
|
@@ -8,7 +8,7 @@ description: Define or modify EvalKit scenarios (evals) and suites. Use when add
|
|
|
8
8
|
Read `../evalkit/SKILL.md`, `../../../sites/evalkit.leostera.dev/src/content/docs/manual/project-structure.md` and `../../../sites/evalkit.leostera.dev/src/content/docs/manual/scoring-and-evals.md`, `../../../examples/starter/scenarios/greeting.eval.ts`, and `../../../examples/configured-matrix/evalkit.config.ts`.
|
|
9
9
|
|
|
10
10
|
1. Default-export one scenario per file from `scenarios/**/*.eval.ts` using `defineEval({ id: 'my-scenario', name, agent, transcript, scoring, datasets?, policy? })`. The CLI discovers these files automatically; no registry or config is required. Choose a stable lowercase kebab-case ID. `metadata` is optional; `name` is a display label. Import shared agents, judges and datasets; keep each scenario short and concrete (a suite of a hundred cases is a hundred files), and never generate scenarios in a loop.
|
|
11
|
-
2. Executable transcript steps are `user('message')`, inline `predicate(...)`, `judge(...)`, and `expectToolCall(...)`. User messages call `session.send` in order on one fresh session per trial; predicates/judges/tool-call assertions run at checkpoints. `judge(...)` requires a separate eval-level `judge` adapter. `agent(...)` transcript steps are not executable. `{
|
|
11
|
+
2. Executable transcript steps are `user('message')`, inline `predicate(...)`, `judge(...)`, and `expectToolCall(...)`. User messages call `session.send` in order on one fresh session per trial; predicates/judges/tool-call assertions run at checkpoints. `judge(...)` requires a separate eval-level `judge` adapter. `agent(...)` transcript steps are not executable. `user(({ parameters, data, seed, trialIndex }) => ...)` computes a message per trial, so one scenario can vary its prompt by matrix axis or candidate dataset instead of being copied per variant; `policy.trials` controls independent trials (default 1, positive integer); `policy.timeoutMs` is not enforced.
|
|
12
12
|
3. Suites are directories: every file below `scenarios/billing/` is in suite `billing` (kebab-case directory names; deeper directories stay in the top one). Files directly in `scenarios/` have no suite; `discovery.suites: false` turns this off. Only use an explicit registry (`registry: registerEvals([defineSuite({ id, evals })])` in the config) when you need full control; it replaces discovery, and duplicate eval IDs throw.
|
|
13
13
|
4. For an intervention comparison, hold task/model/prompt constant and vary one explicit matrix axis (for example `memory: ['off', 'on']`). Repeat trials and include a negative control where possible. Record whether the treatment injects a saved memory or performs live retrieval: those answer different questions. A memory dataset can be evaluator-visible to the trusted adapter, but do not expose evaluator roots or reference answers to the AUT unless revealing the chosen treatment is intentional.
|
|
14
14
|
5. From the project directory run `bun run evalkit run <eval-id>`. Use `bun run evalkit run --suite <suite-id>` for a suite directory. IDs are exact human-defined strings. Inspect per-trial `scoring.json` and the run `summary.json`; completed execution is not the same as passing scores.
|
|
@@ -9,9 +9,10 @@ Read `../evalkit/SKILL.md`, `../../../sites/evalkit.leostera.dev/src/content/doc
|
|
|
9
9
|
|
|
10
10
|
EvalKit currently executes deterministic `predicate(name, callback)` scorers and agent-backed `judge(name, { rubric })` rules. A judge rule requires a **separate eval-level `judge` adapter**; it is not inferred from or shared with the AUT. The `judgeScorer(...)` API is not implemented—do not suggest it.
|
|
11
11
|
|
|
12
|
-
1. Add a named `predicate(...)` for deterministic checks or a `judge(...)` descriptor for rubric-based LLM assessment, then reference it from the eval's `scoring` array or supported transcript checkpoint. The predicate callback receives `{ context, output, data, trajectory, artifacts, turn? }
|
|
12
|
+
1. Add a named `predicate(...)` for deterministic checks or a `judge(...)` descriptor for rubric-based LLM assessment, then reference it from the eval's `scoring` array or supported transcript checkpoint. The predicate callback receives `{ context, output, data, trajectory, artifacts, checkpoints, turn? }`; `checkpoints` are earlier checkpoint results (all of them in final scoring), so a checkpoint that inspects live state before the session closes can hand its `evidence` to final scorers. Use `output` for the final assistant reply and `data[id]` for dataset values (expected answers belong in an evaluator dataset); only filter `trajectory.events` (by `source: 'aut'` and `kind`) for tool calls or intermediate messages. `context` includes per-trial IDs, metadata, random seed and optional parameters; workspace roots are absolute local paths.
|
|
13
13
|
2. A predicate returns a boolean, a finite score from 0 to 1, `{ value, passed?, explanation?, evidence? }` (evidence may be any plain value), or `skip(reason)` when the check does not apply. Without `passed`, only `value === 1` passes; give `predicate(name, fn, { passAt: 0.8 })` for a threshold. A skipped result neither passes nor fails and is left out of averages; never fake "not applicable" as a pass. Use clear evidence for debugging.
|
|
14
14
|
3. A `judge(...)` rule sends a rubric plus the current turn or trajectory to the separate judge adapter, which must emit a JSON verdict. Validate that the judge is independent from the AUT, runs in an appropriate workspace, and does not receive secrets. Judge events/prompts may contain sensitive data and incur model cost; cost is not inferred unless the adapter emits usage.
|
|
15
15
|
4. Normal scorers are skipped after primary execution errors unless declared with `{ supportsPartial: true }` and the required context/workspace exists. Scorer exceptions and invalid scores become recorded failures; never mask them as passes.
|
|
16
16
|
5. Scorers run after the AUT closes; use `node:fs/promises` to inspect candidate/evaluator files before workspace cleanup. Keep evaluator references and secrets out of AUT events, evidence, and exported reports. Reading one evaluator dataset in a trusted adapter and deliberately injecting it as an experiment treatment is valid, but measures injected context—not whether the AUT retrieved it itself.
|
|
17
|
-
6.
|
|
17
|
+
6. Numbers to compare rather than gate on (tokens, time, retries, mistakes, web searches) are **metrics**, not scorers: `metric(name, (context) => number | undefined, { unit?, better? })` in the eval's `metrics` array. Never fake one as a predicate that always passes. Agent time, tokens (when the adapter reports usage) and tool calls are recorded automatically; have the adapter emit `turn-completed` usage so tokens appear. Means show on the run page and scoreboard.
|
|
18
|
+
7. Test passing, failing, and missing-output trajectories; inspect `scoring.json` (`results`, `overall`, `passed`) and run `summary.json`. `overall` is an unweighted mean of valid scores, not the pass rate. Execution `status: 'completed'` can still have failed scoring; run-level `failed` is the meaningful aggregate gate.
|
|
@@ -7,7 +7,7 @@ description: Run Evalkit locally and interpret or process evaluation results. Us
|
|
|
7
7
|
|
|
8
8
|
Read `../evalkit/SKILL.md` and `../../../sites/evalkit.leostera.dev/src/content/docs/index.md` (First run) and `../../../sites/evalkit.leostera.dev/src/content/docs/manual/cli-and-matrices.md` and `../../../sites/evalkit.leostera.dev/src/content/docs/manual/results.md`. Verify report semantics in `../../../packages/runner/src/index.ts`, `../../../packages/runner/src/local-report-store.ts`, and `../../../packages/cli/src/index.ts` before automation.
|
|
9
9
|
|
|
10
|
-
1. Run from the project root containing default-exported `scenarios/**/*.eval.ts` (as in `examples/starter`, or use an optional config as in `examples/configured-matrix`), not this skill directory. Start with `bun run evalkit run <eval-id>`; run all evals only when intended (Pi-backed evals can cost tokens). `bun run evalkit run --suite <suite-id>`, `bun run evalkit run --matrix <matrix-id>`, and `bun run evalkit dev` are also available; `bun run evalkit build [--out dir]` writes a read-only static dashboard snapshot (reports plus candidate artifacts, never evaluator workspaces) that must still be reviewed before sharing; it asks to run evals first (always runs them when there are no results; `--run`/`--no-run` skip the prompt). `bun run evalkit tidy` archives runs of evals no longer in the project (marker `archived.json`, nothing deleted); archived runs are hidden in the dashboard and excluded from builds. Runs record `source` (repo, project, commit, ref, dirty) in `manifest.json`; `bun run evalkit share` uploads runs for HEAD to the configured share server (`share.url` or `EVALKIT_SHARE_URL`; `share.headers` (object or function) adds headers for an auth proxy in front of the server; `--all`, `--allow-dirty`, `--no-workspace`) and prints the URL. `bun run evalkit share serve` runs a local share server.
|
|
10
|
+
1. Run from the project root containing default-exported `scenarios/**/*.eval.ts` (as in `examples/starter`, or use an optional config as in `examples/configured-matrix`), not this skill directory. Start with `bun run evalkit run <eval-id>`; run all evals only when intended (Pi-backed evals can cost tokens). `bun run evalkit run --suite <suite-id>`, `bun run evalkit run --matrix <matrix-id>`, and `bun run evalkit dev` are also available; `bun run evalkit build [--out dir]` writes a read-only static dashboard snapshot (reports plus candidate artifacts, never evaluator workspaces) that must still be reviewed before sharing; it asks to run evals first (always runs them when there are no results; `--run`/`--no-run` skip the prompt). `bun run evalkit tidy` archives runs of evals no longer in the project (marker `archived.json`, nothing deleted); archived runs are hidden in the dashboard and excluded from builds. Runs record `source` (repo, project, commit, ref, dirty) in `manifest.json`; `bun run evalkit share` uploads runs for HEAD to the configured share server (`share.url` or `EVALKIT_SHARE_URL`; `share.headers` (object or function) adds headers for an auth proxy in front of the server; `--all`, `--allow-dirty`, `--no-workspace`) and prints the URL. `bun run evalkit share serve` runs a local share server. Pass `dev --no-open` or `dev --port <n>` (`-p`) for dashboard behavior, and `--log-level debug` (on `run`, `dev` or `build`) to see the runner's structured logs. `evalkit <command> --help` lists every flag. `--concurrency` bounds cell parallelism. In CI, add `--junit <file>` (one test case per scenario and matrix cell) and gate with `bun run evalkit compare --base <branch> --fail-on regression` (or `--base-dir <results>`; `--markdown <file>` for an MR comment, `--fail-on score-drop=0.05`). `run` exits 1 on any failure or a selected file that failed to load (`--skip-broken` runs the rest), 130 when cancelled with Ctrl+C; cancelled runs are never failures. Datasets' digests are recorded per trial; `compare` lists changed datasets. For baseline/treatment studies, inspect a `--dry-run` first, keep model/task/prompt constant, and identify whether the treatment is injected context or live tool retrieval.
|
|
11
11
|
2. Each `_evalkit-results/<run-uuid>/` has `manifest.json`, `summary.json`, and `trials/<trial-uuid>/{manifest.json,trajectory.jsonl,scoring.json,summary.json,artifacts/candidate/...}`. `trajectory.jsonl` contains one JSON event per line; filter by `source` and `kind`. `scoring.json` records scorer values/explanations/errors; candidate snapshot files are report artifacts.
|
|
12
12
|
3. Read run `summary.json` fields `passed`, `failed`, `trialCount` for success rates. Trial `status: 'completed'` means execution finished, **not** that its scorers passed. `scoring.overall` is an unweighted mean of valid values, not a pass rate. For CI, use `jq -e '.failed == 0 and .trialCount > 0' "_evalkit-results/<run-uuid>/summary.json"` after replacing the placeholder; CLI exits nonzero when a matrix cell fails; the report supplies trial-level detail.
|
|
13
13
|
4. `--json` emits one JSON object per completed matrix cell with its key, eval ID, effective parameters, and run result. Read the saved trial trajectory for adapter-emitted turn latency or token usage; EvalKit does not infer provider cost, latency, or token counts. Compare matrix conditions at both cell and trial level and avoid claiming significance from a small pilot.
|