@tangle-network/agent-eval 0.126.7 → 0.127.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 +44 -0
- package/README.md +2 -2
- package/dist/analyst/index.d.ts +51 -39
- package/dist/analyst/index.js +4 -4
- package/dist/belief-state/index.d.ts +34 -36
- package/dist/belief-state/index.js +2 -2
- package/dist/benchmarks/index.d.ts +30 -12
- package/dist/benchmarks/index.js +12 -10
- package/dist/builder-eval/index.js +1 -1
- package/dist/campaign/index.d.ts +432 -146
- package/dist/campaign/index.js +11 -9
- package/dist/{chunk-ARU2PZFM.js → chunk-424XHVKV.js} +43 -23
- package/dist/chunk-424XHVKV.js.map +1 -0
- package/dist/{chunk-NUKSVU3W.js → chunk-5DTSBUL2.js} +2 -2
- package/dist/{chunk-BTACVO2W.js → chunk-65QETEKG.js} +542 -258
- package/dist/chunk-65QETEKG.js.map +1 -0
- package/dist/{chunk-CGG5SLH3.js → chunk-ARCFIY7U.js} +2 -2
- package/dist/{chunk-P22LJ3Y2.js → chunk-CLELFRQG.js} +6 -4
- package/dist/chunk-CLELFRQG.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-IPYXE555.js → chunk-EJGRPCO3.js} +36 -13
- package/dist/chunk-EJGRPCO3.js.map +1 -0
- package/dist/{chunk-K6IAZZ6L.js → chunk-FA3MFYNA.js} +132 -110
- package/dist/chunk-FA3MFYNA.js.map +1 -0
- package/dist/chunk-IG35YDN3.js +614 -0
- package/dist/chunk-IG35YDN3.js.map +1 -0
- package/dist/{chunk-DPZAEKA6.js → chunk-IMGJZBFG.js} +84 -56
- package/dist/chunk-IMGJZBFG.js.map +1 -0
- package/dist/{chunk-H5UD2323.js → chunk-IN455XKS.js} +53 -1
- package/dist/chunk-IN455XKS.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-IILEIWGW.js → chunk-NL33OXEP.js} +41 -36
- package/dist/chunk-NL33OXEP.js.map +1 -0
- package/dist/{chunk-474LBSOX.js → chunk-OD5NQ2CS.js} +41 -16
- package/dist/chunk-OD5NQ2CS.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-E3IADPLG.js → chunk-PRB53E3J.js} +50 -224
- package/dist/chunk-PRB53E3J.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-LKKT3IVV.js → chunk-TSN7JT6D.js} +6 -4
- package/dist/{chunk-LKKT3IVV.js.map → chunk-TSN7JT6D.js.map} +1 -1
- package/dist/{chunk-M7AH34KV.js → chunk-UTA2TGC4.js} +32 -16
- package/dist/chunk-UTA2TGC4.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-ZVCHKKOP.js → chunk-WED5KLZQ.js} +39 -15
- package/dist/chunk-WED5KLZQ.js.map +1 -0
- package/dist/{chunk-OCFJACJU.js → chunk-X6VOPMLD.js} +74 -14
- package/dist/chunk-X6VOPMLD.js.map +1 -0
- package/dist/{chunk-MOXWMGPC.js → chunk-Y5CYOL42.js} +159 -70
- package/dist/chunk-Y5CYOL42.js.map +1 -0
- package/dist/{chunk-FO7HEH76.js → chunk-YJBNWCAA.js} +2 -2
- package/dist/chunk-ZPUEEM5U.js +179 -0
- package/dist/chunk-ZPUEEM5U.js.map +1 -0
- package/dist/{chunk-KE2VWPZX.js → chunk-ZUUWPZCV.js} +3 -3
- package/dist/cli.js +4 -4
- package/dist/contract/index.d.ts +421 -124
- package/dist/contract/index.js +242 -115
- package/dist/contract/index.js.map +1 -1
- package/dist/control.d.ts +34 -32
- package/dist/control.js +2 -2
- package/dist/hosted/index.d.ts +142 -41
- package/dist/hosted/index.js +23 -1
- package/dist/index.d.ts +364 -255
- package/dist/index.js +315 -226
- package/dist/index.js.map +1 -1
- package/dist/meta-eval/index.d.ts +32 -32
- 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 +97 -74
- package/dist/reporting.js +5 -4
- package/dist/rl.d.ts +177 -131
- package/dist/rl.js +232 -126
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +53 -63
- package/dist/rollout/index.js +7 -5
- package/dist/{run-campaign-FFRM3RH5.js → run-campaign-3A2EBYBE.js} +4 -3
- package/dist/supervisor-run/index.d.ts +7 -15
- package/dist/supervisor-run/index.js +2 -2
- package/dist/traces.d.ts +66 -41
- package/dist/traces.js +9 -5
- package/dist/wire/index.d.ts +1 -0
- package/dist/wire/index.js +2 -2
- package/docs/concepts.md +18 -1
- package/docs/hosted-ingest-spec.md +37 -40
- package/docs/insight-report.md +57 -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-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-CGG5SLH3.js.map → chunk-ARCFIY7U.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-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-3A2EBYBE.js.map} +0 -0
package/dist/rollout/index.d.ts
CHANGED
|
@@ -27,19 +27,11 @@ import { DatabaseSync } from 'node:sqlite';
|
|
|
27
27
|
* flag: a gated line must never export as a positive training example.
|
|
28
28
|
*/
|
|
29
29
|
declare const ROLLOUT_SCHEMA = "tangle.rollout.v1";
|
|
30
|
-
/** @deprecated alias kept for consumers of the pre-unification constant name. */
|
|
31
|
-
declare const ROLLOUT_FORMAT = "tangle.rollout.v1";
|
|
32
30
|
/** `agent` = a solo evaluation run (no multi-agent topology). */
|
|
33
31
|
type RolloutRole = 'agent' | 'supervisor' | 'worker' | 'proposer' | 'judge' | 'analyst';
|
|
34
32
|
declare const ROLLOUT_ROLES: readonly RolloutRole[];
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
* optimizer may read — the trainable split), extended with the ledger's
|
|
38
|
-
* 'canary'. 'train' is a legacy alias for 'search' emitted by
|
|
39
|
-
* pre-unification ledgers; it validates and counts as trainable, but new
|
|
40
|
-
* producers must emit 'search'.
|
|
41
|
-
*/
|
|
42
|
-
type RolloutSplit = 'search' | 'dev' | 'holdout' | 'canary' | 'train';
|
|
33
|
+
/** Split vocabulary follows `RunRecord.splitTag`, extended with `canary`. */
|
|
34
|
+
type RolloutSplit = 'search' | 'dev' | 'holdout' | 'canary';
|
|
43
35
|
declare const ROLLOUT_SPLITS: readonly RolloutSplit[];
|
|
44
36
|
/** Splits that may ship in training exports. Everything else is fail-closed excluded. */
|
|
45
37
|
declare const TRAINABLE_SPLITS: readonly RolloutSplit[];
|
|
@@ -136,10 +128,9 @@ interface RolloutOutcome {
|
|
|
136
128
|
/**
|
|
137
129
|
* Anti-Goodhart flag from `RunRecord.outcome.realness.gated`: the run
|
|
138
130
|
* faked its success signal. Reward is forced to 0 at mint time and the
|
|
139
|
-
* line never qualifies for SFT.
|
|
140
|
-
* so pre-unification ledgers stay readable.
|
|
131
|
+
* line never qualifies for SFT.
|
|
141
132
|
*/
|
|
142
|
-
realness_gated
|
|
133
|
+
realness_gated: boolean;
|
|
143
134
|
}
|
|
144
135
|
interface RolloutCostBlock {
|
|
145
136
|
usd: number | null;
|
|
@@ -168,11 +159,10 @@ interface RolloutLine {
|
|
|
168
159
|
/** Spawning invocation within the same episode (worker → supervisor). */
|
|
169
160
|
parent_rollout_id: string | null;
|
|
170
161
|
run_id: string;
|
|
171
|
-
/** Logical experiment grouping from `RunRecord.experimentId
|
|
172
|
-
|
|
173
|
-
experiment_id?: string | null;
|
|
162
|
+
/** Logical experiment grouping from `RunRecord.experimentId`; null = not recorded. */
|
|
163
|
+
experiment_id: string | null;
|
|
174
164
|
/** Stable candidate identity from `RunRecord.candidateId`; null = not recorded. */
|
|
175
|
-
candidate_id
|
|
165
|
+
candidate_id: string | null;
|
|
176
166
|
/** Improvement-loop generation (-1 = baseline); null = not an improvement loop. */
|
|
177
167
|
generation: number | null;
|
|
178
168
|
/** Improvement-loop candidate index (-1 = baseline); null = not an improvement loop. */
|
|
@@ -207,10 +197,13 @@ declare function isRolloutLine(value: unknown): value is RolloutLine;
|
|
|
207
197
|
* labels, no joins.
|
|
208
198
|
*/
|
|
209
199
|
|
|
210
|
-
interface
|
|
211
|
-
/**
|
|
212
|
-
|
|
200
|
+
interface TrainingExportOptions {
|
|
201
|
+
/** Include held-out evaluation data in training output. Default false. */
|
|
202
|
+
allowHeldOutTrainingData?: boolean;
|
|
203
|
+
/** Require reward to be strictly greater than this value. Default 0. */
|
|
204
|
+
minimumQualityExclusive?: number;
|
|
213
205
|
}
|
|
206
|
+
type SftExportOptions = TrainingExportOptions;
|
|
214
207
|
interface SftRow {
|
|
215
208
|
messages: ChatMessage[];
|
|
216
209
|
metadata: {
|
|
@@ -224,7 +217,7 @@ interface SftRow {
|
|
|
224
217
|
/**
|
|
225
218
|
* Supervised fine-tune rows: the completed conversation of each qualifying
|
|
226
219
|
* line. Fail-closed filters: trainable split only (never holdout/canary),
|
|
227
|
-
* reward
|
|
220
|
+
* positive reward, realness-gated lines never qualify, gap lines carry
|
|
228
221
|
* no trainable content.
|
|
229
222
|
*/
|
|
230
223
|
declare function toSftRows(lines: RolloutLine[], options?: SftExportOptions): SftRow[];
|
|
@@ -242,13 +235,9 @@ interface RewardRow {
|
|
|
242
235
|
};
|
|
243
236
|
}
|
|
244
237
|
/**
|
|
245
|
-
* Reward-labeled rows
|
|
246
|
-
* failure. Failures are signal here — only the realness-gate zeroing
|
|
247
|
-
* (applied at mint time) touches the reward, never filtering. Lines with
|
|
248
|
-
* no verdict (reward null) are excluded: an unlabeled example is a gap,
|
|
249
|
-
* not a zero.
|
|
238
|
+
* Reward-labeled rows for completed, positive-quality training runs.
|
|
250
239
|
*/
|
|
251
|
-
declare function toRewardRows(lines: RolloutLine[]): RewardRow[];
|
|
240
|
+
declare function toRewardRows(lines: RolloutLine[], options?: TrainingExportOptions): RewardRow[];
|
|
252
241
|
interface VerifiersTokenUsage {
|
|
253
242
|
input_tokens: number | null;
|
|
254
243
|
output_tokens: number | null;
|
|
@@ -278,7 +267,7 @@ interface VerifiersRolloutOutput {
|
|
|
278
267
|
};
|
|
279
268
|
}
|
|
280
269
|
declare function toVerifiersRolloutOutput(line: RolloutLine): VerifiersRolloutOutput;
|
|
281
|
-
declare function toVerifiersRolloutOutputs(lines: RolloutLine[]): VerifiersRolloutOutput[];
|
|
270
|
+
declare function toVerifiersRolloutOutputs(lines: RolloutLine[], options?: TrainingExportOptions): VerifiersRolloutOutput[];
|
|
282
271
|
interface RftItem {
|
|
283
272
|
/** Prompt turns only — the graded completion is re-sampled during RFT. */
|
|
284
273
|
messages: ChatMessage[];
|
|
@@ -295,7 +284,7 @@ interface RftItem {
|
|
|
295
284
|
}
|
|
296
285
|
declare function toRftItem(line: RolloutLine): RftItem;
|
|
297
286
|
/** RFT needs a real prompt: lines whose transcript starts with prompt turns. */
|
|
298
|
-
declare function toRftItems(lines: RolloutLine[]): RftItem[];
|
|
287
|
+
declare function toRftItems(lines: RolloutLine[], options?: TrainingExportOptions): RftItem[];
|
|
299
288
|
declare function toJsonl(rows: ReadonlyArray<unknown>): string;
|
|
300
289
|
|
|
301
290
|
/**
|
|
@@ -531,7 +520,8 @@ type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'to
|
|
|
531
520
|
* researcher loop SHOULD be recorded as a `RunRecord`. The mandatory
|
|
532
521
|
* fields are exactly those the paper "Two Loops, Three Roles" requires
|
|
533
522
|
* for reproducibility: who/what/when/cost/seed/hash, plus the search vs
|
|
534
|
-
* holdout split tag
|
|
523
|
+
* holdout split tag. A task score is optional because execution-only records
|
|
524
|
+
* must preserve missing labels instead of converting errors into zero quality.
|
|
535
525
|
*
|
|
536
526
|
* This is intentionally NOT a replacement for the rich `Run` /
|
|
537
527
|
* `ProposeReviewReport` / `ScenarioResult` types already in the
|
|
@@ -552,6 +542,13 @@ type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'to
|
|
|
552
542
|
/** Search/dev/holdout split tag. 'search' is the paper-grade alias for the
|
|
553
543
|
* combined train+test pool that the optimizer is allowed to read. */
|
|
554
544
|
type RunSplitTag = 'search' | 'dev' | 'holdout';
|
|
545
|
+
/**
|
|
546
|
+
* Explicit execution-lifecycle result for a run.
|
|
547
|
+
*
|
|
548
|
+
* This is separate from task quality (`outcome`) and failure classification.
|
|
549
|
+
* Producers set it only from root-run or process evidence.
|
|
550
|
+
*/
|
|
551
|
+
type RunTerminalOutcome = 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown';
|
|
555
552
|
interface RunTokenUsage {
|
|
556
553
|
input: number;
|
|
557
554
|
/** All generated tokens charged as output, including reasoning tokens. */
|
|
@@ -565,11 +562,6 @@ interface RunTokenUsage {
|
|
|
565
562
|
}
|
|
566
563
|
/**
|
|
567
564
|
* How a run's USD amount was obtained.
|
|
568
|
-
*
|
|
569
|
-
* `costUsd` remains mandatory for wire compatibility. New producers should
|
|
570
|
-
* always populate this discriminated union so a missing bill is never
|
|
571
|
-
* mistaken for an observed zero-dollar run. For `uncaptured`, `costUsd` uses
|
|
572
|
-
* the legacy `0` sentinel while this field carries the truthful null.
|
|
573
565
|
*/
|
|
574
566
|
type RunCostProvenance = {
|
|
575
567
|
kind: 'observed';
|
|
@@ -615,8 +607,8 @@ interface JudgeScoresRecord {
|
|
|
615
607
|
perJudge: Record<string, Record<string, number>>;
|
|
616
608
|
/** Per-dim mean across judges. Convenience — derivable from `perJudge`. */
|
|
617
609
|
perDimMean: Record<string, number>;
|
|
618
|
-
/** Composite mean across
|
|
619
|
-
*
|
|
610
|
+
/** Composite mean across successful judges. Mirrors the task score only
|
|
611
|
+
* when `failedJudges` is empty. */
|
|
620
612
|
composite: number;
|
|
621
613
|
/** Judges that errored or returned an unparseable verdict. Recorded
|
|
622
614
|
* by id (e.g. `['glm-5.1']`) so a partial-failure case is explicit,
|
|
@@ -627,11 +619,11 @@ interface JudgeScoresRecord {
|
|
|
627
619
|
notes?: string;
|
|
628
620
|
}
|
|
629
621
|
interface RunOutcome {
|
|
630
|
-
/** Score on the search/optimization split. Optional
|
|
631
|
-
*
|
|
622
|
+
/** Score on the search/optimization split. Optional for holdout-only and
|
|
623
|
+
* execution-only records. */
|
|
632
624
|
searchScore?: number;
|
|
633
|
-
/** Score on the held-out split. Optional
|
|
634
|
-
*
|
|
625
|
+
/** Score on the held-out split. Optional for search-only and execution-only
|
|
626
|
+
* records. When both scores are absent, the run is explicitly unlabeled. */
|
|
635
627
|
holdoutScore?: number;
|
|
636
628
|
/** Bag of any other metric the run produced — judge dimensions,
|
|
637
629
|
* pass/fail counters, latency stats, etc. Numeric only — keeps
|
|
@@ -695,42 +687,39 @@ interface RunRecord {
|
|
|
695
687
|
wallMs: number;
|
|
696
688
|
/** Time spent queued before execution started, if known. */
|
|
697
689
|
queueMs?: number;
|
|
698
|
-
/** Total USD cost
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
costUsd: number;
|
|
703
|
-
/** Observed, model-priced estimate, or genuinely uncaptured USD amount.
|
|
704
|
-
* Optional only so existing serialized RunRecords remain valid. */
|
|
705
|
-
costProvenance?: RunCostProvenance;
|
|
690
|
+
/** Total USD cost, or null when the producer could not capture one. */
|
|
691
|
+
costUsd: number | null;
|
|
692
|
+
/** Whether `costUsd` came from billing data, a price calculation, or is unavailable. */
|
|
693
|
+
costProvenance: RunCostProvenance;
|
|
706
694
|
/** Token usage breakdown. */
|
|
707
695
|
tokenUsage: RunTokenUsage;
|
|
696
|
+
/** Root-run or process terminal result. Never inferred from a child span. */
|
|
697
|
+
terminalOutcome: RunTerminalOutcome;
|
|
698
|
+
/** Root-run or process failure reason. Valid only for a failed, cancelled,
|
|
699
|
+
* or incomplete terminal result; never populated from a child span. */
|
|
700
|
+
terminalFailureReason?: string;
|
|
708
701
|
/** Judge-side metadata, if a judge was used. */
|
|
709
702
|
judgeMetadata?: RunJudgeMetadata;
|
|
710
703
|
/** Per-split scores + raw bag. */
|
|
711
704
|
outcome: RunOutcome;
|
|
712
|
-
/** Canonical
|
|
705
|
+
/** Canonical task-failure class drawn from the shared
|
|
713
706
|
* `FAILURE_CLASSES` taxonomy. This is the aggregation key that makes
|
|
714
707
|
* "which failure dominates across the whole fleet" answerable in ONE
|
|
715
708
|
* vocabulary — every agent classifies against the same enum. Producers
|
|
716
|
-
* set it
|
|
717
|
-
*
|
|
709
|
+
* set it only from task-result evidence. Execution errors belong in
|
|
710
|
+
* `outcome.raw.execution_error_count`, even when the run later fails. */
|
|
718
711
|
failureClass?: FailureClass;
|
|
719
|
-
/** Free-form
|
|
712
|
+
/** Free-form task-failure detail, scoped UNDER `failureClass`
|
|
720
713
|
* (e.g. failureClass='tool_recovery_failure', failureMode='forge_build_unsatisfied').
|
|
721
|
-
*
|
|
714
|
+
* Do not populate this from a child execution error alone. */
|
|
722
715
|
failureMode?: string;
|
|
723
716
|
/** Which split this run was drawn from. */
|
|
724
717
|
splitTag: RunSplitTag;
|
|
725
718
|
/**
|
|
726
|
-
* Stable scenario identifier the run was scored against.
|
|
727
|
-
*
|
|
728
|
-
* that pairs runs by scenario (preferences, paired stats, BT tournament)
|
|
729
|
-
* keys on this. The campaign artifact populates it canonically; legacy
|
|
730
|
-
* runs without it fall back to inference from `outcome.raw.scenario_id`
|
|
731
|
-
* or `experimentId`.
|
|
719
|
+
* Stable scenario identifier the run observed or was scored against.
|
|
720
|
+
* Comparison primitives match this identity rather than input order.
|
|
732
721
|
*/
|
|
733
|
-
scenarioId
|
|
722
|
+
scenarioId: string;
|
|
734
723
|
/**
|
|
735
724
|
* Canonical identity for the agent profile cell that produced this row:
|
|
736
725
|
* profile artifact hash plus optional harness/model/prompt/reporting
|
|
@@ -836,7 +825,8 @@ declare function rolloutReward(record: RunRecord): {
|
|
|
836
825
|
/**
|
|
837
826
|
* Join RunRecords with their traces into canonical rollout lines. Records
|
|
838
827
|
* without spans are emitted as labeled gap lines and reported in
|
|
839
|
-
* `missingTraces
|
|
828
|
+
* `missingTraces`. Execution-only records without a task score are rejected
|
|
829
|
+
* because a missing training label is not a zero reward.
|
|
840
830
|
*/
|
|
841
831
|
declare function mintRolloutRows(records: RunRecord[], store: TraceStore, options?: MintRolloutOptions): Promise<MintRolloutResult>;
|
|
842
832
|
|
|
@@ -1058,4 +1048,4 @@ declare function parseRolloutReleaseArgs(argv: string[]): RolloutReleaseCliArgs;
|
|
|
1058
1048
|
/** CLI driver for `agent-eval rollout-release`. Returns the process exit code. */
|
|
1059
1049
|
declare function runRolloutReleaseCli(argv: string[]): Promise<number>;
|
|
1060
1050
|
|
|
1061
|
-
export { type BuildOptions, type BuildSummary, CHAT_ROLES, type ChatMessage, type ChatRole, type ChatToolCall, type ClaudeTranscript, type ClaudeTranscriptRef, type ClaudeUsageTotals, DEFAULT_CLAUDE_PROJECTS_DIR, DEFAULT_OPENCODE_DB, type DatasetCardInputs, FORMAT_FILES, type MintRolloutOptions, type MintRolloutResult, type OpencodeSessionRow, RELEASE_FORMATS, ROLLOUT_CAPTURES,
|
|
1051
|
+
export { type BuildOptions, type BuildSummary, CHAT_ROLES, type ChatMessage, type ChatRole, type ChatToolCall, type ClaudeTranscript, type ClaudeTranscriptRef, type ClaudeUsageTotals, DEFAULT_CLAUDE_PROJECTS_DIR, DEFAULT_OPENCODE_DB, type DatasetCardInputs, FORMAT_FILES, type MintRolloutOptions, type MintRolloutResult, type OpencodeSessionRow, RELEASE_FORMATS, ROLLOUT_CAPTURES, ROLLOUT_RELEASE_USAGE, ROLLOUT_ROLES, ROLLOUT_SCHEMA, ROLLOUT_SPLITS, type ReleaseFormat, type RewardRow, type RftItem, type RolloutArtifacts, type RolloutCapture, type RolloutCostBlock, type RolloutLine, type RolloutOutcome, type RolloutPolicy, type RolloutProvenance, type RolloutReleaseCliArgs, type RolloutRole, type RolloutScrubber, type RolloutSplit, type RolloutStep, type RolloutTask, SCRUB_RULES, type ScrubCounts, type ScrubReport, type ScrubRule, type SftExportOptions, type SftRow, TRAINABLE_SPLITS, type ToolDef, type VerifiersRolloutOutput, type VerifiersTokenUsage, addScrubCounts, appendRolloutLines, assertRolloutLine, buildDatasetCard, buildHfDataset, claudeProjectSlug, defaultRolloutScrubber, emptyScrubCounts, findClaudeTranscripts, findOpencodeSessionById, findOpencodeSessionsByDirectory, isRolloutLine, isTrainableSplit, mintRolloutRows, openOpencodeDb, parseRolloutReleaseArgs, planPushCommand, pushDataset, readClaudeTranscript, readOpencodeSessionMessages, readRolloutLedger, rolloutReward, runRolloutReleaseCli, scrubLines, scrubRolloutLine, scrubText, toJsonl, toRewardRows, toRftItem, toRftItems, toSftRows, toVerifiersRolloutOutput, toVerifiersRolloutOutputs, validateRolloutLine, writeRolloutLedger };
|
package/dist/rollout/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mintRolloutRows,
|
|
3
3
|
rolloutReward
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UTA2TGC4.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_CLAUDE_PROJECTS_DIR,
|
|
7
7
|
DEFAULT_OPENCODE_DB,
|
|
@@ -40,11 +40,10 @@ import {
|
|
|
40
40
|
toVerifiersRolloutOutput,
|
|
41
41
|
toVerifiersRolloutOutputs,
|
|
42
42
|
writeRolloutLedger
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-EJGRPCO3.js";
|
|
44
44
|
import {
|
|
45
45
|
CHAT_ROLES,
|
|
46
46
|
ROLLOUT_CAPTURES,
|
|
47
|
-
ROLLOUT_FORMAT,
|
|
48
47
|
ROLLOUT_ROLES,
|
|
49
48
|
ROLLOUT_SCHEMA,
|
|
50
49
|
ROLLOUT_SPLITS,
|
|
@@ -53,8 +52,12 @@ import {
|
|
|
53
52
|
isRolloutLine,
|
|
54
53
|
isTrainableSplit,
|
|
55
54
|
validateRolloutLine
|
|
56
|
-
} from "../chunk-
|
|
55
|
+
} from "../chunk-UWZZKKU7.js";
|
|
57
56
|
import "../chunk-RZTMDUO7.js";
|
|
57
|
+
import "../chunk-NL33OXEP.js";
|
|
58
|
+
import "../chunk-MA6HLL3S.js";
|
|
59
|
+
import "../chunk-VSMTAMNK.js";
|
|
60
|
+
import "../chunk-ONWEPEDO.js";
|
|
58
61
|
import "../chunk-PZ5AY32C.js";
|
|
59
62
|
export {
|
|
60
63
|
CHAT_ROLES,
|
|
@@ -63,7 +66,6 @@ export {
|
|
|
63
66
|
FORMAT_FILES,
|
|
64
67
|
RELEASE_FORMATS,
|
|
65
68
|
ROLLOUT_CAPTURES,
|
|
66
|
-
ROLLOUT_FORMAT,
|
|
67
69
|
ROLLOUT_RELEASE_USAGE,
|
|
68
70
|
ROLLOUT_ROLES,
|
|
69
71
|
ROLLOUT_SCHEMA,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
planCampaignRun,
|
|
3
3
|
runCampaign
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-WED5KLZQ.js";
|
|
5
|
+
import "./chunk-ZPUEEM5U.js";
|
|
6
|
+
import "./chunk-MHELPNRP.js";
|
|
6
7
|
import "./chunk-WS3NZZQQ.js";
|
|
7
8
|
import "./chunk-VI2UW6B6.js";
|
|
8
9
|
import "./chunk-ONWEPEDO.js";
|
|
@@ -11,4 +12,4 @@ export {
|
|
|
11
12
|
planCampaignRun,
|
|
12
13
|
runCampaign
|
|
13
14
|
};
|
|
14
|
-
//# sourceMappingURL=run-campaign-
|
|
15
|
+
//# sourceMappingURL=run-campaign-3A2EBYBE.js.map
|
|
@@ -27,14 +27,8 @@
|
|
|
27
27
|
declare const ROLLOUT_SCHEMA = "tangle.rollout.v1";
|
|
28
28
|
/** `agent` = a solo evaluation run (no multi-agent topology). */
|
|
29
29
|
type RolloutRole = 'agent' | 'supervisor' | 'worker' | 'proposer' | 'judge' | 'analyst';
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
* optimizer may read — the trainable split), extended with the ledger's
|
|
33
|
-
* 'canary'. 'train' is a legacy alias for 'search' emitted by
|
|
34
|
-
* pre-unification ledgers; it validates and counts as trainable, but new
|
|
35
|
-
* producers must emit 'search'.
|
|
36
|
-
*/
|
|
37
|
-
type RolloutSplit = 'search' | 'dev' | 'holdout' | 'canary' | 'train';
|
|
30
|
+
/** Split vocabulary follows `RunRecord.splitTag`, extended with `canary`. */
|
|
31
|
+
type RolloutSplit = 'search' | 'dev' | 'holdout' | 'canary';
|
|
38
32
|
/** 'mint' = joined live from RunRecord + trace by `mintRolloutRows`. */
|
|
39
33
|
type RolloutCapture = 'mint' | 'settle-time' | 'backfill';
|
|
40
34
|
type ChatRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
@@ -125,10 +119,9 @@ interface RolloutOutcome {
|
|
|
125
119
|
/**
|
|
126
120
|
* Anti-Goodhart flag from `RunRecord.outcome.realness.gated`: the run
|
|
127
121
|
* faked its success signal. Reward is forced to 0 at mint time and the
|
|
128
|
-
* line never qualifies for SFT.
|
|
129
|
-
* so pre-unification ledgers stay readable.
|
|
122
|
+
* line never qualifies for SFT.
|
|
130
123
|
*/
|
|
131
|
-
realness_gated
|
|
124
|
+
realness_gated: boolean;
|
|
132
125
|
}
|
|
133
126
|
interface RolloutCostBlock {
|
|
134
127
|
usd: number | null;
|
|
@@ -157,11 +150,10 @@ interface RolloutLine {
|
|
|
157
150
|
/** Spawning invocation within the same episode (worker → supervisor). */
|
|
158
151
|
parent_rollout_id: string | null;
|
|
159
152
|
run_id: string;
|
|
160
|
-
/** Logical experiment grouping from `RunRecord.experimentId
|
|
161
|
-
|
|
162
|
-
experiment_id?: string | null;
|
|
153
|
+
/** Logical experiment grouping from `RunRecord.experimentId`; null = not recorded. */
|
|
154
|
+
experiment_id: string | null;
|
|
163
155
|
/** Stable candidate identity from `RunRecord.candidateId`; null = not recorded. */
|
|
164
|
-
candidate_id
|
|
156
|
+
candidate_id: string | null;
|
|
165
157
|
/** Improvement-loop generation (-1 = baseline); null = not an improvement loop. */
|
|
166
158
|
generation: number | null;
|
|
167
159
|
/** Improvement-loop candidate index (-1 = baseline); null = not an improvement loop. */
|
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
unavailable,
|
|
28
28
|
writeSupervisorRunReport,
|
|
29
29
|
writeSupervisorRunReportSafe
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-TSN7JT6D.js";
|
|
31
31
|
import "../chunk-VBQ3CRKH.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-UWZZKKU7.js";
|
|
33
33
|
import "../chunk-PZ5AY32C.js";
|
|
34
34
|
export {
|
|
35
35
|
DEFAULT_CANCEL_TOOLS,
|
package/dist/traces.d.ts
CHANGED
|
@@ -533,7 +533,8 @@ declare function isSandboxSpan(s: Span): s is SandboxSpan;
|
|
|
533
533
|
* researcher loop SHOULD be recorded as a `RunRecord`. The mandatory
|
|
534
534
|
* fields are exactly those the paper "Two Loops, Three Roles" requires
|
|
535
535
|
* for reproducibility: who/what/when/cost/seed/hash, plus the search vs
|
|
536
|
-
* holdout split tag
|
|
536
|
+
* holdout split tag. A task score is optional because execution-only records
|
|
537
|
+
* must preserve missing labels instead of converting errors into zero quality.
|
|
537
538
|
*
|
|
538
539
|
* This is intentionally NOT a replacement for the rich `Run` /
|
|
539
540
|
* `ProposeReviewReport` / `ScenarioResult` types already in the
|
|
@@ -554,6 +555,13 @@ declare function isSandboxSpan(s: Span): s is SandboxSpan;
|
|
|
554
555
|
/** Search/dev/holdout split tag. 'search' is the paper-grade alias for the
|
|
555
556
|
* combined train+test pool that the optimizer is allowed to read. */
|
|
556
557
|
type RunSplitTag = 'search' | 'dev' | 'holdout';
|
|
558
|
+
/**
|
|
559
|
+
* Explicit execution-lifecycle result for a run.
|
|
560
|
+
*
|
|
561
|
+
* This is separate from task quality (`outcome`) and failure classification.
|
|
562
|
+
* Producers set it only from root-run or process evidence.
|
|
563
|
+
*/
|
|
564
|
+
type RunTerminalOutcome = 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown';
|
|
557
565
|
interface RunTokenUsage {
|
|
558
566
|
input: number;
|
|
559
567
|
/** All generated tokens charged as output, including reasoning tokens. */
|
|
@@ -567,11 +575,6 @@ interface RunTokenUsage {
|
|
|
567
575
|
}
|
|
568
576
|
/**
|
|
569
577
|
* How a run's USD amount was obtained.
|
|
570
|
-
*
|
|
571
|
-
* `costUsd` remains mandatory for wire compatibility. New producers should
|
|
572
|
-
* always populate this discriminated union so a missing bill is never
|
|
573
|
-
* mistaken for an observed zero-dollar run. For `uncaptured`, `costUsd` uses
|
|
574
|
-
* the legacy `0` sentinel while this field carries the truthful null.
|
|
575
578
|
*/
|
|
576
579
|
type RunCostProvenance = {
|
|
577
580
|
kind: 'observed';
|
|
@@ -617,8 +620,8 @@ interface JudgeScoresRecord {
|
|
|
617
620
|
perJudge: Record<string, Record<string, number>>;
|
|
618
621
|
/** Per-dim mean across judges. Convenience — derivable from `perJudge`. */
|
|
619
622
|
perDimMean: Record<string, number>;
|
|
620
|
-
/** Composite mean across
|
|
621
|
-
*
|
|
623
|
+
/** Composite mean across successful judges. Mirrors the task score only
|
|
624
|
+
* when `failedJudges` is empty. */
|
|
622
625
|
composite: number;
|
|
623
626
|
/** Judges that errored or returned an unparseable verdict. Recorded
|
|
624
627
|
* by id (e.g. `['glm-5.1']`) so a partial-failure case is explicit,
|
|
@@ -629,11 +632,11 @@ interface JudgeScoresRecord {
|
|
|
629
632
|
notes?: string;
|
|
630
633
|
}
|
|
631
634
|
interface RunOutcome {
|
|
632
|
-
/** Score on the search/optimization split. Optional
|
|
633
|
-
*
|
|
635
|
+
/** Score on the search/optimization split. Optional for holdout-only and
|
|
636
|
+
* execution-only records. */
|
|
634
637
|
searchScore?: number;
|
|
635
|
-
/** Score on the held-out split. Optional
|
|
636
|
-
*
|
|
638
|
+
/** Score on the held-out split. Optional for search-only and execution-only
|
|
639
|
+
* records. When both scores are absent, the run is explicitly unlabeled. */
|
|
637
640
|
holdoutScore?: number;
|
|
638
641
|
/** Bag of any other metric the run produced — judge dimensions,
|
|
639
642
|
* pass/fail counters, latency stats, etc. Numeric only — keeps
|
|
@@ -697,42 +700,39 @@ interface RunRecord {
|
|
|
697
700
|
wallMs: number;
|
|
698
701
|
/** Time spent queued before execution started, if known. */
|
|
699
702
|
queueMs?: number;
|
|
700
|
-
/** Total USD cost
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
costUsd: number;
|
|
705
|
-
/** Observed, model-priced estimate, or genuinely uncaptured USD amount.
|
|
706
|
-
* Optional only so existing serialized RunRecords remain valid. */
|
|
707
|
-
costProvenance?: RunCostProvenance;
|
|
703
|
+
/** Total USD cost, or null when the producer could not capture one. */
|
|
704
|
+
costUsd: number | null;
|
|
705
|
+
/** Whether `costUsd` came from billing data, a price calculation, or is unavailable. */
|
|
706
|
+
costProvenance: RunCostProvenance;
|
|
708
707
|
/** Token usage breakdown. */
|
|
709
708
|
tokenUsage: RunTokenUsage;
|
|
709
|
+
/** Root-run or process terminal result. Never inferred from a child span. */
|
|
710
|
+
terminalOutcome: RunTerminalOutcome;
|
|
711
|
+
/** Root-run or process failure reason. Valid only for a failed, cancelled,
|
|
712
|
+
* or incomplete terminal result; never populated from a child span. */
|
|
713
|
+
terminalFailureReason?: string;
|
|
710
714
|
/** Judge-side metadata, if a judge was used. */
|
|
711
715
|
judgeMetadata?: RunJudgeMetadata;
|
|
712
716
|
/** Per-split scores + raw bag. */
|
|
713
717
|
outcome: RunOutcome;
|
|
714
|
-
/** Canonical
|
|
718
|
+
/** Canonical task-failure class drawn from the shared
|
|
715
719
|
* `FAILURE_CLASSES` taxonomy. This is the aggregation key that makes
|
|
716
720
|
* "which failure dominates across the whole fleet" answerable in ONE
|
|
717
721
|
* vocabulary — every agent classifies against the same enum. Producers
|
|
718
|
-
* set it
|
|
719
|
-
*
|
|
722
|
+
* set it only from task-result evidence. Execution errors belong in
|
|
723
|
+
* `outcome.raw.execution_error_count`, even when the run later fails. */
|
|
720
724
|
failureClass?: FailureClass;
|
|
721
|
-
/** Free-form
|
|
725
|
+
/** Free-form task-failure detail, scoped UNDER `failureClass`
|
|
722
726
|
* (e.g. failureClass='tool_recovery_failure', failureMode='forge_build_unsatisfied').
|
|
723
|
-
*
|
|
727
|
+
* Do not populate this from a child execution error alone. */
|
|
724
728
|
failureMode?: string;
|
|
725
729
|
/** Which split this run was drawn from. */
|
|
726
730
|
splitTag: RunSplitTag;
|
|
727
731
|
/**
|
|
728
|
-
* Stable scenario identifier the run was scored against.
|
|
729
|
-
*
|
|
730
|
-
* that pairs runs by scenario (preferences, paired stats, BT tournament)
|
|
731
|
-
* keys on this. The campaign artifact populates it canonically; legacy
|
|
732
|
-
* runs without it fall back to inference from `outcome.raw.scenario_id`
|
|
733
|
-
* or `experimentId`.
|
|
732
|
+
* Stable scenario identifier the run observed or was scored against.
|
|
733
|
+
* Comparison primitives match this identity rather than input order.
|
|
734
734
|
*/
|
|
735
|
-
scenarioId
|
|
735
|
+
scenarioId: string;
|
|
736
736
|
/**
|
|
737
737
|
* Canonical identity for the agent profile cell that produced this row:
|
|
738
738
|
* profile artifact hash plus optional harness/model/prompt/reporting
|
|
@@ -1238,6 +1238,19 @@ declare function applyLlmSpanOtlpAttributes(attributes: Record<string, unknown>,
|
|
|
1238
1238
|
/** Canonical OpenInference-over-OTLP attribute vocabulary used at the trace boundary. */
|
|
1239
1239
|
|
|
1240
1240
|
type ToolSpanOtlpInput = Pick<ToolSpan, 'toolName' | 'args' | 'argsCaptured' | 'result' | 'latencyMs'>;
|
|
1241
|
+
type OtlpSpanRole = 'AGENT' | 'CHAIN' | 'EVALUATOR' | 'GUARDRAIL' | 'LLM' | 'SPAN' | 'TOOL' | 'UNKNOWN';
|
|
1242
|
+
interface OtlpSpanRoleInput {
|
|
1243
|
+
name: string;
|
|
1244
|
+
attributes: Record<string, unknown>;
|
|
1245
|
+
kind?: string | null;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Classify a span once for both measurement and error accounting.
|
|
1249
|
+
* An explicit OpenInference kind wins; untyped spans use the same tool and
|
|
1250
|
+
* model signals in online and offline intake.
|
|
1251
|
+
*/
|
|
1252
|
+
declare function classifyOtlpSpanRole(input: OtlpSpanRoleInput): OtlpSpanRole;
|
|
1253
|
+
declare function isOtlpModelCall(input: OtlpSpanRoleInput): boolean;
|
|
1241
1254
|
declare function applyToolSpanOtlpAttributes(attributes: Record<string, unknown>, span: ToolSpanOtlpInput): void;
|
|
1242
1255
|
declare function traceSpanKindToOpenInferenceKind(kind: string): string;
|
|
1243
1256
|
|
|
@@ -1488,7 +1501,7 @@ declare function convertTraceStoresToOtlp(source: string | TraceStoreSource | re
|
|
|
1488
1501
|
* `ViewTraceOversized`.
|
|
1489
1502
|
*/
|
|
1490
1503
|
/** OTLP span kind (subset we actually use). */
|
|
1491
|
-
type TraceAnalystSpanKind = 'AGENT' | 'LLM' | 'TOOL' | 'CHAIN' | 'GUARDRAIL' | 'SPAN' | 'UNKNOWN';
|
|
1504
|
+
type TraceAnalystSpanKind = 'AGENT' | 'LLM' | 'TOOL' | 'CHAIN' | 'EVALUATOR' | 'GUARDRAIL' | 'SPAN' | 'UNKNOWN';
|
|
1492
1505
|
type TraceAnalystSpanStatus = 'OK' | 'ERROR' | 'UNSET';
|
|
1493
1506
|
/** Subset of OTLP span fields the analyst exposes to the agent. The
|
|
1494
1507
|
* store's job is to project upstream's full span shape down to this
|
|
@@ -2057,13 +2070,17 @@ declare function firstStringAttr(attrs: Record<string, unknown>, keys: readonly
|
|
|
2057
2070
|
* `opts.priceUsdPerToken` from the aggregated tokens; else 0 with a
|
|
2058
2071
|
* loud `raw.cost_unpriced = 1` marker so a missing price is visible, not
|
|
2059
2072
|
* a silent zero folded into a gate.
|
|
2060
|
-
* -
|
|
2061
|
-
*
|
|
2073
|
+
* - terminalFailureReason: the failed root's normalized status message,
|
|
2074
|
+
* when one unambiguous root supplies terminal failure evidence.
|
|
2075
|
+
* - terminalOutcome: reduced from root-span status only. Child tool errors
|
|
2076
|
+
* remain visible in `error_span_count` and `execution_error_count` without
|
|
2077
|
+
* changing the run outcome. Root, guardrail, evaluator, propagated, and
|
|
2078
|
+
* unknown errors retain separate counters.
|
|
2062
2079
|
* - model: the dominant LLM model in the trace (snapshot-padded to satisfy
|
|
2063
2080
|
* `validateRunRecord` when the trace's model is a bare alias).
|
|
2064
2081
|
* - outcome score: `opts.scoreForTrace` (AppWorld `world.evaluate()` →
|
|
2065
|
-
* TGC/SGC) when supplied
|
|
2066
|
-
*
|
|
2082
|
+
* TGC/SGC) when supplied. Traces without an external task-quality signal
|
|
2083
|
+
* remain unlabeled; execution errors never become a task score.
|
|
2067
2084
|
* - prompt / completion: carried into `raw` as token-count signals and,
|
|
2068
2085
|
* when the first/last LLM span exposes `input.value` / `output.value`,
|
|
2069
2086
|
* the verbatim text is preserved on the optional `promptText` /
|
|
@@ -2119,9 +2136,9 @@ interface OtlpToRunRecordsOptions {
|
|
|
2119
2136
|
* Score for a produced run's outcome (AppWorld `world.evaluate()` →
|
|
2120
2137
|
* TGC/SGC, or
|
|
2121
2138
|
* any [0,1] task-success signal). Keyed by the logical run id when
|
|
2122
|
-
* `logicalRunIdForTrace` is supplied, otherwise by `trace_id
|
|
2123
|
-
*
|
|
2124
|
-
*
|
|
2139
|
+
* `logicalRunIdForTrace` is supplied, otherwise by `trace_id`. When the map
|
|
2140
|
+
* has no entry or the function returns undefined, the record remains
|
|
2141
|
+
* unlabeled.
|
|
2125
2142
|
*/
|
|
2126
2143
|
scoreForTrace?: (runId: string, span: TraceAggregate) => number | undefined;
|
|
2127
2144
|
/**
|
|
@@ -2153,6 +2170,12 @@ interface TraceAggregate {
|
|
|
2153
2170
|
toolSpanCount: number;
|
|
2154
2171
|
agentSpanCount: number;
|
|
2155
2172
|
errorSpanCount: number;
|
|
2173
|
+
executionErrorCount: number;
|
|
2174
|
+
processErrorCount: number;
|
|
2175
|
+
guardrailErrorCount: number;
|
|
2176
|
+
judgeErrorCount: number;
|
|
2177
|
+
propagatedErrorCount: number;
|
|
2178
|
+
unclassifiedErrorCount: number;
|
|
2156
2179
|
tokenUsage: RunTokenUsage;
|
|
2157
2180
|
/** First error span's normalized status message, if any. */
|
|
2158
2181
|
firstErrorMessage?: string;
|
|
@@ -2160,6 +2183,8 @@ interface TraceAggregate {
|
|
|
2160
2183
|
startTime: string;
|
|
2161
2184
|
endTime: string;
|
|
2162
2185
|
wallMs: number;
|
|
2186
|
+
/** Root-span terminal result. Child span errors do not change this value. */
|
|
2187
|
+
terminalOutcome: RunTerminalOutcome;
|
|
2163
2188
|
}
|
|
2164
2189
|
/**
|
|
2165
2190
|
* Parse + aggregate an OTLP traces.jsonl string into validated
|
|
@@ -2340,4 +2365,4 @@ declare function traceAnalystFunctionGroup(opts: BuildTraceAnalystToolsOpts): {
|
|
|
2340
2365
|
functions: AxFunction[];
|
|
2341
2366
|
};
|
|
2342
2367
|
|
|
2343
|
-
export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, type AnalyzeTracesTurnSnapshot, type Artifact, type BudgetLedgerEntry, type BudgetSpec, type CaptureFetchContext, type CaptureFetchOptions, DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, type DatasetOverview, type ErrorCluster, type EventFilter, type EventKind, type ExportableSpan, type ExtractUsageFromSseOptions, type ExtractedUsage, FAILURE_CLASSES, type FailureClass, FileSystemRawProviderSink, type FileSystemRawProviderSinkOptions, FileSystemTraceStore, type FileSystemTraceStoreOptions, type FlattenOtlpOptions, type GenericSpan, INPUT_VALUE, InMemoryRawProviderSink, type InMemoryRawProviderSinkOptions, InMemoryTraceStore, type JudgeSpan, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, type LlmSpan, type LlmSpanOtlpInput, type Message, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, type OtelExportConfig, type OtelExporter, type OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, type OtlpResourceSpans, type OtlpSpan, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, type ProviderRedactor, type QueryTracesPage, REDACTION_VERSION, RUN_COST_ATTR_KEYS, type RawProviderDirection, type RawProviderEvent, type RawProviderSink, type RawProviderSinkFilter, type RedactionReport, type RedactionRule, ReplayCache, type ReplayCacheEntry, ReplayCacheMissError, type ReplayCacheStats, type ReplayFetchOptions, type RetrievalSpan, type Run, type RunCompleteHook, type RunCompleteHookContext, type RunFilter, RunIntegrityError, type RunIntegrityExpectations, type RunIntegrityIssue, type RunIntegrityIssueCode, type RunIntegrityReport, type RunLayer, type RunOutcome$1 as RunOutcome, type RunStatus, SPAN_KIND_ATTR_KEYS, type SandboxSpan, type SearchSpanResult, type SearchTraceResult, type Span, type SpanBase, type SpanFilter, type SpanHandle, type SpanKind, type SpanMatchRecord, SpanNotFoundError, type SpanStatus, type SseUsageMode, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, type ToolSpan, type ToolSpanOtlpInput, type TraceAggregate, type TraceAnalysisStore, type TraceAnalystByteBudgets, type TraceAnalystFilters, type TraceAnalystHookOptions, type TraceAnalystSpan, type TraceAnalystSpanKind, type TraceAnalystSpanStatus, type TraceAnalystTraceSummary, TraceEmitter, type TraceEmitterOptions, type TraceEvent, TraceFileMissingError, type TraceInsightContext, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceNotFoundError, type TraceStore, type TraceStoreSource, type TraceStoreToOtlpOptions, type TracesToOtlpResult, type ViewSpansResult, type ViewTraceOversized, type ViewTraceResult, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, contextInputTokens, convertTraceStoresToOtlp, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, inferOtlpKind, isJudgeSpan, isLlmSpan, isRetrievalSpan, isSandboxSpan, isToolSpan, iterateRawCalls, judgeSpans, llmSpanFromProvider, llmSpans, otelRunCompleteHook, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, readOtlpStatus, redactString, redactValue, runFailureClass, runsForScenario, scoreTraceInsightReadiness, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
|
|
2368
|
+
export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, type AnalyzeTracesTurnSnapshot, type Artifact, type BudgetLedgerEntry, type BudgetSpec, type CaptureFetchContext, type CaptureFetchOptions, DEFAULT_REDACTION_RULES, DEFAULT_TRACE_ANALYST_BUDGETS, type DatasetOverview, type ErrorCluster, type EventFilter, type EventKind, type ExportableSpan, type ExtractUsageFromSseOptions, type ExtractedUsage, FAILURE_CLASSES, type FailureClass, FileSystemRawProviderSink, type FileSystemRawProviderSinkOptions, FileSystemTraceStore, type FileSystemTraceStoreOptions, type FlattenOtlpOptions, type GenericSpan, INPUT_VALUE, InMemoryRawProviderSink, type InMemoryRawProviderSinkOptions, InMemoryTraceStore, type JudgeSpan, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, type LlmSpan, type LlmSpanOtlpInput, type Message, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, type OtelExportConfig, type OtelExporter, type OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, type OtlpResourceSpans, type OtlpSpan, type OtlpSpanRole, type OtlpSpanRoleInput, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, type ProviderRedactor, type QueryTracesPage, REDACTION_VERSION, RUN_COST_ATTR_KEYS, type RawProviderDirection, type RawProviderEvent, type RawProviderSink, type RawProviderSinkFilter, type RedactionReport, type RedactionRule, ReplayCache, type ReplayCacheEntry, ReplayCacheMissError, type ReplayCacheStats, type ReplayFetchOptions, type RetrievalSpan, type Run, type RunCompleteHook, type RunCompleteHookContext, type RunFilter, RunIntegrityError, type RunIntegrityExpectations, type RunIntegrityIssue, type RunIntegrityIssueCode, type RunIntegrityReport, type RunLayer, type RunOutcome$1 as RunOutcome, type RunStatus, SPAN_KIND_ATTR_KEYS, type SandboxSpan, type SearchSpanResult, type SearchTraceResult, type Span, type SpanBase, type SpanFilter, type SpanHandle, type SpanKind, type SpanMatchRecord, SpanNotFoundError, type SpanStatus, type SseUsageMode, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, type ToolSpan, type ToolSpanOtlpInput, type TraceAggregate, type TraceAnalysisStore, type TraceAnalystByteBudgets, type TraceAnalystFilters, type TraceAnalystHookOptions, type TraceAnalystSpan, type TraceAnalystSpanKind, type TraceAnalystSpanStatus, type TraceAnalystTraceSummary, TraceEmitter, type TraceEmitterOptions, type TraceEvent, TraceFileMissingError, type TraceInsightContext, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceNotFoundError, type TraceStore, type TraceStoreSource, type TraceStoreToOtlpOptions, type TracesToOtlpResult, type ViewSpansResult, type ViewTraceOversized, type ViewTraceResult, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyOtlpSpanRole, contextInputTokens, convertTraceStoresToOtlp, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, inferOtlpKind, isJudgeSpan, isLlmSpan, isOtlpModelCall, isRetrievalSpan, isSandboxSpan, isToolSpan, iterateRawCalls, judgeSpans, llmSpanFromProvider, llmSpans, otelRunCompleteHook, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, readOtlpStatus, redactString, redactValue, runFailureClass, runsForScenario, scoreTraceInsightReadiness, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
|