@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/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,36 @@ 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
|
|
713
|
-
* `FAILURE_CLASSES` taxonomy.
|
|
714
|
-
*
|
|
715
|
-
*
|
|
716
|
-
* set it via the substrate classifier; leave unset only when the failure
|
|
717
|
-
* genuinely can't be classified. */
|
|
705
|
+
/** Canonical task-failure class drawn from the shared
|
|
706
|
+
* `FAILURE_CLASSES` taxonomy. Producers set it only from task-result
|
|
707
|
+
* evidence. Execution errors belong in
|
|
708
|
+
* `outcome.raw.execution_error_count`. */
|
|
718
709
|
failureClass?: FailureClass;
|
|
719
|
-
/** Free-form
|
|
720
|
-
*
|
|
721
|
-
* The within-agent drill-down; `failureClass` is the cross-agent key. */
|
|
710
|
+
/** Free-form task-failure detail scoped under a non-success
|
|
711
|
+
* `failureClass`. It is invalid without that class. */
|
|
722
712
|
failureMode?: string;
|
|
723
713
|
/** Which split this run was drawn from. */
|
|
724
714
|
splitTag: RunSplitTag;
|
|
725
715
|
/**
|
|
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`.
|
|
716
|
+
* Stable scenario identifier the run observed or was scored against.
|
|
717
|
+
* Comparison primitives match this identity rather than input order.
|
|
732
718
|
*/
|
|
733
|
-
scenarioId
|
|
719
|
+
scenarioId: string;
|
|
734
720
|
/**
|
|
735
721
|
* Canonical identity for the agent profile cell that produced this row:
|
|
736
722
|
* profile artifact hash plus optional harness/model/prompt/reporting
|
|
@@ -836,7 +822,8 @@ declare function rolloutReward(record: RunRecord): {
|
|
|
836
822
|
/**
|
|
837
823
|
* Join RunRecords with their traces into canonical rollout lines. Records
|
|
838
824
|
* without spans are emitted as labeled gap lines and reported in
|
|
839
|
-
* `missingTraces
|
|
825
|
+
* `missingTraces`. Execution-only records without a task score are rejected
|
|
826
|
+
* because a missing training label is not a zero reward.
|
|
840
827
|
*/
|
|
841
828
|
declare function mintRolloutRows(records: RunRecord[], store: TraceStore, options?: MintRolloutOptions): Promise<MintRolloutResult>;
|
|
842
829
|
|
|
@@ -1058,4 +1045,4 @@ declare function parseRolloutReleaseArgs(argv: string[]): RolloutReleaseCliArgs;
|
|
|
1058
1045
|
/** CLI driver for `agent-eval rollout-release`. Returns the process exit code. */
|
|
1059
1046
|
declare function runRolloutReleaseCli(argv: string[]): Promise<number>;
|
|
1060
1047
|
|
|
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,
|
|
1048
|
+
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-IHQDPH7D.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,11 @@ 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-2JX3CFMB.js";
|
|
58
|
+
import "../chunk-MA6HLL3S.js";
|
|
59
|
+
import "../chunk-ONWEPEDO.js";
|
|
58
60
|
import "../chunk-PZ5AY32C.js";
|
|
59
61
|
export {
|
|
60
62
|
CHAT_ROLES,
|
|
@@ -63,7 +65,6 @@ export {
|
|
|
63
65
|
FORMAT_FILES,
|
|
64
66
|
RELEASE_FORMATS,
|
|
65
67
|
ROLLOUT_CAPTURES,
|
|
66
|
-
ROLLOUT_FORMAT,
|
|
67
68
|
ROLLOUT_RELEASE_USAGE,
|
|
68
69
|
ROLLOUT_ROLES,
|
|
69
70
|
ROLLOUT_SCHEMA,
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
planCampaignRun,
|
|
3
3
|
runCampaign
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-EZJEIH2R.js";
|
|
5
|
+
import "./chunk-2MKQIFS4.js";
|
|
6
|
+
import "./chunk-MHELPNRP.js";
|
|
6
7
|
import "./chunk-WS3NZZQQ.js";
|
|
7
8
|
import "./chunk-VI2UW6B6.js";
|
|
9
|
+
import "./chunk-2JX3CFMB.js";
|
|
10
|
+
import "./chunk-MA6HLL3S.js";
|
|
8
11
|
import "./chunk-ONWEPEDO.js";
|
|
9
12
|
import "./chunk-PZ5AY32C.js";
|
|
10
13
|
export {
|
|
11
14
|
planCampaignRun,
|
|
12
15
|
runCampaign
|
|
13
16
|
};
|
|
14
|
-
//# sourceMappingURL=run-campaign-
|
|
17
|
+
//# sourceMappingURL=run-campaign-ISHFZ7FJ.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,36 @@ 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
|
|
715
|
-
* `FAILURE_CLASSES` taxonomy.
|
|
716
|
-
*
|
|
717
|
-
*
|
|
718
|
-
* set it via the substrate classifier; leave unset only when the failure
|
|
719
|
-
* genuinely can't be classified. */
|
|
718
|
+
/** Canonical task-failure class drawn from the shared
|
|
719
|
+
* `FAILURE_CLASSES` taxonomy. Producers set it only from task-result
|
|
720
|
+
* evidence. Execution errors belong in
|
|
721
|
+
* `outcome.raw.execution_error_count`. */
|
|
720
722
|
failureClass?: FailureClass;
|
|
721
|
-
/** Free-form
|
|
722
|
-
*
|
|
723
|
-
* The within-agent drill-down; `failureClass` is the cross-agent key. */
|
|
723
|
+
/** Free-form task-failure detail scoped under a non-success
|
|
724
|
+
* `failureClass`. It is invalid without that class. */
|
|
724
725
|
failureMode?: string;
|
|
725
726
|
/** Which split this run was drawn from. */
|
|
726
727
|
splitTag: RunSplitTag;
|
|
727
728
|
/**
|
|
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`.
|
|
729
|
+
* Stable scenario identifier the run observed or was scored against.
|
|
730
|
+
* Comparison primitives match this identity rather than input order.
|
|
734
731
|
*/
|
|
735
|
-
scenarioId
|
|
732
|
+
scenarioId: string;
|
|
736
733
|
/**
|
|
737
734
|
* Canonical identity for the agent profile cell that produced this row:
|
|
738
735
|
* profile artifact hash plus optional harness/model/prompt/reporting
|
|
@@ -1238,6 +1235,19 @@ declare function applyLlmSpanOtlpAttributes(attributes: Record<string, unknown>,
|
|
|
1238
1235
|
/** Canonical OpenInference-over-OTLP attribute vocabulary used at the trace boundary. */
|
|
1239
1236
|
|
|
1240
1237
|
type ToolSpanOtlpInput = Pick<ToolSpan, 'toolName' | 'args' | 'argsCaptured' | 'result' | 'latencyMs'>;
|
|
1238
|
+
type OtlpSpanRole = 'AGENT' | 'CHAIN' | 'EVALUATOR' | 'GUARDRAIL' | 'LLM' | 'SPAN' | 'TOOL' | 'UNKNOWN';
|
|
1239
|
+
interface OtlpSpanRoleInput {
|
|
1240
|
+
name: string;
|
|
1241
|
+
attributes: Record<string, unknown>;
|
|
1242
|
+
kind?: string | null;
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Classify a span once for both measurement and error accounting.
|
|
1246
|
+
* An explicit OpenInference kind wins; untyped spans use the same tool and
|
|
1247
|
+
* model signals in online and offline intake.
|
|
1248
|
+
*/
|
|
1249
|
+
declare function classifyOtlpSpanRole(input: OtlpSpanRoleInput): OtlpSpanRole;
|
|
1250
|
+
declare function isOtlpModelCall(input: OtlpSpanRoleInput): boolean;
|
|
1241
1251
|
declare function applyToolSpanOtlpAttributes(attributes: Record<string, unknown>, span: ToolSpanOtlpInput): void;
|
|
1242
1252
|
declare function traceSpanKindToOpenInferenceKind(kind: string): string;
|
|
1243
1253
|
|
|
@@ -1488,7 +1498,7 @@ declare function convertTraceStoresToOtlp(source: string | TraceStoreSource | re
|
|
|
1488
1498
|
* `ViewTraceOversized`.
|
|
1489
1499
|
*/
|
|
1490
1500
|
/** OTLP span kind (subset we actually use). */
|
|
1491
|
-
type TraceAnalystSpanKind = 'AGENT' | 'LLM' | 'TOOL' | 'CHAIN' | 'GUARDRAIL' | 'SPAN' | 'UNKNOWN';
|
|
1501
|
+
type TraceAnalystSpanKind = 'AGENT' | 'LLM' | 'TOOL' | 'CHAIN' | 'EVALUATOR' | 'GUARDRAIL' | 'SPAN' | 'UNKNOWN';
|
|
1492
1502
|
type TraceAnalystSpanStatus = 'OK' | 'ERROR' | 'UNSET';
|
|
1493
1503
|
/** Subset of OTLP span fields the analyst exposes to the agent. The
|
|
1494
1504
|
* store's job is to project upstream's full span shape down to this
|
|
@@ -2054,16 +2064,21 @@ declare function firstStringAttr(attrs: Record<string, unknown>, keys: readonly
|
|
|
2054
2064
|
* - tokenUsage: reconcile input, output, cache-read, and cache-write across
|
|
2055
2065
|
* nested model-call wrappers without double-counting parent aggregates.
|
|
2056
2066
|
* - costUsd: reconcile complete observed model-call cost when present; else priced via
|
|
2057
|
-
* `opts.priceUsdPerToken` from the aggregated tokens; else
|
|
2058
|
-
* loud `raw.cost_unpriced = 1` marker
|
|
2059
|
-
*
|
|
2060
|
-
*
|
|
2061
|
-
*
|
|
2067
|
+
* `opts.priceUsdPerToken` from the aggregated tokens; else `null` with a
|
|
2068
|
+
* loud `raw.cost_unpriced = 1` marker.
|
|
2069
|
+
* - task failure class and detail: read from process-root
|
|
2070
|
+
* `tangle.task.failure_*` attributes; malformed or conflicting values throw.
|
|
2071
|
+
* - terminalFailureReason: the failed root's normalized status message,
|
|
2072
|
+
* when one unambiguous root supplies terminal failure evidence.
|
|
2073
|
+
* - terminalOutcome: reduced from root-span status only. Child tool errors
|
|
2074
|
+
* remain visible in `error_span_count` and `execution_error_count` without
|
|
2075
|
+
* changing the run outcome. Root, guardrail, evaluator, propagated, and
|
|
2076
|
+
* unknown errors retain separate counters.
|
|
2062
2077
|
* - model: the dominant LLM model in the trace (snapshot-padded to satisfy
|
|
2063
2078
|
* `validateRunRecord` when the trace's model is a bare alias).
|
|
2064
2079
|
* - outcome score: `opts.scoreForTrace` (AppWorld `world.evaluate()` →
|
|
2065
|
-
* TGC/SGC) when supplied
|
|
2066
|
-
*
|
|
2080
|
+
* TGC/SGC) when supplied. Traces without an external task-quality signal
|
|
2081
|
+
* remain unlabeled; execution errors never become a task score.
|
|
2067
2082
|
* - prompt / completion: carried into `raw` as token-count signals and,
|
|
2068
2083
|
* when the first/last LLM span exposes `input.value` / `output.value`,
|
|
2069
2084
|
* the verbatim text is preserved on the optional `promptText` /
|
|
@@ -2102,8 +2117,7 @@ interface OtlpToRunRecordsOptions {
|
|
|
2102
2117
|
/**
|
|
2103
2118
|
* USD per total token (input+output) used to price a trace when no
|
|
2104
2119
|
* per-span cost attribute is present. When unset, an unpriced trace
|
|
2105
|
-
* records `costUsd:
|
|
2106
|
-
* never silent.
|
|
2120
|
+
* records `costUsd: null` and `raw.cost_unpriced = 1`.
|
|
2107
2121
|
*/
|
|
2108
2122
|
priceUsdPerToken?: number;
|
|
2109
2123
|
/**
|
|
@@ -2119,9 +2133,9 @@ interface OtlpToRunRecordsOptions {
|
|
|
2119
2133
|
* Score for a produced run's outcome (AppWorld `world.evaluate()` →
|
|
2120
2134
|
* TGC/SGC, or
|
|
2121
2135
|
* any [0,1] task-success signal). Keyed by the logical run id when
|
|
2122
|
-
* `logicalRunIdForTrace` is supplied, otherwise by `trace_id
|
|
2123
|
-
*
|
|
2124
|
-
*
|
|
2136
|
+
* `logicalRunIdForTrace` is supplied, otherwise by `trace_id`. When the map
|
|
2137
|
+
* has no entry or the function returns undefined, the record remains
|
|
2138
|
+
* unlabeled.
|
|
2125
2139
|
*/
|
|
2126
2140
|
scoreForTrace?: (runId: string, span: TraceAggregate) => number | undefined;
|
|
2127
2141
|
/**
|
|
@@ -2153,6 +2167,12 @@ interface TraceAggregate {
|
|
|
2153
2167
|
toolSpanCount: number;
|
|
2154
2168
|
agentSpanCount: number;
|
|
2155
2169
|
errorSpanCount: number;
|
|
2170
|
+
executionErrorCount: number;
|
|
2171
|
+
processErrorCount: number;
|
|
2172
|
+
guardrailErrorCount: number;
|
|
2173
|
+
judgeErrorCount: number;
|
|
2174
|
+
propagatedErrorCount: number;
|
|
2175
|
+
unclassifiedErrorCount: number;
|
|
2156
2176
|
tokenUsage: RunTokenUsage;
|
|
2157
2177
|
/** First error span's normalized status message, if any. */
|
|
2158
2178
|
firstErrorMessage?: string;
|
|
@@ -2160,6 +2180,8 @@ interface TraceAggregate {
|
|
|
2160
2180
|
startTime: string;
|
|
2161
2181
|
endTime: string;
|
|
2162
2182
|
wallMs: number;
|
|
2183
|
+
/** Root-span terminal result. Child span errors do not change this value. */
|
|
2184
|
+
terminalOutcome: RunTerminalOutcome;
|
|
2163
2185
|
}
|
|
2164
2186
|
/**
|
|
2165
2187
|
* Parse + aggregate an OTLP traces.jsonl string into validated
|
|
@@ -2340,4 +2362,4 @@ declare function traceAnalystFunctionGroup(opts: BuildTraceAnalystToolsOpts): {
|
|
|
2340
2362
|
functions: AxFunction[];
|
|
2341
2363
|
};
|
|
2342
2364
|
|
|
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 };
|
|
2365
|
+
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 };
|