@tangle-network/agent-eval 0.126.7 → 0.128.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 +59 -0
- package/README.md +6 -2
- package/dist/analyst/index.d.ts +52 -43
- package/dist/analyst/index.js +4 -4
- package/dist/belief-state/index.d.ts +35 -40
- package/dist/belief-state/index.js +2 -2
- package/dist/benchmarks/index.d.ts +30 -12
- package/dist/benchmarks/index.js +12 -11
- package/dist/builder-eval/index.js +1 -1
- package/dist/campaign/index.d.ts +441 -160
- package/dist/campaign/index.js +11 -10
- package/dist/{chunk-IILEIWGW.js → chunk-2JX3CFMB.js} +100 -40
- package/dist/chunk-2JX3CFMB.js.map +1 -0
- package/dist/chunk-2MKQIFS4.js +183 -0
- package/dist/chunk-2MKQIFS4.js.map +1 -0
- package/dist/{chunk-NUKSVU3W.js → chunk-5DTSBUL2.js} +2 -2
- package/dist/{chunk-H5UD2323.js → chunk-7ZZMD7UK.js} +102 -2
- package/dist/chunk-7ZZMD7UK.js.map +1 -0
- package/dist/{chunk-474LBSOX.js → chunk-BYT7ELPS.js} +45 -18
- package/dist/chunk-BYT7ELPS.js.map +1 -0
- package/dist/{chunk-LUNF2SEL.js → chunk-DJKY2TSY.js} +3 -3
- package/dist/chunk-DPUHNQLN.js +232 -0
- package/dist/chunk-DPUHNQLN.js.map +1 -0
- package/dist/chunk-DRYIUNWY.js +622 -0
- package/dist/chunk-DRYIUNWY.js.map +1 -0
- package/dist/{chunk-IPYXE555.js → chunk-EJGRPCO3.js} +36 -13
- package/dist/chunk-EJGRPCO3.js.map +1 -0
- package/dist/{chunk-OCFJACJU.js → chunk-EOSZT7PL.js} +82 -18
- package/dist/chunk-EOSZT7PL.js.map +1 -0
- package/dist/{chunk-ZVCHKKOP.js → chunk-EZJEIH2R.js} +39 -15
- package/dist/chunk-EZJEIH2R.js.map +1 -0
- package/dist/{chunk-M7AH34KV.js → chunk-IHQDPH7D.js} +32 -16
- package/dist/chunk-IHQDPH7D.js.map +1 -0
- package/dist/{chunk-PJQFMIOX.js → chunk-MHELPNRP.js} +31 -1
- package/dist/chunk-MHELPNRP.js.map +1 -0
- package/dist/{chunk-K6IAZZ6L.js → chunk-NACAGYSY.js} +153 -122
- package/dist/chunk-NACAGYSY.js.map +1 -0
- package/dist/{chunk-BTACVO2W.js → chunk-NKAGIDE2.js} +542 -258
- package/dist/chunk-NKAGIDE2.js.map +1 -0
- package/dist/{chunk-ARU2PZFM.js → chunk-NYLOYM6N.js} +43 -23
- package/dist/chunk-NYLOYM6N.js.map +1 -0
- package/dist/{chunk-QOTFXW5L.js → chunk-P5W7RQKK.js} +2 -2
- package/dist/{chunk-IR3KBHOY.js → chunk-P6FYH6K4.js} +39 -3
- package/dist/chunk-P6FYH6K4.js.map +1 -0
- package/dist/{chunk-J5SQWP6Y.js → chunk-PBE2LOSS.js} +18 -2
- package/dist/chunk-PBE2LOSS.js.map +1 -0
- package/dist/{chunk-X4UCIOTZ.js → chunk-S5YLIBFX.js} +2 -2
- package/dist/{chunk-7VYEGHWF.js → chunk-SZLVEKMJ.js} +41 -20
- package/dist/chunk-SZLVEKMJ.js.map +1 -0
- package/dist/{chunk-P22LJ3Y2.js → chunk-TBL77AUT.js} +8 -8
- package/dist/chunk-TBL77AUT.js.map +1 -0
- package/dist/{chunk-LKKT3IVV.js → chunk-TSN7JT6D.js} +6 -4
- package/dist/{chunk-LKKT3IVV.js.map → chunk-TSN7JT6D.js.map} +1 -1
- package/dist/{chunk-E3IADPLG.js → chunk-UB2LOJ6Q.js} +51 -227
- package/dist/chunk-UB2LOJ6Q.js.map +1 -0
- package/dist/{chunk-MAX3TN3C.js → chunk-UWZZKKU7.js} +7 -19
- package/dist/chunk-UWZZKKU7.js.map +1 -0
- package/dist/{chunk-DPZAEKA6.js → chunk-VLOATJQ2.js} +85 -57
- package/dist/chunk-VLOATJQ2.js.map +1 -0
- package/dist/{chunk-MOXWMGPC.js → chunk-XDWDC2MP.js} +197 -79
- package/dist/chunk-XDWDC2MP.js.map +1 -0
- package/dist/{chunk-CGG5SLH3.js → chunk-XPRT64IE.js} +2 -2
- package/dist/{chunk-FO7HEH76.js → chunk-YJBNWCAA.js} +2 -2
- package/dist/{chunk-KE2VWPZX.js → chunk-ZUUWPZCV.js} +3 -3
- package/dist/cli.js +4 -4
- package/dist/contract/index.d.ts +438 -138
- package/dist/contract/index.js +259 -113
- package/dist/contract/index.js.map +1 -1
- package/dist/control.d.ts +56 -39
- package/dist/control.js +2 -3
- package/dist/hosted/index.d.ts +152 -51
- package/dist/hosted/index.js +24 -1
- package/dist/index.d.ts +399 -277
- package/dist/index.js +363 -244
- package/dist/index.js.map +1 -1
- package/dist/meta-eval/index.d.ts +33 -36
- package/dist/meta-eval/index.js +2 -2
- package/dist/multishot/index.d.ts +1 -0
- package/dist/openapi.json +1 -1
- package/dist/pipelines/index.js +2 -2
- package/dist/reporting.d.ts +101 -80
- package/dist/reporting.js +7 -5
- package/dist/rl.d.ts +198 -142
- package/dist/rl.js +235 -127
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +54 -67
- package/dist/rollout/index.js +6 -5
- package/dist/{run-campaign-FFRM3RH5.js → run-campaign-ISHFZ7FJ.js} +6 -3
- package/dist/supervisor-run/index.d.ts +7 -15
- package/dist/supervisor-run/index.js +2 -2
- package/dist/traces.d.ts +72 -50
- package/dist/traces.js +9 -6
- package/dist/wire/index.d.ts +1 -0
- package/dist/wire/index.js +2 -2
- package/docs/concepts.md +18 -1
- package/docs/customer-journeys.md +7 -6
- package/docs/hosted-ingest-spec.md +37 -40
- package/docs/insight-report.md +78 -7
- package/docs/research-report-methodology.md +20 -21
- package/docs/rollout.md +13 -8
- package/package.json +4 -3
- package/dist/chunk-474LBSOX.js.map +0 -1
- package/dist/chunk-7VYEGHWF.js.map +0 -1
- package/dist/chunk-ARU2PZFM.js.map +0 -1
- package/dist/chunk-BTACVO2W.js.map +0 -1
- package/dist/chunk-DPZAEKA6.js.map +0 -1
- package/dist/chunk-E3IADPLG.js.map +0 -1
- package/dist/chunk-H5UD2323.js.map +0 -1
- package/dist/chunk-IILEIWGW.js.map +0 -1
- package/dist/chunk-IPYXE555.js.map +0 -1
- package/dist/chunk-IR3KBHOY.js.map +0 -1
- package/dist/chunk-J5SQWP6Y.js.map +0 -1
- package/dist/chunk-K6IAZZ6L.js.map +0 -1
- package/dist/chunk-M7AH34KV.js.map +0 -1
- package/dist/chunk-MAX3TN3C.js.map +0 -1
- package/dist/chunk-MOXWMGPC.js.map +0 -1
- package/dist/chunk-OCFJACJU.js.map +0 -1
- package/dist/chunk-P22LJ3Y2.js.map +0 -1
- package/dist/chunk-PJQFMIOX.js.map +0 -1
- package/dist/chunk-VSMTAMNK.js +0 -53
- package/dist/chunk-VSMTAMNK.js.map +0 -1
- package/dist/chunk-ZVCHKKOP.js.map +0 -1
- package/dist/chunk-ZZUXHH3R.js +0 -99
- package/dist/chunk-ZZUXHH3R.js.map +0 -1
- /package/dist/{chunk-NUKSVU3W.js.map → chunk-5DTSBUL2.js.map} +0 -0
- /package/dist/{chunk-LUNF2SEL.js.map → chunk-DJKY2TSY.js.map} +0 -0
- /package/dist/{chunk-QOTFXW5L.js.map → chunk-P5W7RQKK.js.map} +0 -0
- /package/dist/{chunk-X4UCIOTZ.js.map → chunk-S5YLIBFX.js.map} +0 -0
- /package/dist/{chunk-CGG5SLH3.js.map → chunk-XPRT64IE.js.map} +0 -0
- /package/dist/{chunk-FO7HEH76.js.map → chunk-YJBNWCAA.js.map} +0 -0
- /package/dist/{chunk-KE2VWPZX.js.map → chunk-ZUUWPZCV.js.map} +0 -0
- /package/dist/{run-campaign-FFRM3RH5.js.map → run-campaign-ISHFZ7FJ.js.map} +0 -0
package/dist/rl.d.ts
CHANGED
|
@@ -233,7 +233,8 @@ type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'to
|
|
|
233
233
|
* researcher loop SHOULD be recorded as a `RunRecord`. The mandatory
|
|
234
234
|
* fields are exactly those the paper "Two Loops, Three Roles" requires
|
|
235
235
|
* for reproducibility: who/what/when/cost/seed/hash, plus the search vs
|
|
236
|
-
* holdout split tag
|
|
236
|
+
* holdout split tag. A task score is optional because execution-only records
|
|
237
|
+
* must preserve missing labels instead of converting errors into zero quality.
|
|
237
238
|
*
|
|
238
239
|
* This is intentionally NOT a replacement for the rich `Run` /
|
|
239
240
|
* `ProposeReviewReport` / `ScenarioResult` types already in the
|
|
@@ -254,6 +255,13 @@ type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'to
|
|
|
254
255
|
/** Search/dev/holdout split tag. 'search' is the paper-grade alias for the
|
|
255
256
|
* combined train+test pool that the optimizer is allowed to read. */
|
|
256
257
|
type RunSplitTag = 'search' | 'dev' | 'holdout';
|
|
258
|
+
/**
|
|
259
|
+
* Explicit execution-lifecycle result for a run.
|
|
260
|
+
*
|
|
261
|
+
* This is separate from task quality (`outcome`) and failure classification.
|
|
262
|
+
* Producers set it only from root-run or process evidence.
|
|
263
|
+
*/
|
|
264
|
+
type RunTerminalOutcome = 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown';
|
|
257
265
|
interface RunTokenUsage {
|
|
258
266
|
input: number;
|
|
259
267
|
/** All generated tokens charged as output, including reasoning tokens. */
|
|
@@ -267,11 +275,6 @@ interface RunTokenUsage {
|
|
|
267
275
|
}
|
|
268
276
|
/**
|
|
269
277
|
* How a run's USD amount was obtained.
|
|
270
|
-
*
|
|
271
|
-
* `costUsd` remains mandatory for wire compatibility. New producers should
|
|
272
|
-
* always populate this discriminated union so a missing bill is never
|
|
273
|
-
* mistaken for an observed zero-dollar run. For `uncaptured`, `costUsd` uses
|
|
274
|
-
* the legacy `0` sentinel while this field carries the truthful null.
|
|
275
278
|
*/
|
|
276
279
|
type RunCostProvenance = {
|
|
277
280
|
kind: 'observed';
|
|
@@ -317,8 +320,8 @@ interface JudgeScoresRecord {
|
|
|
317
320
|
perJudge: Record<string, Record<string, number>>;
|
|
318
321
|
/** Per-dim mean across judges. Convenience — derivable from `perJudge`. */
|
|
319
322
|
perDimMean: Record<string, number>;
|
|
320
|
-
/** Composite mean across
|
|
321
|
-
*
|
|
323
|
+
/** Composite mean across successful judges. Mirrors the task score only
|
|
324
|
+
* when `failedJudges` is empty. */
|
|
322
325
|
composite: number;
|
|
323
326
|
/** Judges that errored or returned an unparseable verdict. Recorded
|
|
324
327
|
* by id (e.g. `['glm-5.1']`) so a partial-failure case is explicit,
|
|
@@ -329,11 +332,11 @@ interface JudgeScoresRecord {
|
|
|
329
332
|
notes?: string;
|
|
330
333
|
}
|
|
331
334
|
interface RunOutcome {
|
|
332
|
-
/** Score on the search/optimization split. Optional
|
|
333
|
-
*
|
|
335
|
+
/** Score on the search/optimization split. Optional for holdout-only and
|
|
336
|
+
* execution-only records. */
|
|
334
337
|
searchScore?: number;
|
|
335
|
-
/** Score on the held-out split. Optional
|
|
336
|
-
*
|
|
338
|
+
/** Score on the held-out split. Optional for search-only and execution-only
|
|
339
|
+
* records. When both scores are absent, the run is explicitly unlabeled. */
|
|
337
340
|
holdoutScore?: number;
|
|
338
341
|
/** Bag of any other metric the run produced — judge dimensions,
|
|
339
342
|
* pass/fail counters, latency stats, etc. Numeric only — keeps
|
|
@@ -397,42 +400,36 @@ interface RunRecord {
|
|
|
397
400
|
wallMs: number;
|
|
398
401
|
/** Time spent queued before execution started, if known. */
|
|
399
402
|
queueMs?: number;
|
|
400
|
-
/** Total USD cost
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
costUsd: number;
|
|
405
|
-
/** Observed, model-priced estimate, or genuinely uncaptured USD amount.
|
|
406
|
-
* Optional only so existing serialized RunRecords remain valid. */
|
|
407
|
-
costProvenance?: RunCostProvenance;
|
|
403
|
+
/** Total USD cost, or null when the producer could not capture one. */
|
|
404
|
+
costUsd: number | null;
|
|
405
|
+
/** Whether `costUsd` came from billing data, a price calculation, or is unavailable. */
|
|
406
|
+
costProvenance: RunCostProvenance;
|
|
408
407
|
/** Token usage breakdown. */
|
|
409
408
|
tokenUsage: RunTokenUsage;
|
|
409
|
+
/** Root-run or process terminal result. Never inferred from a child span. */
|
|
410
|
+
terminalOutcome: RunTerminalOutcome;
|
|
411
|
+
/** Root-run or process failure reason. Valid only for a failed, cancelled,
|
|
412
|
+
* or incomplete terminal result; never populated from a child span. */
|
|
413
|
+
terminalFailureReason?: string;
|
|
410
414
|
/** Judge-side metadata, if a judge was used. */
|
|
411
415
|
judgeMetadata?: RunJudgeMetadata;
|
|
412
416
|
/** Per-split scores + raw bag. */
|
|
413
417
|
outcome: RunOutcome;
|
|
414
|
-
/** Canonical
|
|
415
|
-
* `FAILURE_CLASSES` taxonomy.
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* set it via the substrate classifier; leave unset only when the failure
|
|
419
|
-
* genuinely can't be classified. */
|
|
418
|
+
/** Canonical task-failure class drawn from the shared
|
|
419
|
+
* `FAILURE_CLASSES` taxonomy. Producers set it only from task-result
|
|
420
|
+
* evidence. Execution errors belong in
|
|
421
|
+
* `outcome.raw.execution_error_count`. */
|
|
420
422
|
failureClass?: FailureClass;
|
|
421
|
-
/** Free-form
|
|
422
|
-
*
|
|
423
|
-
* The within-agent drill-down; `failureClass` is the cross-agent key. */
|
|
423
|
+
/** Free-form task-failure detail scoped under a non-success
|
|
424
|
+
* `failureClass`. It is invalid without that class. */
|
|
424
425
|
failureMode?: string;
|
|
425
426
|
/** Which split this run was drawn from. */
|
|
426
427
|
splitTag: RunSplitTag;
|
|
427
428
|
/**
|
|
428
|
-
* Stable scenario identifier the run was scored against.
|
|
429
|
-
*
|
|
430
|
-
* that pairs runs by scenario (preferences, paired stats, BT tournament)
|
|
431
|
-
* keys on this. The campaign artifact populates it canonically; legacy
|
|
432
|
-
* runs without it fall back to inference from `outcome.raw.scenario_id`
|
|
433
|
-
* or `experimentId`.
|
|
429
|
+
* Stable scenario identifier the run observed or was scored against.
|
|
430
|
+
* Comparison primitives match this identity rather than input order.
|
|
434
431
|
*/
|
|
435
|
-
scenarioId
|
|
432
|
+
scenarioId: string;
|
|
436
433
|
/**
|
|
437
434
|
* Canonical identity for the agent profile cell that produced this row:
|
|
438
435
|
* profile artifact hash plus optional harness/model/prompt/reporting
|
|
@@ -442,6 +439,23 @@ interface RunRecord {
|
|
|
442
439
|
*/
|
|
443
440
|
agentProfile?: AgentProfileCell;
|
|
444
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* Canonical task-result classification.
|
|
444
|
+
*
|
|
445
|
+
* A producer may omit classification, record explicit success, or attach
|
|
446
|
+
* domain-specific detail to a non-success class. Detail can never stand alone.
|
|
447
|
+
* Execution errors belong in `outcome.raw.execution_error_count`.
|
|
448
|
+
*/
|
|
449
|
+
type RunTaskFailure = {
|
|
450
|
+
failureClass?: undefined;
|
|
451
|
+
failureMode?: undefined;
|
|
452
|
+
} | {
|
|
453
|
+
failureClass: 'success';
|
|
454
|
+
failureMode?: undefined;
|
|
455
|
+
} | {
|
|
456
|
+
failureClass: Exclude<FailureClass, 'success'>;
|
|
457
|
+
failureMode?: string;
|
|
458
|
+
};
|
|
445
459
|
|
|
446
460
|
/**
|
|
447
461
|
* Adaptive curriculum / active scenario selection.
|
|
@@ -959,9 +973,7 @@ declare function injectIrrelevantClause<S extends {
|
|
|
959
973
|
* per scenario but biggest score gap per pair. Useful for early
|
|
960
974
|
* bootstrapping when you have few variants.
|
|
961
975
|
*
|
|
962
|
-
*
|
|
963
|
-
* mappable to TRL's `DPODataset` shape (`prompt`, `chosen`, `rejected`)
|
|
964
|
-
* via the `toTRLFormat` helper.
|
|
976
|
+
* Resolve `PreferenceTriple` text with `toDpoRows` from `./exporters`.
|
|
965
977
|
*/
|
|
966
978
|
|
|
967
979
|
type PreferenceStrategy = 'paired-by-scenario-and-seed' | 'paired-by-scenario' | 'top-vs-bottom';
|
|
@@ -1000,7 +1012,7 @@ interface PreferenceTriple {
|
|
|
1000
1012
|
rejectedModel: string;
|
|
1001
1013
|
};
|
|
1002
1014
|
}
|
|
1003
|
-
interface ExtractPreferencesOptions {
|
|
1015
|
+
interface ExtractPreferencesOptions extends TrainingRunSelectionOptions {
|
|
1004
1016
|
strategy?: PreferenceStrategy;
|
|
1005
1017
|
/**
|
|
1006
1018
|
* Minimum score gap required to admit a pair. Pairs below this are
|
|
@@ -1008,8 +1020,8 @@ interface ExtractPreferencesOptions {
|
|
|
1008
1020
|
*/
|
|
1009
1021
|
minMargin?: number;
|
|
1010
1022
|
/**
|
|
1011
|
-
* Optional split tag filter
|
|
1012
|
-
* `
|
|
1023
|
+
* Optional split tag filter. Without one, only search is included.
|
|
1024
|
+
* Holdout requires `allowHeldOutTrainingData: true`; dev is evaluation-only.
|
|
1013
1025
|
*/
|
|
1014
1026
|
splitTag?: RunRecord['splitTag'];
|
|
1015
1027
|
/**
|
|
@@ -1040,19 +1052,9 @@ interface PreferenceExtractionReport {
|
|
|
1040
1052
|
* 1. Run a campaign producing 5–10 variants × 50–200 scenarios × 3 seeds
|
|
1041
1053
|
* 2. Call this with `strategy: 'paired-by-scenario-and-seed'` and a
|
|
1042
1054
|
* verifiable-reward extractor as `rewardOf`
|
|
1043
|
-
* 3. Pass `report.pairs` to `
|
|
1055
|
+
* 3. Pass `report.pairs` to `toDpoRows` with prompt/completion resolvers
|
|
1044
1056
|
*/
|
|
1045
1057
|
declare function extractPreferences(runs: RunRecord[], opts?: ExtractPreferencesOptions): PreferenceExtractionReport;
|
|
1046
|
-
/**
|
|
1047
|
-
* TRL-compatible export. TRL's `DPODataset` is `{ prompt, chosen, rejected }`
|
|
1048
|
-
* but the prompt isn't stored on the RunRecord — only its hash. The caller
|
|
1049
|
-
* passes a `promptOf(promptHash)` lookup that the TRL trainer can use.
|
|
1050
|
-
*/
|
|
1051
|
-
declare function toTRLFormat(triples: PreferenceTriple[], promptOf: (hash: string) => string): Array<{
|
|
1052
|
-
prompt: string;
|
|
1053
|
-
chosen: string;
|
|
1054
|
-
rejected: string;
|
|
1055
|
-
}>;
|
|
1056
1058
|
/**
|
|
1057
1059
|
* Anthropic finetuning JSONL export — `{ system, user, assistant_chosen, assistant_rejected }`
|
|
1058
1060
|
* shape. Same caveat as TRL: prompt + outputs are content the caller has
|
|
@@ -1290,7 +1292,13 @@ interface DpoExportRow {
|
|
|
1290
1292
|
declare function toDpoRows(triples: PreferenceTriple[], lookups: DpoLookups): Promise<DpoExportRow[]>;
|
|
1291
1293
|
/** Serialize DPO rows as JSONL. One line per row. */
|
|
1292
1294
|
declare function toDpoJsonl(rows: DpoExportRow[]): string;
|
|
1293
|
-
interface
|
|
1295
|
+
interface TrainingRunSelectionOptions {
|
|
1296
|
+
/** Include held-out evaluation data in training output. Default false. */
|
|
1297
|
+
allowHeldOutTrainingData?: boolean;
|
|
1298
|
+
/** Require quality to be strictly greater than this value. Default 0. */
|
|
1299
|
+
minimumQualityExclusive?: number;
|
|
1300
|
+
}
|
|
1301
|
+
interface GrpoLookups extends TrainingRunSelectionOptions {
|
|
1294
1302
|
promptOf: (runId: string) => string | Promise<string>;
|
|
1295
1303
|
completionOf: (runId: string) => string | Promise<string>;
|
|
1296
1304
|
/** Optional: derive a custom reward from the run. Defaults to score. */
|
|
@@ -1305,16 +1313,17 @@ interface GrpoExportRow {
|
|
|
1305
1313
|
meta?: Record<string, unknown>;
|
|
1306
1314
|
}
|
|
1307
1315
|
/**
|
|
1308
|
-
* Convert RunRecord[] grouped by `(scenarioId)`
|
|
1309
|
-
*
|
|
1316
|
+
* Convert RunRecord[] grouped by canonical `(scenarioId, promptHash)` identity
|
|
1317
|
+
* into GRPO offline rows.
|
|
1310
1318
|
*
|
|
1311
1319
|
* GRPO (Shao et al. 2024 / DeepSeek-R1) trains on relative advantages
|
|
1312
1320
|
* within a group of completions for the same prompt; this is the
|
|
1313
|
-
* canonical input format.
|
|
1321
|
+
* canonical input format. A scenario containing multiple prompt hashes, or a
|
|
1322
|
+
* prompt hash that resolves to different text, is rejected rather than mixed.
|
|
1314
1323
|
*/
|
|
1315
1324
|
declare function toGrpoRows(runs: RunRecord[], lookups: GrpoLookups): Promise<GrpoExportRow[]>;
|
|
1316
1325
|
declare function toGrpoJsonl(rows: GrpoExportRow[]): string;
|
|
1317
|
-
interface SftLookups {
|
|
1326
|
+
interface SftLookups extends TrainingRunSelectionOptions {
|
|
1318
1327
|
promptOf: (runId: string) => string | Promise<string>;
|
|
1319
1328
|
completionOf: (runId: string) => string | Promise<string>;
|
|
1320
1329
|
/** Optional system message. Default omits. */
|
|
@@ -1331,9 +1340,8 @@ interface SftExportRow {
|
|
|
1331
1340
|
}
|
|
1332
1341
|
/**
|
|
1333
1342
|
* Convert RunRecord[] into Hugging Face / OpenAI / Anthropic-style
|
|
1334
|
-
* conversational SFT rows. By default
|
|
1335
|
-
*
|
|
1336
|
-
* rejection-sampling SFT).
|
|
1343
|
+
* conversational SFT rows. By default, only completed, positive-quality
|
|
1344
|
+
* search runs are eligible. Pass `include` for additional filtering.
|
|
1337
1345
|
*/
|
|
1338
1346
|
declare function toSftRows(runs: RunRecord[], lookups: SftLookups): Promise<SftExportRow[]>;
|
|
1339
1347
|
declare function toSftJsonl(rows: SftExportRow[]): string;
|
|
@@ -1372,6 +1380,7 @@ interface StepRewardJsonlRow {
|
|
|
1372
1380
|
weight: number;
|
|
1373
1381
|
}
|
|
1374
1382
|
declare function stepRewardsToJsonl(stepRewards: StepReward[]): string;
|
|
1383
|
+
declare function isTrainingRunEligible(run: RunRecord, quality: number | null | undefined, options?: TrainingRunSelectionOptions): quality is number;
|
|
1375
1384
|
|
|
1376
1385
|
/**
|
|
1377
1386
|
* RL dataset packaging + datasheet — the publishable, sellable bundle.
|
|
@@ -1393,7 +1402,9 @@ declare function stepRewardsToJsonl(stepRewards: StepReward[]): string;
|
|
|
1393
1402
|
*/
|
|
1394
1403
|
|
|
1395
1404
|
type RewardKind = 'deterministic' | 'probabilistic' | 'mixed';
|
|
1396
|
-
|
|
1405
|
+
declare const DATASET_FORMATS: readonly ["grpo", "sft", "dpo"];
|
|
1406
|
+
type DatasetFormat = (typeof DATASET_FORMATS)[number];
|
|
1407
|
+
declare function validateDatasetFormats(value: unknown): DatasetFormat[];
|
|
1397
1408
|
/** Caller-declared context — the qualitative half of the datasheet that can't
|
|
1398
1409
|
* be computed from records. */
|
|
1399
1410
|
interface RlDatasetConfig {
|
|
@@ -1416,7 +1427,7 @@ interface RlDatasetConfig {
|
|
|
1416
1427
|
limitations: string;
|
|
1417
1428
|
/** ISO timestamp — passed in (the substrate forbids Date.now()). */
|
|
1418
1429
|
createdAtIso: string;
|
|
1419
|
-
/** Default: ['
|
|
1430
|
+
/** Default: ['sft']. GRPO must be requested for multi-completion groups. */
|
|
1420
1431
|
formats?: DatasetFormat[];
|
|
1421
1432
|
/** Quality gates already run, recorded on the card for the buyer. */
|
|
1422
1433
|
qualityGates?: {
|
|
@@ -1427,14 +1438,16 @@ interface RlDatasetConfig {
|
|
|
1427
1438
|
}
|
|
1428
1439
|
interface RewardStats {
|
|
1429
1440
|
n: number;
|
|
1430
|
-
mean: number;
|
|
1431
|
-
median: number;
|
|
1432
|
-
min: number;
|
|
1433
|
-
max: number;
|
|
1434
|
-
std: number;
|
|
1441
|
+
mean: number | null;
|
|
1442
|
+
median: number | null;
|
|
1443
|
+
min: number | null;
|
|
1444
|
+
max: number | null;
|
|
1445
|
+
std: number | null;
|
|
1435
1446
|
}
|
|
1436
1447
|
interface RlDatasetStats {
|
|
1437
1448
|
records: number;
|
|
1449
|
+
/** Records carrying an explicit task-quality score. */
|
|
1450
|
+
scoredRecords: number;
|
|
1438
1451
|
/** Record count per split — a publishable dataset must declare its holdout. */
|
|
1439
1452
|
splits: Record<RunSplitTag, number>;
|
|
1440
1453
|
reward: RewardStats;
|
|
@@ -1470,7 +1483,7 @@ declare function buildRlDataset(records: RunRecord[], lookups: GrpoLookups & Sft
|
|
|
1470
1483
|
triples: PreferenceTriple[];
|
|
1471
1484
|
lookups: DpoLookups;
|
|
1472
1485
|
}): Promise<RlDatasetBundle>;
|
|
1473
|
-
/** Render the "Datasheet for Datasets" card
|
|
1486
|
+
/** Render the "Datasheet for Datasets" card that a buyer reads. */
|
|
1474
1487
|
declare function datasheetToMarkdown(m: RlDatasetManifest): string;
|
|
1475
1488
|
|
|
1476
1489
|
/**
|
|
@@ -1515,8 +1528,10 @@ declare function readCorpus(corpusPath: string): CorpusRecord[];
|
|
|
1515
1528
|
interface HarvestOptions {
|
|
1516
1529
|
/** Keep only records scoring >= this (rejection-sampling for SFT). */
|
|
1517
1530
|
minScore?: number;
|
|
1518
|
-
/** Keep only these splits
|
|
1531
|
+
/** Keep only these source splits. Held-out rows still require the explicit override below. */
|
|
1519
1532
|
splits?: RunRecord['splitTag'][];
|
|
1533
|
+
/** Permit held-out rows in training files. Default false. */
|
|
1534
|
+
allowHeldOutTrainingData?: boolean;
|
|
1520
1535
|
}
|
|
1521
1536
|
/**
|
|
1522
1537
|
* Harvest the accumulated corpus into a publishable RL dataset bundle. Reads
|
|
@@ -1851,35 +1866,39 @@ interface RubricPredictiveValidityReport {
|
|
|
1851
1866
|
* specific promotion path (still useful for replay-style evals).
|
|
1852
1867
|
*/
|
|
1853
1868
|
|
|
1854
|
-
type HeldOutGateRejectionCode = 'few_runs' | 'negative_delta' | 'overfit_gap' | 'cost_ceiling';
|
|
1869
|
+
type HeldOutGateRejectionCode = 'few_runs' | 'missing_split_scores' | 'missing_cost' | 'negative_delta' | 'overfit_gap' | 'cost_ceiling';
|
|
1855
1870
|
interface GateEvidence {
|
|
1856
1871
|
/** Number of paired (candidate, baseline) holdout observations used. */
|
|
1857
1872
|
productiveRuns: number;
|
|
1858
|
-
/**
|
|
1859
|
-
|
|
1860
|
-
/**
|
|
1873
|
+
/** Candidate holdout rows with no baseline row at the same work identity. */
|
|
1874
|
+
unpairedCandidateRuns: number;
|
|
1875
|
+
/** Baseline holdout rows with no candidate row at the same work identity. */
|
|
1876
|
+
unpairedBaselineRuns: number;
|
|
1877
|
+
/** Median of paired holdout deltas, or null when there are no pairs. */
|
|
1878
|
+
medianPairedDelta: number | null;
|
|
1879
|
+
/** Bootstrap CI on the median paired holdout delta, if computed. */
|
|
1861
1880
|
pairedCI: {
|
|
1862
1881
|
low: number;
|
|
1863
1882
|
high: number;
|
|
1864
|
-
};
|
|
1865
|
-
/** Wilcoxon signed-rank p-value
|
|
1866
|
-
pairedPValue: number;
|
|
1867
|
-
/** Mean candidate score on the search split
|
|
1868
|
-
searchScore: number;
|
|
1869
|
-
/** Mean candidate score on the holdout split
|
|
1870
|
-
holdoutScore: number;
|
|
1871
|
-
/** Candidate (search − holdout) gap. */
|
|
1872
|
-
overfitGap: number;
|
|
1873
|
-
/** Baseline (search − holdout) gap. */
|
|
1874
|
-
baselineOverfitGap: number;
|
|
1883
|
+
} | null;
|
|
1884
|
+
/** Wilcoxon signed-rank p-value, if computed. */
|
|
1885
|
+
pairedPValue: number | null;
|
|
1886
|
+
/** Mean candidate score on the search split, or null when absent. */
|
|
1887
|
+
searchScore: number | null;
|
|
1888
|
+
/** Mean candidate score on the holdout split, or null when absent. */
|
|
1889
|
+
holdoutScore: number | null;
|
|
1890
|
+
/** Candidate (search − holdout) gap, or null when either side is absent. */
|
|
1891
|
+
overfitGap: number | null;
|
|
1892
|
+
/** Baseline (search − holdout) gap, or null when either side is absent. */
|
|
1893
|
+
baselineOverfitGap: number | null;
|
|
1875
1894
|
/** Median per-task USD cost across the candidate's runs. Recorded
|
|
1876
1895
|
* even when no `costPerTaskCeiling` is configured so downstream
|
|
1877
1896
|
* dashboards (intelligence.tangle.tools) can render \$/task per
|
|
1878
1897
|
* generation regardless of gating policy. */
|
|
1879
|
-
medianCandidateCost: number;
|
|
1898
|
+
medianCandidateCost: number | null;
|
|
1880
1899
|
/** Median per-task USD cost across the baseline runs, for
|
|
1881
1900
|
* symmetric reporting. */
|
|
1882
|
-
medianBaselineCost: number;
|
|
1901
|
+
medianBaselineCost: number | null;
|
|
1883
1902
|
}
|
|
1884
1903
|
interface GateDecision$1 {
|
|
1885
1904
|
/** Final promote/no-promote verdict. */
|
|
@@ -2142,6 +2161,8 @@ interface Finding {
|
|
|
2142
2161
|
interface LayerResult {
|
|
2143
2162
|
layer: string;
|
|
2144
2163
|
status: LayerStatus;
|
|
2164
|
+
/** Origin of an `error` or `timeout`. Defaults to `execution`. */
|
|
2165
|
+
errorSource?: 'execution' | 'judge';
|
|
2145
2166
|
/** 0..1 score, optional — layers that don't produce a numeric score omit. */
|
|
2146
2167
|
score?: number;
|
|
2147
2168
|
durationMs: number;
|
|
@@ -2160,22 +2181,29 @@ interface LayerResult {
|
|
|
2160
2181
|
/** Any rich per-layer detail — rendered as-is by consumers that know the layer. */
|
|
2161
2182
|
detail?: Record<string, unknown>;
|
|
2162
2183
|
}
|
|
2163
|
-
/** Extends the substrate verdict spine: `valid` = `allPass
|
|
2164
|
-
*
|
|
2165
|
-
* consumers (drivers, gates) read this report without an adapter. */
|
|
2184
|
+
/** Extends the substrate verdict spine: `valid` = `allPass`; `score` is the
|
|
2185
|
+
* complete task score or 0 when the configured scoring panel was incomplete. */
|
|
2166
2186
|
interface VerificationReport extends DefaultVerdict {
|
|
2167
2187
|
layers: LayerResult[];
|
|
2168
2188
|
passCount: number;
|
|
2169
2189
|
failCount: number;
|
|
2170
2190
|
skippedCount: number;
|
|
2171
2191
|
errorCount: number;
|
|
2172
|
-
/** True iff
|
|
2192
|
+
/** True iff the configured scoring panel completed and every layer passed. */
|
|
2173
2193
|
allPass: boolean;
|
|
2174
2194
|
/**
|
|
2175
|
-
*
|
|
2176
|
-
*
|
|
2195
|
+
* Diagnostic weighted mean across contributing layers. This may represent a
|
|
2196
|
+
* partial panel. It is 0 when no layer contributed.
|
|
2177
2197
|
*/
|
|
2178
2198
|
blendedScore: number;
|
|
2199
|
+
/**
|
|
2200
|
+
* Complete task-quality measurement.
|
|
2201
|
+
* Present when at least one layer produced a valid score, every other layer
|
|
2202
|
+
* completed successfully or contributed an explicit scored failure, and no
|
|
2203
|
+
* result is missing because of a failure, skip, error, or timeout.
|
|
2204
|
+
* Use this field, not `blendedScore`, when creating task labels.
|
|
2205
|
+
*/
|
|
2206
|
+
taskScore?: number;
|
|
2179
2207
|
durationMs: number;
|
|
2180
2208
|
startedAt: string;
|
|
2181
2209
|
finishedAt: string;
|
|
@@ -2354,14 +2382,17 @@ interface RewardHackingFinding {
|
|
|
2354
2382
|
}
|
|
2355
2383
|
interface RewardHackingReport {
|
|
2356
2384
|
findings: RewardHackingFinding[];
|
|
2385
|
+
/** Signals with enough usable observations to produce a finding. */
|
|
2386
|
+
evaluatedSignals: RewardHackingSignal[];
|
|
2357
2387
|
/**
|
|
2358
|
-
* Composite verdict. `'
|
|
2359
|
-
* `'
|
|
2388
|
+
* Composite verdict. `'insufficient_evidence'` when fewer than four scored
|
|
2389
|
+
* runs exist; otherwise `'clean'` if every signal severity < 0.3,
|
|
2390
|
+
* `'suspect'` if at least one ≥ 0.3 but none ≥ 0.6, and `'gaming'` if any ≥ 0.6.
|
|
2360
2391
|
*/
|
|
2361
|
-
verdict: 'clean' | 'suspect' | 'gaming';
|
|
2392
|
+
verdict: 'insufficient_evidence' | 'clean' | 'suspect' | 'gaming';
|
|
2362
2393
|
/** Rationale for the verdict, ready to paste into an audit log. */
|
|
2363
2394
|
rationale: string[];
|
|
2364
|
-
/** Number of
|
|
2395
|
+
/** Number of runs with a usable proxy reward. */
|
|
2365
2396
|
n: number;
|
|
2366
2397
|
}
|
|
2367
2398
|
interface DetectRewardHackingInput {
|
|
@@ -2531,6 +2562,7 @@ type ProviderRedactor = (event: RawProviderEvent) => RawProviderEvent;
|
|
|
2531
2562
|
* OpenAI-compatible `/v1/chat/completions` client with:
|
|
2532
2563
|
* - Exponential-backoff retry on 429 + 5xx gateway errors (502/503/504).
|
|
2533
2564
|
* - Retry on transient network errors (fetch failed, AbortError, ECONNRESET).
|
|
2565
|
+
* - One retry at temperature 1 when a model explicitly requires it.
|
|
2534
2566
|
* - Graceful json_schema → json_object degrade on 400 with schema-reject body.
|
|
2535
2567
|
* - Fenced-JSON stripping (```json ... ```) for models that wrap structured output.
|
|
2536
2568
|
* - Configurable base URL + api key / bearer, works with LiteLLM proxies, OpenAI
|
|
@@ -2751,10 +2783,16 @@ interface SummaryTableRow {
|
|
|
2751
2783
|
mean: number;
|
|
2752
2784
|
ciLow: number;
|
|
2753
2785
|
ciHigh: number;
|
|
2754
|
-
/** BH-adjusted q-value vs comparator
|
|
2755
|
-
qValue: number;
|
|
2756
|
-
/** Cohen's
|
|
2757
|
-
cohensD: number;
|
|
2786
|
+
/** BH-adjusted q-value vs comparator, or null when unavailable. */
|
|
2787
|
+
qValue: number | null;
|
|
2788
|
+
/** Paired Cohen's dz vs comparator, or null when the paired variance is zero. */
|
|
2789
|
+
cohensD: number | null;
|
|
2790
|
+
/** Matched observations used for paired comparison, or null on the comparator row. */
|
|
2791
|
+
pairedN: number | null;
|
|
2792
|
+
/** Candidate observations without a comparator match. */
|
|
2793
|
+
unpairedCandidateN: number | null;
|
|
2794
|
+
/** Comparator observations without a candidate match. */
|
|
2795
|
+
unpairedComparatorN: number | null;
|
|
2758
2796
|
}
|
|
2759
2797
|
interface SummaryTable {
|
|
2760
2798
|
rows: SummaryTableRow[];
|
|
@@ -2776,7 +2814,7 @@ interface ParetoPoint {
|
|
|
2776
2814
|
onFrontier: boolean;
|
|
2777
2815
|
/** Optional gate verdict for this candidate, if a `GateDecision`
|
|
2778
2816
|
* for it was passed in. */
|
|
2779
|
-
gate?: 'promote' | '
|
|
2817
|
+
gate?: 'promote' | 'reject';
|
|
2780
2818
|
}
|
|
2781
2819
|
interface ParetoFigureSpec {
|
|
2782
2820
|
kind: 'pareto-cost-quality';
|
|
@@ -2802,12 +2840,16 @@ interface GainDistributionFigureSpec {
|
|
|
2802
2840
|
split: 'search' | 'holdout';
|
|
2803
2841
|
/** Number of pairs used. */
|
|
2804
2842
|
n: number;
|
|
2843
|
+
/** Candidate rows without a comparator match. */
|
|
2844
|
+
unpairedCandidateN: number;
|
|
2845
|
+
/** Comparator rows without a candidate match. */
|
|
2846
|
+
unpairedComparatorN: number;
|
|
2805
2847
|
bins: GainDistributionBin[];
|
|
2806
|
-
median: number;
|
|
2848
|
+
median: number | null;
|
|
2807
2849
|
ci: {
|
|
2808
2850
|
low: number;
|
|
2809
2851
|
high: number;
|
|
2810
|
-
};
|
|
2852
|
+
} | null;
|
|
2811
2853
|
}
|
|
2812
2854
|
type ResearchReportDecision = 'promote' | 'hold' | 'reject' | 'equivalent' | 'needs_more_data';
|
|
2813
2855
|
interface ResearchReportOptions {
|
|
@@ -2880,8 +2922,8 @@ interface ResearchReportCandidate {
|
|
|
2880
2922
|
mean: number;
|
|
2881
2923
|
ciLow: number;
|
|
2882
2924
|
ciHigh: number;
|
|
2883
|
-
qValue: number;
|
|
2884
|
-
cohensD: number;
|
|
2925
|
+
qValue: number | null;
|
|
2926
|
+
cohensD: number | null;
|
|
2885
2927
|
meanDeltaVsComparator: number | null;
|
|
2886
2928
|
pairedN: number;
|
|
2887
2929
|
medianGain: number | null;
|
|
@@ -2891,10 +2933,9 @@ interface ResearchReportCandidate {
|
|
|
2891
2933
|
high: number;
|
|
2892
2934
|
} | null;
|
|
2893
2935
|
/**
|
|
2894
|
-
* Bayesian-bootstrap
|
|
2895
|
-
*
|
|
2896
|
-
*
|
|
2897
|
-
* matched pairs."
|
|
2936
|
+
* Bayesian-bootstrap posterior summaries on the paired mean delta.
|
|
2937
|
+
* Dirichlet(1, ..., 1) weights represent uncertainty over the empirical
|
|
2938
|
+
* distribution of matched deltas.
|
|
2898
2939
|
*/
|
|
2899
2940
|
prGreaterThanZero: number | null;
|
|
2900
2941
|
prInRope: number | null;
|
|
@@ -3204,13 +3245,15 @@ interface CampaignRunContext<V> {
|
|
|
3204
3245
|
*/
|
|
3205
3246
|
llmOpts: LlmClientOptions;
|
|
3206
3247
|
}
|
|
3207
|
-
interface
|
|
3248
|
+
interface CampaignRunOutcomeFields {
|
|
3208
3249
|
/** Did the run pass? Mirrors `RunOutcome.pass` semantics. */
|
|
3209
3250
|
pass: boolean;
|
|
3210
3251
|
/** Score for the run on its split. Maps to `searchScore` or `holdoutScore`. */
|
|
3211
3252
|
score: number;
|
|
3212
|
-
/**
|
|
3213
|
-
costUsd: number;
|
|
3253
|
+
/** Cost in USD, or null when the runner could not capture it. */
|
|
3254
|
+
costUsd: number | null;
|
|
3255
|
+
/** Source of the cost amount. */
|
|
3256
|
+
costProvenance: RunCostProvenance;
|
|
3214
3257
|
tokenUsage: RunTokenUsage;
|
|
3215
3258
|
/** Snapshot model id (e.g. `claude-sonnet-4-6@2025-04-15`). */
|
|
3216
3259
|
model: string;
|
|
@@ -3220,12 +3263,6 @@ interface CampaignRunOutcome {
|
|
|
3220
3263
|
configHash: string;
|
|
3221
3264
|
/** Optional extra numeric metrics to land in `outcome.raw`. */
|
|
3222
3265
|
raw?: Record<string, number>;
|
|
3223
|
-
/** Canonical cross-agent failure class from the shared `FAILURE_CLASSES`
|
|
3224
|
-
* taxonomy. Propagated to `RunRecord.failureClass` so campaign runs
|
|
3225
|
-
* aggregate failures in the same vocabulary as every other producer. */
|
|
3226
|
-
failureClass?: FailureClass;
|
|
3227
|
-
/** Optional free-form failure detail, scoped under `failureClass`. */
|
|
3228
|
-
failureMode?: string;
|
|
3229
3266
|
/** Optional judge metadata when a judge was used. */
|
|
3230
3267
|
judgeMetadata?: RunJudgeMetadata;
|
|
3231
3268
|
/**
|
|
@@ -3241,6 +3278,8 @@ interface CampaignRunOutcome {
|
|
|
3241
3278
|
*/
|
|
3242
3279
|
agentProfile?: AgentProfileCell | AgentProfileCellInput;
|
|
3243
3280
|
}
|
|
3281
|
+
/** Campaign result with the same task-failure invariant as `RunRecord`. */
|
|
3282
|
+
type CampaignRunOutcome = CampaignRunOutcomeFields & RunTaskFailure;
|
|
3244
3283
|
type CampaignRunner<V> = (ctx: CampaignRunContext<V>) => Promise<CampaignRunOutcome>;
|
|
3245
3284
|
type CampaignIntegrityPolicy = 'throw' | 'mark_failed' | 'log';
|
|
3246
3285
|
interface EvalCampaignOptions<V> {
|
|
@@ -3569,14 +3608,17 @@ interface JudgeScore {
|
|
|
3569
3608
|
}
|
|
3570
3609
|
/** Five-valued verdict taxonomy (MOSS-paper alignment). */
|
|
3571
3610
|
type GateDecision = 'ship' | 'hold' | 'need_more_work' | 'model_ceiling' | 'arch_ceiling';
|
|
3611
|
+
/** Outcome of one check that contributed to a release decision. */
|
|
3612
|
+
type GateCheckStatus = 'pass' | 'fail' | 'not_evaluated';
|
|
3613
|
+
interface GateContribution {
|
|
3614
|
+
name: string;
|
|
3615
|
+
status: GateCheckStatus;
|
|
3616
|
+
detail: unknown;
|
|
3617
|
+
}
|
|
3572
3618
|
interface GateResult {
|
|
3573
3619
|
decision: GateDecision;
|
|
3574
3620
|
reasons: string[];
|
|
3575
|
-
contributingGates:
|
|
3576
|
-
name: string;
|
|
3577
|
-
passed: boolean;
|
|
3578
|
-
detail: unknown;
|
|
3579
|
-
}>;
|
|
3621
|
+
contributingGates: GateContribution[];
|
|
3580
3622
|
delta?: number;
|
|
3581
3623
|
}
|
|
3582
3624
|
/** Token usage accumulated for a cell. Aliased to the canonical `RunTokenUsage`
|
|
@@ -3609,6 +3651,10 @@ interface CampaignCellResult<TArtifact> {
|
|
|
3609
3651
|
durationMs: number;
|
|
3610
3652
|
seed: number;
|
|
3611
3653
|
cached: boolean;
|
|
3654
|
+
/** Stage that produced `error`. Missing on successful cells. */
|
|
3655
|
+
errorStage?: 'dispatch' | 'judge';
|
|
3656
|
+
/** Judge that threw when `errorStage` is `judge`. */
|
|
3657
|
+
errorJudge?: string;
|
|
3612
3658
|
error?: string;
|
|
3613
3659
|
}
|
|
3614
3660
|
interface JudgeAggregate {
|
|
@@ -3633,8 +3679,10 @@ interface GenerationRecord {
|
|
|
3633
3679
|
* handled — the evidence a blind `Mutator` cannot see. */
|
|
3634
3680
|
interface GenerationCandidate {
|
|
3635
3681
|
surfaceHash: string;
|
|
3636
|
-
|
|
3637
|
-
|
|
3682
|
+
/** Mean over complete task-quality scores, or null when none were produced. */
|
|
3683
|
+
composite: number | null;
|
|
3684
|
+
/** Descriptive interval for `composite`, or null when no score exists. */
|
|
3685
|
+
ci95: [number, number] | null;
|
|
3638
3686
|
/** Exact surface this candidate mutated. */
|
|
3639
3687
|
parentSurfaceHash?: string;
|
|
3640
3688
|
/** Measured search-split composite of the exact parent surface. */
|
|
@@ -3644,13 +3692,12 @@ interface GenerationCandidate {
|
|
|
3644
3692
|
observedDeltaFromParent?: number;
|
|
3645
3693
|
/** Whether this candidate had a scorable result for every designed campaign
|
|
3646
3694
|
* cell and was therefore eligible for ranking, promotion, and Pareto
|
|
3647
|
-
* selection.
|
|
3648
|
-
|
|
3649
|
-
eligibleForPromotion?: boolean;
|
|
3695
|
+
* selection. */
|
|
3696
|
+
eligibleForPromotion: boolean;
|
|
3650
3697
|
/** Exact denominator receipt for selection eligibility. Scores stay
|
|
3651
3698
|
* descriptive: an incomplete candidate is retained with its observed score
|
|
3652
3699
|
* and errors instead of receiving an invented penalty. */
|
|
3653
|
-
coverage
|
|
3700
|
+
coverage: {
|
|
3654
3701
|
expectedCells: number;
|
|
3655
3702
|
scorableCells: number;
|
|
3656
3703
|
unscorableCells: Array<{
|
|
@@ -3691,10 +3738,18 @@ interface CampaignAggregates {
|
|
|
3691
3738
|
cost: CostLedgerSummary;
|
|
3692
3739
|
/** Compatibility alias of `cost.totalCostUsd`. */
|
|
3693
3740
|
totalCostUsd: number;
|
|
3741
|
+
/** Cells whose dispatch completed, including cells whose later judge failed. */
|
|
3694
3742
|
cellsExecuted: number;
|
|
3695
3743
|
cellsSkipped: number;
|
|
3696
3744
|
cellsCached: number;
|
|
3745
|
+
/** All non-skipped dispatch, judge, and unclassified cell failures. */
|
|
3697
3746
|
cellsFailed: number;
|
|
3747
|
+
/** Present on results that record failure stages. */
|
|
3748
|
+
cellsDispatchFailed?: number;
|
|
3749
|
+
/** Present on results that record failure stages. */
|
|
3750
|
+
cellsJudgeFailed?: number;
|
|
3751
|
+
/** Legacy failures whose stage was not recorded. */
|
|
3752
|
+
cellsUnclassifiedFailed?: number;
|
|
3698
3753
|
}
|
|
3699
3754
|
interface CampaignResult<TArtifact = unknown, TScenario extends Scenario = Scenario> {
|
|
3700
3755
|
/** sha256(scenarios, judges, dispatch source ref, optimizer config, seed). Stable identity for reruns. */
|
|
@@ -3749,29 +3804,30 @@ interface AdapterContext {
|
|
|
3749
3804
|
configHash: string;
|
|
3750
3805
|
/** Default split tag. Default `'search'`. */
|
|
3751
3806
|
splitTag?: RunSplitTag;
|
|
3752
|
-
/**
|
|
3807
|
+
/** Estimated cost in USD when the source doesn't record one. */
|
|
3753
3808
|
defaultCostUsd?: number;
|
|
3754
3809
|
}
|
|
3755
3810
|
/**
|
|
3756
|
-
* Convert a `CampaignResult` into canonical `RunRecord[]
|
|
3757
|
-
*
|
|
3758
|
-
*
|
|
3759
|
-
*
|
|
3760
|
-
*
|
|
3761
|
-
*
|
|
3811
|
+
* Convert a `CampaignResult` into canonical `RunRecord[]`, one per cell.
|
|
3812
|
+
* Successful judged cells carry their mean judge composite and dimensions.
|
|
3813
|
+
* Errored or unjudged cells remain unlabeled while retaining explicit terminal
|
|
3814
|
+
* outcome, execution-error count, token usage, cost, and failure detail.
|
|
3815
|
+
* `candidateId` identifies the measured surface and defaults to the campaign
|
|
3816
|
+
* manifest hash.
|
|
3762
3817
|
*/
|
|
3763
3818
|
declare function campaignToRunRecords(campaign: CampaignResult, ctx: AdapterContext & {
|
|
3764
3819
|
candidateId?: string;
|
|
3765
3820
|
}): RunRecord[];
|
|
3766
3821
|
/**
|
|
3767
3822
|
* Convert a `MultiLayerVerifier` `VerificationReport` into a `RunRecord`.
|
|
3768
|
-
*
|
|
3769
|
-
*
|
|
3770
|
-
*
|
|
3823
|
+
* A split score is emitted only when `report.taskScore` proves the configured
|
|
3824
|
+
* scoring panel completed. Partial scores remain in `outcome.raw` for
|
|
3825
|
+
* diagnosis. Layer errors and timeouts become judge or execution telemetry;
|
|
3826
|
+
* only a scored `fail` layer may produce task-failure detail.
|
|
3771
3827
|
*/
|
|
3772
3828
|
declare function verificationReportToRunRecord(report: VerificationReport, ctx: AdapterContext & {
|
|
3773
3829
|
candidateId: string;
|
|
3774
|
-
scenarioId
|
|
3830
|
+
scenarioId: string;
|
|
3775
3831
|
}, opts?: {
|
|
3776
3832
|
runId?: string;
|
|
3777
3833
|
}): RunRecord;
|
|
@@ -4057,4 +4113,4 @@ interface BuildPairwiseFromCampaignInput {
|
|
|
4057
4113
|
}
|
|
4058
4114
|
declare function buildPairwiseFromCampaign(input: BuildPairwiseFromCampaignInput): PairwiseOutcome[];
|
|
4059
4115
|
|
|
4060
|
-
export { ABSENT_CATEGORY, type AdaptationCurve, type AdaptationPoint, type AdaptationRunner, type AdapterContext, type AdversarialMutation, type BehaviorFeatures, type BradleyTerryFit, type BradleyTerryRating, type BuildPairwiseFromCampaignInput, type CellObservation, type CompareCurvesResult, type ComputeBestOfNOptions, type ComputeBestOfNResult, type ComputeCurve, type ComputeCurveBudget, type ComputeCurvePoint, type ContaminationProbeInput, type ContaminationProbeOptions, type ContaminationProbeReport, type CorpusAppendResult, type CorpusRecord, type CurriculumAllocation, DEFAULT_MIN_N_PER_FEATURE, DEFAULT_QUANTILE_BUCKETS, type DatasetFormat, type DeploymentOutcome, type DetectRewardHackingInput, type DpoExportRow, type DpoLookups, type EasyModeOptions, type EasyModeReport, type EloOptions, type ExtractPreferencesOptions, type ExtractStepRewardsOptions, type FeatureDivergence, type FeatureShift, type FidelityReport, type FidelityVerdict, FileSystemOutcomeStore, type FileSystemOutcomeStoreOptions, type GrpoExportRow, type GrpoLookups, type HarvestOptions, InMemoryOutcomeStore, type OffPolicyContributionCounts, type OffPolicyEstimate, type OffPolicyOptions, type OffPolicyTrajectory, type OutcomeStore, type PairwiseOutcome, type ParetoPointInput, PredictiveValidityResearcher, type PredictiveValidityResearcherOptions, type PreferenceExtractionReport, type PreferenceStrategy, type PreferenceTriple, type PrmExportRow, type PrmLookups, type PrmTrainingTriple, REPRESENTATIVE_MIN_FIDELITY, type RLCampaignResult, type RewardHackingFinding, type RewardHackingReport, type RewardHackingSignal, type RewardKind, type RewardStats, type RlDatasetBundle, type RlDatasetConfig, type RlDatasetManifest, type RlDatasetStats, type RunAdaptationCurveOptions, type RunComputeCurveOptions, type RunRLCampaignOptions, type RunwiseStepSummary, type ScenarioPerturbation, type ScenarioPerturbationKind, type SelfConsistencyOptions, type SelfConsistencyResult, type SftExportRow, type SftLookups, type SimFidelityOptions, type StepReward, type StepRewardJsonlRow, type StepScorer, type ThompsonCurriculumOptions, type VarianceCurriculumOptions, type VerifiableReward, type VerifiableRewardExtractionOptions, type VerifiableRewardSource, appendToCorpus, applyEloUpdate, bestOfN, bucketLabel, buildDatasetFromCorpus, buildPairwiseFromCampaign, buildRlDataset, campaignToRunRecords, compareAdaptationCurves, datasheetToMarkdown, defaultBehaviorFeatures, detectRewardHacking, doublyRobust, easyModeCheck, extractPreferences, extractStepRewards, extractVerifiableReward, extractVerifiableRewardsFromRecords, filterDeterministicallyRewarded, firstPassK, fitBradleyTerry, injectIrrelevantClause, inverseProbabilityWeighting, jsDivergence, observationsFromRunRecords, offPolicyEstimateAll, paretoFrontier, prmTrainingPairs, quantileEdges, readCorpus, renameVariables, runAdaptationCurve, runComputeCurve, runContaminationProbe, runEvalCampaign, runRLCampaign, runwiseStepRewardSummary, selfConsistency, selfNormalizedImportanceWeighting, shuffleOrder, simFidelityReport, stepRewardsToJsonl, thompsonCurriculum, toAnthropicFormat, toDpoJsonl, toDpoRows, toGrpoJsonl, toGrpoRows, toPrmJsonl, toPrmRows, toSftJsonl, toSftRows,
|
|
4116
|
+
export { ABSENT_CATEGORY, type AdaptationCurve, type AdaptationPoint, type AdaptationRunner, type AdapterContext, type AdversarialMutation, type BehaviorFeatures, type BradleyTerryFit, type BradleyTerryRating, type BuildPairwiseFromCampaignInput, type CellObservation, type CompareCurvesResult, type ComputeBestOfNOptions, type ComputeBestOfNResult, type ComputeCurve, type ComputeCurveBudget, type ComputeCurvePoint, type ContaminationProbeInput, type ContaminationProbeOptions, type ContaminationProbeReport, type CorpusAppendResult, type CorpusRecord, type CurriculumAllocation, DEFAULT_MIN_N_PER_FEATURE, DEFAULT_QUANTILE_BUCKETS, type DatasetFormat, type DeploymentOutcome, type DetectRewardHackingInput, type DpoExportRow, type DpoLookups, type EasyModeOptions, type EasyModeReport, type EloOptions, type ExtractPreferencesOptions, type ExtractStepRewardsOptions, type FeatureDivergence, type FeatureShift, type FidelityReport, type FidelityVerdict, FileSystemOutcomeStore, type FileSystemOutcomeStoreOptions, type GrpoExportRow, type GrpoLookups, type HarvestOptions, InMemoryOutcomeStore, type OffPolicyContributionCounts, type OffPolicyEstimate, type OffPolicyOptions, type OffPolicyTrajectory, type OutcomeStore, type PairwiseOutcome, type ParetoPointInput, PredictiveValidityResearcher, type PredictiveValidityResearcherOptions, type PreferenceExtractionReport, type PreferenceStrategy, type PreferenceTriple, type PrmExportRow, type PrmLookups, type PrmTrainingTriple, REPRESENTATIVE_MIN_FIDELITY, type RLCampaignResult, type RewardHackingFinding, type RewardHackingReport, type RewardHackingSignal, type RewardKind, type RewardStats, type RlDatasetBundle, type RlDatasetConfig, type RlDatasetManifest, type RlDatasetStats, type RunAdaptationCurveOptions, type RunComputeCurveOptions, type RunRLCampaignOptions, type RunwiseStepSummary, type ScenarioPerturbation, type ScenarioPerturbationKind, type SelfConsistencyOptions, type SelfConsistencyResult, type SftExportRow, type SftLookups, type SimFidelityOptions, type StepReward, type StepRewardJsonlRow, type StepScorer, type ThompsonCurriculumOptions, type TrainingRunSelectionOptions, type VarianceCurriculumOptions, type VerifiableReward, type VerifiableRewardExtractionOptions, type VerifiableRewardSource, appendToCorpus, applyEloUpdate, bestOfN, bucketLabel, buildDatasetFromCorpus, buildPairwiseFromCampaign, buildRlDataset, campaignToRunRecords, compareAdaptationCurves, datasheetToMarkdown, defaultBehaviorFeatures, detectRewardHacking, doublyRobust, easyModeCheck, extractPreferences, extractStepRewards, extractVerifiableReward, extractVerifiableRewardsFromRecords, filterDeterministicallyRewarded, firstPassK, fitBradleyTerry, injectIrrelevantClause, inverseProbabilityWeighting, isTrainingRunEligible, jsDivergence, observationsFromRunRecords, offPolicyEstimateAll, paretoFrontier, prmTrainingPairs, quantileEdges, readCorpus, renameVariables, runAdaptationCurve, runComputeCurve, runContaminationProbe, runEvalCampaign, runRLCampaign, runwiseStepRewardSummary, selfConsistency, selfNormalizedImportanceWeighting, shuffleOrder, simFidelityReport, stepRewardsToJsonl, thompsonCurriculum, toAnthropicFormat, toDpoJsonl, toDpoRows, toGrpoJsonl, toGrpoRows, toPrmJsonl, toPrmRows, toSftJsonl, toSftRows, validateDatasetFormats, varianceBasedCurriculum, verificationReportToRunRecord };
|